diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-06-16 10:48:27 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-06-16 16:38:47 -0500 |
commit | 79e39e40167b5bb4d4bddbaa958e44217773174b (patch) | |
tree | c989e3b3d9c67b0ce68f9f3b2bdee6a171830b68 /src | |
parent | 6ea7dba3b6d0087eb872acd65181bf9ee61a506c (diff) | |
download | ofono-79e39e40167b5bb4d4bddbaa958e44217773174b.tar.bz2 |
SMS 8-Bit and 16-Bit ports are not the same
Diffstat (limited to 'src')
-rw-r--r-- | src/smsutil.c | 9 | ||||
-rw-r--r-- | src/smsutil.h | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/smsutil.c b/src/smsutil.c index d45fbc40..7c87b0cc 100644 --- a/src/smsutil.c +++ b/src/smsutil.c @@ -1703,7 +1703,8 @@ const char *sms_address_to_string(const struct sms_address *addr) return buffer; } -gboolean sms_extract_app_port(const struct sms *sms, int *dst, int *src) +gboolean sms_extract_app_port(const struct sms *sms, int *dst, int *src, + gboolean *is_8bit) { struct sms_udh_iter iter; enum sms_iei iei; @@ -1711,6 +1712,7 @@ gboolean sms_extract_app_port(const struct sms *sms, int *dst, int *src) int srcport = -1; int dstport = -1; + gboolean is_addr_8bit; if (!sms_udh_iter_init(sms, &iter)) return FALSE; @@ -1739,6 +1741,7 @@ gboolean sms_extract_app_port(const struct sms *sms, int *dst, int *src) dstport = addr_hdr[0]; srcport = addr_hdr[1]; + is_addr_8bit = TRUE; break; case SMS_IEI_APPLICATION_ADDRESS_16BIT: @@ -1755,6 +1758,7 @@ gboolean sms_extract_app_port(const struct sms *sms, int *dst, int *src) dstport = (addr_hdr[0] << 8) | addr_hdr[1]; srcport = (addr_hdr[2] << 8) | addr_hdr[3]; + is_addr_8bit = FALSE; break; default: @@ -1773,6 +1777,9 @@ gboolean sms_extract_app_port(const struct sms *sms, int *dst, int *src) if (src) *src = srcport; + if (is_8bit) + *is_8bit = is_addr_8bit; + return TRUE; } diff --git a/src/smsutil.h b/src/smsutil.h index 64d7800d..70363359 100644 --- a/src/smsutil.h +++ b/src/smsutil.h @@ -367,7 +367,8 @@ gboolean sms_mwi_dcs_decode(guint8 dcs, enum sms_mwi_type *type, enum sms_charset *charset, gboolean *active, gboolean *discard); -gboolean sms_extract_app_port(const struct sms *sms, int *dst, int *src); +gboolean sms_extract_app_port(const struct sms *sms, int *dst, int *src, + gboolean *is_8bit); gboolean sms_extract_concatenation(const struct sms *sms, guint16 *ref_num, guint8 *max_msgs, guint8 *seq_num); |