From: Felix Fietkau Date: Mon, 18 Feb 2013 22:57:37 +0000 (+0100) Subject: add detection for the class field in the TP-DCS octet X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b77ffd42fe98c186db6875f78bb9f278e5d94fc3;p=oweals%2Fuqmi.git add detection for the class field in the TP-DCS octet --- 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++;