From 45ceba76924f184ed9e12ba3d35e00a55ad3a197 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 29 May 2013 12:41:49 +0200 Subject: api,introspection: 'SupportedModes' is now a list of possible combinations Instead of just a mask of MMModemMode values, we now provide a list of the allowed and preferred mode combinations supported by the modem. E.g.: $> sudo mmcli -m 0 ------------------------- Modes | supported: 'allowed: 2g; preferred: none | allowed: 3g; preferred: none | allowed: 2g, 3g; preferred: none | allowed: 2g, 3g; preferred: 2g | allowed: 2g, 3g; preferred: 3g | allowed: 4g; preferred: none | allowed: 2g, 3g, 4g; preferred: none' --- plugins/iridium/mm-broadband-modem-iridium.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'plugins/iridium') diff --git a/plugins/iridium/mm-broadband-modem-iridium.c b/plugins/iridium/mm-broadband-modem-iridium.c index c3c81aaf..b26851b2 100644 --- a/plugins/iridium/mm-broadband-modem-iridium.c +++ b/plugins/iridium/mm-broadband-modem-iridium.c @@ -219,13 +219,12 @@ setup_flow_control (MMIfaceModem *self, /*****************************************************************************/ /* Load supported modes (Modem inteface) */ -static MMModemMode +static GArray * load_supported_modes_finish (MMIfaceModem *self, GAsyncResult *res, GError **error) { - /* Report CS only, Iridium connections are circuit-switched */ - return MM_MODEM_MODE_CS; + return g_array_ref (g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res))); } static void @@ -234,11 +233,23 @@ load_supported_modes (MMIfaceModem *self, gpointer user_data) { GSimpleAsyncResult *result; + GArray *combinations; + MMModemModeCombination mode; result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, load_supported_modes); + + /* Build list of combinations */ + combinations = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 1); + + /* Report CS only, Iridium connections are circuit-switched */ + mode.allowed = MM_MODEM_MODE_CS; + mode.preferred = MM_MODEM_MODE_NONE; + g_array_append_val (combinations, mode); + + g_simple_async_result_set_op_res_gpointer (result, combinations, (GDestroyNotify) g_array_unref); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } -- cgit v1.2.3