From a15193b7ca7c1b18f3aa6ee290f1c2866ab40a8c Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 19 Oct 2018 15:55:21 +0200 Subject: broadband-modem: enable and handle +CGEV indications The +CGEV indications allow us to get notified of packet domain events like network-initiated or ME-initiated disconnections on specific connected contexts, as well as full PS detach events (all contexts disconnected). If the modem supports these indications, we will enable them with +CGEREP and will then process them when they are emitted by the modem. If a full PS detach event happens, we will explicitly disconnect all connected bearers. If a deactivation inidication is received for a single context, we will look for the associated bearer by CID and explicitly disconnect it. --- src/mm-modem-helpers.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'src/mm-modem-helpers.h') diff --git a/src/mm-modem-helpers.h b/src/mm-modem-helpers.h index 71d8893e..237046ad 100644 --- a/src/mm-modem-helpers.h +++ b/src/mm-modem-helpers.h @@ -125,6 +125,7 @@ MMFlowControl mm_flow_control_from_string (const gchar *str, GPtrArray *mm_3gpp_creg_regex_get (gboolean solicited); void mm_3gpp_creg_regex_destroy (GPtrArray *array); GRegex *mm_3gpp_ciev_regex_get (void); +GRegex *mm_3gpp_cgev_regex_get (void); GRegex *mm_3gpp_cusd_regex_get (void); GRegex *mm_3gpp_cmti_regex_get (void); GRegex *mm_3gpp_cds_regex_get (void); @@ -272,6 +273,47 @@ gint mm_3gpp_cind_response_get_max (MM3gppCindResponse *r); GByteArray *mm_3gpp_parse_cind_read_response (const gchar *reply, GError **error); +/* +CGEV indication parser */ +typedef enum { + MM_3GPP_CGEV_UNKNOWN, + MM_3GPP_CGEV_NW_DETACH, + MM_3GPP_CGEV_ME_DETACH, + MM_3GPP_CGEV_NW_CLASS, + MM_3GPP_CGEV_ME_CLASS, + MM_3GPP_CGEV_NW_ACT_PRIMARY, + MM_3GPP_CGEV_ME_ACT_PRIMARY, + MM_3GPP_CGEV_NW_ACT_SECONDARY, + MM_3GPP_CGEV_ME_ACT_SECONDARY, + MM_3GPP_CGEV_NW_DEACT_PRIMARY, + MM_3GPP_CGEV_ME_DEACT_PRIMARY, + MM_3GPP_CGEV_NW_DEACT_SECONDARY, + MM_3GPP_CGEV_ME_DEACT_SECONDARY, + MM_3GPP_CGEV_NW_DEACT_PDP, + MM_3GPP_CGEV_ME_DEACT_PDP, + MM_3GPP_CGEV_NW_MODIFY, + MM_3GPP_CGEV_ME_MODIFY, + MM_3GPP_CGEV_REJECT, + MM_3GPP_CGEV_NW_REACT, +} MM3gppCgev; + +MM3gppCgev mm_3gpp_parse_cgev_indication_action (const gchar *str); +gboolean mm_3gpp_parse_cgev_indication_pdp (const gchar *str, + MM3gppCgev type, + gchar **out_pdp_type, + gchar **out_pdp_addr, + guint *out_cid, + GError **error); +gboolean mm_3gpp_parse_cgev_indication_primary (const gchar *str, + MM3gppCgev type, + guint *out_cid, + GError **error); +gboolean mm_3gpp_parse_cgev_indication_secondary (const gchar *str, + MM3gppCgev type, + guint *out_p_cid, + guint *out_cid, + guint *out_event_type, + GError **error); + /* AT+CMGL=4 (list sms parts) response parser */ typedef struct { gint index; -- cgit v1.2.3-70-g09d2