[][src]Function gpsd_proto::handshake

pub fn handshake(
    reader: &mut dyn BufRead,
    writer: &mut dyn Write
) -> Result<(), GpsdError>

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 received
  • reader - reader to fetch data from gpsd
  • writer - write to send data to gpsd

Errors

If the handshake fails, this functions returns an error that indicates the type of error.