Skip to main content

ublox_cellular/command/control/
mod.rs

1//! ### 15 - V24 control and V25ter
2//! These commands, unless specifically stated, do not implement set syntax using "=", read ("?"), or test ("=?").
3//! If such commands are used, the "+CME ERROR: unknown" or "+CME ERROR: 100" error result code is provided
4//! (depending on the +CMEE AT command setting).
5pub mod responses;
6pub mod types;
7
8use super::NoResponse;
9use atat::atat_derive::AtatCmd;
10use responses::DataRate;
11use types::{
12    BaudRate, Circuit108Behaviour, Circuit109Behaviour, Echo, FlowControl, ResultCodeSelection,
13    SoftwareFlowControl,
14};
15
16/// 15.2 Circuit 109 behavior &C
17///
18/// Controls how the state of RS232 circuit 109 - Data Carrier Detect (DCD) -
19/// relates to the detection of received line signal from the remote end.
20///
21/// **NOTES:**
22/// - **LARA-R211 / SARA-U201-04A / SARA-U201-04B / SARA-U201-04X /
23///   SARA-G450-01C / SARA-G340-02S / SARA-G340-02X / SARA-G350-02A /
24///   SARA-G350-02S / SARA-G350-02X** - On the AUX UART interface the command is
25///   not effective.
26#[derive(Clone, AtatCmd)]
27#[at_cmd("&C", NoResponse, value_sep = false)]
28pub struct SetCircuit109Behaviour {
29    #[at_arg(position = 0)]
30    pub value: Circuit109Behaviour,
31}
32
33/// 15.3 Circuit 108/2 behavior &D
34///
35/// Controls how the state of RS232 circuit 108/2 - Data Terminal Ready (DTR) -
36/// relates to changes from ON to OFF condition during on-line data state.
37#[derive(Clone, AtatCmd)]
38#[at_cmd("&D", NoResponse, value_sep = false)]
39pub struct SetCircuit108Behaviour {
40    #[at_arg(position = 0)]
41    pub value: Circuit108Behaviour,
42}
43/// 15.5 Flow control &K
44///
45/// Controls the flow control mechanism. The following settings are allowed:
46/// - No flow control
47/// - HW flow control also referred with RTS / CTS flow control
48/// - SW flow control also referred with XON / XOFF flow control
49#[derive(Clone, AtatCmd)]
50#[at_cmd("&K", NoResponse, value_sep = false)]
51pub struct SetFlowControl {
52    #[at_arg(position = 0)]
53    pub value: FlowControl,
54}
55
56/// 15.8 Set flow control \Q
57///
58/// Controls the operation of the local flow control between DTE and DCE. It is
59/// used when the data are sent or received. When the software flow control
60/// (XON/XOFF) is used, the DC1 (XON, 0x11) and DC3 (XOFF, 0x13) characters are
61/// reserved and therefore filtered (e.g. in SMS text mode these two characters
62/// can not be input). Since the DTE-DCE communication relies on the correct
63/// reception of DC1/DC3 characters, the UART power saving should be disabled on
64/// the module when SW flow control is used. If the UART power saving is active,
65/// the DC1/DC3 characters could be used to wake up the module's UART, and
66/// therefore lost. In case a DC3 character (XOFF) is correctly received by
67/// module's UART and some data is waiting to be transmitted, the module is
68/// forced to stay awake until a subsequent DC1 character (XON) is received.
69#[derive(Clone, AtatCmd)]
70#[at_cmd("\\Q", NoResponse, value_sep = false)]
71pub struct SetSoftwareFlowControl {
72    #[at_arg(position = 0)]
73    pub value: SoftwareFlowControl,
74}
75
76/// 15.9 UART data rate configuration +IPR
77///
78/// Specifies the data rate at which the DCE accepts commands on the UART
79/// interface. The full range of data rates depends on HW or other criteria.
80#[derive(Clone, AtatCmd)]
81#[at_cmd("+IPR", NoResponse)]
82pub struct SetDataRate {
83    #[at_arg(position = 0)]
84    pub rate: BaudRate,
85}
86
87/// 15.9 UART data rate configuration +IPR
88///
89/// Specifies the data rate at which the DCE accepts commands on the UART
90/// interface. The full range of data rates depends on HW or other criteria.
91#[derive(Clone, AtatCmd)]
92#[at_cmd("+IPR?", DataRate)]
93pub struct GetDataRate;
94
95/// 15.25 Set to factory defined configuration &F
96///
97/// Resets the current profile to factory-programmed setting. Other NVM
98/// settings, not included in the profiles, are not affected. In case of
99/// success, the response is issued using the configuration of the result codes
100/// format (Q, V, S3, S4 AT commands) loaded from the factory-programmed
101/// profile. The other DCE settings are applied after the response has been
102/// sent.
103#[derive(Clone, AtatCmd)]
104#[at_cmd("&F", NoResponse)]
105pub struct FactoryResetConfig;
106
107/// 15.25 Set to factory defined configuration &F
108///
109/// Resets the current profile to factory-programmed setting. Other NVM
110/// settings, not included in the profiles, are not affected. In case of
111/// success, the response is issued using the configuration of the result codes
112/// format (Q, V, S3, S4 AT commands) loaded from the factory-programmed
113/// profile. The other DCE settings are applied after the response has been
114/// sent.
115#[derive(Clone, AtatCmd)]
116#[at_cmd("E", NoResponse, value_sep = false)]
117pub struct SetEcho {
118    #[at_arg(position = 0)]
119    pub enabled: Echo,
120}
121
122/// 14.21 Result code selection and call progress monitoring control X
123///
124/// In a CS data call, determines how the DCE transmits to the DTE the CONNECT
125/// result code.
126#[derive(Clone, AtatCmd)]
127#[at_cmd("X", NoResponse, value_sep = false)]
128pub struct SetResultCodeSelection {
129    #[at_arg(position = 0)]
130    pub value: ResultCodeSelection,
131}