GpsdClient

Type Alias GpsdClient 

Source
pub type GpsdClient<Stream> = GpsdClientCore<Stream, V3>;
Expand description

Type alias for a GPSD client using protocol version 3

This is the most common client type and should be used for connecting to modern GPSD servers (version 3.x).

Aliased Type§

pub struct GpsdClient<Stream> { /* private fields */ }

Implementations§

Source§

impl<Stream> GpsdClient<Stream>
where Stream: Read + Write,

Source

pub fn version(&mut self) -> Result<Version>

Requests version information from the GPSD server

Returns details about the GPSD server version, protocol version, and capabilities.

Source

pub fn devices(&mut self) -> Result<DeviceList>

Lists all GPS devices known to the GPSD server

Returns information about each connected GPS receiver including device paths, driver information, and current status.

Source

pub fn device(&mut self) -> Result<Device>

Gets information about the currently active GPS device

Returns detailed information about the device currently being used for GPS data.

Source

pub fn watch(&mut self) -> Result<(Watch, DeviceList)>

Enables data streaming from GPSD with default settings

Returns the current watch configuration and list of available devices. After calling this method, GPS data will be streamed from the server.

Source

pub fn poll(&mut self) -> Result<Poll>

Polls for the current GPS fix data

Returns the most recent GPS fix information available from all active devices.

Source

pub fn watch_mode(&mut self, enable: bool) -> Result<()>

Enables or disables data streaming mode

§Arguments
  • enable - true to start streaming, false to stop
Source

pub fn stream<Format: StreamFormat>( self, opts: StreamOptions<Format>, ) -> Result<GpsdDataStream<Stream, V3, Format>>

Starts a data stream with the specified format and options

This method consumes the client and returns a stream iterator that yields GPS data in the requested format.

§Arguments
  • opts - Stream configuration options
§Example
let stream = client.stream(StreamOptions::json()).unwrap();