[][src]Function gpsd_proto::handshake

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

Performs the initial handshake with gpsd.

The following sequence of messages is expected: get VERSION, set WATCH, get DEVICES, get WATCH.


  • debug - enable debug printing of raw JSON data received
  • reader - reader to fetch data from gpsd
  • writer - write to send data to gpsd


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