diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2020-06-29 10:13:44 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2020-06-29 08:53:00 +0000 |
commit | af8afcc6c9fd6eb6b88d43c88dee013d4a02c0cf (patch) | |
tree | 0f3b483c4f475471458f9921e3259c01cf455bdf | |
parent | 619b054e5c874844a73594a724b4e5ce5ec18b6d (diff) |
quectel,shared: only flag GPS source as enabled if it was successful
-rw-r--r-- | plugins/quectel/mm-shared-quectel.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/quectel/mm-shared-quectel.c b/plugins/quectel/mm-shared-quectel.c index c485f6f5..aaeca95f 100644 --- a/plugins/quectel/mm-shared-quectel.c +++ b/plugins/quectel/mm-shared-quectel.c @@ -346,6 +346,9 @@ gps_startup_ready (MMBaseModem *self, { MMModemLocationSource source; GError *error = NULL; + Private *priv; + + priv = get_private (MM_SHARED_QUECTEL (self)); mm_base_modem_at_sequence_finish (self, res, NULL, &error); if (error) { @@ -369,10 +372,16 @@ gps_startup_ready (MMBaseModem *self, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, "Couldn't open raw GPS serial port"); - } else + } else { + /* GPS port was successfully opened */ + priv->enabled_sources |= source; g_task_return_boolean (task, TRUE); - } else + } + } else { + /* No need to open GPS port */ + priv->enabled_sources |= source; g_task_return_boolean (task, TRUE); + } g_object_unref (task); } @@ -428,8 +437,6 @@ mm_shared_quectel_enable_location_gathering (MMIfaceModemLocation *self, MM_MODEM_LOCATION_SOURCE_GPS_RAW | MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED))); - priv->enabled_sources |= source; - if (start_gps) { mm_base_modem_at_sequence ( MM_BASE_MODEM (self), @@ -442,6 +449,7 @@ mm_shared_quectel_enable_location_gathering (MMIfaceModemLocation *self, } /* If the GPS is already running just return */ + priv->enabled_sources |= source; g_task_return_boolean (task, TRUE); g_object_unref (task); } |