pub struct DeviceConfig {
pub wifi: WifiSection,
pub collection: CollectionSection,
pub csi_config: CsiConfigSection,
pub csi_delivery_mode: Option<String>,
pub csi_logging_enabled: Option<bool>,
}Expand description
Server-side cached view of device-side UserConfig, structured to mirror
the firmware’s show-config output (sections [WiFi], [Collection],
[CSI Config]). Fields are best-effort: each is populated when the
matching POST /api/config/* endpoint succeeds, and reset to firmware
defaults by POST /api/config/reset. Values can drift if the device is
re-flashed or commands are sent out-of-band.
sta_password is intentionally not cached even though show-config
echoes it — round-tripping plaintext passwords through a GET endpoint
would defeat the point of having one.
The trailing fields (csi_delivery_mode, csi_logging_enabled) live
alongside the show-config sections because they’re set via separate CLI
commands (set-csi-delivery) and are useful to surface here even though
they aren’t part of the show-config block.
The log mode is fixed to serialized (the only format this server
consumes), so it is no longer a configurable field.
Fields§
§wifi: WifiSection§collection: CollectionSection§csi_config: CsiConfigSection§csi_delivery_mode: Option<String>§csi_logging_enabled: Option<bool>Implementations§
Source§impl DeviceConfig
impl DeviceConfig
Sourcepub fn firmware_defaults() -> Self
pub fn firmware_defaults() -> Self
Snapshot of UserConfig::new() / CsiConfig::default() on the
device, as documented in the show-config spec. Populated into
the cache by POST /api/config/reset so the response after a
reset reflects what the firmware actually holds, even before the
user re-sends any set-* commands.
Both the classic and the extended (C5/C6) CSI defaults are populated —
the caller can ignore the fields irrelevant to the connected chip
(consult GET /api/info for the chip field).
Sourcepub fn firmware_defaults_for_chip(chip: Option<&str>) -> Self
pub fn firmware_defaults_for_chip(chip: Option<&str>) -> Self
Like [firmware_defaults], with chip-specific Wi-Fi channel (C5 → 149,
C6 → 6, others → 1) matching the esp-csi-cli-rs lab examples.
Trait Implementations§
Source§impl Clone for DeviceConfig
impl Clone for DeviceConfig
Source§fn clone(&self) -> DeviceConfig
fn clone(&self) -> DeviceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more