Function gpsd_proto::handshake
source · pub fn handshake(
reader: &mut dyn BufRead,
writer: &mut dyn Write
) -> Result<(), GpsdError>
Expand description
Performs the initial handshake with gpsd
.
The following sequence of messages is expected: get VERSION, set WATCH, get DEVICES, get WATCH.
Arguments
debug
- enable debug printing of raw JSON data receivedreader
- reader to fetch data fromgpsd
writer
- write to send data togpsd
Errors
If the handshake fails, this functions returns an error that indicates the type of error.