diff options
-rw-r--r-- | include/gsmd/vendorplugin.h | 1 | ||||
-rw-r--r-- | src/gsmd/atcmd.c | 4 | ||||
-rw-r--r-- | src/gsmd/vendor_qc.c | 1 | ||||
-rw-r--r-- | src/gsmd/vendor_ti.c | 1 | ||||
-rw-r--r-- | src/gsmd/vendor_tihtc.c | 1 |
5 files changed, 6 insertions, 2 deletions
diff --git a/include/gsmd/vendorplugin.h b/include/gsmd/vendorplugin.h index c3843b2..1911fef 100644 --- a/include/gsmd/vendorplugin.h +++ b/include/gsmd/vendorplugin.h @@ -12,6 +12,7 @@ struct gsmd_unsolicit; struct gsmd_vendor_plugin { struct llist_head list; unsigned char *name; + unsigned char *ext_chars; unsigned int num_unsolicit; const struct gsmd_unsolicit *unsolicit; int (*detect)(struct gsmd *g); diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c index 9d45588..800035a 100644 --- a/src/gsmd/atcmd.c +++ b/src/gsmd/atcmd.c @@ -237,7 +237,7 @@ static int ml_parse(const char *buf, int len, void *ctx) * TBD */ - if (buf[0] == '+' || buf[0] == '%') { + if (buf[0] == '+' || strchr(g->vendorpl->ext_chars, buf[0])) { /* an extended response */ const char *colon = strchr(buf, ':'); if (!colon) { @@ -293,7 +293,7 @@ static int ml_parse(const char *buf, int len, void *ctx) } if (cmd) { - if (cmd->buf[2] != '+' && cmd->buf[2] != '%') { + if (cmd->buf[2] != '+' && strchr(g->vendorpl->ext_chars, cmd->buf[2]) == NULL) { gsmd_log(GSMD_ERROR, "extd reply to non-extd command?\n"); return -EINVAL; } diff --git a/src/gsmd/vendor_qc.c b/src/gsmd/vendor_qc.c index a4a65ce..1aa4e6f 100644 --- a/src/gsmd/vendor_qc.c +++ b/src/gsmd/vendor_qc.c @@ -100,6 +100,7 @@ static int qc_initsettings(struct gsmd *g) struct gsmd_vendor_plugin gsmd_vendor_plugin = { .name = "Qualcomm msm6250", + .ext_chars = "@", .num_unsolicit = ARRAY_SIZE(qc_unsolicit), .unsolicit = qc_unsolicit, .detect = &qc_detect, diff --git a/src/gsmd/vendor_ti.c b/src/gsmd/vendor_ti.c index c219355..4c7d182 100644 --- a/src/gsmd/vendor_ti.c +++ b/src/gsmd/vendor_ti.c @@ -303,6 +303,7 @@ static int ticalypso_initsettings(struct gsmd *g) struct gsmd_vendor_plugin gsmd_vendor_plugin = { .name = "TI Calypso", + .ext_chars = "%@", .num_unsolicit = ARRAY_SIZE(ticalypso_unsolicit), .unsolicit = ticalypso_unsolicit, .detect = &ticalypso_detect, diff --git a/src/gsmd/vendor_tihtc.c b/src/gsmd/vendor_tihtc.c index 8add5f7..42f9d50 100644 --- a/src/gsmd/vendor_tihtc.c +++ b/src/gsmd/vendor_tihtc.c @@ -298,6 +298,7 @@ static int tihtc_initsettings(struct gsmd *g) struct gsmd_vendor_plugin gsmd_vendor_plugin = { .name = "TI Calypso / HTC firmware", + .ext_chars = "%", .num_unsolicit = ARRAY_SIZE(tihtc_unsolicit), .unsolicit = tihtc_unsolicit, .detect = &tihtc_detect, |