diff options
author | Ujjwal Pande <ujjwalpande@google.com> | 2024-05-30 00:04:24 +0000 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2024-06-12 09:39:12 +0000 |
commit | 2904510e760fa1fdf491d1ef4574c29d05307b3b (patch) | |
tree | 999160f261639f947303ef96589e7d1a0bf497b0 /libmm-glib/mm-modem-3gpp.c | |
parent | df8287bf6c2febd068d06f0f45194bc622118bd4 (diff) |
api: new NetworkRejection property
When a modem is not able to register to the network, MBIM and QMI indications
related to registration reports network rejection cause codes if request is
rejected by the network. This information is currently logged in the ModemManager
but not exposed outside of ModemManager.
These are the changes to define interface to expose network reject cause codes
over d-bus to the above layers which could be used by above layers to present
this information in a user friendly way.
Diffstat (limited to 'libmm-glib/mm-modem-3gpp.c')
-rw-r--r-- | libmm-glib/mm-modem-3gpp.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/libmm-glib/mm-modem-3gpp.c b/libmm-glib/mm-modem-3gpp.c index cb228108..e86360d3 100644 --- a/libmm-glib/mm-modem-3gpp.c +++ b/libmm-glib/mm-modem-3gpp.c @@ -52,6 +52,7 @@ struct _MMModem3gppPrivate { PROPERTY_OBJECT_DECLARE (initial_eps_bearer_settings, MMBearerProperties) PROPERTY_OBJECT_DECLARE (nr5g_registration_settings, MMNr5gRegistrationSettings) + PROPERTY_OBJECT_DECLARE (network_rejection, MMNetworkRejection) }; /*****************************************************************************/ @@ -696,6 +697,52 @@ PROPERTY_OBJECT_DEFINE_FAILABLE (initial_eps_bearer_settings, MMBearerProperties, mm_bearer_properties_new_from_dictionary) +/** + * mm_modem_3gpp_get_network_rejection: + * @self: A #MMModem3gpp. + * + * Gets a #MMNetworkRejection object specifying the network rejection + * information received during registration failure. + * + * <warning>The values reported by @self are not updated when the values in the + * interface change. Instead, the client is expected to call + * mm_modem_3gpp_get_network_rejection() again to get a new + * #MMNetworkRejection with the new values.</warning> + * + * Returns: (transfer full): A #MMNetworkRejection that must be freed with + * g_object_unref() or %NULL if unknown. + * + * Since: 1.24 + */ + +/** + * mm_modem_3gpp_peek_network_rejection: + * @self: A #MMModem3gpp. + * + * Gets a #MMNetworkRejection object specifying the network rejection + * information received during registration failure. + * + * <warning>The returned value is only valid until the property changes so + * it is only safe to use this function on the thread where + * @self was constructed. Use mm_modem_3gpp_get_network_rejection() + * if on another thread.</warning> + * + * Returns: (transfer none): A #MMNetworkRejection. Do not free the returned + * value, it belongs to @self. + * + * Since: 1.24 + */ + +/* helpers to match the property substring name with the one in our API */ +#define mm_gdbus_modem_3gpp_dup_network_rejection mm_gdbus_modem3gpp_dup_network_rejection + +PROPERTY_OBJECT_DEFINE_FAILABLE (network_rejection, + Modem3gpp, modem_3gpp, MODEM_3GPP, + MMNetworkRejection, + mm_network_rejection_new_from_dictionary) + +/*****************************************************************************/ + /*****************************************************************************/ static GList * @@ -1613,6 +1660,7 @@ mm_modem_3gpp_init (MMModem3gpp *self) PROPERTY_INITIALIZE (initial_eps_bearer_settings, "initial-eps-bearer-settings") PROPERTY_INITIALIZE (nr5g_registration_settings, "nr5g-registration-settings") + PROPERTY_INITIALIZE (network_rejection, "network-rejection") } static void @@ -1624,6 +1672,7 @@ finalize (GObject *object) PROPERTY_OBJECT_FINALIZE (initial_eps_bearer_settings); PROPERTY_OBJECT_FINALIZE (nr5g_registration_settings); + PROPERTY_OBJECT_FINALIZE (network_rejection); G_OBJECT_CLASS (mm_modem_3gpp_parent_class)->finalize (object); } |