diff mbox

[OpenWrt-Devel,uqmi] Add support for 16-bit reference number in concatenated SMS.

Message ID 1418823288-10857-1-git-send-email-s.demeszko@wireless-instruments.com
State Accepted
Headers show

Commit Message

Sławomir Demeszko Dec. 17, 2014, 1:34 p.m. UTC
Signed-off-by: Sławomir Demeszko <s.demeszko@wireless-instruments.com>
---
 commands-wms.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/commands-wms.c b/commands-wms.c
index 47d4d76..6ac52eb 100644
--- a/commands-wms.c
+++ b/commands-wms.c
@@ -179,11 +179,16 @@  static int decode_udh(const unsigned char *data)
 			break;
 
 		switch (type) {
-		case 0:
+		case 0x00:
 			blobmsg_add_u32(&status, "concat_ref", (uint32_t) val[0]);
 			blobmsg_add_u32(&status, "concat_part", (uint32_t) val[2]);
 			blobmsg_add_u32(&status, "concat_parts", (uint32_t) val[1]);
 			break;
+		case 0x08:
+			blobmsg_add_u32(&status, "concat_ref", (uint32_t) (val[0] << 8 | val[1]));
+			blobmsg_add_u32(&status, "concat_part", (uint32_t) val[3]);
+			blobmsg_add_u32(&status, "concat_parts", (uint32_t) val[2]);
+			break;
 		default:
 			break;
 		}