summaryrefslogtreecommitdiff
path: root/src/gclue-modem-gps.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove manual GError memory managementMaciej S. Szmigiero2023-01-051-4/+2
|
* Make sure to not cast user_data to GObjects in callback if call is canceledMaciej S. Szmigiero2022-10-111-5/+6
| | | | | This can abort at runtime if the object pointed to by user_data is already gone by the time the callback is run.
* Make sure signals aren't left connected after handler object is goneMaciej S. Szmigiero2022-10-111-4/+4
|
* Fix various memory leaks as reported by ValgrindMaciej S. Szmigiero2021-11-161-1/+1
| | | | | Reduces memory usage considerably for me: from 370 MiB RSS to just 24 MiB after a day.
* modem: Make 'fix-gps' signal parameter a string arrayTeemu Ikonen2021-11-071-4/+4
| | | | | | | | | | | | | | Change the only parameter of the 'fix-gps' signal to a NULL terminated array of strings, i.e. G_TYPE_STRV. The on_get_gps_nmea_ready function in gclue-modem-manager.c now emits 'fix-gps' with NMEA GGA and RMC sentences read from ModemManager. The signal handler on_fix_gps in gclue-modem-gps.c now accepts a string array argument and calls gclue_location_create_from_nmeas to create a new location. Fixes #147.
* Fix return values in GClueLocationSource start() implementationsTeemu Ikonen2021-11-071-1/+2
| | | | | | Return the correct enum also in g_return_val_if_fail calls. These were missed in in commit 2d1968f84fa81 (merge request !94).
* Don't use G_TYPE_INSTANCE_GET_PRIVATETeemu Ikonen2021-10-211-1/+1
| | | | | | | It has been deprecated since GObject 2.58. Replace with *_get_instance_private() functions generated by GObject G_ADD_PRIVATE macro.
* location-source: Fix subclass resource leaks on startTeemu Ikonen2021-10-051-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The start_source() and stop_source() functions in GClueLocationSource are chained up by all the start() and stop() method implementations in GClueLocationSource subclasses to determine when to really start and stop the source and allocate / free the needed resources. Commit 0661107fe0 made start_source() return TRUE when the source was already active, which caused the resources already reserved for the physical source to be reserved again. The source class implementations are typically designed to hold just one set of resources, so the references to previously reserved resources are lost, that is they leak. An example of this is the GSocketClient reference (priv->client) held by GClueNMEASource. Another visible (in the debug log) example of the extra resources are callbacks connected to the "fix-*" signals of the physical sources (see gclue_modem_gps_start() for example). With more than one client using the same source, all clients receive the same location update N times, where N is the number of clients using the source. Make GClueLocationSource.start() and .stop() methods return enums GClueLocationSourceStartResult and GClueLocationSourceStopResult which gives subclasses more information on when to allocate resources on starting and stopping. The start_source() function now returns the value GCLUE_LOCATION_SOURCE_START_RESULT_ALREADY_STARTED when the source is already active. The subclass start() method implementations are changed to return immediately when they get this value from the base class. This effectively reverts the first diff in commit 0661107fe0 "location-source: Return source state from start_source and stop_source". The behaviour of stop() method subclass implementations remains the same. Freeing of resources is always attempted, except when the value GCLUE_LOCATION_SOURCE_STOP_RESULT_STILL_USED is returned from the base class.
* nmea: Make modem-manager works with RMC sentencesSujanan Bhathiya2020-05-021-2/+6
| | | | | | | | | | | | | | | | | This add support for RMC based NMEA sentences. Benefit ======= When NMEA updates are not very frequent due DBUS scheduling (It is scheduled to give updates every 30 seconds) processing information obtained from previous location will provide an average speed while $GPRMC data may provide an instantaneous speed every time it gets an update. more: http://aprs.gids.nl/nmea/#rmc https://gitlab.freedesktop.org/geoclue/geoclue/issues/48 Based on a patch from Iqbal Inzamam (https://gitlab.freedesktop.org/inzamam.15)
* Drop use of deprecated g_type_class_add_private()Zeeshan Ali2019-01-041-3/+4
| | | | | | | | | Use the G_ADD_PRIVATE() macro instead. This doesn't fix the issue in geocode-glib but that's not an issue since we plan to drop geocode-glib (#88). Fixes #98.
* Remove redundant '(C)' in copyright headersZeeshan Ali2018-04-221-1/+1
|
* modem-gps: Forward time-threshold to modemZeeshan Ali2018-04-191-0/+19
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=105993
* modem-gps: Fix short-description in doc commentZeeshan Ali2018-04-141-1/+1
|
* modem-gps: Add a missing returnZeeshan Ali (Khattak)2015-09-171-0/+2
| | | | And avoid a crash.
* Add gclue_location_create_from_gga()Ankit2015-08-221-111/+7
| | | | | | | | | Add gclue_location_create_from_gga() the creates a GClueLocation object out of an NMEA GGA sentence. This function works with the help of get_accuracy_from_hdop(), parse_coordinate_string() and parse_altitude_string() that are moved from gclue-modem-gps.c. https://bugs.freedesktop.org/show_bug.cgi?id=90974
* modem-gps: Fix GPS coordinates parsingFabrice Bellet2015-03-281-2/+9
| | | | | | | Latitude and longitude don't have the same number of digits on the left side of the decimal point in the GGA NMEA sentence. https://bugs.freedesktop.org/show_bug.cgi?id=89715
* Switch to GClueLocation classAnkit2015-03-261-3/+3
| | | | | | | | This patch switches the code from use of GeocodeLocation to GClueLocation. This is needed for the new API which will be added to GClueLocation. https://bugs.freedesktop.org/show_bug.cgi?id=89395
* Split-out ModemManager codeZeeshan Ali (Khattak)2014-06-211-2/+2
| | | | | | | GClueModem is not an interface and the new GClueModemManager class now implements this interface using ModemManager. This is pretty useless on its own right now but its intended to make it easy to add alternative Modem source(s), e.g ofono-based.
* modem-gps: Use Modem classZeeshan Ali (Khattak)2014-06-101-104/+209
| | | | | | | Instead of deriving from GClueModemSource class, GClueModemGPS now just uses GClueModem singleton to talk to ModemManager. Refer to 9231e64 ("Add GClueModem class") for rationale.
* all sources: Chain-up finalize before own cleanupZeeshan Ali (Khattak)2014-04-151-2/+2
| | | | | This will ensure that baseclass will stops the source before the source free the resources that might be needed for stopping the source.
* gps,3g: Ignore new location if inactiveZeeshan Ali (Khattak)2014-04-111-0/+3
| | | | | Since location is retrieved asynchronously, its possible that source was stopped in between.
* modem-gps: Expose altitude of locationZeeshan Ali (Khattak)2014-04-111-1/+4
|
* Add a GPS modem geolocation sourceZeeshan Ali (Khattak)2014-01-261-0/+250