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.
This commit is contained in:
@@ -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,
|
/* Look for an AT port to use for GPS. Prefer secondary port if there is one,
|
||||||
* otherwise use primary */
|
* otherwise use primary */
|
||||||
g_assert (!priv->gps_port);
|
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) {
|
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) {
|
if (!priv->gps_port) {
|
||||||
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
|
priv->gps_port = mm_base_modem_get_port_primary (MM_BASE_MODEM (self));
|
||||||
"No valid port found to control GPS");
|
if (!priv->gps_port) {
|
||||||
g_object_unref (task);
|
g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
|
||||||
return;
|
"No valid port found to control GPS");
|
||||||
|
g_object_unref (task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user