[PATCH v2 09/13] ublox: try to use AT+UACT? to query current bands

Aleksander Morgado aleksander at aleksander.es
Fri Sep 15 05:01:05 UTC 2017


---
 plugins/ublox/mm-broadband-modem-ublox.c | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/plugins/ublox/mm-broadband-modem-ublox.c b/plugins/ublox/mm-broadband-modem-ublox.c
index 27345752..23f14c7c 100644
--- a/plugins/ublox/mm-broadband-modem-ublox.c
+++ b/plugins/ublox/mm-broadband-modem-ublox.c
@@ -179,24 +179,43 @@ load_supported_bands (MMIfaceModem        *self,
 /* Load current bands (Modem interface) */

 static GArray *
-load_current_bands_finish (MMIfaceModem  *self,
+load_current_bands_finish (MMIfaceModem  *_self,
                            GAsyncResult  *res,
                            GError       **error)
 {
-    const gchar *response;
+    MMBroadbandModemUblox *self = MM_BROADBAND_MODEM_UBLOX (_self);
+    const gchar           *response;

     response = mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error);
     if (!response)
         return NULL;

+    if (self->priv->uact == FEATURE_SUPPORTED)
+        return mm_ublox_parse_uact_response (response, error);
+
     return mm_ublox_parse_ubandsel_response (response, error);
 }

 static void
-load_current_bands (MMIfaceModem        *self,
+load_current_bands (MMIfaceModem        *_self,
                     GAsyncReadyCallback  callback,
                     gpointer             user_data)
 {
+    MMBroadbandModemUblox *self = MM_BROADBAND_MODEM_UBLOX (_self);
+
+    g_assert (self->priv->uact != FEATURE_SUPPORT_UNKNOWN);
+
+    if (self->priv->uact == FEATURE_SUPPORTED) {
+        mm_base_modem_at_command (
+            MM_BASE_MODEM (self),
+            "+UACT?",
+            3,
+            FALSE,
+            (GAsyncReadyCallback)callback,
+            user_data);
+        return;
+    }
+
     mm_base_modem_at_command (
         MM_BASE_MODEM (self),
         "+UBANDSEL?",
--
2.14.1


More information about the ModemManager-devel mailing list