From ffca45d9cc416879881b75fb93880aee8c7563d2 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 29 Jun 2020 10:46:47 +0200 Subject: quectel,shared: add GPS trace handler --- plugins/quectel/mm-shared-quectel.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'plugins/quectel/mm-shared-quectel.c') diff --git a/plugins/quectel/mm-shared-quectel.c b/plugins/quectel/mm-shared-quectel.c index aaeca95f..e10d581d 100644 --- a/plugins/quectel/mm-shared-quectel.c +++ b/plugins/quectel/mm-shared-quectel.c @@ -205,6 +205,17 @@ mm_shared_quectel_setup_sim_hot_swap (MMIfaceModem *self, g_object_unref (task); } +/*****************************************************************************/ +/* GPS trace received */ + +static void +trace_received (MMPortSerialGps *port, + const gchar *trace, + MMIfaceModemLocation *self) +{ + mm_iface_modem_location_gps_update (self, trace); +} + /*****************************************************************************/ /* Location capabilities loading (Location interface) */ @@ -255,6 +266,12 @@ probe_qgps_ready (MMBaseModem *_self, priv->provided_sources |= MM_MODEM_LOCATION_SOURCE_GPS_UNMANAGED; sources |= priv->provided_sources; + + /* Add handler for the NMEA traces in the GPS data port */ + mm_port_serial_gps_add_trace_handler (mm_base_modem_peek_port_gps (MM_BASE_MODEM (self)), + (MMPortSerialGpsTraceFn)trace_received, + self, + NULL); } /* So we're done, complete */ -- cgit v1.2.3-70-g09d2