Expand description
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
with a GPS mice (Adopt SkyTraQ Venus 8) and the iOS app
GPS2IP.
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://192.168.177.147:11123
Test the connection to gpsd
with telnet localhost 2947
and send the string:
?WATCH={"enable":true,"json":true};
Structs§
- Device
- Device information.
- Device
Info - Single device information as reported by
gpsd
. - Devices
- Device information (i.e. device enumeration).
- Gst
- Pseudorange noise report.
- Pps
- This message is emitted each time the daemon sees a valid PPS (Pulse Per Second) strobe from a device.
- Satellite
- Detailed satellite information.
- Sky
- Satellites information.
- Tpv
- GPS position.
- Version
gpsd
ships a VERSION response to each client when the client first connects to it.- Watch
- Watch response. Elicits a report of per-subscriber policy.
Enums§
- Gpsd
Error - Errors during handshake or data acquisition.
- Mode
- Type of GPS fix.
- Response
Data - Responses from
gpsd
after handshake (i.e. the payload) - Response
Handshake - Responses from
gpsd
during handshake.. - Unified
Response - All known
gpsd
responses (handshake + normal operation).
Constants§
- ENABLE_
WATCH_ CMD - Command to enable watch.
- PROTO_
MAJOR_ MIN - Minimum supported version of
gpsd
.