gpsd_json/protocol/v3/request.rs
1//! GPSD Protocol v3 request message types
2//!
3//! This module defines the request messages that clients can send to GPSD.
4//! Each request type corresponds to a specific GPSD command.
5
6use super::types::*;
7
8/// Request message types for GPSD protocol v3
9///
10/// These are the commands that a client can send to GPSD to query
11/// information or control data streaming.
12#[derive(Debug, Clone, PartialEq)]
13pub enum Message {
14 /// Request a list of all GPS devices known to GPSD
15 ///
16 /// Command: `?DEVICES;`
17 Devices,
18
19 /// Control data streaming from GPSD
20 ///
21 /// - `None`: Query current watch settings (`?WATCH;`)
22 /// - `Some(watch)`: Set watch parameters (`?WATCH={...};`)
23 Watch(Option<Watch>),
24
25 /// Control or query a specific GPS device
26 ///
27 /// - `None`: Query current device (`?DEVICE;`)
28 /// - `Some(device)`: Configure device (`?DEVICE={...};`)
29 Device(Option<Device>),
30
31 /// Poll for current GPS data from all devices
32 ///
33 /// Command: `?POLL;`
34 Poll,
35
36 /// Request GPSD version information
37 ///
38 /// Command: `?VERSION;`
39 Version,
40}