#gps #gpsd #protocols #tcp-socket #satellite #information #json

gpsd_proto

The gpsd_proto module contains types and functions to connect to gpsd to get GPS coordinates and satellite information

15 releases (1 stable)

1.0.0 Nov 1, 2023
0.7.0 Sep 1, 2020
0.6.0 Jan 3, 2020
0.5.1 Aug 18, 2019
0.2.1 Oct 11, 2018

#576 in Network programming

Download history 133/week @ 2024-06-30 92/week @ 2024-07-07 111/week @ 2024-07-14 165/week @ 2024-07-21 236/week @ 2024-07-28 217/week @ 2024-08-04 222/week @ 2024-08-11 242/week @ 2024-08-18 92/week @ 2024-08-25 128/week @ 2024-09-01 166/week @ 2024-09-08 116/week @ 2024-09-15 157/week @ 2024-09-22 103/week @ 2024-09-29 59/week @ 2024-10-06 65/week @ 2024-10-13

393 downloads per month

Apache-2.0

31KB
391 lines

gpsd_proto   Build Status Latest Docs Coverage Status

The gpsd_proto module contains types and functions to connect to gpsd to get GPS coordinates and satellite information.

gpsd_proto uses a plain TCP socket to connect to gpsd, reads and writes JSON messages. The main motivation to create this crate was independence from C libraries, like libgps (provided by gpsd) to ease cross compiling.

A example demo application is provided in the example sub directory. Check the repository for up to date sample code.

Testing

gpsd_proto has been tested against gpsd version 3.17 on macOS and Linux with these devices:

Feel free to report any other supported GPS by opening a GitHub issue.

Reference documentation

Important reference documentation of gpsd are the JSON protocol and the client HOWTO.

Development notes

Start gpsd with a real GPS device:

/usr/local/sbin/gpsd -N -D4 /dev/tty.SLAB_USBtoUART

Or start gpsd with a TCP stream to a remote GPS:

/usr/local/sbin/gpsd -N -D2 tcp://<IP>:<PORT>

Test the connection to gpsd with telnet localhost 2947 and send the string:

?WATCH={"enable":true,"json":true};

Dependencies

~0.7–1.7MB
~36K SLoC