diff options
| author | Ulf Lilleengen <[email protected]> | 2023-12-20 12:44:11 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-20 12:44:11 +0000 |
| commit | 49005e955dbaa8fd951943dbfcd8c1d9a219badd (patch) | |
| tree | db06733542591b3a414ff18cb166ea0b79ac980a | |
| parent | 70ea805af3fa80f815cbd2f1170b7488da0e52fe (diff) | |
| parent | 93bb34d8d1304a87ba62017834f4be848a1757e5 (diff) | |
Merge pull request #2330 from embassy-rs/embassy-net-esp-hosted-docs
Embassy net esp hosted docs
| -rw-r--r-- | embassy-net-esp-hosted/Cargo.toml | 4 | ||||
| -rw-r--r-- | embassy-net-esp-hosted/README.md | 27 | ||||
| -rw-r--r-- | embassy-net-esp-hosted/src/control.rs | 20 | ||||
| -rw-r--r-- | embassy-net-esp-hosted/src/lib.rs | 11 | ||||
| -rw-r--r-- | embassy-net-esp-hosted/src/proto.rs | 108 |
5 files changed, 117 insertions, 53 deletions
diff --git a/embassy-net-esp-hosted/Cargo.toml b/embassy-net-esp-hosted/Cargo.toml index 70b1bbe2a..b051b37ad 100644 --- a/embassy-net-esp-hosted/Cargo.toml +++ b/embassy-net-esp-hosted/Cargo.toml | |||
| @@ -2,6 +2,10 @@ | |||
| 2 | name = "embassy-net-esp-hosted" | 2 | name = "embassy-net-esp-hosted" |
| 3 | version = "0.1.0" | 3 | version = "0.1.0" |
| 4 | edition = "2021" | 4 | edition = "2021" |
| 5 | description = "embassy-net driver for ESP-Hosted" | ||
| 6 | keywords = ["embedded", "esp-hosted", "embassy-net", "embedded-hal-async", "wifi", "async"] | ||
| 7 | categories = ["embedded", "hardware-support", "no-std", "network-programming", "async"] | ||
| 8 | license = "MIT OR Apache-2.0" | ||
| 5 | 9 | ||
| 6 | [dependencies] | 10 | [dependencies] |
| 7 | defmt = { version = "0.3", optional = true } | 11 | defmt = { version = "0.3", optional = true } |
diff --git a/embassy-net-esp-hosted/README.md b/embassy-net-esp-hosted/README.md new file mode 100644 index 000000000..3c9cc4c9e --- /dev/null +++ b/embassy-net-esp-hosted/README.md | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | # ESP-Hosted `embassy-net` integration | ||
| 2 | |||
| 3 | [`embassy-net`](https://crates.io/crates/embassy-net) integration for Espressif SoCs running the the ESP-Hosted stack. | ||
| 4 | |||
| 5 | See [`examples`](https://github.com/embassy-rs/embassy/tree/main/examples/nrf52840) directory for usage examples with the nRF52840. | ||
| 6 | |||
| 7 | ## Supported chips | ||
| 8 | |||
| 9 | - W5500 | ||
| 10 | - W5100S | ||
| 11 | |||
| 12 | ## Interoperability | ||
| 13 | |||
| 14 | This crate can run on any executor. | ||
| 15 | |||
| 16 | It supports any SPI driver implementing [`embedded-hal-async`](https://crates.io/crates/embedded-hal-async). | ||
| 17 | |||
| 18 | |||
| 19 | ## License | ||
| 20 | |||
| 21 | This work is licensed under either of | ||
| 22 | |||
| 23 | - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or | ||
| 24 | http://www.apache.org/licenses/LICENSE-2.0) | ||
| 25 | - MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) | ||
| 26 | |||
| 27 | at your option. | ||
diff --git a/embassy-net-esp-hosted/src/control.rs b/embassy-net-esp-hosted/src/control.rs index c86891bc3..c8cea8503 100644 --- a/embassy-net-esp-hosted/src/control.rs +++ b/embassy-net-esp-hosted/src/control.rs | |||
| @@ -5,38 +5,54 @@ use heapless::String; | |||
| 5 | use crate::ioctl::Shared; | 5 | use crate::ioctl::Shared; |
| 6 | use crate::proto::{self, CtrlMsg}; | 6 | use crate::proto::{self, CtrlMsg}; |
| 7 | 7 | ||
| 8 | /// Errors reported by control. | ||
| 8 | #[derive(Copy, Clone, PartialEq, Eq, Debug)] | 9 | #[derive(Copy, Clone, PartialEq, Eq, Debug)] |
| 9 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 10 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 10 | pub enum Error { | 11 | pub enum Error { |
| 12 | /// The operation failed with the given error code. | ||
| 11 | Failed(u32), | 13 | Failed(u32), |
| 14 | /// The operation timed out. | ||
| 12 | Timeout, | 15 | Timeout, |
| 16 | /// Internal error. | ||
| 13 | Internal, | 17 | Internal, |
| 14 | } | 18 | } |
| 15 | 19 | ||
| 20 | /// Handle for managing the network and WiFI state. | ||
| 16 | pub struct Control<'a> { | 21 | pub struct Control<'a> { |
| 17 | state_ch: ch::StateRunner<'a>, | 22 | state_ch: ch::StateRunner<'a>, |
| 18 | shared: &'a Shared, | 23 | shared: &'a Shared, |
| 19 | } | 24 | } |
| 20 | 25 | ||
| 26 | /// WiFi mode. | ||
| 21 | #[allow(unused)] | 27 | #[allow(unused)] |
| 22 | #[derive(Copy, Clone, PartialEq, Eq, Debug)] | 28 | #[derive(Copy, Clone, PartialEq, Eq, Debug)] |
| 23 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 29 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 24 | enum WifiMode { | 30 | enum WifiMode { |
| 31 | /// No mode. | ||
| 25 | None = 0, | 32 | None = 0, |
| 33 | /// Client station. | ||
| 26 | Sta = 1, | 34 | Sta = 1, |
| 35 | /// Access point mode. | ||
| 27 | Ap = 2, | 36 | Ap = 2, |
| 37 | /// Repeater mode. | ||
| 28 | ApSta = 3, | 38 | ApSta = 3, |
| 29 | } | 39 | } |
| 30 | 40 | ||
| 31 | pub use proto::CtrlWifiSecProt as Security; | 41 | pub use proto::CtrlWifiSecProt as Security; |
| 32 | 42 | ||
| 43 | /// WiFi status. | ||
| 33 | #[derive(Clone, Debug)] | 44 | #[derive(Clone, Debug)] |
| 34 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 45 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 35 | pub struct Status { | 46 | pub struct Status { |
| 47 | /// Service Set Identifier. | ||
| 36 | pub ssid: String<32>, | 48 | pub ssid: String<32>, |
| 49 | /// Basic Service Set Identifier. | ||
| 37 | pub bssid: [u8; 6], | 50 | pub bssid: [u8; 6], |
| 51 | /// Received Signal Strength Indicator. | ||
| 38 | pub rssi: i32, | 52 | pub rssi: i32, |
| 53 | /// WiFi channel. | ||
| 39 | pub channel: u32, | 54 | pub channel: u32, |
| 55 | /// Security mode. | ||
| 40 | pub security: Security, | 56 | pub security: Security, |
| 41 | } | 57 | } |
| 42 | 58 | ||
| @@ -65,6 +81,7 @@ impl<'a> Control<'a> { | |||
| 65 | Self { state_ch, shared } | 81 | Self { state_ch, shared } |
| 66 | } | 82 | } |
| 67 | 83 | ||
| 84 | /// Initialize device. | ||
| 68 | pub async fn init(&mut self) -> Result<(), Error> { | 85 | pub async fn init(&mut self) -> Result<(), Error> { |
| 69 | debug!("wait for init event..."); | 86 | debug!("wait for init event..."); |
| 70 | self.shared.init_wait().await; | 87 | self.shared.init_wait().await; |
| @@ -82,6 +99,7 @@ impl<'a> Control<'a> { | |||
| 82 | Ok(()) | 99 | Ok(()) |
| 83 | } | 100 | } |
| 84 | 101 | ||
| 102 | /// Get the current status. | ||
| 85 | pub async fn get_status(&mut self) -> Result<Status, Error> { | 103 | pub async fn get_status(&mut self) -> Result<Status, Error> { |
| 86 | let req = proto::CtrlMsgReqGetApConfig {}; | 104 | let req = proto::CtrlMsgReqGetApConfig {}; |
| 87 | ioctl!(self, ReqGetApConfig, RespGetApConfig, req, resp); | 105 | ioctl!(self, ReqGetApConfig, RespGetApConfig, req, resp); |
| @@ -95,6 +113,7 @@ impl<'a> Control<'a> { | |||
| 95 | }) | 113 | }) |
| 96 | } | 114 | } |
| 97 | 115 | ||
| 116 | /// Connect to the network identified by ssid using the provided password. | ||
| 98 | pub async fn connect(&mut self, ssid: &str, password: &str) -> Result<(), Error> { | 117 | pub async fn connect(&mut self, ssid: &str, password: &str) -> Result<(), Error> { |
| 99 | let req = proto::CtrlMsgReqConnectAp { | 118 | let req = proto::CtrlMsgReqConnectAp { |
| 100 | ssid: unwrap!(String::try_from(ssid)), | 119 | ssid: unwrap!(String::try_from(ssid)), |
| @@ -108,6 +127,7 @@ impl<'a> Control<'a> { | |||
| 108 | Ok(()) | 127 | Ok(()) |
| 109 | } | 128 | } |
| 110 | 129 | ||
| 130 | /// Disconnect from any currently connected network. | ||
| 111 | pub async fn disconnect(&mut self) -> Result<(), Error> { | 131 | pub async fn disconnect(&mut self) -> Result<(), Error> { |
| 112 | let req = proto::CtrlMsgReqGetStatus {}; | 132 | let req = proto::CtrlMsgReqGetStatus {}; |
| 113 | ioctl!(self, ReqDisconnectAp, RespDisconnectAp, req, resp); | 133 | ioctl!(self, ReqDisconnectAp, RespDisconnectAp, req, resp); |
diff --git a/embassy-net-esp-hosted/src/lib.rs b/embassy-net-esp-hosted/src/lib.rs index d61eaef3a..c78578bf1 100644 --- a/embassy-net-esp-hosted/src/lib.rs +++ b/embassy-net-esp-hosted/src/lib.rs | |||
| @@ -1,4 +1,6 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![doc = include_str!("../README.md")] | ||
| 3 | #![warn(missing_docs)] | ||
| 2 | 4 | ||
| 3 | use embassy_futures::select::{select4, Either4}; | 5 | use embassy_futures::select::{select4, Either4}; |
| 4 | use embassy_net_driver_channel as ch; | 6 | use embassy_net_driver_channel as ch; |
| @@ -97,12 +99,14 @@ enum InterfaceType { | |||
| 97 | const MAX_SPI_BUFFER_SIZE: usize = 1600; | 99 | const MAX_SPI_BUFFER_SIZE: usize = 1600; |
| 98 | const HEARTBEAT_MAX_GAP: Duration = Duration::from_secs(20); | 100 | const HEARTBEAT_MAX_GAP: Duration = Duration::from_secs(20); |
| 99 | 101 | ||
| 102 | /// State for the esp-hosted driver. | ||
| 100 | pub struct State { | 103 | pub struct State { |
| 101 | shared: Shared, | 104 | shared: Shared, |
| 102 | ch: ch::State<MTU, 4, 4>, | 105 | ch: ch::State<MTU, 4, 4>, |
| 103 | } | 106 | } |
| 104 | 107 | ||
| 105 | impl State { | 108 | impl State { |
| 109 | /// Create a new state. | ||
| 106 | pub fn new() -> Self { | 110 | pub fn new() -> Self { |
| 107 | Self { | 111 | Self { |
| 108 | shared: Shared::new(), | 112 | shared: Shared::new(), |
| @@ -111,8 +115,13 @@ impl State { | |||
| 111 | } | 115 | } |
| 112 | } | 116 | } |
| 113 | 117 | ||
| 118 | /// Type alias for network driver. | ||
| 114 | pub type NetDriver<'a> = ch::Device<'a, MTU>; | 119 | pub type NetDriver<'a> = ch::Device<'a, MTU>; |
| 115 | 120 | ||
| 121 | /// Create a new esp-hosted driver using the provided state, SPI peripheral and pins. | ||
| 122 | /// | ||
| 123 | /// Returns a device handle for interfacing with embassy-net, a control handle for | ||
| 124 | /// interacting with the driver, and a runner for communicating with the WiFi device. | ||
| 116 | pub async fn new<'a, SPI, IN, OUT>( | 125 | pub async fn new<'a, SPI, IN, OUT>( |
| 117 | state: &'a mut State, | 126 | state: &'a mut State, |
| 118 | spi: SPI, | 127 | spi: SPI, |
| @@ -144,6 +153,7 @@ where | |||
| 144 | (device, Control::new(state_ch, &state.shared), runner) | 153 | (device, Control::new(state_ch, &state.shared), runner) |
| 145 | } | 154 | } |
| 146 | 155 | ||
| 156 | /// Runner for communicating with the WiFi device. | ||
| 147 | pub struct Runner<'a, SPI, IN, OUT> { | 157 | pub struct Runner<'a, SPI, IN, OUT> { |
| 148 | ch: ch::Runner<'a, MTU>, | 158 | ch: ch::Runner<'a, MTU>, |
| 149 | state_ch: ch::StateRunner<'a>, | 159 | state_ch: ch::StateRunner<'a>, |
| @@ -166,6 +176,7 @@ where | |||
| 166 | { | 176 | { |
| 167 | async fn init(&mut self) {} | 177 | async fn init(&mut self) {} |
| 168 | 178 | ||
| 179 | /// Run the packet processing. | ||
| 169 | pub async fn run(mut self) -> ! { | 180 | pub async fn run(mut self) -> ! { |
| 170 | debug!("resetting..."); | 181 | debug!("resetting..."); |
| 171 | self.reset.set_low().unwrap(); | 182 | self.reset.set_low().unwrap(); |
diff --git a/embassy-net-esp-hosted/src/proto.rs b/embassy-net-esp-hosted/src/proto.rs index 8ceb1579d..034d5bf84 100644 --- a/embassy-net-esp-hosted/src/proto.rs +++ b/embassy-net-esp-hosted/src/proto.rs | |||
| @@ -4,7 +4,7 @@ use heapless::{String, Vec}; | |||
| 4 | 4 | ||
| 5 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 5 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 6 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 6 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 7 | pub struct ScanResult { | 7 | pub(crate) struct ScanResult { |
| 8 | #[noproto(tag = "1")] | 8 | #[noproto(tag = "1")] |
| 9 | pub ssid: String<32>, | 9 | pub ssid: String<32>, |
| 10 | #[noproto(tag = "2")] | 10 | #[noproto(tag = "2")] |
| @@ -19,7 +19,7 @@ pub struct ScanResult { | |||
| 19 | 19 | ||
| 20 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 20 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 21 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 21 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 22 | pub struct ConnectedStaList { | 22 | pub(crate) struct ConnectedStaList { |
| 23 | #[noproto(tag = "1")] | 23 | #[noproto(tag = "1")] |
| 24 | pub mac: String<32>, | 24 | pub mac: String<32>, |
| 25 | #[noproto(tag = "2")] | 25 | #[noproto(tag = "2")] |
| @@ -29,14 +29,14 @@ pub struct ConnectedStaList { | |||
| 29 | 29 | ||
| 30 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 30 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 31 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 31 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 32 | pub struct CtrlMsgReqGetMacAddress { | 32 | pub(crate) struct CtrlMsgReqGetMacAddress { |
| 33 | #[noproto(tag = "1")] | 33 | #[noproto(tag = "1")] |
| 34 | pub mode: u32, | 34 | pub mode: u32, |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 37 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 38 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 38 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 39 | pub struct CtrlMsgRespGetMacAddress { | 39 | pub(crate) struct CtrlMsgRespGetMacAddress { |
| 40 | #[noproto(tag = "1")] | 40 | #[noproto(tag = "1")] |
| 41 | pub mac: String<32>, | 41 | pub mac: String<32>, |
| 42 | #[noproto(tag = "2")] | 42 | #[noproto(tag = "2")] |
| @@ -45,11 +45,11 @@ pub struct CtrlMsgRespGetMacAddress { | |||
| 45 | 45 | ||
| 46 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 46 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 47 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 47 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 48 | pub struct CtrlMsgReqGetMode {} | 48 | pub(crate) struct CtrlMsgReqGetMode {} |
| 49 | 49 | ||
| 50 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 50 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 51 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 51 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 52 | pub struct CtrlMsgRespGetMode { | 52 | pub(crate) struct CtrlMsgRespGetMode { |
| 53 | #[noproto(tag = "1")] | 53 | #[noproto(tag = "1")] |
| 54 | pub mode: u32, | 54 | pub mode: u32, |
| 55 | #[noproto(tag = "2")] | 55 | #[noproto(tag = "2")] |
| @@ -58,32 +58,32 @@ pub struct CtrlMsgRespGetMode { | |||
| 58 | 58 | ||
| 59 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 59 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 60 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 60 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 61 | pub struct CtrlMsgReqSetMode { | 61 | pub(crate) struct CtrlMsgReqSetMode { |
| 62 | #[noproto(tag = "1")] | 62 | #[noproto(tag = "1")] |
| 63 | pub mode: u32, | 63 | pub mode: u32, |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 66 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 67 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 67 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 68 | pub struct CtrlMsgRespSetMode { | 68 | pub(crate) struct CtrlMsgRespSetMode { |
| 69 | #[noproto(tag = "1")] | 69 | #[noproto(tag = "1")] |
| 70 | pub resp: u32, | 70 | pub resp: u32, |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 73 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 74 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 74 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 75 | pub struct CtrlMsgReqGetStatus {} | 75 | pub(crate) struct CtrlMsgReqGetStatus {} |
| 76 | 76 | ||
| 77 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 77 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 78 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 78 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 79 | pub struct CtrlMsgRespGetStatus { | 79 | pub(crate) struct CtrlMsgRespGetStatus { |
| 80 | #[noproto(tag = "1")] | 80 | #[noproto(tag = "1")] |
| 81 | pub resp: u32, | 81 | pub resp: u32, |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 84 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 85 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 85 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 86 | pub struct CtrlMsgReqSetMacAddress { | 86 | pub(crate) struct CtrlMsgReqSetMacAddress { |
| 87 | #[noproto(tag = "1")] | 87 | #[noproto(tag = "1")] |
| 88 | pub mac: String<32>, | 88 | pub mac: String<32>, |
| 89 | #[noproto(tag = "2")] | 89 | #[noproto(tag = "2")] |
| @@ -92,18 +92,18 @@ pub struct CtrlMsgReqSetMacAddress { | |||
| 92 | 92 | ||
| 93 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 93 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 94 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 94 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 95 | pub struct CtrlMsgRespSetMacAddress { | 95 | pub(crate) struct CtrlMsgRespSetMacAddress { |
| 96 | #[noproto(tag = "1")] | 96 | #[noproto(tag = "1")] |
| 97 | pub resp: u32, | 97 | pub resp: u32, |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 100 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 101 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 101 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 102 | pub struct CtrlMsgReqGetApConfig {} | 102 | pub(crate) struct CtrlMsgReqGetApConfig {} |
| 103 | 103 | ||
| 104 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 104 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 105 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 105 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 106 | pub struct CtrlMsgRespGetApConfig { | 106 | pub(crate) struct CtrlMsgRespGetApConfig { |
| 107 | #[noproto(tag = "1")] | 107 | #[noproto(tag = "1")] |
| 108 | pub ssid: String<32>, | 108 | pub ssid: String<32>, |
| 109 | #[noproto(tag = "2")] | 109 | #[noproto(tag = "2")] |
| @@ -120,7 +120,7 @@ pub struct CtrlMsgRespGetApConfig { | |||
| 120 | 120 | ||
| 121 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 121 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 122 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 122 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 123 | pub struct CtrlMsgReqConnectAp { | 123 | pub(crate) struct CtrlMsgReqConnectAp { |
| 124 | #[noproto(tag = "1")] | 124 | #[noproto(tag = "1")] |
| 125 | pub ssid: String<32>, | 125 | pub ssid: String<32>, |
| 126 | #[noproto(tag = "2")] | 126 | #[noproto(tag = "2")] |
| @@ -135,7 +135,7 @@ pub struct CtrlMsgReqConnectAp { | |||
| 135 | 135 | ||
| 136 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 136 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 137 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 137 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 138 | pub struct CtrlMsgRespConnectAp { | 138 | pub(crate) struct CtrlMsgRespConnectAp { |
| 139 | #[noproto(tag = "1")] | 139 | #[noproto(tag = "1")] |
| 140 | pub resp: u32, | 140 | pub resp: u32, |
| 141 | #[noproto(tag = "2")] | 141 | #[noproto(tag = "2")] |
| @@ -144,11 +144,11 @@ pub struct CtrlMsgRespConnectAp { | |||
| 144 | 144 | ||
| 145 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 145 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 146 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 146 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 147 | pub struct CtrlMsgReqGetSoftApConfig {} | 147 | pub(crate) struct CtrlMsgReqGetSoftApConfig {} |
| 148 | 148 | ||
| 149 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 149 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 150 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 150 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 151 | pub struct CtrlMsgRespGetSoftApConfig { | 151 | pub(crate) struct CtrlMsgRespGetSoftApConfig { |
| 152 | #[noproto(tag = "1")] | 152 | #[noproto(tag = "1")] |
| 153 | pub ssid: String<32>, | 153 | pub ssid: String<32>, |
| 154 | #[noproto(tag = "2")] | 154 | #[noproto(tag = "2")] |
| @@ -169,7 +169,7 @@ pub struct CtrlMsgRespGetSoftApConfig { | |||
| 169 | 169 | ||
| 170 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 170 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 171 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 171 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 172 | pub struct CtrlMsgReqStartSoftAp { | 172 | pub(crate) struct CtrlMsgReqStartSoftAp { |
| 173 | #[noproto(tag = "1")] | 173 | #[noproto(tag = "1")] |
| 174 | pub ssid: String<32>, | 174 | pub ssid: String<32>, |
| 175 | #[noproto(tag = "2")] | 175 | #[noproto(tag = "2")] |
| @@ -188,7 +188,7 @@ pub struct CtrlMsgReqStartSoftAp { | |||
| 188 | 188 | ||
| 189 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 189 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 190 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 190 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 191 | pub struct CtrlMsgRespStartSoftAp { | 191 | pub(crate) struct CtrlMsgRespStartSoftAp { |
| 192 | #[noproto(tag = "1")] | 192 | #[noproto(tag = "1")] |
| 193 | pub resp: u32, | 193 | pub resp: u32, |
| 194 | #[noproto(tag = "2")] | 194 | #[noproto(tag = "2")] |
| @@ -197,11 +197,11 @@ pub struct CtrlMsgRespStartSoftAp { | |||
| 197 | 197 | ||
| 198 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 198 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 199 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 199 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 200 | pub struct CtrlMsgReqScanResult {} | 200 | pub(crate) struct CtrlMsgReqScanResult {} |
| 201 | 201 | ||
| 202 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 202 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 203 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 203 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 204 | pub struct CtrlMsgRespScanResult { | 204 | pub(crate) struct CtrlMsgRespScanResult { |
| 205 | #[noproto(tag = "1")] | 205 | #[noproto(tag = "1")] |
| 206 | pub count: u32, | 206 | pub count: u32, |
| 207 | #[noproto(repeated, tag = "2")] | 207 | #[noproto(repeated, tag = "2")] |
| @@ -212,11 +212,11 @@ pub struct CtrlMsgRespScanResult { | |||
| 212 | 212 | ||
| 213 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 213 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 214 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 214 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 215 | pub struct CtrlMsgReqSoftApConnectedSta {} | 215 | pub(crate) struct CtrlMsgReqSoftApConnectedSta {} |
| 216 | 216 | ||
| 217 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 217 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 218 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 218 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 219 | pub struct CtrlMsgRespSoftApConnectedSta { | 219 | pub(crate) struct CtrlMsgRespSoftApConnectedSta { |
| 220 | #[noproto(tag = "1")] | 220 | #[noproto(tag = "1")] |
| 221 | pub num: u32, | 221 | pub num: u32, |
| 222 | #[noproto(repeated, tag = "2")] | 222 | #[noproto(repeated, tag = "2")] |
| @@ -227,43 +227,43 @@ pub struct CtrlMsgRespSoftApConnectedSta { | |||
| 227 | 227 | ||
| 228 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 228 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 229 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 229 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 230 | pub struct CtrlMsgReqOtaBegin {} | 230 | pub(crate) struct CtrlMsgReqOtaBegin {} |
| 231 | 231 | ||
| 232 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 232 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 233 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 233 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 234 | pub struct CtrlMsgRespOtaBegin { | 234 | pub(crate) struct CtrlMsgRespOtaBegin { |
| 235 | #[noproto(tag = "1")] | 235 | #[noproto(tag = "1")] |
| 236 | pub resp: u32, | 236 | pub resp: u32, |
| 237 | } | 237 | } |
| 238 | 238 | ||
| 239 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 239 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 240 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 240 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 241 | pub struct CtrlMsgReqOtaWrite { | 241 | pub(crate) struct CtrlMsgReqOtaWrite { |
| 242 | #[noproto(tag = "1")] | 242 | #[noproto(tag = "1")] |
| 243 | pub ota_data: Vec<u8, 1024>, | 243 | pub ota_data: Vec<u8, 1024>, |
| 244 | } | 244 | } |
| 245 | 245 | ||
| 246 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 246 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 247 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 247 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 248 | pub struct CtrlMsgRespOtaWrite { | 248 | pub(crate) struct CtrlMsgRespOtaWrite { |
| 249 | #[noproto(tag = "1")] | 249 | #[noproto(tag = "1")] |
| 250 | pub resp: u32, | 250 | pub resp: u32, |
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 253 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 254 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 254 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 255 | pub struct CtrlMsgReqOtaEnd {} | 255 | pub(crate) struct CtrlMsgReqOtaEnd {} |
| 256 | 256 | ||
| 257 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 257 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 258 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 258 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 259 | pub struct CtrlMsgRespOtaEnd { | 259 | pub(crate) struct CtrlMsgRespOtaEnd { |
| 260 | #[noproto(tag = "1")] | 260 | #[noproto(tag = "1")] |
| 261 | pub resp: u32, | 261 | pub resp: u32, |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 264 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 265 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 265 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 266 | pub struct CtrlMsgReqVendorIeData { | 266 | pub(crate) struct CtrlMsgReqVendorIeData { |
| 267 | #[noproto(tag = "1")] | 267 | #[noproto(tag = "1")] |
| 268 | pub element_id: u32, | 268 | pub element_id: u32, |
| 269 | #[noproto(tag = "2")] | 269 | #[noproto(tag = "2")] |
| @@ -278,7 +278,7 @@ pub struct CtrlMsgReqVendorIeData { | |||
| 278 | 278 | ||
| 279 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 279 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 280 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 280 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 281 | pub struct CtrlMsgReqSetSoftApVendorSpecificIe { | 281 | pub(crate) struct CtrlMsgReqSetSoftApVendorSpecificIe { |
| 282 | #[noproto(tag = "1")] | 282 | #[noproto(tag = "1")] |
| 283 | pub enable: bool, | 283 | pub enable: bool, |
| 284 | #[noproto(tag = "2")] | 284 | #[noproto(tag = "2")] |
| @@ -291,32 +291,32 @@ pub struct CtrlMsgReqSetSoftApVendorSpecificIe { | |||
| 291 | 291 | ||
| 292 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 292 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 293 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 293 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 294 | pub struct CtrlMsgRespSetSoftApVendorSpecificIe { | 294 | pub(crate) struct CtrlMsgRespSetSoftApVendorSpecificIe { |
| 295 | #[noproto(tag = "1")] | 295 | #[noproto(tag = "1")] |
| 296 | pub resp: u32, | 296 | pub resp: u32, |
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 299 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 300 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 300 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 301 | pub struct CtrlMsgReqSetWifiMaxTxPower { | 301 | pub(crate) struct CtrlMsgReqSetWifiMaxTxPower { |
| 302 | #[noproto(tag = "1")] | 302 | #[noproto(tag = "1")] |
| 303 | pub wifi_max_tx_power: u32, | 303 | pub wifi_max_tx_power: u32, |
| 304 | } | 304 | } |
| 305 | 305 | ||
| 306 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 306 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 307 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 307 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 308 | pub struct CtrlMsgRespSetWifiMaxTxPower { | 308 | pub(crate) struct CtrlMsgRespSetWifiMaxTxPower { |
| 309 | #[noproto(tag = "1")] | 309 | #[noproto(tag = "1")] |
| 310 | pub resp: u32, | 310 | pub resp: u32, |
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 313 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 314 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 314 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 315 | pub struct CtrlMsgReqGetWifiCurrTxPower {} | 315 | pub(crate) struct CtrlMsgReqGetWifiCurrTxPower {} |
| 316 | 316 | ||
| 317 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 317 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 318 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 318 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 319 | pub struct CtrlMsgRespGetWifiCurrTxPower { | 319 | pub(crate) struct CtrlMsgRespGetWifiCurrTxPower { |
| 320 | #[noproto(tag = "1")] | 320 | #[noproto(tag = "1")] |
| 321 | pub wifi_curr_tx_power: u32, | 321 | pub wifi_curr_tx_power: u32, |
| 322 | #[noproto(tag = "2")] | 322 | #[noproto(tag = "2")] |
| @@ -325,7 +325,7 @@ pub struct CtrlMsgRespGetWifiCurrTxPower { | |||
| 325 | 325 | ||
| 326 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 326 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 327 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 327 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 328 | pub struct CtrlMsgReqConfigHeartbeat { | 328 | pub(crate) struct CtrlMsgReqConfigHeartbeat { |
| 329 | #[noproto(tag = "1")] | 329 | #[noproto(tag = "1")] |
| 330 | pub enable: bool, | 330 | pub enable: bool, |
| 331 | #[noproto(tag = "2")] | 331 | #[noproto(tag = "2")] |
| @@ -334,7 +334,7 @@ pub struct CtrlMsgReqConfigHeartbeat { | |||
| 334 | 334 | ||
| 335 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 335 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 336 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 336 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 337 | pub struct CtrlMsgRespConfigHeartbeat { | 337 | pub(crate) struct CtrlMsgRespConfigHeartbeat { |
| 338 | #[noproto(tag = "1")] | 338 | #[noproto(tag = "1")] |
| 339 | pub resp: u32, | 339 | pub resp: u32, |
| 340 | } | 340 | } |
| @@ -342,28 +342,28 @@ pub struct CtrlMsgRespConfigHeartbeat { | |||
| 342 | 342 | ||
| 343 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 343 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 344 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 344 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 345 | pub struct CtrlMsgEventEspInit { | 345 | pub(crate) struct CtrlMsgEventEspInit { |
| 346 | #[noproto(tag = "1")] | 346 | #[noproto(tag = "1")] |
| 347 | pub init_data: Vec<u8, 64>, | 347 | pub init_data: Vec<u8, 64>, |
| 348 | } | 348 | } |
| 349 | 349 | ||
| 350 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 350 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 351 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 351 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 352 | pub struct CtrlMsgEventHeartbeat { | 352 | pub(crate) struct CtrlMsgEventHeartbeat { |
| 353 | #[noproto(tag = "1")] | 353 | #[noproto(tag = "1")] |
| 354 | pub hb_num: u32, | 354 | pub hb_num: u32, |
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 357 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 358 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 358 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 359 | pub struct CtrlMsgEventStationDisconnectFromAp { | 359 | pub(crate) struct CtrlMsgEventStationDisconnectFromAp { |
| 360 | #[noproto(tag = "1")] | 360 | #[noproto(tag = "1")] |
| 361 | pub resp: u32, | 361 | pub resp: u32, |
| 362 | } | 362 | } |
| 363 | 363 | ||
| 364 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 364 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 365 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 365 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 366 | pub struct CtrlMsgEventStationDisconnectFromEspSoftAp { | 366 | pub(crate) struct CtrlMsgEventStationDisconnectFromEspSoftAp { |
| 367 | #[noproto(tag = "1")] | 367 | #[noproto(tag = "1")] |
| 368 | pub resp: u32, | 368 | pub resp: u32, |
| 369 | #[noproto(tag = "2")] | 369 | #[noproto(tag = "2")] |
| @@ -372,7 +372,7 @@ pub struct CtrlMsgEventStationDisconnectFromEspSoftAp { | |||
| 372 | 372 | ||
| 373 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | 373 | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] |
| 374 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 374 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 375 | pub struct CtrlMsg { | 375 | pub(crate) struct CtrlMsg { |
| 376 | /// msg_type could be req, resp or Event | 376 | /// msg_type could be req, resp or Event |
| 377 | #[noproto(tag = "1")] | 377 | #[noproto(tag = "1")] |
| 378 | pub msg_type: CtrlMsgType, | 378 | pub msg_type: CtrlMsgType, |
| @@ -390,7 +390,7 @@ pub struct CtrlMsg { | |||
| 390 | /// union of all msg ids | 390 | /// union of all msg ids |
| 391 | #[derive(Debug, Clone, Eq, PartialEq, noproto::Oneof)] | 391 | #[derive(Debug, Clone, Eq, PartialEq, noproto::Oneof)] |
| 392 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 392 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 393 | pub enum CtrlMsgPayload { | 393 | pub(crate) enum CtrlMsgPayload { |
| 394 | /// * Requests * | 394 | /// * Requests * |
| 395 | #[noproto(tag = "101")] | 395 | #[noproto(tag = "101")] |
| 396 | ReqGetMacAddress(CtrlMsgReqGetMacAddress), | 396 | ReqGetMacAddress(CtrlMsgReqGetMacAddress), |
| @@ -492,7 +492,7 @@ pub enum CtrlMsgPayload { | |||
| 492 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | 492 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] |
| 493 | #[repr(u32)] | 493 | #[repr(u32)] |
| 494 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 494 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 495 | pub enum CtrlVendorIeType { | 495 | pub(crate) enum CtrlVendorIeType { |
| 496 | #[default] | 496 | #[default] |
| 497 | Beacon = 0, | 497 | Beacon = 0, |
| 498 | ProbeReq = 1, | 498 | ProbeReq = 1, |
| @@ -504,7 +504,7 @@ pub enum CtrlVendorIeType { | |||
| 504 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | 504 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] |
| 505 | #[repr(u32)] | 505 | #[repr(u32)] |
| 506 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 506 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 507 | pub enum CtrlVendorIeid { | 507 | pub(crate) enum CtrlVendorIeid { |
| 508 | #[default] | 508 | #[default] |
| 509 | Id0 = 0, | 509 | Id0 = 0, |
| 510 | Id1 = 1, | 510 | Id1 = 1, |
| @@ -513,7 +513,7 @@ pub enum CtrlVendorIeid { | |||
| 513 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | 513 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] |
| 514 | #[repr(u32)] | 514 | #[repr(u32)] |
| 515 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 515 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 516 | pub enum CtrlWifiMode { | 516 | pub(crate) enum CtrlWifiMode { |
| 517 | #[default] | 517 | #[default] |
| 518 | None = 0, | 518 | None = 0, |
| 519 | Sta = 1, | 519 | Sta = 1, |
| @@ -524,7 +524,7 @@ pub enum CtrlWifiMode { | |||
| 524 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | 524 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] |
| 525 | #[repr(u32)] | 525 | #[repr(u32)] |
| 526 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 526 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 527 | pub enum CtrlWifiBw { | 527 | pub(crate) enum CtrlWifiBw { |
| 528 | #[default] | 528 | #[default] |
| 529 | BwInvalid = 0, | 529 | BwInvalid = 0, |
| 530 | Ht20 = 1, | 530 | Ht20 = 1, |
| @@ -534,13 +534,15 @@ pub enum CtrlWifiBw { | |||
| 534 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | 534 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] |
| 535 | #[repr(u32)] | 535 | #[repr(u32)] |
| 536 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 536 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 537 | pub enum CtrlWifiPowerSave { | 537 | pub(crate) enum CtrlWifiPowerSave { |
| 538 | #[default] | 538 | #[default] |
| 539 | PsInvalid = 0, | 539 | PsInvalid = 0, |
| 540 | MinModem = 1, | 540 | MinModem = 1, |
| 541 | MaxModem = 2, | 541 | MaxModem = 2, |
| 542 | } | 542 | } |
| 543 | 543 | ||
| 544 | /// Wifi Security Settings | ||
| 545 | #[allow(missing_docs)] | ||
| 544 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | 546 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] |
| 545 | #[repr(u32)] | 547 | #[repr(u32)] |
| 546 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 548 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| @@ -560,7 +562,7 @@ pub enum CtrlWifiSecProt { | |||
| 560 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | 562 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] |
| 561 | #[repr(u32)] | 563 | #[repr(u32)] |
| 562 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 564 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 563 | pub enum CtrlStatus { | 565 | pub(crate) enum CtrlStatus { |
| 564 | #[default] | 566 | #[default] |
| 565 | Connected = 0, | 567 | Connected = 0, |
| 566 | NotConnected = 1, | 568 | NotConnected = 1, |
| @@ -573,7 +575,7 @@ pub enum CtrlStatus { | |||
| 573 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | 575 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] |
| 574 | #[repr(u32)] | 576 | #[repr(u32)] |
| 575 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 577 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 576 | pub enum CtrlMsgType { | 578 | pub(crate) enum CtrlMsgType { |
| 577 | #[default] | 579 | #[default] |
| 578 | MsgTypeInvalid = 0, | 580 | MsgTypeInvalid = 0, |
| 579 | Req = 1, | 581 | Req = 1, |
| @@ -585,7 +587,7 @@ pub enum CtrlMsgType { | |||
| 585 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | 587 | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] |
| 586 | #[repr(u32)] | 588 | #[repr(u32)] |
| 587 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | 589 | #[cfg_attr(feature = "defmt", derive(defmt::Format))] |
| 588 | pub enum CtrlMsgId { | 590 | pub(crate) enum CtrlMsgId { |
| 589 | #[default] | 591 | #[default] |
| 590 | MsgIdInvalid = 0, | 592 | MsgIdInvalid = 0, |
| 591 | /// * Request Msgs * | 593 | /// * Request Msgs * |
