diff options
Diffstat (limited to 'src/pdu_decode.c')
-rw-r--r-- | src/pdu_decode.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/pdu_decode.c b/src/pdu_decode.c index 62b60ba..9c0ced5 100644 --- a/src/pdu_decode.c +++ b/src/pdu_decode.c @@ -239,7 +239,7 @@ int pdu_decode_user_data(const char *pdu_str, struct pdu_info *pdu, int *nr_octe } else if (pdu->data_coding.general.alphabet == PDU_ALPHABET_CDMA_DEFAULT) { if (is_vzw_lte()) { // LE910-SVG stores data length as # of septets - log_debug("counting PDU length byte as number of septets (LE910-SVG/LE910-NA1/VZW)"); + log_debug("counting PDU length byte as number of septets (LE910-SVG/LE910-SV1/LE910-NA1/VZW)"); *nr_octets = octets_from_septets(pdu->user_data_len); } else { @@ -290,11 +290,15 @@ int pdu_decode_user_data(const char *pdu_str, struct pdu_info *pdu, int *nr_octe (pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT2) || (pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT_MULTI)|| (pdu->data_coding.general.alphabet == PDU_ALPHABET_TE)) { - // Keep UDH for concatenated SMS. + // Keep UDH for concatenated SMS ONLY. // Otherwise it is impossible to process correctly concatenated SMS. i = 0; if (pdu->type.user_data_header || - (pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT_MULTI)) { + // For LVW3, LNA3 and LVW2 - Save header ONLY when it's actually a multi-part message. + // Multi-part messages should use Teleservice ID 4101 (0x1005) in LVW2 7-BIT MULTI-PART format. + // See 3GPP2 X.S0004-550-E for details on Teleservice ID. + (pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT_MULTI + && pdu->teleservice_id == PDU_TELE_ID_CDMA_WEMT)) { for (i = 0; i <= octets[0]; ++i) { pdu->user_data[i] = octets[i]; } @@ -536,11 +540,17 @@ int pdu_decode_cdma(const char *pdu_str, struct pdu_info *pdu) pdu_str += HEX_BYTE_LEN; log_debug("tele-id-1: 0x%02X", tmp); + pdu->teleservice_id = 0; + pdu->teleservice_id |= (tmp << 8); // save upper byte of the Teleservice ID + tmp = hex_byte_decode(pdu_str); DECODE_FAIL(tmp < 0, "tele-id-2", -1); pdu_str += HEX_BYTE_LEN; log_debug("tele-id-2: 0x%02X", tmp); + pdu->teleservice_id |= (tmp); // save lower byte of the Teleservice ID + log_debug("tele-id: 0x%04X", pdu->teleservice_id); + //Priority tmp = hex_byte_decode(pdu_str); DECODE_FAIL(tmp < 0, "priority", -1); |