modem-3gpp: add 'Pco' property to Modem3gpp interface
This patch adds a 'Pco' property to the Modem3gpp interface for tracking PCOs that the modem has received from the network.
This commit is contained in:
@@ -277,6 +277,7 @@ mm_modem_3gpp_get_enabled_facility_locks
|
||||
mm_modem_3gpp_get_registration_state
|
||||
mm_modem_3gpp_get_subscription_state
|
||||
mm_modem_3gpp_get_eps_ue_mode_operation
|
||||
mm_modem_3gpp_get_pco
|
||||
<SUBSECTION Methods>
|
||||
mm_modem_3gpp_register
|
||||
mm_modem_3gpp_register_finish
|
||||
@@ -1703,6 +1704,8 @@ mm_gdbus_modem3gpp_dup_operator_name
|
||||
mm_gdbus_modem3gpp_get_enabled_facility_locks
|
||||
mm_gdbus_modem3gpp_get_subscription_state
|
||||
mm_gdbus_modem3gpp_get_eps_ue_mode_operation
|
||||
mm_gdbus_modem3gpp_get_pco
|
||||
mm_gdbus_modem3gpp_dup_pco
|
||||
<SUBSECTION Methods>
|
||||
mm_gdbus_modem3gpp_call_register
|
||||
mm_gdbus_modem3gpp_call_register_finish
|
||||
@@ -1726,6 +1729,7 @@ mm_gdbus_modem3gpp_set_operator_name
|
||||
mm_gdbus_modem3gpp_set_registration_state
|
||||
mm_gdbus_modem3gpp_set_subscription_state
|
||||
mm_gdbus_modem3gpp_set_eps_ue_mode_operation
|
||||
mm_gdbus_modem3gpp_set_pco
|
||||
<SUBSECTION Standard>
|
||||
MM_GDBUS_IS_MODEM3GPP
|
||||
MM_GDBUS_MODEM3GPP
|
||||
|
||||
@@ -164,5 +164,12 @@
|
||||
-->
|
||||
<property name="EpsUeModeOperation" type="u" access="read" />
|
||||
|
||||
<!--
|
||||
Pco:
|
||||
|
||||
The raw PCOs received from the network.
|
||||
-->
|
||||
<property name="Pco" type="a(ubay)" access="read" />
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "mm-helpers.h"
|
||||
#include "mm-errors-types.h"
|
||||
#include "mm-modem-3gpp.h"
|
||||
#include "mm-pco.h"
|
||||
|
||||
/**
|
||||
* SECTION: mm-modem-3gpp
|
||||
@@ -298,6 +299,45 @@ mm_modem_3gpp_get_eps_ue_mode_operation (MMModem3gpp *self)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_modem_3gpp_get_pco:
|
||||
* @self: A #MMModem3gpp.
|
||||
*
|
||||
* Get the list of #MMPco received from the network.
|
||||
*
|
||||
* The caller is responsible for freeing the returned #GList with
|
||||
* mm_pco_list_free().
|
||||
*
|
||||
* Returns: (transfer full): A list of #MMPco.
|
||||
*/
|
||||
GList *
|
||||
mm_modem_3gpp_get_pco (MMModem3gpp *self)
|
||||
{
|
||||
GList *pco_list = NULL;
|
||||
GVariant *container, *child;
|
||||
GVariantIter iter;
|
||||
|
||||
g_return_val_if_fail (MM_IS_MODEM_3GPP (self), NULL);
|
||||
|
||||
container = mm_gdbus_modem3gpp_get_pco (MM_GDBUS_MODEM3GPP (self));
|
||||
|
||||
g_return_val_if_fail (g_variant_is_of_type (container, G_VARIANT_TYPE ("a(ubay)")),
|
||||
NULL);
|
||||
g_variant_iter_init (&iter, container);
|
||||
while ((child = g_variant_iter_next_value (&iter))) {
|
||||
MMPco *pco;
|
||||
|
||||
pco = mm_pco_from_variant (child, NULL);
|
||||
pco_list = mm_pco_list_add (pco_list, pco);
|
||||
g_object_unref (pco);
|
||||
g_variant_unref (child);
|
||||
}
|
||||
|
||||
return pco_list;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* mm_modem_3gpp_register_finish:
|
||||
* @self: A #MMModem3gpp.
|
||||
|
||||
@@ -82,6 +82,8 @@ MMModem3gppFacility mm_modem_3gpp_get_enabled_facility_locks (MMModem3
|
||||
|
||||
MMModem3gppEpsUeModeOperation mm_modem_3gpp_get_eps_ue_mode_operation (MMModem3gpp *self);
|
||||
|
||||
GList *mm_modem_3gpp_get_pco (MMModem3gpp *self);
|
||||
|
||||
void mm_modem_3gpp_register (MMModem3gpp *self,
|
||||
const gchar *network_id,
|
||||
GCancellable *cancellable,
|
||||
|
||||
@@ -1540,6 +1540,34 @@ periodic_registration_check_enable (MMIfaceModem3gpp *self)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
void
|
||||
mm_iface_modem_3gpp_update_pco_list (MMIfaceModem3gpp *self,
|
||||
const GList *pco_list)
|
||||
{
|
||||
MmGdbusModem3gpp *skeleton = NULL;
|
||||
GVariantBuilder builder;
|
||||
GVariant *variant;
|
||||
const GList *iter;
|
||||
|
||||
g_object_get (self,
|
||||
MM_IFACE_MODEM_3GPP_DBUS_SKELETON, &skeleton,
|
||||
NULL);
|
||||
if (!skeleton)
|
||||
return;
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ubay)"));
|
||||
for (iter = pco_list; iter; iter = g_list_next (iter)) {
|
||||
g_variant_builder_add_value (&builder,
|
||||
mm_pco_to_variant (MM_PCO (iter->data)));
|
||||
}
|
||||
variant = g_variant_ref_sink (g_variant_builder_end (&builder));
|
||||
mm_gdbus_modem3gpp_set_pco (skeleton, variant);
|
||||
g_variant_unref (variant);
|
||||
g_object_unref (skeleton);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct _DisablingContext DisablingContext;
|
||||
static void interface_disabling_step (GTask *task);
|
||||
|
||||
@@ -2242,6 +2270,7 @@ mm_iface_modem_3gpp_initialize (MMIfaceModem3gpp *self,
|
||||
mm_gdbus_modem3gpp_set_operator_name (skeleton, NULL);
|
||||
mm_gdbus_modem3gpp_set_enabled_facility_locks (skeleton, MM_MODEM_3GPP_FACILITY_NONE);
|
||||
mm_gdbus_modem3gpp_set_subscription_state (skeleton, MM_MODEM_3GPP_SUBSCRIPTION_STATE_UNKNOWN);
|
||||
mm_gdbus_modem3gpp_set_pco (skeleton, NULL);
|
||||
|
||||
/* Bind our RegistrationState property */
|
||||
g_object_bind_property (self, MM_IFACE_MODEM_3GPP_REGISTRATION_STATE,
|
||||
|
||||
@@ -259,6 +259,8 @@ void mm_iface_modem_3gpp_update_location (MMIfaceModem3gpp *self,
|
||||
gulong location_area_code,
|
||||
gulong tracking_area_code,
|
||||
gulong cell_id);
|
||||
void mm_iface_modem_3gpp_update_pco_list (MMIfaceModem3gpp *self,
|
||||
const GList *pco_list);
|
||||
|
||||
/* Run all registration checks */
|
||||
void mm_iface_modem_3gpp_run_registration_checks (MMIfaceModem3gpp *self,
|
||||
|
||||
Reference in New Issue
Block a user