From b77ffd42fe98c186db6875f78bb9f278e5d94fc3 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 18 Feb 2013 23:57:37 +0100 Subject: [PATCH] add detection for the class field in the TP-DCS octet --- commands-wms.c | 10 ++++++++-- 1 file 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++; -- 2.25.1