B2G/gecko/dom/mobilemessage/src/ril/WspPduHelper.jsm
/**
   * @param data
   *        A wrapped object containing raw PDU data.
   * @param isSessionless
   *        Whether or not the PDU contains a session less WSP PDU.
   * @param msg [optional]
   *        Optional pre-defined PDU object.
   *
   * @return Parsed WSP PDU object or null in case of errors found.
   */
@param data
A wrapped object containing raw PDU data.
@param isSessionless
Whether or not the PDU contains a session less WSP PDU.
@param msg [optional]
Optional pre-defined PDU object.

@return Parsed WSP PDU object or null in case of errors found.
@param data A wrapped object containing raw PDU data . @param isSessionless Whether or not the PDU contains a session less WSP PDU . @param msg [ optional ] Optional pre - defined PDU object . @return Parsed WSP PDU object or null in case of errors found .
function parse(data, isSessionless, msg) {
    if (!msg) {
      msg = {
        type: null,
      };
    }
    try {
      if (isSessionless) {
        msg.transactionId = Octet.decode(data);
      }
      msg.type = Octet.decode(data);
      switch (msg.type) {
        case WSP_PDU_TYPE_PUSH:
          this.parsePushHeaders(data, msg);
          break;
      }
    } catch (e) {
      debug("Parse error. Message: " + e.message);
      msg = null;
    }
    return msg;
  }
function parse ( data , isSessionless , msg ) { if ( ! msg ) { msg = { type : null , } ; } try { if ( isSessionless ) { msg . transactionId = Octet . decode ( data ) ; } msg . type = Octet . decode ( data ) ; switch ( msg . type ) { case WSP_PDU_TYPE_PUSH : this . parsePushHeaders ( data , msg ) ; break ; } } catch ( e ) { debug ( "Parse error. Message: " + e . message ) ; msg = null ; } return msg ; }
@param data
        A wrapped object containing raw PDU data.
@param data A wrapped object containing raw PDU data .
// "The `transactionId` is used to associate requests with replies in // the connectionless session service." ~ WAP-230-WSP-20010705-a 8.2.1