aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2018-08-14 14:55:43 -0700
committerBen Chan <benchan@chromium.org>2018-08-18 13:34:06 -0700
commit930a5879d4735cf9ab934905b209a3ec158a02a2 (patch)
tree2d8e2a2db1396e83540ad04f102801df31da7bbf
parentd46aa0c36a8543857e28f151e134f88462369fc4 (diff)
broadband-modem-mbim: update 'Pco' property in Modem3gpp interface
This patch changes MMBroadbandModemMbim to update the 'Pco' property in the Modem3gpp interface upon receiving a MBIM_CID_PCO notification.
-rw-r--r--src/mm-broadband-modem-mbim.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c
index 03496b12..9ec0c04b 100644
--- a/src/mm-broadband-modem-mbim.c
+++ b/src/mm-broadband-modem-mbim.c
@@ -91,6 +91,8 @@ struct _MMBroadbandModemMbimPrivate {
ProcessNotificationFlag setup_flags;
ProcessNotificationFlag enable_flags;
+ GList *pco_list;
+
/* 3GPP registration helpers */
gchar *current_operator_id;
gchar *current_operator_name;
@@ -2520,6 +2522,7 @@ basic_connect_extensions_notification_pco (MMBroadbandModemMbim *self,
MbimPcoValue *pco_value;
GError *error = NULL;
gchar *pco_data_hex;
+ MMPco *pco;
if (!mbim_message_basic_connect_extensions_pco_notification_parse (
notification,
@@ -2530,13 +2533,27 @@ basic_connect_extensions_notification_pco (MMBroadbandModemMbim *self,
return;
}
- pco_data_hex = mm_utils_bin2hexstr (pco_value->pco_data_buffer, pco_value->pco_data_size);
+ pco_data_hex = mm_utils_bin2hexstr (pco_value->pco_data_buffer,
+ pco_value->pco_data_size);
mm_dbg ("Received PCO: session ID=%u type=%s size=%u data=%s",
pco_value->session_id,
mbim_pco_type_get_string (pco_value->pco_data_type),
pco_value->pco_data_size,
pco_data_hex);
g_free (pco_data_hex);
+
+ pco = mm_pco_new ();
+ mm_pco_set_session_id (pco, pco_value->session_id);
+ mm_pco_set_complete (pco,
+ pco_value->pco_data_type == MBIM_PCO_TYPE_COMPLETE);
+ mm_pco_set_data (pco,
+ pco_value->pco_data_buffer,
+ pco_value->pco_data_size);
+
+ self->priv->pco_list = mm_pco_list_add (self->priv->pco_list, pco);
+ mm_iface_modem_3gpp_update_pco_list (MM_IFACE_MODEM_3GPP (self),
+ self->priv->pco_list);
+ g_object_unref (pco);
mbim_pco_value_free (pco_value);
}
@@ -3884,6 +3901,7 @@ finalize (GObject *object)
g_free (self->priv->caps_hardware_info);
g_free (self->priv->current_operator_id);
g_free (self->priv->current_operator_name);
+ mm_pco_list_free (self->priv->pco_list);
G_OBJECT_CLASS (mm_broadband_modem_mbim_parent_class)->finalize (object);
}