From 538ed3f24e9ec5d64abc1543476e5ee34b504455 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sun, 28 Jun 2020 11:06:06 +0200 Subject: [PATCH] quectel,shared: don't report GPS capabilities if no GPS port found The QGPS based implementation needs the existence of a port flagged as GPS data; if there is no such port, we cannot provide GPS support. --- plugins/quectel/mm-shared-quectel.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/quectel/mm-shared-quectel.c b/plugins/quectel/mm-shared-quectel.c index 2d3a0d72..2bdc7d78 100644 --- a/plugins/quectel/mm-shared-quectel.c +++ b/plugins/quectel/mm-shared-quectel.c @@ -318,6 +318,14 @@ parent_load_capabilities_ready (MMIfaceModemLocation *self, return; } + /* Now our own check. If we don't have any GPS port, we're done */ + if (!mm_base_modem_peek_port_gps (MM_BASE_MODEM (self))) { + mm_obj_dbg (self, "no GPS data port found: no GPS capabilities"); + g_task_return_int (task, sources); + g_object_unref (task); + return; + } + /* Store parent supported sources in task data */ g_task_set_task_data (task, GUINT_TO_POINTER (sources), NULL);