summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-02-18 23:57:37 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-02-18 23:57:37 +0100
commitb77ffd42fe98c186db6875f78bb9f278e5d94fc3 (patch)
tree453a39c17d028b938cfd865c63bdfcea4f327f9b
parentb7970ebe4a5ffe84630b09a90ed6ba1cc2e4588c (diff)
add detection for the class field in the TP-DCS octet
-rw-r--r--commands-wms.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/commands-wms.c b/commands-wms.c
index 9e28f65..296f5fb 100644
--- a/commands-wms.c
+++ b/commands-wms.c
@@ -156,7 +156,7 @@ static void cmd_wms_get_message_cb(struct qmi_dev *qmi, struct qmi_request *req,
char *str;
int i, cur_len;
bool sent;
- unsigned char first;
+ unsigned char first, dcs;
qmi_parse_wms_raw_read_response(msg, &res);
data = (unsigned char *) res.data.raw_message_data.raw_data;
@@ -197,9 +197,15 @@ static void cmd_wms_get_message_cb(struct qmi_dev *qmi, struct qmi_request *req,
return;
/* Data Encoding */
- if (*(data++) != 0)
+ dcs = *(data++);
+
+ /* only 7-bit encoding supported for now */
+ if (dcs & 0x0c)
return;
+ if (dcs & 0x10)
+ blobmsg_add_u32(&status, "class", (dcs & 3));
+
if (sent) {
/* Message validity */
data++;