From 064e92e9b77b35f83cb522c6ea98b9016ce5db8c Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 17 Feb 2021 15:49:01 +0100 Subject: 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. --- src/mm-bearer-mbim.c | 8 ++++++++ src/mm-bearer-qmi.c | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c index b808f547..c5ca427d 100644 --- a/src/mm-bearer-mbim.c +++ b/src/mm-bearer-mbim.c @@ -1125,6 +1125,14 @@ _connect (MMBaseBearer *self, if (!peek_ports (self, &device, &data, callback, user_data)) return; + if (mm_bearer_properties_get_multiplex (mm_base_bearer_peek_config (self)) == MM_BEARER_MULTIPLEX_SUPPORT_REQUIRED) { + g_task_report_new_error ( + self, callback, user_data, _connect, + MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Multiplex support not available"); + return; + } + g_object_get (self, MM_BASE_BEARER_MODEM, &modem, NULL); diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c index 670fb804..a31ae860 100644 --- a/src/mm-bearer-qmi.c +++ b/src/mm-bearer-qmi.c @@ -1692,6 +1692,14 @@ _connect (MMBaseBearer *_self, GTask *task; GCancellable *operation_cancellable = NULL; + if (mm_bearer_properties_get_multiplex (mm_base_bearer_peek_config (_self)) == MM_BEARER_MULTIPLEX_SUPPORT_REQUIRED) { + g_task_report_new_error ( + self, callback, user_data, _connect, + MM_CORE_ERROR, MM_CORE_ERROR_UNSUPPORTED, + "Multiplex support not available"); + goto out; + } + g_object_get (self, MM_BASE_BEARER_MODEM, &modem, NULL); -- cgit v1.2.3-70-g09d2