ublox_cellular/command/system_features/mod.rs
1//! ### 19 - System features Commands
2//!
3//! Triggers the FW installation procedure, starting from the file (update binary file) stored in the module file
4//! system. It could be used as a part of implementation of the FOTA procedure. The command causes a SW
5//! system reset with network deregistration.
6
7pub mod responses;
8pub mod types;
9use atat::atat_derive::AtatCmd;
10use responses::{FactoryConfiguration, PowerSavingControl};
11use types::{FSFactoryRestoreType, NVMFactoryRestoreType, PowerSavingMode, Seconds};
12
13use super::NoResponse;
14
15/// Serial interfaces configuration selection +USIO
16///
17/// Selects the serial interfaces' configuration. The configuration affects how
18/// an available (either physical or logical) serial interface is used, i.e. the
19/// meaning of the data flowing over it.
20///
21/// Possible usages are:
22/// - Modem interface (AT command)
23/// - Trace interface (diagnostic log)
24/// - Raw interface (e.g. GPS/GNSS tunneling or SAP)
25/// - Digital audio interface
26/// - None
27///
28/// A set of configurations, that considers all the available serial interfaces'
29/// and their associated usage, is called +USIO's configuration variant.
30///
31/// **NOTE**
32/// - The serial interfaces' configuration switch is not performed run-time. The
33/// settings are saved in NVM; the new configuration will be effective at the
34/// subsequent module reboot.
35/// - A serial interface might not support all the usages. For instance, UART
36/// cannot be used as digital audio interface.
37/// - For the complete list of allowed USIO variants supported by each series
38/// modules, see Notes.
39#[derive(Clone, AtatCmd)]
40#[at_cmd("+USIO", NoResponse)]
41pub struct SetSerialInterfaceConfig {
42 #[at_arg(position = 0)]
43 pub variant: u8,
44}
45
46/// 19.8 Power saving control (Power Saving) +UPSV
47///
48/// Sets the UART power saving configuration, but it has a global effect on the
49/// module power saving configuration:
50/// - If the power saving is enabled (+UPSV: 1), the UART interface is
51/// cyclically enabled and the module enters idle mode automatically whenever
52/// possible
53/// - If the power saving is disabled (+UPSV: 0), the UART interface is always
54/// enabled and the module does not enter idle mode
55/// - If the power saving is controlled by the UART RTS line (+UPSV: 2), the
56/// UART interface is enabled and the module does not enter idle mode as long
57/// as the UART RTS line state is ON
58/// - If the power saving is controlled by the UART DTR line (+UPSV: 3), the
59/// UART interface is enabled and the module does not enter idle mode as long
60/// as the UART DTR line state is ON
61#[derive(Clone, AtatCmd)]
62#[at_cmd("+UPSV", NoResponse)]
63pub struct SetPowerSavingControl {
64 #[at_arg(position = 0)]
65 pub mode: PowerSavingMode,
66 #[at_arg(position = 1)]
67 pub timeout: Option<Seconds>,
68}
69#[derive(Clone, AtatCmd)]
70#[at_cmd("+UPSV?", PowerSavingControl)]
71pub struct GetPowerSavingControl;
72
73/// 19.25 Restore factory configuration +UFACTORY
74///
75/// Force, at the next module boot, the restore of the factory configuration for
76/// FS and/or NVM. When the command is issued, a flag is written into the NVM:
77/// no action is done and it will be triggered to be executed only at the next
78/// module boot. If, before the next boot, the triggered operation must be
79/// deleted, then it is possible to issue the command with parameter 0,0.
80#[derive(Clone, AtatCmd)]
81#[at_cmd("+UFACTORY", NoResponse)]
82pub struct SetFactoryConfiguration {
83 #[at_arg(position = 0)]
84 pub fs_op: FSFactoryRestoreType,
85 #[at_arg(position = 1)]
86 pub nvm_op: NVMFactoryRestoreType,
87}
88
89/// 19.25 Restore factory configuration +UFACTORY
90#[derive(Clone, AtatCmd)]
91#[at_cmd("+UFACTORY?", FactoryConfiguration)]
92pub struct GetFactoryConfiguration;