summaryrefslogtreecommitdiff
path: root/src/pdu_decode.c
diff options
context:
space:
mode:
authorBrandon Bayer <bbayer@multitech.com>2016-02-09 13:08:31 -0600
committerBrandon Bayer <bbayer@multitech.com>2016-02-10 14:04:53 -0600
commitdcd2eb11c9dfdc5b7691edfaaf3f4a28aa606ea9 (patch)
tree95edabffb22901584558dd84e2c168b443c90796 /src/pdu_decode.c
parent568c7e7196537397c99eb1547f61788b4d95b0f7 (diff)
downloadsms-utils-dcd2eb11c9dfdc5b7691edfaaf3f4a28aa606ea9.tar.gz
sms-utils-dcd2eb11c9dfdc5b7691edfaaf3f4a28aa606ea9.tar.bz2
sms-utils-dcd2eb11c9dfdc5b7691edfaaf3f4a28aa606ea9.zip
fix: cdma pdu data length for C2 radios
Diffstat (limited to 'src/pdu_decode.c')
-rw-r--r--src/pdu_decode.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/pdu_decode.c b/src/pdu_decode.c
index d7def28..7c36385 100644
--- a/src/pdu_decode.c
+++ b/src/pdu_decode.c
@@ -227,15 +227,18 @@ 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) {
- // LE910-SVG stores data length as # of septets
- if (!strcmp(Global.core.model, "LE910-SVG")) {
- *nr_octets = octets_from_septets(pdu->user_data_len);
- }
- // Other CDMA radios store data length as # of octets
- else {
+ 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);
}
+ 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);
+ }
+
if (pdu->user_data_len > PDU_UD_7BIT_MAX) {
log_warning("pdu contains invalid user-data-len: 0x%02X", pdu->user_data_len);