diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2016-11-24 01:53:11 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-01-04 14:11:17 +0100 |
commit | 37521ed2b611bdccd288cabc5fc4e48c51a32e49 (patch) | |
tree | f7349c269b04c5f687ae62ae15c9bc85a2b053cb /plugins/cinterion/mm-modem-helpers-cinterion.h | |
parent | dc96829bb5a49216e45e770f249f29e725ce97ad (diff) |
cinterion: simplify ^SWWAN response parsing
We get as input the ^SWWAN index we're interested in, and we loop
through the list of ^SWWAN lines looking for the one we need.
This updated helper method allows working with multi-line ^SWWAN
responses, e.g. given when more than one PDP context is active.
Diffstat (limited to 'plugins/cinterion/mm-modem-helpers-cinterion.h')
-rw-r--r-- | plugins/cinterion/mm-modem-helpers-cinterion.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/cinterion/mm-modem-helpers-cinterion.h b/plugins/cinterion/mm-modem-helpers-cinterion.h index c94341ec..5d05e2c6 100644 --- a/plugins/cinterion/mm-modem-helpers-cinterion.h +++ b/plugins/cinterion/mm-modem-helpers-cinterion.h @@ -67,7 +67,15 @@ gboolean mm_cinterion_parse_sind_response (const gchar *response, /*****************************************************************************/ /* ^SWWAN response parser */ -gboolean mm_cinterion_parse_swwan_response (const gchar *response, - GList **result, - GError **error); + +typedef enum { + MM_SWWAN_STATE_UNKNOWN = -1, + MM_SWWAN_STATE_DISCONNECTED = 0, + MM_SWWAN_STATE_CONNECTED = 1, +} MMSwwanState; + +MMSwwanState mm_cinterion_parse_swwan_response (const gchar *response, + guint swwan_index, + GError **error); + #endif /* MM_MODEM_HELPERS_CINTERION_H */ |