Compare commits
	
		
			6 Commits
		
	
	
		
			embassy-ne
			...
			boot-nrf-s
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 896690c415 | ||
|  | c8eb128a56 | ||
|  | 22ee868f04 | ||
|  | 1c3cf347cb | ||
|  | 13c107e815 | ||
|  | f9d0daad80 | 
							
								
								
									
										4
									
								
								ci.sh
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								ci.sh
									
									
									
									
									
								
							| @@ -91,12 +91,12 @@ cargo batch  \ | |||||||
|     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f417zg,defmt,exti,time-driver-any,time \ |     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f417zg,defmt,exti,time-driver-any,time \ | ||||||
|     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f423zh,defmt,exti,time-driver-any,time \ |     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f423zh,defmt,exti,time-driver-any,time \ | ||||||
|     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f427zi,defmt,exti,time-driver-any,time \ |     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f427zi,defmt,exti,time-driver-any,time \ | ||||||
|     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,embedded-sdmmc,time \ |     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti,time-driver-any,time \ | ||||||
|     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f437zi,log,exti,time-driver-any,time \ |     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f437zi,log,exti,time-driver-any,time \ | ||||||
|     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f439zi,defmt,exti,time-driver-any,time \ |     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f439zi,defmt,exti,time-driver-any,time \ | ||||||
|     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f446ze,defmt,exti,time-driver-any,time \ |     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f446ze,defmt,exti,time-driver-any,time \ | ||||||
|     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f469zi,defmt,exti,time-driver-any,time \ |     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f469zi,defmt,exti,time-driver-any,time \ | ||||||
|     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f479zi,defmt,exti,time-driver-any,embedded-sdmmc,time \ |     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f479zi,defmt,exti,time-driver-any,time \ | ||||||
|     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f730i8,defmt,exti,time-driver-any,time \ |     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f730i8,defmt,exti,time-driver-any,time \ | ||||||
|     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h753zi,defmt,exti,time-driver-any,time \ |     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h753zi,defmt,exti,time-driver-any,time \ | ||||||
|     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h735zg,defmt,exti,time-driver-any,time \ |     --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h735zg,defmt,exti,time-driver-any,time \ | ||||||
|   | |||||||
| @@ -4,6 +4,12 @@ name = "embassy-boot-nrf" | |||||||
| version = "0.1.0" | version = "0.1.0" | ||||||
| description = "Bootloader lib for nRF chips" | description = "Bootloader lib for nRF chips" | ||||||
| license = "MIT OR Apache-2.0" | license = "MIT OR Apache-2.0" | ||||||
|  | repository = "https://github.com/embassy-rs/embassy" | ||||||
|  | categories = [ | ||||||
|  |     "embedded", | ||||||
|  |     "no-std", | ||||||
|  |     "asynchronous", | ||||||
|  | ] | ||||||
|  |  | ||||||
| [package.metadata.embassy_docs] | [package.metadata.embassy_docs] | ||||||
| src_base = "https://github.com/embassy-rs/embassy/blob/embassy-boot-nrf-v$VERSION/embassy-boot/nrf/src/" | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-boot-nrf-v$VERSION/embassy-boot/nrf/src/" | ||||||
| @@ -25,7 +31,7 @@ embedded-storage = "0.3.1" | |||||||
| embedded-storage-async = { version = "0.4.1" } | embedded-storage-async = { version = "0.4.1" } | ||||||
| cfg-if = "1.0.0" | cfg-if = "1.0.0" | ||||||
|  |  | ||||||
| nrf-softdevice-mbr = { version = "0.1.0", git = "https://github.com/embassy-rs/nrf-softdevice.git", branch = "master", optional = true } | nrf-softdevice-mbr = { version = "0.2.0", optional = true } | ||||||
|  |  | ||||||
| [features] | [features] | ||||||
| defmt = [ | defmt = [ | ||||||
|   | |||||||
| @@ -4,6 +4,12 @@ name = "embassy-boot-rp" | |||||||
| version = "0.1.0" | version = "0.1.0" | ||||||
| description = "Bootloader lib for RP2040 chips" | description = "Bootloader lib for RP2040 chips" | ||||||
| license = "MIT OR Apache-2.0" | license = "MIT OR Apache-2.0" | ||||||
|  | repository = "https://github.com/embassy-rs/embassy" | ||||||
|  | categories = [ | ||||||
|  |     "embedded", | ||||||
|  |     "no-std", | ||||||
|  |     "asynchronous", | ||||||
|  | ] | ||||||
|  |  | ||||||
| [package.metadata.embassy_docs] | [package.metadata.embassy_docs] | ||||||
| src_base = "https://github.com/embassy-rs/embassy/blob/embassy-boot-rp-v$VERSION/src/" | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-boot-rp-v$VERSION/src/" | ||||||
|   | |||||||
| @@ -4,6 +4,12 @@ name = "embassy-boot-stm32" | |||||||
| version = "0.1.0" | version = "0.1.0" | ||||||
| description = "Bootloader lib for STM32 chips" | description = "Bootloader lib for STM32 chips" | ||||||
| license = "MIT OR Apache-2.0" | license = "MIT OR Apache-2.0" | ||||||
|  | repository = "https://github.com/embassy-rs/embassy" | ||||||
|  | categories = [ | ||||||
|  |     "embedded", | ||||||
|  |     "no-std", | ||||||
|  |     "asynchronous", | ||||||
|  | ] | ||||||
|  |  | ||||||
| [package.metadata.embassy_docs] | [package.metadata.embassy_docs] | ||||||
| src_base = "https://github.com/embassy-rs/embassy/blob/embassy-boot-nrf-v$VERSION/embassy-boot/stm32/src/" | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-boot-nrf-v$VERSION/embassy-boot/stm32/src/" | ||||||
|   | |||||||
| @@ -2,10 +2,6 @@ | |||||||
| name = "embassy-net-esp-hosted" | name = "embassy-net-esp-hosted" | ||||||
| version = "0.1.0" | version = "0.1.0" | ||||||
| edition = "2021" | edition = "2021" | ||||||
| description = "embassy-net driver for ESP-Hosted" |  | ||||||
| keywords = ["embedded", "esp-hosted", "embassy-net", "embedded-hal-async", "wifi", "async"] |  | ||||||
| categories = ["embedded", "hardware-support", "no-std", "network-programming", "async"] |  | ||||||
| license = "MIT OR Apache-2.0" |  | ||||||
|  |  | ||||||
| [dependencies] | [dependencies] | ||||||
| defmt = { version = "0.3", optional = true } | defmt = { version = "0.3", optional = true } | ||||||
|   | |||||||
| @@ -1,27 +0,0 @@ | |||||||
| # ESP-Hosted `embassy-net` integration |  | ||||||
|  |  | ||||||
| [`embassy-net`](https://crates.io/crates/embassy-net) integration for Espressif SoCs running the the ESP-Hosted stack. |  | ||||||
|  |  | ||||||
| See [`examples`](https://github.com/embassy-rs/embassy/tree/main/examples/nrf52840) directory for usage examples with the nRF52840. |  | ||||||
|  |  | ||||||
| ## Supported chips |  | ||||||
|  |  | ||||||
| - W5500 |  | ||||||
| - W5100S |  | ||||||
|  |  | ||||||
| ## Interoperability |  | ||||||
|  |  | ||||||
| This crate can run on any executor. |  | ||||||
|  |  | ||||||
| It supports any SPI driver implementing [`embedded-hal-async`](https://crates.io/crates/embedded-hal-async). |  | ||||||
|  |  | ||||||
|  |  | ||||||
| ## License |  | ||||||
|  |  | ||||||
| This work is licensed under either of |  | ||||||
|  |  | ||||||
| - Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or |  | ||||||
|   http://www.apache.org/licenses/LICENSE-2.0) |  | ||||||
| - MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) |  | ||||||
|  |  | ||||||
| at your option. |  | ||||||
| @@ -5,54 +5,38 @@ use heapless::String; | |||||||
| use crate::ioctl::Shared; | use crate::ioctl::Shared; | ||||||
| use crate::proto::{self, CtrlMsg}; | use crate::proto::{self, CtrlMsg}; | ||||||
|  |  | ||||||
| /// Errors reported by control. |  | ||||||
| #[derive(Copy, Clone, PartialEq, Eq, Debug)] | #[derive(Copy, Clone, PartialEq, Eq, Debug)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub enum Error { | pub enum Error { | ||||||
|     /// The operation failed with the given error code. |  | ||||||
|     Failed(u32), |     Failed(u32), | ||||||
|     /// The operation timed out. |  | ||||||
|     Timeout, |     Timeout, | ||||||
|     /// Internal error. |  | ||||||
|     Internal, |     Internal, | ||||||
| } | } | ||||||
|  |  | ||||||
| /// Handle for managing the network and WiFI state. |  | ||||||
| pub struct Control<'a> { | pub struct Control<'a> { | ||||||
|     state_ch: ch::StateRunner<'a>, |     state_ch: ch::StateRunner<'a>, | ||||||
|     shared: &'a Shared, |     shared: &'a Shared, | ||||||
| } | } | ||||||
|  |  | ||||||
| /// WiFi mode. |  | ||||||
| #[allow(unused)] | #[allow(unused)] | ||||||
| #[derive(Copy, Clone, PartialEq, Eq, Debug)] | #[derive(Copy, Clone, PartialEq, Eq, Debug)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| enum WifiMode { | enum WifiMode { | ||||||
|     /// No mode. |  | ||||||
|     None = 0, |     None = 0, | ||||||
|     /// Client station. |  | ||||||
|     Sta = 1, |     Sta = 1, | ||||||
|     /// Access point mode. |  | ||||||
|     Ap = 2, |     Ap = 2, | ||||||
|     /// Repeater mode. |  | ||||||
|     ApSta = 3, |     ApSta = 3, | ||||||
| } | } | ||||||
|  |  | ||||||
| pub use proto::CtrlWifiSecProt as Security; | pub use proto::CtrlWifiSecProt as Security; | ||||||
|  |  | ||||||
| /// WiFi status. |  | ||||||
| #[derive(Clone, Debug)] | #[derive(Clone, Debug)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub struct Status { | pub struct Status { | ||||||
|     /// Service Set Identifier. |  | ||||||
|     pub ssid: String<32>, |     pub ssid: String<32>, | ||||||
|     /// Basic Service Set Identifier. |  | ||||||
|     pub bssid: [u8; 6], |     pub bssid: [u8; 6], | ||||||
|     /// Received Signal Strength Indicator. |  | ||||||
|     pub rssi: i32, |     pub rssi: i32, | ||||||
|     /// WiFi channel. |  | ||||||
|     pub channel: u32, |     pub channel: u32, | ||||||
|     /// Security mode. |  | ||||||
|     pub security: Security, |     pub security: Security, | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -81,7 +65,6 @@ impl<'a> Control<'a> { | |||||||
|         Self { state_ch, shared } |         Self { state_ch, shared } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /// Initialize device. |  | ||||||
|     pub async fn init(&mut self) -> Result<(), Error> { |     pub async fn init(&mut self) -> Result<(), Error> { | ||||||
|         debug!("wait for init event..."); |         debug!("wait for init event..."); | ||||||
|         self.shared.init_wait().await; |         self.shared.init_wait().await; | ||||||
| @@ -99,7 +82,6 @@ impl<'a> Control<'a> { | |||||||
|         Ok(()) |         Ok(()) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /// Get the current status. |  | ||||||
|     pub async fn get_status(&mut self) -> Result<Status, Error> { |     pub async fn get_status(&mut self) -> Result<Status, Error> { | ||||||
|         let req = proto::CtrlMsgReqGetApConfig {}; |         let req = proto::CtrlMsgReqGetApConfig {}; | ||||||
|         ioctl!(self, ReqGetApConfig, RespGetApConfig, req, resp); |         ioctl!(self, ReqGetApConfig, RespGetApConfig, req, resp); | ||||||
| @@ -113,7 +95,6 @@ impl<'a> Control<'a> { | |||||||
|         }) |         }) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /// Connect to the network identified by ssid using the provided password. |  | ||||||
|     pub async fn connect(&mut self, ssid: &str, password: &str) -> Result<(), Error> { |     pub async fn connect(&mut self, ssid: &str, password: &str) -> Result<(), Error> { | ||||||
|         let req = proto::CtrlMsgReqConnectAp { |         let req = proto::CtrlMsgReqConnectAp { | ||||||
|             ssid: unwrap!(String::try_from(ssid)), |             ssid: unwrap!(String::try_from(ssid)), | ||||||
| @@ -127,7 +108,6 @@ impl<'a> Control<'a> { | |||||||
|         Ok(()) |         Ok(()) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /// Disconnect from any currently connected network. |  | ||||||
|     pub async fn disconnect(&mut self) -> Result<(), Error> { |     pub async fn disconnect(&mut self) -> Result<(), Error> { | ||||||
|         let req = proto::CtrlMsgReqGetStatus {}; |         let req = proto::CtrlMsgReqGetStatus {}; | ||||||
|         ioctl!(self, ReqDisconnectAp, RespDisconnectAp, req, resp); |         ioctl!(self, ReqDisconnectAp, RespDisconnectAp, req, resp); | ||||||
|   | |||||||
| @@ -1,6 +1,4 @@ | |||||||
| #![no_std] | #![no_std] | ||||||
| #![doc = include_str!("../README.md")] |  | ||||||
| #![warn(missing_docs)] |  | ||||||
|  |  | ||||||
| use embassy_futures::select::{select4, Either4}; | use embassy_futures::select::{select4, Either4}; | ||||||
| use embassy_net_driver_channel as ch; | use embassy_net_driver_channel as ch; | ||||||
| @@ -99,14 +97,12 @@ enum InterfaceType { | |||||||
| const MAX_SPI_BUFFER_SIZE: usize = 1600; | const MAX_SPI_BUFFER_SIZE: usize = 1600; | ||||||
| const HEARTBEAT_MAX_GAP: Duration = Duration::from_secs(20); | const HEARTBEAT_MAX_GAP: Duration = Duration::from_secs(20); | ||||||
|  |  | ||||||
| /// State for the esp-hosted driver. |  | ||||||
| pub struct State { | pub struct State { | ||||||
|     shared: Shared, |     shared: Shared, | ||||||
|     ch: ch::State<MTU, 4, 4>, |     ch: ch::State<MTU, 4, 4>, | ||||||
| } | } | ||||||
|  |  | ||||||
| impl State { | impl State { | ||||||
|     /// Create a new state. |  | ||||||
|     pub fn new() -> Self { |     pub fn new() -> Self { | ||||||
|         Self { |         Self { | ||||||
|             shared: Shared::new(), |             shared: Shared::new(), | ||||||
| @@ -115,13 +111,8 @@ impl State { | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| /// Type alias for network driver. |  | ||||||
| pub type NetDriver<'a> = ch::Device<'a, MTU>; | pub type NetDriver<'a> = ch::Device<'a, MTU>; | ||||||
|  |  | ||||||
| /// Create a new esp-hosted driver using the provided state, SPI peripheral and pins. |  | ||||||
| /// |  | ||||||
| /// Returns a device handle for interfacing with embassy-net, a control handle for |  | ||||||
| /// interacting with the driver, and a runner for communicating with the WiFi device. |  | ||||||
| pub async fn new<'a, SPI, IN, OUT>( | pub async fn new<'a, SPI, IN, OUT>( | ||||||
|     state: &'a mut State, |     state: &'a mut State, | ||||||
|     spi: SPI, |     spi: SPI, | ||||||
| @@ -153,7 +144,6 @@ where | |||||||
|     (device, Control::new(state_ch, &state.shared), runner) |     (device, Control::new(state_ch, &state.shared), runner) | ||||||
| } | } | ||||||
|  |  | ||||||
| /// Runner for communicating with the WiFi device. |  | ||||||
| pub struct Runner<'a, SPI, IN, OUT> { | pub struct Runner<'a, SPI, IN, OUT> { | ||||||
|     ch: ch::Runner<'a, MTU>, |     ch: ch::Runner<'a, MTU>, | ||||||
|     state_ch: ch::StateRunner<'a>, |     state_ch: ch::StateRunner<'a>, | ||||||
| @@ -176,7 +166,6 @@ where | |||||||
| { | { | ||||||
|     async fn init(&mut self) {} |     async fn init(&mut self) {} | ||||||
|  |  | ||||||
|     /// Run the packet processing. |  | ||||||
|     pub async fn run(mut self) -> ! { |     pub async fn run(mut self) -> ! { | ||||||
|         debug!("resetting..."); |         debug!("resetting..."); | ||||||
|         self.reset.set_low().unwrap(); |         self.reset.set_low().unwrap(); | ||||||
|   | |||||||
| @@ -4,7 +4,7 @@ use heapless::{String, Vec}; | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct ScanResult { | pub struct ScanResult { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub ssid: String<32>, |     pub ssid: String<32>, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -19,7 +19,7 @@ pub(crate) struct ScanResult { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct ConnectedStaList { | pub struct ConnectedStaList { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub mac: String<32>, |     pub mac: String<32>, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -29,14 +29,14 @@ pub(crate) struct ConnectedStaList { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqGetMacAddress { | pub struct CtrlMsgReqGetMacAddress { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub mode: u32, |     pub mode: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespGetMacAddress { | pub struct CtrlMsgRespGetMacAddress { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub mac: String<32>, |     pub mac: String<32>, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -45,11 +45,11 @@ pub(crate) struct CtrlMsgRespGetMacAddress { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqGetMode {} | pub struct CtrlMsgReqGetMode {} | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespGetMode { | pub struct CtrlMsgRespGetMode { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub mode: u32, |     pub mode: u32, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -58,32 +58,32 @@ pub(crate) struct CtrlMsgRespGetMode { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqSetMode { | pub struct CtrlMsgReqSetMode { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub mode: u32, |     pub mode: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespSetMode { | pub struct CtrlMsgRespSetMode { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqGetStatus {} | pub struct CtrlMsgReqGetStatus {} | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespGetStatus { | pub struct CtrlMsgRespGetStatus { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqSetMacAddress { | pub struct CtrlMsgReqSetMacAddress { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub mac: String<32>, |     pub mac: String<32>, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -92,18 +92,18 @@ pub(crate) struct CtrlMsgReqSetMacAddress { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespSetMacAddress { | pub struct CtrlMsgRespSetMacAddress { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqGetApConfig {} | pub struct CtrlMsgReqGetApConfig {} | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespGetApConfig { | pub struct CtrlMsgRespGetApConfig { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub ssid: String<32>, |     pub ssid: String<32>, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -120,7 +120,7 @@ pub(crate) struct CtrlMsgRespGetApConfig { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqConnectAp { | pub struct CtrlMsgReqConnectAp { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub ssid: String<32>, |     pub ssid: String<32>, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -135,7 +135,7 @@ pub(crate) struct CtrlMsgReqConnectAp { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespConnectAp { | pub struct CtrlMsgRespConnectAp { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -144,11 +144,11 @@ pub(crate) struct CtrlMsgRespConnectAp { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqGetSoftApConfig {} | pub struct CtrlMsgReqGetSoftApConfig {} | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespGetSoftApConfig { | pub struct CtrlMsgRespGetSoftApConfig { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub ssid: String<32>, |     pub ssid: String<32>, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -169,7 +169,7 @@ pub(crate) struct CtrlMsgRespGetSoftApConfig { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqStartSoftAp { | pub struct CtrlMsgReqStartSoftAp { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub ssid: String<32>, |     pub ssid: String<32>, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -188,7 +188,7 @@ pub(crate) struct CtrlMsgReqStartSoftAp { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespStartSoftAp { | pub struct CtrlMsgRespStartSoftAp { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -197,11 +197,11 @@ pub(crate) struct CtrlMsgRespStartSoftAp { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqScanResult {} | pub struct CtrlMsgReqScanResult {} | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespScanResult { | pub struct CtrlMsgRespScanResult { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub count: u32, |     pub count: u32, | ||||||
|     #[noproto(repeated, tag = "2")] |     #[noproto(repeated, tag = "2")] | ||||||
| @@ -212,11 +212,11 @@ pub(crate) struct CtrlMsgRespScanResult { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqSoftApConnectedSta {} | pub struct CtrlMsgReqSoftApConnectedSta {} | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespSoftApConnectedSta { | pub struct CtrlMsgRespSoftApConnectedSta { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub num: u32, |     pub num: u32, | ||||||
|     #[noproto(repeated, tag = "2")] |     #[noproto(repeated, tag = "2")] | ||||||
| @@ -227,43 +227,43 @@ pub(crate) struct CtrlMsgRespSoftApConnectedSta { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqOtaBegin {} | pub struct CtrlMsgReqOtaBegin {} | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespOtaBegin { | pub struct CtrlMsgRespOtaBegin { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqOtaWrite { | pub struct CtrlMsgReqOtaWrite { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub ota_data: Vec<u8, 1024>, |     pub ota_data: Vec<u8, 1024>, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespOtaWrite { | pub struct CtrlMsgRespOtaWrite { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqOtaEnd {} | pub struct CtrlMsgReqOtaEnd {} | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespOtaEnd { | pub struct CtrlMsgRespOtaEnd { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqVendorIeData { | pub struct CtrlMsgReqVendorIeData { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub element_id: u32, |     pub element_id: u32, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -278,7 +278,7 @@ pub(crate) struct CtrlMsgReqVendorIeData { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqSetSoftApVendorSpecificIe { | pub struct CtrlMsgReqSetSoftApVendorSpecificIe { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub enable: bool, |     pub enable: bool, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -291,32 +291,32 @@ pub(crate) struct CtrlMsgReqSetSoftApVendorSpecificIe { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespSetSoftApVendorSpecificIe { | pub struct CtrlMsgRespSetSoftApVendorSpecificIe { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqSetWifiMaxTxPower { | pub struct CtrlMsgReqSetWifiMaxTxPower { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub wifi_max_tx_power: u32, |     pub wifi_max_tx_power: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespSetWifiMaxTxPower { | pub struct CtrlMsgRespSetWifiMaxTxPower { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqGetWifiCurrTxPower {} | pub struct CtrlMsgReqGetWifiCurrTxPower {} | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespGetWifiCurrTxPower { | pub struct CtrlMsgRespGetWifiCurrTxPower { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub wifi_curr_tx_power: u32, |     pub wifi_curr_tx_power: u32, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -325,7 +325,7 @@ pub(crate) struct CtrlMsgRespGetWifiCurrTxPower { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgReqConfigHeartbeat { | pub struct CtrlMsgReqConfigHeartbeat { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub enable: bool, |     pub enable: bool, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -334,7 +334,7 @@ pub(crate) struct CtrlMsgReqConfigHeartbeat { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgRespConfigHeartbeat { | pub struct CtrlMsgRespConfigHeartbeat { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
| } | } | ||||||
| @@ -342,28 +342,28 @@ pub(crate) struct CtrlMsgRespConfigHeartbeat { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgEventEspInit { | pub struct CtrlMsgEventEspInit { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub init_data: Vec<u8, 64>, |     pub init_data: Vec<u8, 64>, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgEventHeartbeat { | pub struct CtrlMsgEventHeartbeat { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub hb_num: u32, |     pub hb_num: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgEventStationDisconnectFromAp { | pub struct CtrlMsgEventStationDisconnectFromAp { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
| } | } | ||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsgEventStationDisconnectFromEspSoftAp { | pub struct CtrlMsgEventStationDisconnectFromEspSoftAp { | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub resp: u32, |     pub resp: u32, | ||||||
|     #[noproto(tag = "2")] |     #[noproto(tag = "2")] | ||||||
| @@ -372,7 +372,7 @@ pub(crate) struct CtrlMsgEventStationDisconnectFromEspSoftAp { | |||||||
|  |  | ||||||
| #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | #[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) struct CtrlMsg { | pub struct CtrlMsg { | ||||||
|     /// msg_type could be req, resp or Event |     /// msg_type could be req, resp or Event | ||||||
|     #[noproto(tag = "1")] |     #[noproto(tag = "1")] | ||||||
|     pub msg_type: CtrlMsgType, |     pub msg_type: CtrlMsgType, | ||||||
| @@ -390,7 +390,7 @@ pub(crate) struct CtrlMsg { | |||||||
| /// union of all msg ids | /// union of all msg ids | ||||||
| #[derive(Debug, Clone, Eq, PartialEq, noproto::Oneof)] | #[derive(Debug, Clone, Eq, PartialEq, noproto::Oneof)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) enum CtrlMsgPayload { | pub enum CtrlMsgPayload { | ||||||
|     /// * Requests * |     /// * Requests * | ||||||
|     #[noproto(tag = "101")] |     #[noproto(tag = "101")] | ||||||
|     ReqGetMacAddress(CtrlMsgReqGetMacAddress), |     ReqGetMacAddress(CtrlMsgReqGetMacAddress), | ||||||
| @@ -492,7 +492,7 @@ pub(crate) enum CtrlMsgPayload { | |||||||
| #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | ||||||
| #[repr(u32)] | #[repr(u32)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) enum CtrlVendorIeType { | pub enum CtrlVendorIeType { | ||||||
|     #[default] |     #[default] | ||||||
|     Beacon = 0, |     Beacon = 0, | ||||||
|     ProbeReq = 1, |     ProbeReq = 1, | ||||||
| @@ -504,7 +504,7 @@ pub(crate) enum CtrlVendorIeType { | |||||||
| #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | ||||||
| #[repr(u32)] | #[repr(u32)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) enum CtrlVendorIeid { | pub enum CtrlVendorIeid { | ||||||
|     #[default] |     #[default] | ||||||
|     Id0 = 0, |     Id0 = 0, | ||||||
|     Id1 = 1, |     Id1 = 1, | ||||||
| @@ -513,7 +513,7 @@ pub(crate) enum CtrlVendorIeid { | |||||||
| #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | ||||||
| #[repr(u32)] | #[repr(u32)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) enum CtrlWifiMode { | pub enum CtrlWifiMode { | ||||||
|     #[default] |     #[default] | ||||||
|     None = 0, |     None = 0, | ||||||
|     Sta = 1, |     Sta = 1, | ||||||
| @@ -524,7 +524,7 @@ pub(crate) enum CtrlWifiMode { | |||||||
| #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | ||||||
| #[repr(u32)] | #[repr(u32)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) enum CtrlWifiBw { | pub enum CtrlWifiBw { | ||||||
|     #[default] |     #[default] | ||||||
|     BwInvalid = 0, |     BwInvalid = 0, | ||||||
|     Ht20 = 1, |     Ht20 = 1, | ||||||
| @@ -534,15 +534,13 @@ pub(crate) enum CtrlWifiBw { | |||||||
| #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | ||||||
| #[repr(u32)] | #[repr(u32)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) enum CtrlWifiPowerSave { | pub enum CtrlWifiPowerSave { | ||||||
|     #[default] |     #[default] | ||||||
|     PsInvalid = 0, |     PsInvalid = 0, | ||||||
|     MinModem = 1, |     MinModem = 1, | ||||||
|     MaxModem = 2, |     MaxModem = 2, | ||||||
| } | } | ||||||
|  |  | ||||||
| /// Wifi Security Settings |  | ||||||
| #[allow(missing_docs)] |  | ||||||
| #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | ||||||
| #[repr(u32)] | #[repr(u32)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| @@ -562,7 +560,7 @@ pub enum CtrlWifiSecProt { | |||||||
| #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | ||||||
| #[repr(u32)] | #[repr(u32)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) enum CtrlStatus { | pub enum CtrlStatus { | ||||||
|     #[default] |     #[default] | ||||||
|     Connected = 0, |     Connected = 0, | ||||||
|     NotConnected = 1, |     NotConnected = 1, | ||||||
| @@ -575,7 +573,7 @@ pub(crate) enum CtrlStatus { | |||||||
| #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | ||||||
| #[repr(u32)] | #[repr(u32)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) enum CtrlMsgType { | pub enum CtrlMsgType { | ||||||
|     #[default] |     #[default] | ||||||
|     MsgTypeInvalid = 0, |     MsgTypeInvalid = 0, | ||||||
|     Req = 1, |     Req = 1, | ||||||
| @@ -587,7 +585,7 @@ pub(crate) enum CtrlMsgType { | |||||||
| #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | #[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] | ||||||
| #[repr(u32)] | #[repr(u32)] | ||||||
| #[cfg_attr(feature = "defmt", derive(defmt::Format))] | #[cfg_attr(feature = "defmt", derive(defmt::Format))] | ||||||
| pub(crate) enum CtrlMsgId { | pub enum CtrlMsgId { | ||||||
|     #[default] |     #[default] | ||||||
|     MsgIdInvalid = 0, |     MsgIdInvalid = 0, | ||||||
|     /// * Request Msgs * |     /// * Request Msgs * | ||||||
|   | |||||||
| @@ -56,7 +56,6 @@ cortex-m = "0.7.6" | |||||||
| futures = { version = "0.3.17", default-features = false, features = ["async-await"] } | futures = { version = "0.3.17", default-features = false, features = ["async-await"] } | ||||||
| rand_core = "0.6.3" | rand_core = "0.6.3" | ||||||
| sdio-host = "0.5.0" | sdio-host = "0.5.0" | ||||||
| embedded-sdmmc = { git = "https://github.com/embassy-rs/embedded-sdmmc-rs", rev = "a4f293d3a6f72158385f79c98634cb8a14d0d2fc", optional = true } |  | ||||||
| critical-section = "1.1" | critical-section = "1.1" | ||||||
| stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-2234f380f51d16d0398b8e547088b33ea623cc7c" } | stm32-metapac = { git = "https://github.com/embassy-rs/stm32-data-generated", tag = "stm32-data-2234f380f51d16d0398b8e547088b33ea623cc7c" } | ||||||
| vcell = "0.1.3" | vcell = "0.1.3" | ||||||
|   | |||||||
| @@ -1538,53 +1538,3 @@ foreach_peripheral!( | |||||||
|         impl Instance for peripherals::$inst {} |         impl Instance for peripherals::$inst {} | ||||||
|     }; |     }; | ||||||
| ); | ); | ||||||
|  |  | ||||||
| #[cfg(feature = "embedded-sdmmc")] |  | ||||||
| mod sdmmc_rs { |  | ||||||
|     use embedded_sdmmc::{Block, BlockCount, BlockDevice, BlockIdx}; |  | ||||||
|  |  | ||||||
|     use super::*; |  | ||||||
|  |  | ||||||
|     impl<'d, T: Instance, Dma: SdmmcDma<T>> BlockDevice for Sdmmc<'d, T, Dma> { |  | ||||||
|         type Error = Error; |  | ||||||
|  |  | ||||||
|         async fn read( |  | ||||||
|             &mut self, |  | ||||||
|             blocks: &mut [Block], |  | ||||||
|             start_block_idx: BlockIdx, |  | ||||||
|             _reason: &str, |  | ||||||
|         ) -> Result<(), Self::Error> { |  | ||||||
|             let mut address = start_block_idx.0; |  | ||||||
|  |  | ||||||
|             for block in blocks.iter_mut() { |  | ||||||
|                 let block: &mut [u8; 512] = &mut block.contents; |  | ||||||
|  |  | ||||||
|                 // NOTE(unsafe) Block uses align(4) |  | ||||||
|                 let block = unsafe { &mut *(block as *mut _ as *mut DataBlock) }; |  | ||||||
|                 self.read_block(address, block).await?; |  | ||||||
|                 address += 1; |  | ||||||
|             } |  | ||||||
|             Ok(()) |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         async fn write(&mut self, blocks: &[Block], start_block_idx: BlockIdx) -> Result<(), Self::Error> { |  | ||||||
|             let mut address = start_block_idx.0; |  | ||||||
|  |  | ||||||
|             for block in blocks.iter() { |  | ||||||
|                 let block: &[u8; 512] = &block.contents; |  | ||||||
|  |  | ||||||
|                 // NOTE(unsafe) DataBlock uses align 4 |  | ||||||
|                 let block = unsafe { &*(block as *const _ as *const DataBlock) }; |  | ||||||
|                 self.write_block(address, block).await?; |  | ||||||
|                 address += 1; |  | ||||||
|             } |  | ||||||
|             Ok(()) |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         fn num_blocks(&self) -> Result<BlockCount, Self::Error> { |  | ||||||
|             let card = self.card()?; |  | ||||||
|             let count = card.csd.block_count(); |  | ||||||
|             Ok(BlockCount(count)) |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| } |  | ||||||
|   | |||||||
| @@ -111,6 +111,20 @@ where | |||||||
|         poll_fn(move |cx| self.poll_wait(cx)) |         poll_fn(move |cx| self.poll_wait(cx)) | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     /// non-blocking method to try and take the signal value. | ||||||
|  |     pub fn try_take(&self) -> Option<T> { | ||||||
|  |         self.state.lock(|cell| { | ||||||
|  |             let state = cell.replace(State::None); | ||||||
|  |             match state { | ||||||
|  |                 State::Signaled(res) => Some(res), | ||||||
|  |                 state => { | ||||||
|  |                     cell.set(state); | ||||||
|  |                     None | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         }) | ||||||
|  |     } | ||||||
|  |  | ||||||
|     /// non-blocking method to check whether this signal has been signaled. |     /// non-blocking method to check whether this signal has been signaled. | ||||||
|     pub fn signaled(&self) -> bool { |     pub fn signaled(&self) -> bool { | ||||||
|         self.state.lock(|cell| { |         self.state.lock(|cell| { | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" | |||||||
|  |  | ||||||
| [dependencies] | [dependencies] | ||||||
| # Change stm32f429zi to your chip name, if necessary. | # Change stm32f429zi to your chip name, if necessary. | ||||||
| embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "embedded-sdmmc", "chrono"]  } | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti", "chrono"]  } | ||||||
| embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | embassy-sync = { version = "0.5.0", path = "../../embassy-sync", features = ["defmt"] } | ||||||
| embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | embassy-executor = { version = "0.4.0", path = "../../embassy-executor", features = ["nightly", "arch-cortex-m", "executor-thread", "executor-interrupt", "defmt", "integrated-timers"] } | ||||||
| embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | embassy-time = { version = "0.2", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user