aboutsummaryrefslogtreecommitdiff
path: root/plugins/iridium
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-05-29 12:41:49 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-06-05 19:15:14 +0200
commit45ceba76924f184ed9e12ba3d35e00a55ad3a197 (patch)
treec413d3e29a64eb86340e964ec48e67d8a66c6f76 /plugins/iridium
parent212d00c529ee07131bf3b71a8759dca49292c059 (diff)
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'
Diffstat (limited to 'plugins/iridium')
-rw-r--r--plugins/iridium/mm-broadband-modem-iridium.c17
1 files changed, 14 insertions, 3 deletions
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);
}