diff options
author | Nick Stevens <Nick.Stevens@digi.com> | 2015-09-17 21:31:28 +0000 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2015-09-22 09:24:18 +0200 |
commit | eaf65ed98dd7e04b985be6b4241e9adab66750aa (patch) | |
tree | de288543475ca669e4a129aa2323390ed64f1c20 /src/mm-modem-helpers.h | |
parent | 0ca68657fbcd5bace3d303a0babe2da292784385 (diff) |
core: process SMS +CGMR response with regex
Variability in the response style from certain modems causes the parsing
of the +CGMR response to fail. For example, the Telit HE910 inserts an
empty string ("") in the second field of the response, causing the
sscanf implementation to fail.
This patch converts the parsing of the CGMR response to a regex that
allows for more flexibility and robustness, and adds unit tests around
the parsing call.
Signed-off-by: Nick Stevens <Nick.Stevens@digi.com>
Diffstat (limited to 'src/mm-modem-helpers.h')
-rw-r--r-- | src/mm-modem-helpers.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mm-modem-helpers.h b/src/mm-modem-helpers.h index 9fabd6aa..e92b6c0a 100644 --- a/src/mm-modem-helpers.h +++ b/src/mm-modem-helpers.h @@ -191,10 +191,15 @@ typedef struct { gint status; gchar *pdu; } MM3gppPduInfo; +void mm_3gpp_pdu_info_free (MM3gppPduInfo *info); void mm_3gpp_pdu_info_list_free (GList *info_list); GList *mm_3gpp_parse_pdu_cmgl_response (const gchar *str, GError **error); +/* AT+CMGR (Read message) response parser */ +MM3gppPduInfo *mm_3gpp_parse_cmgr_read_response (const gchar *reply, + guint index, + GError **error); /* Additional 3GPP-specific helpers */ |