diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2019-10-16 18:03:53 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2019-10-16 18:04:47 +0200 |
commit | 5316e9e4e56faa606c2ae4f19087ae98b8c3944d (patch) | |
tree | 2b4557f8d33aa319bf9933f887709dc3327dd399 /plugins/simtech/mm-modem-helpers-simtech.c | |
parent | eb66e8ae6844dfd065b68523bc9b5e3b2bf0d979 (diff) |
simtech: handle 'MISSED_CALL' URCs
https://source.puri.sm/Librem5/ModemManager/issues/6
Diffstat (limited to 'plugins/simtech/mm-modem-helpers-simtech.c')
-rw-r--r-- | plugins/simtech/mm-modem-helpers-simtech.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plugins/simtech/mm-modem-helpers-simtech.c b/plugins/simtech/mm-modem-helpers-simtech.c index 4da3c988..d452e0b6 100644 --- a/plugins/simtech/mm-modem-helpers-simtech.c +++ b/plugins/simtech/mm-modem-helpers-simtech.c @@ -152,6 +152,36 @@ out: /*****************************************************************************/ /* + * <CR><LF>MISSED_CALL: 11:01AM 07712345678<CR><LF> + */ +GRegex * +mm_simtech_get_missed_call_urc_regex (void) +{ + return g_regex_new ("\\r\\nMISSED_CALL:\\s*(.+)\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); +} + +gboolean +mm_simtech_parse_missed_call_urc (GMatchInfo *match_info, + gchar **details, + GError **error) +{ + gchar *str; + + str = mm_get_string_unquoted_from_match_info (match_info, 1); + if (!str) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't read missed call URC details"); + return FALSE; + } + + *details = str; + return TRUE; +} + +/*****************************************************************************/ + +/* * Using TWO <CR> instead of one... * <CR><CR><LF>+CRING: VOICE<CR><CR><LF> */ |