diff options
author | Brandon Bayer <bbayer@multitech.com> | 2016-02-15 14:50:21 -0600 |
---|---|---|
committer | Brandon Bayer <bbayer@multitech.com> | 2016-02-15 14:56:59 -0600 |
commit | dce78f7a2bd56c6582c123eb3b070255b5781e2d (patch) | |
tree | 455a87b969b01918ead03631aaf0e2c4ca43d21d | |
parent | 7d63d18905b7f7ea2f0febc3b70c906ed42e9850 (diff) | |
download | sms-utils-dce78f7a2bd56c6582c123eb3b070255b5781e2d.tar.gz sms-utils-dce78f7a2bd56c6582c123eb3b070255b5781e2d.tar.bz2 sms-utils-dce78f7a2bd56c6582c123eb3b070255b5781e2d.zip |
fix: CE910 PDU decode truncation0.0.16
- It turns out the CE910 PDU data lengh is # of septets when sending,
but number of octets when receiving. Wonder why I didn't guess that?!
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | src/pdu_decode.c | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/configure.in b/configure.in index e9cd8e2..e71fbf7 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ AC_INIT([src/sms_main.c]) -AM_INIT_AUTOMAKE([sms-utils], [0.0.15]) +AM_INIT_AUTOMAKE([sms-utils], [0.0.16]) AM_CONFIG_HEADER([config.h]) AC_PROG_CC diff --git a/src/pdu_decode.c b/src/pdu_decode.c index 7c36385..5acb07b 100644 --- a/src/pdu_decode.c +++ b/src/pdu_decode.c @@ -227,16 +227,17 @@ int pdu_decode_user_data(const char *pdu_str, struct pdu_info *pdu, int *nr_octe // CDMA 7-BIT ENCODING } else if (pdu->data_coding.general.alphabet == PDU_ALPHABET_CDMA_DEFAULT) { - if (!strcmp(Global.core.model, "DE910-DUAL")) { - // DE910-DUAL stores data length as # of octets - log_debug("counting PDU length byte as number of octets (DE910-DUAL)"); - *nr_octets = pdu->user_data_len; - pdu->user_data_len = septets_from_octets(pdu->user_data_len); + if (!strcmp(Global.core.model, "LE910-SVG")) { + // LE910-SVG stores data length as # of septets + log_debug("counting PDU length byte as number of septets (LE910-SVG)"); + *nr_octets = octets_from_septets(pdu->user_data_len); } else { - // Other CDMA radios store data length as # of septets - log_debug("counting PDU length byte as number of septets"); - *nr_octets = octets_from_septets(pdu->user_data_len); + // Other CDMA radios store data length as # of octets + // NOTE: CE910 send PDU needs # of septets but receive PDU is in # of octets + log_debug("counting PDU length byte as number of octets"); + *nr_octets = pdu->user_data_len; + pdu->user_data_len = septets_from_octets(pdu->user_data_len); } |