summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-09-16nmea-source: Drop service on failure to read from itwip/drop-serviceZeeshan Ali (Khattak)1-14/+24
Since we longer read NMEA data from service if we fail to read from it and it's most likely indication that service has closed the socket without (first) advertising it going down, let's just drop the service from the list and refresh available accuracy level.
2015-09-16nmea-source: Correct order of argumentsZeeshan Ali (Khattak)1-9/+9
'self' should always be the first argument.
2015-09-16nmea-source: Don't access error if NULLBastien Nocera1-4/+8
The g_data_input_stream_read_line_finish() documentation says: If there's no content to read, it will still return NULL, but error won't be set. So we can end up with a crash when turning off the NMEA server: #0 0x0000000000420273 in on_read_gga_sentence (object=0x6b0870 [GDataInputStream], result=0x661510, user_data=0x6769b0) at gclue-nmea-source.c:449 #1 0x00007ffff6d110c3 in g_task_return_now (task=0x661510 [GTask]) at gtask.c:1088 #2 0x00007ffff6d1175e in g_task_return (task=0x661510 [GTask], type=<optimized out>) at gtask.c:1146 #3 0x00007ffff6cc98d7 in g_data_input_stream_read_complete (task=0x661510 [GTask], read_length=0, skip_length=0) at gdatainputstream.c:982 Co-author: Ankit <ankitstarski@gmail.com>. https://bugs.freedesktop.org/show_bug.cgi?id=91940
2015-09-10locator: Prefer more recent location updateZeeshan Ali (Khattak)1-11/+18
If we get a new location update with timestamp older than existing location, let's ignore that. This solves the issue of wifi-based geolocation getting overwritten by older location from network NMEA source, just cause it was more accurate.
2015-09-10location: Use timestamp from NMEA GGA sentenceZeeshan Ali (Khattak)1-1/+63
2015-09-10location: Add gclue_location_duplicate()Zeeshan Ali (Khattak)3-8/+33
Add a method to duplicate a location object and make use of that from location-source.
2015-09-10location: Ensure speed change notificationZeeshan Ali (Khattak)1-2/+3
2015-09-10location: No negative speedsZeeshan Ali (Khattak)1-1/+1
If timestamp on new location is older than that on previous location, calculating speed from them does not make sense. Instead simply set the speed to unknown in such cases.
2015-09-10location: Correctly handle same timestamp caseZeeshan Ali (Khattak)1-1/+5
Same timestamp on new and previous locations, is not programmer error and hence use of g_return_if_fail() for this case would be wrong. Instead simply set the speed to unknown in such cases.
2015-09-10location: Update from geocode-glibZeeshan Ali (Khattak)1-5/+32
2015-09-09build: Fix detection of gdbus-codegen toolPhilip Withnall1-6/+3
The code didn’t even make sense. My bad. https://bugs.freedesktop.org/show_bug.cgi?id=91939
2015-09-09locator: Compare distance & accuracy in same unitsAnkit1-1/+1
This patch fixes a bug causing some GPS locations to be discarded when the device is moving slowly, because the distance from previous location is expressed in kilometers, while the accuracy of the GPS location is in meters. Based on patch from Fabrice Bellet <fabrice@bellet.info> https://bugs.freedesktop.org/show_bug.cgi?id=89922
2015-09-07nmea-source: Ensure 1st service remains 1st in listZeeshan Ali (Khattak)1-4/+9
Currently if a second service is discovered that has the same accuracy as the first one in the list, g_list_insert_sorted() can (and in practice does) insert it in the beginning since our comparison function declares them both equal. Because of this, we end up switching to the new service even if its accuracy level is the same as the one we are already using. Let's solve this by also taking time of discovery into account in our comparison function.
2015-09-07nmea-source: Simplify service comparison func a bitZeeshan Ali (Khattak)1-1/+1
2015-09-04location: Update from geocode-glibZeeshan Ali (Khattak)10-113/+597
2015-09-04nmea-source: Handle service going up/downZeeshan Ali (Khattak)1-3/+33
Currently, if source is active and the service is use goes away while another service is available, we don't switch to the other service until source is restarted by geoclue. This patch not only fixes that but also switches to a new more accurate source.
2015-09-04nmea-source: Refactor code disconnecting from serviceZeeshan Ali (Khattak)1-16/+23
This is a good idea anyway (to keep code cleaner) but the new function will also be used in a following path to disconnect (and clean-up resoure) if the active source either goes away or we find a more accurate service.
2015-09-04nmea-source: Add a NULL checkZeeshan Ali (Khattak)1-6/+9
Don't try to disconnect the connection before ensuring it's not NULL.
2015-09-04nmea-source: Ensure pointers are reset to NULLZeeshan Ali (Khattak)1-2/+2
2015-09-04nmea-source: No need to return FALSE from _stop()Zeeshan Ali (Khattak)1-4/+1
If we for some reason don't manage to close the socket, it's not a big deal and we should continue to freeing resources and besides the return value isn't really used.
2015-09-04nmea-source: Show actual error message in warningZeeshan Ali (Khattak)1-1/+1
2015-09-04nmea-source: Refactor code connecting to serviceZeeshan Ali (Khattak)1-20/+26
This is a good idea anyway (to keep code cleaner) but the new function will also be used in a following path to connect to a new source when source is active already.
2015-09-04nmea-source: Move a NULL check early in _start()Zeeshan Ali (Khattak)1-3/+3
And by doing so we avoid unnecessarily creating/initializing some resources.
2015-09-04nmea-source: Simplify _start() a bitZeeshan Ali (Khattak)1-8/+3
2015-09-04nmea-source: No need to return FALSE from _start()Zeeshan Ali (Khattak)1-1/+1
The return value isn't really used. The boolean return is only there as a hack to ensure that we don't start a source twice.
2015-09-04nmea-source: No warning on cancellationZeeshan Ali (Khattak)1-1/+2
If reading from NMEA source fails because of cancellation, there is no cause for an alarm since cancellation is done by source itself.
2015-09-04nmea-source: Don't unref stream object too earlyZeeshan Ali (Khattak)1-1/+1
Don't unref stream object until we are done using it.
2015-09-04nmea-source: Free a struct earlierZeeshan Ali (Khattak)1-2/+2
Ideally memory should be freed as soon as not used anymore.
2015-09-04nmea-source: Fix leaking of service infoZeeshan Ali (Khattak)1-0/+1
Removing nodes from the list does not free associated data, we gotta do that explicitly.
2015-09-04nmea-source: Add a NULL checkZeeshan Ali (Khattak)1-0/+2
2015-09-04nmea-source: Check for more specific gtypeZeeshan Ali (Khattak)1-2/+2
2015-09-04nmea-source: Remove a harmful checkZeeshan Ali (Khattak)1-2/+0
_stop() was returning early if connection was active. This is quite the opposite to what it should be doing.
2015-09-04nmea-source: Remove a redundant empty lineZeeshan Ali (Khattak)1-1/+0
2015-09-04locator: Append newly activated source to listZeeshan Ali (Khattak)1-0/+3
Don't forget to add the newly activated source to the private list of active sources, otherwise it won't be stopped when it's accuracy level changes to none or greater than max accuracy.
2015-08-26Workaround an intltool issueZeeshan Ali (Khattak)1-0/+2
`make distcheck` breaks with the error: ----- The following files contain translations and are currently not in use. Please consider adding these to the POTFILES.in file, located in the po/ directory. sub/demo/geoclue-demo-agent.desktop.in sub/demo/geoclue-where-am-i.desktop.in ---- The only known workaround is to add these paths to POTFILES.skip and this patch does that.
2015-08-26agent: Only allow the geoclue user to call methodsLaurent Bigonville2-1/+2
The policy applies only to the process sending a message, not the one receiving it. We need to be sure only the geoclue user can call the Agent's methods. Explanation by smvc from the bugreport: [...] The issue here is that every file in /etc/dbus-1/system.d applies to everything on the system bus - there is no way to limit policies to particular packages. So Geoclue2's policy allows any uid to call any method on the Properties interface at the path /org/freedesktop/GeoClue2/Agent, in *any* destination. You might think "why would any other service have an object at /org/freedesktop/GeoClue2/Agent?", but not all services distinguish between object paths: those that are implemented in terms of simplistic libdbus filters[1] typically do not. [...] https://bugs.freedesktop.org/show_bug.cgi?id=91214
2015-08-26build: Don't ship generated D-Bus service filesLaurent Bigonville1-1/+1
Do not ship generated D-Bus service files in the tarball. https://bugs.freedesktop.org/show_bug.cgi?id=91214
2015-08-25location: Move public functions togetherZeeshan Ali (Khattak)1-47/+47
2015-08-23Add config option for NMEA sourceAnkit4-19/+56
Add configuration option to enable/disable Network NMEA source. Default is enabled. https://bugs.freedesktop.org/show_bug.cgi?id=90974
2015-08-23Add GClueNMEASourceAnkit5-0/+765
GClueNMEASource receives NMEA GGA sentences from a NMEA source on the network. It uses Avahi for the auto-discovery of nmea-tcp services on local network. This will enable us to receive location info from other devices on the local network with location capabilities, such as smartphones. This patch adds dependency on avahi-glib and avahi-client. https://bugs.freedesktop.org/show_bug.cgi?id=90974
2015-08-22Add gclue_location_create_from_gga()Ankit3-111/+150
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
2015-08-03config: Return correct enum valueZeeshan Ali (Khattak)1-1/+1
gclue_config_get_app_perm() is supposed to return GClueAppPerm enum, not a boolean.
2015-08-03geoclue.conf: Document application entriesZeeshan Ali (Khattak)1-0/+6
Add a note to application-specific section, informing people that their favorite app does not need to be in the config to be able to get location.
2015-08-03configure: More portable string comparisonsZeeshan Ali (Khattak)1-9/+9
2015-07-27service-client: Complete Start() if already startedZeeshan Ali (Khattak)1-1/+4
Simply returning TRUE from D-Bus method handler won't actually complete the method call, we need to explicitly complete the call.
2015-07-13configure: Remove a redundant declarationZeeshan Ali (Khattak)1-1/+0
We haven't required geoip package for a while so no need to declare required version of it.
2015-07-07service-client: More helpful error on agent rejectionZeeshan Ali (Khattak)1-5/+18
https://bugs.freedesktop.org/show_bug.cgi?id=91237
2015-06-18location-source: Only fetch heading if asked toZeeshan Ali (Khattak)1-11/+20
Only fetch heading from compass if 'compute-heading' is set to TRUE. This fixes the double location updates on each heading update from compass.
2015-06-18location-source: Generalize meaning of 'compute-movement'Zeeshan Ali (Khattak)1-5/+5
This property now also covers whether the base GClueLocationSource class should get the movement from hardware (e.g a compass). Currently only GClueLocator sets this property to FALSE but in future GClueModemGPS might need to do the same. See: https://bugs.freedesktop.org/show_bug.cgi?id=89907
2015-06-18compass: Add debug for compass claim & releaseZeeshan Ali (Khattak)1-0/+2