aboutsummaryrefslogtreecommitdiff
path: root/plugins/iridium
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-02-17 15:49:01 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-03-10 10:59:19 +0100
commit064e92e9b77b35f83cb522c6ea98b9016ce5db8c (patch)
treea890a28fc2577fcbe6aaeb91b34329286af94956 /plugins/iridium
parent71bad1d86263a07d78274b939ed0f7dfeed4201d (diff)
api,simple: new 'multiplex' setting in bearer properties
Both the Simple.Connect() and Modem.CreateBearer() are updated to allow a new 'multiplex' setting in the properties provided by the user in both of these methods. The new setting expects a MMBearerMultiplexSupport enum indicating what kind of multiplex needs the user has: * none: if multiplex must not be used. * requested: if multiplex should be used if available. * required: if multiplex must be used. The underlying implementations will take care of accepting or rejecting the setting depending on the system and modem capabilities.
Diffstat (limited to 'plugins/iridium')
-rw-r--r--plugins/iridium/mm-bearer-iridium.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/iridium/mm-bearer-iridium.c b/plugins/iridium/mm-bearer-iridium.c
index 12b60419..6210eca3 100644
--- a/plugins/iridium/mm-bearer-iridium.c
+++ b/plugins/iridium/mm-bearer-iridium.c
@@ -183,6 +183,15 @@ connect (MMBaseBearer *self,
GTask *task;
MMBaseModem *modem = NULL;
+ task = g_task_new (self, cancellable, callback, user_data);
+
+ if (mm_bearer_properties_get_multiplex (mm_base_bearer_peek_config (self)) == MM_BEARER_MULTIPLEX_SUPPORT_REQUIRED) {
+ g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED,
+ "Multiplex support not available");
+ g_object_unref (task);
+ return;
+ }
+
g_object_get (self,
MM_BASE_BEARER_MODEM, &modem,
NULL);
@@ -194,8 +203,6 @@ connect (MMBaseBearer *self,
/* In this context, we only keep the stuff we'll need later */
ctx = g_new0 (ConnectContext, 1);
ctx->primary = mm_base_modem_get_port_primary (modem);
-
- task = g_task_new (self, cancellable, callback, user_data);
g_task_set_task_data (task, ctx, (GDestroyNotify) connect_context_free);
/* Bearer service type set to 9600bps (V.110), which behaves better than the