summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-03-27 12:24:29 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-03-29 09:17:53 +0200
commit97f779df1e2d5dfd82aea1084edf018c5fe5c9e5 (patch)
tree15071e50d2e757b251a6fee87106bad50fc899e2
parent1cfab89719c29b6019070fb40126bb8c95c5ee4a (diff)
downloadModemManager-97f779df1e2d5dfd82aea1084edf018c5fe5c9e5.tar.gz
hso: ensure GPS is disabled when we initialize the modem
-rw-r--r--plugins/option/mm-broadband-modem-hso.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/option/mm-broadband-modem-hso.c b/plugins/option/mm-broadband-modem-hso.c
index 603eefb53..4c9bb8dcd 100644
--- a/plugins/option/mm-broadband-modem-hso.c
+++ b/plugins/option/mm-broadband-modem-hso.c
@@ -444,6 +444,8 @@ enable_location_gathering (MMIfaceModemLocation *self,
static void
setup_ports (MMBroadbandModem *self)
{
+ MMAtSerialPort *gps_control_port;
+
/* Call parent's setup ports first always */
MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_hso_parent_class)->setup_ports (self);
@@ -459,6 +461,16 @@ setup_ports (MMBroadbandModem *self)
* messages, which are not <CR><LF> prefixed. */
MM_AT_SERIAL_PORT_REMOVE_ECHO, FALSE,
NULL);
+
+ /* It may happen that the modem was started with GPS already enabled, or
+ * maybe ModemManager got rebooted and it was left enabled before. We'll make
+ * sure that it is disabled when we initialize the modem */
+ gps_control_port = mm_base_modem_peek_port_gps_control (MM_BASE_MODEM (self));
+ if (gps_control_port)
+ mm_base_modem_at_command_full (MM_BASE_MODEM (self),
+ gps_control_port,
+ "_OGPS=0",
+ 3, FALSE, NULL, NULL, NULL);
}
/*****************************************************************************/