aboutsummaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers.h
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2018-10-19 15:55:21 +0200
committerDan Williams <dcbw@redhat.com>2018-11-26 16:28:39 +0000
commita15193b7ca7c1b18f3aa6ee290f1c2866ab40a8c (patch)
tree3813acc6fe20b675b27dd9e9152bc25e44168a54 /src/mm-modem-helpers.h
parent73df7087fd218e9d95fb72c00fbcdf0cc5ccf1ac (diff)
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.
Diffstat (limited to 'src/mm-modem-helpers.h')
-rw-r--r--src/mm-modem-helpers.h42
1 files changed, 42 insertions, 0 deletions
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;