diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2022-02-09 15:42:53 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2022-03-07 09:51:43 +0000 |
commit | f3e885e067df7bd2486d48be28ef3f95efb56e1f (patch) | |
tree | 34577fc0fa651fdeab4aa760a361572b775ef075 | |
parent | 343f27a5e7b0226e10aec025c502703d0be9d1ac (diff) |
xmm: prefer port flagged as AT_GPS_CONTROL to manage the GNSS engine
Use the new AT_GPS_CONTROL udev tag to decide which is the best port
to manage the GNSS engine.
-rw-r--r-- | plugins/xmm/mm-shared-xmm.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/xmm/mm-shared-xmm.c b/plugins/xmm/mm-shared-xmm.c index 2bf5e8e2..141a83c4 100644 --- a/plugins/xmm/mm-shared-xmm.c +++ b/plugins/xmm/mm-shared-xmm.c @@ -1018,14 +1018,18 @@ gps_engine_start (GTask *task) /* Look for an AT port to use for GPS. Prefer secondary port if there is one, * otherwise use primary */ g_assert (!priv->gps_port); - priv->gps_port = mm_base_modem_get_port_secondary (MM_BASE_MODEM (self)); + + priv->gps_port = mm_base_modem_get_port_gps_control (MM_BASE_MODEM (self)); if (!priv->gps_port) { - priv->gps_port = mm_base_modem_get_port_primary (MM_BASE_MODEM (self)); + priv->gps_port = mm_base_modem_get_port_secondary (MM_BASE_MODEM (self)); if (!priv->gps_port) { - g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, - "No valid port found to control GPS"); - g_object_unref (task); - return; + priv->gps_port = mm_base_modem_get_port_primary (MM_BASE_MODEM (self)); + if (!priv->gps_port) { + g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "No valid port found to control GPS"); + g_object_unref (task); + return; + } } } |