diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-05-23 10:39:13 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-06-05 19:15:13 +0200 |
commit | b3222202bdabf762ffe0b2e92835ab22a3cd3d5c (patch) | |
tree | f6db11c45b6f5cd3a95520310fdfc3209c742c98 /src | |
parent | 7ad30ecce14f72a1b4bfe0274a2fefedf734d56a (diff) |
api,introspection: new 'SupportedIpFamilies' property
This property will let the clients know which are the IP families supported by
the modem.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-iface-modem.c | 41 | ||||
-rw-r--r-- | src/mm-iface-modem.h | 8 |
2 files changed, 49 insertions, 0 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 8eadc73b..54340880 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -3444,6 +3444,7 @@ typedef enum { INITIALIZATION_STEP_DEVICE_ID, INITIALIZATION_STEP_SUPPORTED_MODES, INITIALIZATION_STEP_SUPPORTED_BANDS, + INITIALIZATION_STEP_SUPPORTED_IP_FAMILIES, INITIALIZATION_STEP_POWER_STATE, INITIALIZATION_STEP_UNLOCK_REQUIRED, INITIALIZATION_STEP_SIM, @@ -3696,6 +3697,29 @@ load_supported_bands_ready (MMIfaceModem *self, interface_initialization_step (ctx); } +static void +load_supported_ip_families_ready (MMIfaceModem *self, + GAsyncResult *res, + InitializationContext *ctx) +{ + GError *error = NULL; + MMBearerIpFamily ip_families; + + ip_families = MM_IFACE_MODEM_GET_INTERFACE (self)->load_supported_ip_families_finish (self, res, &error); + + if (ip_families != MM_BEARER_IP_FAMILY_NONE) + mm_gdbus_modem_set_supported_ip_families (ctx->skeleton, ip_families); + + if (error) { + mm_warn ("couldn't load Supported IP families: '%s'", error->message); + g_error_free (error); + } + + /* Go on to next step */ + ctx->step++; + interface_initialization_step (ctx); +} + UINT_REPLY_READY_FN (power_state, "Power State") static void @@ -4033,6 +4057,22 @@ interface_initialization_step (InitializationContext *ctx) ctx->step++; } + case INITIALIZATION_STEP_SUPPORTED_IP_FAMILIES: + /* Supported ip_families are meant to be loaded only once during the whole + * lifetime of the modem. Therefore, if we already have them loaded, + * don't try to load them again. */ + if (MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_ip_families != NULL && + MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_ip_families_finish != NULL && + mm_gdbus_modem_get_supported_ip_families (ctx->skeleton) == MM_BEARER_IP_FAMILY_NONE) { + MM_IFACE_MODEM_GET_INTERFACE (ctx->self)->load_supported_ip_families ( + ctx->self, + (GAsyncReadyCallback)load_supported_ip_families_ready, + ctx); + return; + } + /* Fall down to next step */ + ctx->step++; + case INITIALIZATION_STEP_POWER_STATE: /* Initial power state is meant to be loaded only once. Therefore, if we * already have it loaded, don't try to load it again. */ @@ -4222,6 +4262,7 @@ mm_iface_modem_initialize (MMIfaceModem *self, mm_gdbus_modem_set_preferred_mode (skeleton, MM_MODEM_MODE_NONE); mm_gdbus_modem_set_supported_bands (skeleton, mm_common_build_bands_unknown ()); mm_gdbus_modem_set_bands (skeleton, mm_common_build_bands_unknown ()); + mm_gdbus_modem_set_supported_ip_families (skeleton, MM_BEARER_IP_FAMILY_NONE); mm_gdbus_modem_set_power_state (skeleton, MM_MODEM_POWER_STATE_UNKNOWN); mm_gdbus_modem_set_state_failed_reason (skeleton, MM_MODEM_STATE_FAILED_REASON_NONE); diff --git a/src/mm-iface-modem.h b/src/mm-iface-modem.h index ba9282fe..5a41aa2a 100644 --- a/src/mm-iface-modem.h +++ b/src/mm-iface-modem.h @@ -156,6 +156,14 @@ struct _MMIfaceModem { GAsyncResult *res, GError **error); + /* Loading of the SupportedIpFamilies property */ + void (* load_supported_ip_families) (MMIfaceModem *self, + GAsyncReadyCallback callback, + gpointer user_data); + MMBearerIpFamily (* load_supported_ip_families_finish) (MMIfaceModem *self, + GAsyncResult *res, + GError **error); + /* Loading of the PowerState property */ void (* load_power_state) (MMIfaceModem *self, GAsyncReadyCallback callback, |