We need to update gps.c in order to give mcp accurate LAT/LON data in the absence of a CSBF GPS.
Acceptance
Follow the gpsdclient architecture to connect to a running instance of gpsd, and query it for the latest info from the daemon.
When complete, the module shall continuously try to query the daemon for LAT/LON data. When the daemon responds, it shall update GPSData->latitude, GPSData->longitude, and GPSData->is_new (NOT gps_info, which is unused in mcp) with the LAT/LON in degrees.
Task
We need to update
gps.c
in order to givemcp
accurate LAT/LON data in the absence of a CSBF GPS.Acceptance
Follow the
gpsd
client architecture to connect to a running instance ofgpsd
, and query it for the latest info from the daemon.When complete, the module shall continuously try to query the daemon for LAT/LON data. When the daemon responds, it shall update
GPSData->latitude
,GPSData->longitude
, andGPSData->is_new
(NOTgps_info
, which is unused inmcp
) with the LAT/LON in degrees.Details
gpsd
has kindly provided an example client in C: https://gpsd.gitlab.io/gpsd/gpsd-client-example-code.html Copy as much as possible, with attribution.In order to use the
gpsd
client API, which was installed when we installedgpsd
fromapt
, you will need to link againstlgps
by editing the CMake.GPSData
is useful forpointing.c
, in that it allows us to know our location if the SIP GPS data is not present.