From 98de11e5e3ae437676198a105ffab8c0f4977513 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 29 Oct 2025 17:49:55 +0100 Subject: net-esp-hosted: add Interface trait. --- embassy-net-esp-hosted/src/iface.rs | 62 ++++++++++++++++++++++++++++ embassy-net-esp-hosted/src/lib.rs | 47 ++++++++------------- examples/nrf52840/src/bin/wifi_esp_hosted.rs | 16 +++---- tests/nrf/src/bin/wifi_esp_hosted_perf.rs | 15 +++---- 4 files changed, 89 insertions(+), 51 deletions(-) create mode 100644 embassy-net-esp-hosted/src/iface.rs diff --git a/embassy-net-esp-hosted/src/iface.rs b/embassy-net-esp-hosted/src/iface.rs new file mode 100644 index 000000000..1f57851e0 --- /dev/null +++ b/embassy-net-esp-hosted/src/iface.rs @@ -0,0 +1,62 @@ +use embassy_time::Timer; +use embedded_hal::digital::InputPin; +use embedded_hal_async::digital::Wait; +use embedded_hal_async::spi::SpiDevice; + +/// Physical interface trait for communicating with the ESP chip. +pub trait Interface { + /// Wait for the HANDSHAKE signal indicating the ESP is ready for a new transaction. + async fn wait_for_handshake(&mut self); + + /// Wait for the READY signal indicating the ESP has data to send. + async fn wait_for_ready(&mut self); + + /// Perform a SPI transfer, exchanging data with the ESP chip. + async fn transfer(&mut self, rx: &mut [u8], tx: &[u8]); +} + +/// Standard SPI interface. +/// +/// This interface is what's implemented in the upstream `esp-hosted-fg` firmware. It uses: +/// - An `SpiDevice` for SPI communication (CS is handled by the device) +/// - A handshake pin that signals when the ESP is ready for a new transaction +/// - A ready pin that indicates when the ESP has data to send +pub struct SpiInterface { + spi: SPI, + handshake: IN, + ready: IN, +} + +impl SpiInterface +where + SPI: SpiDevice, + IN: InputPin + Wait, +{ + /// Create a new SpiInterface. + pub fn new(spi: SPI, handshake: IN, ready: IN) -> Self { + Self { spi, handshake, ready } + } +} + +impl Interface for SpiInterface +where + SPI: SpiDevice, + IN: InputPin + Wait, +{ + async fn wait_for_handshake(&mut self) { + self.handshake.wait_for_high().await.unwrap(); + } + + async fn wait_for_ready(&mut self) { + self.ready.wait_for_high().await.unwrap(); + } + + async fn transfer(&mut self, rx: &mut [u8], tx: &[u8]) { + self.spi.transfer(rx, tx).await.unwrap(); + + // The esp-hosted firmware deasserts the HANDSHAKE pin a few us AFTER ending the SPI transfer + // If we check it again too fast, we'll see it's high from the previous transfer, and if we send it + // data it will get lost. + Timer::after_micros(100).await; + } +} diff --git a/embassy-net-esp-hosted/src/lib.rs b/embassy-net-esp-hosted/src/lib.rs index 4405d9f77..8da0cd4dc 100644 --- a/embassy-net-esp-hosted/src/lib.rs +++ b/embassy-net-esp-hosted/src/lib.rs @@ -1,14 +1,13 @@ #![no_std] #![doc = include_str!("../README.md")] #![warn(missing_docs)] +#![allow(async_fn_in_trait)] use embassy_futures::select::{Either4, select4}; use embassy_net_driver_channel as ch; use embassy_net_driver_channel::driver::LinkState; use embassy_time::{Duration, Instant, Timer}; -use embedded_hal::digital::{InputPin, OutputPin}; -use embedded_hal_async::digital::Wait; -use embedded_hal_async::spi::SpiDevice; +use embedded_hal::digital::OutputPin; use crate::ioctl::{PendingIoctl, Shared}; use crate::proto::{CtrlMsg, CtrlMsgPayload}; @@ -19,9 +18,11 @@ mod proto; mod fmt; mod control; +mod iface; mod ioctl; pub use control::*; +pub use iface::*; const MTU: usize = 1514; @@ -118,20 +119,17 @@ impl State { /// Type alias for network driver. pub type NetDriver<'a> = ch::Device<'a, MTU>; -/// Create a new esp-hosted driver using the provided state, SPI peripheral and pins. +/// Create a new esp-hosted driver using the provided state, interface, and reset pin. /// /// 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, I, OUT>( state: &'a mut State, - spi: SPI, - handshake: IN, - ready: IN, + iface: I, reset: OUT, -) -> (NetDriver<'a>, Control<'a>, Runner<'a, SPI, IN, OUT>) +) -> (NetDriver<'a>, Control<'a>, Runner<'a, I, OUT>) where - SPI: SpiDevice, - IN: InputPin + Wait, + I: Interface, OUT: OutputPin, { let (ch_runner, device) = ch::new(&mut state.ch, ch::driver::HardwareAddress::Ethernet([0; 6])); @@ -142,10 +140,8 @@ where state_ch, shared: &state.shared, next_seq: 1, - handshake, - ready, reset, - spi, + iface, heartbeat_deadline: Instant::now() + HEARTBEAT_MAX_GAP, }; @@ -153,7 +149,7 @@ where } /// Runner for communicating with the WiFi device. -pub struct Runner<'a, SPI, IN, OUT> { +pub struct Runner<'a, I, OUT> { ch: ch::Runner<'a, MTU>, state_ch: ch::StateRunner<'a>, shared: &'a Shared, @@ -161,16 +157,13 @@ pub struct Runner<'a, SPI, IN, OUT> { next_seq: u16, heartbeat_deadline: Instant, - spi: SPI, - handshake: IN, - ready: IN, + iface: I, reset: OUT, } -impl<'a, SPI, IN, OUT> Runner<'a, SPI, IN, OUT> +impl<'a, I, OUT> Runner<'a, I, OUT> where - SPI: SpiDevice, - IN: InputPin + Wait, + I: Interface, OUT: OutputPin, { /// Run the packet processing. @@ -185,11 +178,11 @@ where let mut rx_buf = [0u8; MAX_SPI_BUFFER_SIZE]; loop { - self.handshake.wait_for_high().await.unwrap(); + self.iface.wait_for_handshake().await; let ioctl = self.shared.ioctl_wait_pending(); let tx = self.ch.tx_buf(); - let ev = async { self.ready.wait_for_high().await.unwrap() }; + let ev = async { self.iface.wait_for_ready().await }; let hb = Timer::at(self.heartbeat_deadline); match select4(ioctl, tx, ev, hb).await { @@ -243,15 +236,9 @@ where trace!("tx: {:02x}", &tx_buf[..40]); } - self.spi.transfer(&mut rx_buf, &tx_buf).await.unwrap(); + self.iface.transfer(&mut rx_buf, &tx_buf).await; - // The esp-hosted firmware deasserts the HANSHAKE pin a few us AFTER ending the SPI transfer - // If we check it again too fast, we'll see it's high from the previous transfer, and if we send it - // data it will get lost. - // Make sure we check it after 100us at minimum. - let delay_until = Instant::now() + Duration::from_micros(100); self.handle_rx(&mut rx_buf); - Timer::at(delay_until).await; } } diff --git a/examples/nrf52840/src/bin/wifi_esp_hosted.rs b/examples/nrf52840/src/bin/wifi_esp_hosted.rs index 07752ffc4..2f9c06b56 100644 --- a/examples/nrf52840/src/bin/wifi_esp_hosted.rs +++ b/examples/nrf52840/src/bin/wifi_esp_hosted.rs @@ -27,14 +27,12 @@ bind_interrupts!(struct Irqs { async fn wifi_task( runner: hosted::Runner< 'static, - ExclusiveDevice, Output<'static>, Delay>, - Input<'static>, + hosted::SpiInterface, Output<'static>, Delay>, Input<'static>>, Output<'static>, >, ) -> ! { runner.run().await } - #[embassy_executor::task] async fn net_task(mut runner: embassy_net::Runner<'static, hosted::NetDriver<'static>>) -> ! { runner.run().await @@ -60,15 +58,11 @@ async fn main(spawner: Spawner) { let spi = spim::Spim::new(p.SPI3, Irqs, sck, miso, mosi, config); let spi = ExclusiveDevice::new(spi, cs, Delay); + let iface = hosted::SpiInterface::new(spi, handshake, ready); + static ESP_STATE: StaticCell = StaticCell::new(); - let (device, mut control, runner) = embassy_net_esp_hosted::new( - ESP_STATE.init(embassy_net_esp_hosted::State::new()), - spi, - handshake, - ready, - reset, - ) - .await; + let (device, mut control, runner) = + embassy_net_esp_hosted::new(ESP_STATE.init(embassy_net_esp_hosted::State::new()), iface, reset).await; spawner.spawn(unwrap!(wifi_task(runner))); diff --git a/tests/nrf/src/bin/wifi_esp_hosted_perf.rs b/tests/nrf/src/bin/wifi_esp_hosted_perf.rs index 091a70ce9..ac082dbb8 100644 --- a/tests/nrf/src/bin/wifi_esp_hosted_perf.rs +++ b/tests/nrf/src/bin/wifi_esp_hosted_perf.rs @@ -29,8 +29,7 @@ const WIFI_PASSWORD: &str = "V8YxhKt5CdIAJFud"; async fn wifi_task( runner: hosted::Runner< 'static, - ExclusiveDevice, Output<'static>, Delay>, - Input<'static>, + hosted::SpiInterface, Output<'static>, Delay>, Input<'static>>, Output<'static>, >, ) -> ! { @@ -64,15 +63,11 @@ async fn main(spawner: Spawner) { let spi = spim::Spim::new(p.SPI3, Irqs, sck, miso, mosi, config); let spi = ExclusiveDevice::new(spi, cs, Delay); + let iface = hosted::SpiInterface::new(spi, handshake, ready); + static STATE: StaticCell = StaticCell::new(); - let (device, mut control, runner) = embassy_net_esp_hosted::new( - STATE.init(embassy_net_esp_hosted::State::new()), - spi, - handshake, - ready, - reset, - ) - .await; + let (device, mut control, runner) = + embassy_net_esp_hosted::new(STATE.init(embassy_net_esp_hosted::State::new()), iface, reset).await; spawner.spawn(unwrap!(wifi_task(runner))); -- cgit From 252664c1b0b4d81c34953c92bdcec84f7b5d3986 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 29 Oct 2025 18:24:57 +0100 Subject: net-esp-hosted: switch from noproto to micropb. --- embassy-net-esp-hosted/Cargo.toml | 5 +- embassy-net-esp-hosted/build.rs | 33 ++ embassy-net-esp-hosted/src/control.rs | 69 ++-- embassy-net-esp-hosted/src/lib.rs | 28 +- embassy-net-esp-hosted/src/proto.rs | 656 ---------------------------------- 5 files changed, 94 insertions(+), 697 deletions(-) create mode 100644 embassy-net-esp-hosted/build.rs delete mode 100644 embassy-net-esp-hosted/src/proto.rs diff --git a/embassy-net-esp-hosted/Cargo.toml b/embassy-net-esp-hosted/Cargo.toml index f148f4762..2442b3235 100644 --- a/embassy-net-esp-hosted/Cargo.toml +++ b/embassy-net-esp-hosted/Cargo.toml @@ -25,9 +25,12 @@ embassy-net-driver-channel = { version = "0.3.2", path = "../embassy-net-driver- embedded-hal = { version = "1.0" } embedded-hal-async = { version = "1.0" } -noproto = "0.1.0" +micropb = { version = "0.4.0", default-features = false, features = ["container-heapless", "encode", "decode"] } heapless = "0.8" +[build-dependencies] +micropb-gen = "0.4.0" + [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-esp-hosted-v$VERSION/embassy-net-esp-hosted/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net-esp-hosted/src/" diff --git a/embassy-net-esp-hosted/build.rs b/embassy-net-esp-hosted/build.rs new file mode 100644 index 000000000..1e9b8cffd --- /dev/null +++ b/embassy-net-esp-hosted/build.rs @@ -0,0 +1,33 @@ +fn main() { + let out_dir = std::env::var("OUT_DIR").unwrap(); + + let mut g = micropb_gen::Generator::new(); + g.use_container_heapless(); + + g.configure( + ".", + micropb_gen::Config::new() + .max_bytes(32) // For ssid, mac, etc - strings + .max_len(16) // For repeated fields + .type_attributes("#[cfg_attr(feature = \"defmt\", derive(defmt::Format))]"), + ); + + // Special config for things that need to be larger + g.configure( + ".CtrlMsg_Req_OTAWrite.ota_data", + micropb_gen::Config::new().max_bytes(1024), + ); + g.configure( + ".CtrlMsg_Event_ESPInit.init_data", + micropb_gen::Config::new().max_bytes(64), + ); + g.configure( + ".CtrlMsg_Req_VendorIEData.payload", + micropb_gen::Config::new().max_bytes(64), + ); + + g.compile_protos(&["src/esp_hosted_config.proto"], format!("{}/proto.rs", out_dir)) + .unwrap(); + + println!("cargo:rerun-if-changed=src/esp_hosted_config.proto"); +} diff --git a/embassy-net-esp-hosted/src/control.rs b/embassy-net-esp-hosted/src/control.rs index cbc194877..a7f5168c2 100644 --- a/embassy-net-esp-hosted/src/control.rs +++ b/embassy-net-esp-hosted/src/control.rs @@ -1,6 +1,7 @@ use embassy_net_driver_channel as ch; use embassy_net_driver_channel::driver::{HardwareAddress, LinkState}; use heapless::String; +use micropb::{MessageDecode, MessageEncode, PbEncoder}; use crate::ioctl::Shared; use crate::proto::{self, CtrlMsg}; @@ -38,7 +39,7 @@ enum WifiMode { ApSta = 3, } -pub use proto::CtrlWifiSecProt as Security; +pub use proto::Ctrl_WifiSecProt as Security; /// WiFi status. #[derive(Clone, Debug)] @@ -59,18 +60,18 @@ pub struct Status { macro_rules! ioctl { ($self:ident, $req_variant:ident, $resp_variant:ident, $req:ident, $resp:ident) => { let mut msg = proto::CtrlMsg { - msg_id: proto::CtrlMsgId::$req_variant as _, - msg_type: proto::CtrlMsgType::Req as _, - payload: Some(proto::CtrlMsgPayload::$req_variant($req)), + r#msg_id: proto::CtrlMsgId::$req_variant, + r#msg_type: proto::CtrlMsgType::Req, + r#payload: Some(proto::CtrlMsg_::Payload::$req_variant($req)), }; $self.ioctl(&mut msg).await?; #[allow(unused_mut)] - let Some(proto::CtrlMsgPayload::$resp_variant(mut $resp)) = msg.payload else { + let Some(proto::CtrlMsg_::Payload::$resp_variant(mut $resp)) = msg.payload else { warn!("unexpected response variant"); return Err(Error::Internal); }; if $resp.resp != 0 { - return Err(Error::Failed($resp.resp)); + return Err(Error::Failed($resp.resp as u32)); } }; } @@ -100,26 +101,28 @@ impl<'a> Control<'a> { /// Get the current status. pub async fn get_status(&mut self) -> Result { - let req = proto::CtrlMsgReqGetApConfig {}; + let req = proto::CtrlMsg_Req_GetAPConfig {}; ioctl!(self, ReqGetApConfig, RespGetApConfig, req, resp); - trim_nulls(&mut resp.ssid); + let ssid = core::str::from_utf8(&resp.ssid).map_err(|_| Error::Internal)?; + let ssid = String::try_from(ssid.trim_end_matches('\0')).map_err(|_| Error::Internal)?; + let bssid_str = core::str::from_utf8(&resp.bssid).map_err(|_| Error::Internal)?; Ok(Status { - ssid: resp.ssid, - bssid: parse_mac(&resp.bssid)?, + ssid, + bssid: parse_mac(bssid_str)?, rssi: resp.rssi as _, - channel: resp.chnl, + channel: resp.chnl as u32, security: resp.sec_prot, }) } /// Connect to the network identified by ssid using the provided password. pub async fn connect(&mut self, ssid: &str, password: &str) -> Result<(), Error> { - let req = proto::CtrlMsgReqConnectAp { - ssid: unwrap!(String::try_from(ssid)), - pwd: unwrap!(String::try_from(password)), - bssid: String::new(), - listen_interval: 3, - is_wpa3_supported: true, + let req = proto::CtrlMsg_Req_ConnectAP { + r#ssid: unwrap!(String::try_from(ssid)), + r#pwd: unwrap!(String::try_from(password)), + r#bssid: String::new(), + r#listen_interval: 3, + r#is_wpa3_supported: true, }; ioctl!(self, ReqConnectAp, RespConnectAp, req, resp); self.state_ch.set_link_state(LinkState::Up); @@ -128,7 +131,7 @@ impl<'a> Control<'a> { /// Disconnect from any currently connected network. pub async fn disconnect(&mut self) -> Result<(), Error> { - let req = proto::CtrlMsgReqGetStatus {}; + let req = proto::CtrlMsg_Req_GetStatus {}; ioctl!(self, ReqDisconnectAp, RespDisconnectAp, req, resp); self.state_ch.set_link_state(LinkState::Down); Ok(()) @@ -136,21 +139,25 @@ impl<'a> Control<'a> { /// duration in seconds, clamped to [10, 3600] async fn set_heartbeat(&mut self, duration: u32) -> Result<(), Error> { - let req = proto::CtrlMsgReqConfigHeartbeat { enable: true, duration }; + let req = proto::CtrlMsg_Req_ConfigHeartbeat { + r#enable: true, + r#duration: duration as i32, + }; ioctl!(self, ReqConfigHeartbeat, RespConfigHeartbeat, req, resp); Ok(()) } async fn get_mac_addr(&mut self) -> Result<[u8; 6], Error> { - let req = proto::CtrlMsgReqGetMacAddress { - mode: WifiMode::Sta as _, + let req = proto::CtrlMsg_Req_GetMacAddress { + r#mode: WifiMode::Sta as _, }; ioctl!(self, ReqGetMacAddress, RespGetMacAddress, req, resp); - parse_mac(&resp.mac) + let mac_str = core::str::from_utf8(&resp.mac).map_err(|_| Error::Internal)?; + parse_mac(mac_str) } async fn set_wifi_mode(&mut self, mode: u32) -> Result<(), Error> { - let req = proto::CtrlMsgReqSetMode { mode }; + let req = proto::CtrlMsg_Req_SetMode { r#mode: mode as i32 }; ioctl!(self, ReqSetWifiMode, RespSetWifiMode, req, resp); Ok(()) @@ -160,11 +167,15 @@ impl<'a> Control<'a> { debug!("ioctl req: {:?}", &msg); let mut buf = [0u8; 128]; + let buf_len = buf.len(); - let req_len = noproto::write(msg, &mut buf).map_err(|_| { + let mut encoder = PbEncoder::new(&mut buf[..]); + msg.encode(&mut encoder).map_err(|_| { warn!("failed to serialize control request"); Error::Internal })?; + let remaining = encoder.into_writer(); + let req_len = buf_len - remaining.len(); struct CancelOnDrop<'a>(&'a Shared); @@ -186,8 +197,8 @@ impl<'a> Control<'a> { ioctl.defuse(); - *msg = noproto::read(&buf[..resp_len]).map_err(|_| { - warn!("failed to serialize control request"); + msg.decode_from_bytes(&buf[..resp_len]).map_err(|_| { + warn!("failed to deserialize control response"); Error::Internal })?; debug!("ioctl resp: {:?}", msg); @@ -221,9 +232,3 @@ fn parse_mac(mac: &str) -> Result<[u8; 6], Error> { } Ok(res) } - -fn trim_nulls(s: &mut String) { - while s.chars().rev().next() == Some(0 as char) { - s.pop(); - } -} diff --git a/embassy-net-esp-hosted/src/lib.rs b/embassy-net-esp-hosted/src/lib.rs index 8da0cd4dc..1fbed3e83 100644 --- a/embassy-net-esp-hosted/src/lib.rs +++ b/embassy-net-esp-hosted/src/lib.rs @@ -10,9 +10,19 @@ use embassy_time::{Duration, Instant, Timer}; use embedded_hal::digital::OutputPin; use crate::ioctl::{PendingIoctl, Shared}; -use crate::proto::{CtrlMsg, CtrlMsgPayload}; - -mod proto; +use crate::proto::{CtrlMsg, CtrlMsg_}; + +mod proto { + #![allow(unused)] + #![allow(non_snake_case)] + #![allow(non_camel_case_types)] + #![allow(non_upper_case_globals)] + #![allow(missing_docs)] + #![allow(clippy::all)] + + // Include the generated protobuf code from micropb-gen + include!(concat!(env!("OUT_DIR"), "/proto.rs")); +} // must be first mod fmt; @@ -313,10 +323,12 @@ where } fn handle_event(&mut self, data: &[u8]) { - let Ok(event) = noproto::read::(data) else { + use micropb::MessageDecode; + let mut event = CtrlMsg::default(); + if event.decode_from_bytes(data).is_err() { warn!("failed to parse event"); return; - }; + } debug!("event: {:?}", &event); @@ -326,9 +338,9 @@ where }; match payload { - CtrlMsgPayload::EventEspInit(_) => self.shared.init_done(), - CtrlMsgPayload::EventHeartbeat(_) => self.heartbeat_deadline = Instant::now() + HEARTBEAT_MAX_GAP, - CtrlMsgPayload::EventStationDisconnectFromAp(e) => { + CtrlMsg_::Payload::EventEspInit(_) => self.shared.init_done(), + CtrlMsg_::Payload::EventHeartbeat(_) => self.heartbeat_deadline = Instant::now() + HEARTBEAT_MAX_GAP, + CtrlMsg_::Payload::EventStationDisconnectFromAp(e) => { info!("disconnected, code {}", e.resp); self.state_ch.set_link_state(LinkState::Down); } diff --git a/embassy-net-esp-hosted/src/proto.rs b/embassy-net-esp-hosted/src/proto.rs deleted file mode 100644 index 089ded677..000000000 --- a/embassy-net-esp-hosted/src/proto.rs +++ /dev/null @@ -1,656 +0,0 @@ -#![allow(unused)] - -use heapless::{String, Vec}; - -/// internal supporting structures for CtrlMsg - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct ScanResult { - #[noproto(tag = "1")] - pub ssid: String<32>, - #[noproto(tag = "2")] - pub chnl: u32, - #[noproto(tag = "3")] - pub rssi: u32, - #[noproto(tag = "4")] - pub bssid: String<32>, - #[noproto(tag = "5")] - pub sec_prot: CtrlWifiSecProt, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct ConnectedStaList { - #[noproto(tag = "1")] - pub mac: String<32>, - #[noproto(tag = "2")] - pub rssi: u32, -} -/// * Req/Resp structure * - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqGetMacAddress { - #[noproto(tag = "1")] - pub mode: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespGetMacAddress { - #[noproto(tag = "1")] - pub mac: String<32>, - #[noproto(tag = "2")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqGetMode {} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespGetMode { - #[noproto(tag = "1")] - pub mode: u32, - #[noproto(tag = "2")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqSetMode { - #[noproto(tag = "1")] - pub mode: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespSetMode { - #[noproto(tag = "1")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqGetStatus {} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespGetStatus { - #[noproto(tag = "1")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqSetMacAddress { - #[noproto(tag = "1")] - pub mac: String<32>, - #[noproto(tag = "2")] - pub mode: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespSetMacAddress { - #[noproto(tag = "1")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqGetApConfig {} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespGetApConfig { - #[noproto(tag = "1")] - pub ssid: String<32>, - #[noproto(tag = "2")] - pub bssid: String<32>, - #[noproto(tag = "3")] - pub rssi: u32, - #[noproto(tag = "4")] - pub chnl: u32, - #[noproto(tag = "5")] - pub sec_prot: CtrlWifiSecProt, - #[noproto(tag = "6")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqConnectAp { - #[noproto(tag = "1")] - pub ssid: String<32>, - #[noproto(tag = "2")] - pub pwd: String<32>, - #[noproto(tag = "3")] - pub bssid: String<32>, - #[noproto(tag = "4")] - pub is_wpa3_supported: bool, - #[noproto(tag = "5")] - pub listen_interval: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespConnectAp { - #[noproto(tag = "1")] - pub resp: u32, - #[noproto(tag = "2")] - pub mac: String<32>, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqGetSoftApConfig {} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespGetSoftApConfig { - #[noproto(tag = "1")] - pub ssid: String<32>, - #[noproto(tag = "2")] - pub pwd: String<32>, - #[noproto(tag = "3")] - pub chnl: u32, - #[noproto(tag = "4")] - pub sec_prot: CtrlWifiSecProt, - #[noproto(tag = "5")] - pub max_conn: u32, - #[noproto(tag = "6")] - pub ssid_hidden: bool, - #[noproto(tag = "7")] - pub bw: u32, - #[noproto(tag = "8")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqStartSoftAp { - #[noproto(tag = "1")] - pub ssid: String<32>, - #[noproto(tag = "2")] - pub pwd: String<32>, - #[noproto(tag = "3")] - pub chnl: u32, - #[noproto(tag = "4")] - pub sec_prot: CtrlWifiSecProt, - #[noproto(tag = "5")] - pub max_conn: u32, - #[noproto(tag = "6")] - pub ssid_hidden: bool, - #[noproto(tag = "7")] - pub bw: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespStartSoftAp { - #[noproto(tag = "1")] - pub resp: u32, - #[noproto(tag = "2")] - pub mac: String<32>, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqScanResult {} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespScanResult { - #[noproto(tag = "1")] - pub count: u32, - #[noproto(repeated, tag = "2")] - pub entries: Vec, - #[noproto(tag = "3")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqSoftApConnectedSta {} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespSoftApConnectedSta { - #[noproto(tag = "1")] - pub num: u32, - #[noproto(repeated, tag = "2")] - pub stations: Vec, - #[noproto(tag = "3")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqOtaBegin {} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespOtaBegin { - #[noproto(tag = "1")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqOtaWrite { - #[noproto(tag = "1")] - pub ota_data: Vec, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespOtaWrite { - #[noproto(tag = "1")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqOtaEnd {} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespOtaEnd { - #[noproto(tag = "1")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqVendorIeData { - #[noproto(tag = "1")] - pub element_id: u32, - #[noproto(tag = "2")] - pub length: u32, - #[noproto(tag = "3")] - pub vendor_oui: Vec, - #[noproto(tag = "4")] - pub vendor_oui_type: u32, - #[noproto(tag = "5")] - pub payload: Vec, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqSetSoftApVendorSpecificIe { - #[noproto(tag = "1")] - pub enable: bool, - #[noproto(tag = "2")] - pub r#type: CtrlVendorIeType, - #[noproto(tag = "3")] - pub idx: CtrlVendorIeid, - #[noproto(optional, tag = "4")] - pub vendor_ie_data: Option, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespSetSoftApVendorSpecificIe { - #[noproto(tag = "1")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqSetWifiMaxTxPower { - #[noproto(tag = "1")] - pub wifi_max_tx_power: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespSetWifiMaxTxPower { - #[noproto(tag = "1")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqGetWifiCurrTxPower {} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespGetWifiCurrTxPower { - #[noproto(tag = "1")] - pub wifi_curr_tx_power: u32, - #[noproto(tag = "2")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgReqConfigHeartbeat { - #[noproto(tag = "1")] - pub enable: bool, - #[noproto(tag = "2")] - pub duration: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgRespConfigHeartbeat { - #[noproto(tag = "1")] - pub resp: u32, -} -/// * Event structure * - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgEventEspInit { - #[noproto(tag = "1")] - pub init_data: Vec, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgEventHeartbeat { - #[noproto(tag = "1")] - pub hb_num: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgEventStationDisconnectFromAp { - #[noproto(tag = "1")] - pub resp: u32, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsgEventStationDisconnectFromEspSoftAp { - #[noproto(tag = "1")] - pub resp: u32, - #[noproto(tag = "2")] - pub mac: String<32>, -} - -#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) struct CtrlMsg { - /// msg_type could be req, resp or Event - #[noproto(tag = "1")] - pub msg_type: CtrlMsgType, - /// msg id - #[noproto(tag = "2")] - pub msg_id: CtrlMsgId, - /// union of all msg ids - #[noproto( - oneof, - tags = "101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 301, 302, 303, 304" - )] - pub payload: Option, -} - -/// union of all msg ids -#[derive(Debug, Clone, Eq, PartialEq, noproto::Oneof)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) enum CtrlMsgPayload { - /// * Requests * - #[noproto(tag = "101")] - ReqGetMacAddress(CtrlMsgReqGetMacAddress), - #[noproto(tag = "102")] - ReqSetMacAddress(CtrlMsgReqSetMacAddress), - #[noproto(tag = "103")] - ReqGetWifiMode(CtrlMsgReqGetMode), - #[noproto(tag = "104")] - ReqSetWifiMode(CtrlMsgReqSetMode), - #[noproto(tag = "105")] - ReqScanApList(CtrlMsgReqScanResult), - #[noproto(tag = "106")] - ReqGetApConfig(CtrlMsgReqGetApConfig), - #[noproto(tag = "107")] - ReqConnectAp(CtrlMsgReqConnectAp), - #[noproto(tag = "108")] - ReqDisconnectAp(CtrlMsgReqGetStatus), - #[noproto(tag = "109")] - ReqGetSoftapConfig(CtrlMsgReqGetSoftApConfig), - #[noproto(tag = "110")] - ReqSetSoftapVendorSpecificIe(CtrlMsgReqSetSoftApVendorSpecificIe), - #[noproto(tag = "111")] - ReqStartSoftap(CtrlMsgReqStartSoftAp), - #[noproto(tag = "112")] - ReqSoftapConnectedStasList(CtrlMsgReqSoftApConnectedSta), - #[noproto(tag = "113")] - ReqStopSoftap(CtrlMsgReqGetStatus), - #[noproto(tag = "114")] - ReqSetPowerSaveMode(CtrlMsgReqSetMode), - #[noproto(tag = "115")] - ReqGetPowerSaveMode(CtrlMsgReqGetMode), - #[noproto(tag = "116")] - ReqOtaBegin(CtrlMsgReqOtaBegin), - #[noproto(tag = "117")] - ReqOtaWrite(CtrlMsgReqOtaWrite), - #[noproto(tag = "118")] - ReqOtaEnd(CtrlMsgReqOtaEnd), - #[noproto(tag = "119")] - ReqSetWifiMaxTxPower(CtrlMsgReqSetWifiMaxTxPower), - #[noproto(tag = "120")] - ReqGetWifiCurrTxPower(CtrlMsgReqGetWifiCurrTxPower), - #[noproto(tag = "121")] - ReqConfigHeartbeat(CtrlMsgReqConfigHeartbeat), - /// * Responses * - #[noproto(tag = "201")] - RespGetMacAddress(CtrlMsgRespGetMacAddress), - #[noproto(tag = "202")] - RespSetMacAddress(CtrlMsgRespSetMacAddress), - #[noproto(tag = "203")] - RespGetWifiMode(CtrlMsgRespGetMode), - #[noproto(tag = "204")] - RespSetWifiMode(CtrlMsgRespSetMode), - #[noproto(tag = "205")] - RespScanApList(CtrlMsgRespScanResult), - #[noproto(tag = "206")] - RespGetApConfig(CtrlMsgRespGetApConfig), - #[noproto(tag = "207")] - RespConnectAp(CtrlMsgRespConnectAp), - #[noproto(tag = "208")] - RespDisconnectAp(CtrlMsgRespGetStatus), - #[noproto(tag = "209")] - RespGetSoftapConfig(CtrlMsgRespGetSoftApConfig), - #[noproto(tag = "210")] - RespSetSoftapVendorSpecificIe(CtrlMsgRespSetSoftApVendorSpecificIe), - #[noproto(tag = "211")] - RespStartSoftap(CtrlMsgRespStartSoftAp), - #[noproto(tag = "212")] - RespSoftapConnectedStasList(CtrlMsgRespSoftApConnectedSta), - #[noproto(tag = "213")] - RespStopSoftap(CtrlMsgRespGetStatus), - #[noproto(tag = "214")] - RespSetPowerSaveMode(CtrlMsgRespSetMode), - #[noproto(tag = "215")] - RespGetPowerSaveMode(CtrlMsgRespGetMode), - #[noproto(tag = "216")] - RespOtaBegin(CtrlMsgRespOtaBegin), - #[noproto(tag = "217")] - RespOtaWrite(CtrlMsgRespOtaWrite), - #[noproto(tag = "218")] - RespOtaEnd(CtrlMsgRespOtaEnd), - #[noproto(tag = "219")] - RespSetWifiMaxTxPower(CtrlMsgRespSetWifiMaxTxPower), - #[noproto(tag = "220")] - RespGetWifiCurrTxPower(CtrlMsgRespGetWifiCurrTxPower), - #[noproto(tag = "221")] - RespConfigHeartbeat(CtrlMsgRespConfigHeartbeat), - /// * Notifications * - #[noproto(tag = "301")] - EventEspInit(CtrlMsgEventEspInit), - #[noproto(tag = "302")] - EventHeartbeat(CtrlMsgEventHeartbeat), - #[noproto(tag = "303")] - EventStationDisconnectFromAp(CtrlMsgEventStationDisconnectFromAp), - #[noproto(tag = "304")] - EventStationDisconnectFromEspSoftAp(CtrlMsgEventStationDisconnectFromEspSoftAp), -} - -/// Enums similar to ESP IDF -#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] -#[repr(u32)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) enum CtrlVendorIeType { - #[default] - Beacon = 0, - ProbeReq = 1, - ProbeResp = 2, - AssocReq = 3, - AssocResp = 4, -} - -#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] -#[repr(u32)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) enum CtrlVendorIeid { - #[default] - Id0 = 0, - Id1 = 1, -} - -#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] -#[repr(u32)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) enum CtrlWifiMode { - #[default] - None = 0, - Sta = 1, - Ap = 2, - Apsta = 3, -} - -#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] -#[repr(u32)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) enum CtrlWifiBw { - #[default] - BwInvalid = 0, - Ht20 = 1, - Ht40 = 2, -} - -#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] -#[repr(u32)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) enum CtrlWifiPowerSave { - #[default] - PsInvalid = 0, - MinModem = 1, - MaxModem = 2, -} - -/// Wifi Security Settings -#[allow(missing_docs)] -#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] -#[repr(u32)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub enum CtrlWifiSecProt { - #[default] - Open = 0, - Wep = 1, - WpaPsk = 2, - Wpa2Psk = 3, - WpaWpa2Psk = 4, - Wpa2Enterprise = 5, - Wpa3Psk = 6, - Wpa2Wpa3Psk = 7, -} - -/// enums for Control path -#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] -#[repr(u32)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) enum CtrlStatus { - #[default] - Connected = 0, - NotConnected = 1, - NoApFound = 2, - ConnectionFail = 3, - InvalidArgument = 4, - OutOfRange = 5, -} - -#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] -#[repr(u32)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) enum CtrlMsgType { - #[default] - MsgTypeInvalid = 0, - Req = 1, - Resp = 2, - Event = 3, - MsgTypeMax = 4, -} - -#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] -#[repr(u32)] -#[cfg_attr(feature = "defmt", derive(defmt::Format))] -pub(crate) enum CtrlMsgId { - #[default] - MsgIdInvalid = 0, - /// * Request Msgs * - ReqBase = 100, - ReqGetMacAddress = 101, - ReqSetMacAddress = 102, - ReqGetWifiMode = 103, - ReqSetWifiMode = 104, - ReqGetApScanList = 105, - ReqGetApConfig = 106, - ReqConnectAp = 107, - ReqDisconnectAp = 108, - ReqGetSoftApConfig = 109, - ReqSetSoftApVendorSpecificIe = 110, - ReqStartSoftAp = 111, - ReqGetSoftApConnectedStaList = 112, - ReqStopSoftAp = 113, - ReqSetPowerSaveMode = 114, - ReqGetPowerSaveMode = 115, - ReqOtaBegin = 116, - ReqOtaWrite = 117, - ReqOtaEnd = 118, - ReqSetWifiMaxTxPower = 119, - ReqGetWifiCurrTxPower = 120, - ReqConfigHeartbeat = 121, - /// Add new control path command response before Req_Max - /// and update Req_Max - ReqMax = 122, - /// * Response Msgs * - RespBase = 200, - RespGetMacAddress = 201, - RespSetMacAddress = 202, - RespGetWifiMode = 203, - RespSetWifiMode = 204, - RespGetApScanList = 205, - RespGetApConfig = 206, - RespConnectAp = 207, - RespDisconnectAp = 208, - RespGetSoftApConfig = 209, - RespSetSoftApVendorSpecificIe = 210, - RespStartSoftAp = 211, - RespGetSoftApConnectedStaList = 212, - RespStopSoftAp = 213, - RespSetPowerSaveMode = 214, - RespGetPowerSaveMode = 215, - RespOtaBegin = 216, - RespOtaWrite = 217, - RespOtaEnd = 218, - RespSetWifiMaxTxPower = 219, - RespGetWifiCurrTxPower = 220, - RespConfigHeartbeat = 221, - /// Add new control path command response before Resp_Max - /// and update Resp_Max - RespMax = 222, - /// * Event Msgs * - EventBase = 300, - EventEspInit = 301, - EventHeartbeat = 302, - EventStationDisconnectFromAp = 303, - EventStationDisconnectFromEspSoftAp = 304, - /// Add new control path command notification before Event_Max - /// and update Event_Max - EventMax = 305, -} -- cgit From 3681c782765408685d14d7c80c88d4d18dee783d Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 29 Oct 2025 19:17:14 +0100 Subject: net-esp-hosted: update proto definitions to latest esp-hosted-fg. --- embassy-net-esp-hosted/src/control.rs | 33 ++-- embassy-net-esp-hosted/src/esp_hosted_config.proto | 205 ++++++++++++++++++++- embassy-net-esp-hosted/src/lib.rs | 4 + 3 files changed, 225 insertions(+), 17 deletions(-) diff --git a/embassy-net-esp-hosted/src/control.rs b/embassy-net-esp-hosted/src/control.rs index a7f5168c2..38ec648b4 100644 --- a/embassy-net-esp-hosted/src/control.rs +++ b/embassy-net-esp-hosted/src/control.rs @@ -60,9 +60,11 @@ pub struct Status { macro_rules! ioctl { ($self:ident, $req_variant:ident, $resp_variant:ident, $req:ident, $resp:ident) => { let mut msg = proto::CtrlMsg { - r#msg_id: proto::CtrlMsgId::$req_variant, - r#msg_type: proto::CtrlMsgType::Req, - r#payload: Some(proto::CtrlMsg_::Payload::$req_variant($req)), + msg_id: proto::CtrlMsgId::$req_variant, + msg_type: proto::CtrlMsgType::Req, + payload: Some(proto::CtrlMsg_::Payload::$req_variant($req)), + req_resp_type: 0, + uid: 0, }; $self.ioctl(&mut msg).await?; #[allow(unused_mut)] @@ -117,15 +119,22 @@ 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> { + const WIFI_BAND_MODE_AUTO: i32 = 3; // 2.4GHz + 5GHz + let req = proto::CtrlMsg_Req_ConnectAP { - r#ssid: unwrap!(String::try_from(ssid)), - r#pwd: unwrap!(String::try_from(password)), - r#bssid: String::new(), - r#listen_interval: 3, - r#is_wpa3_supported: true, + ssid: unwrap!(String::try_from(ssid)), + pwd: unwrap!(String::try_from(password)), + bssid: String::new(), + listen_interval: 3, + is_wpa3_supported: true, + band_mode: WIFI_BAND_MODE_AUTO, }; ioctl!(self, ReqConnectAp, RespConnectAp, req, resp); + + // TODO: in newer esp-hosted firmwares that added EventStationConnectedToAp + // the connect ioctl seems to be async, so we shouldn't immediately set LinkState::Up here. self.state_ch.set_link_state(LinkState::Up); + Ok(()) } @@ -140,8 +149,8 @@ impl<'a> Control<'a> { /// duration in seconds, clamped to [10, 3600] async fn set_heartbeat(&mut self, duration: u32) -> Result<(), Error> { let req = proto::CtrlMsg_Req_ConfigHeartbeat { - r#enable: true, - r#duration: duration as i32, + enable: true, + duration: duration as i32, }; ioctl!(self, ReqConfigHeartbeat, RespConfigHeartbeat, req, resp); Ok(()) @@ -149,7 +158,7 @@ impl<'a> Control<'a> { async fn get_mac_addr(&mut self) -> Result<[u8; 6], Error> { let req = proto::CtrlMsg_Req_GetMacAddress { - r#mode: WifiMode::Sta as _, + mode: WifiMode::Sta as _, }; ioctl!(self, ReqGetMacAddress, RespGetMacAddress, req, resp); let mac_str = core::str::from_utf8(&resp.mac).map_err(|_| Error::Internal)?; @@ -157,7 +166,7 @@ impl<'a> Control<'a> { } async fn set_wifi_mode(&mut self, mode: u32) -> Result<(), Error> { - let req = proto::CtrlMsg_Req_SetMode { r#mode: mode as i32 }; + let req = proto::CtrlMsg_Req_SetMode { mode: mode as i32 }; ioctl!(self, ReqSetWifiMode, RespSetWifiMode, req, resp); Ok(()) diff --git a/embassy-net-esp-hosted/src/esp_hosted_config.proto b/embassy-net-esp-hosted/src/esp_hosted_config.proto index aa1bfde64..7d626207e 100644 --- a/embassy-net-esp-hosted/src/esp_hosted_config.proto +++ b/embassy-net-esp-hosted/src/esp_hosted_config.proto @@ -1,3 +1,6 @@ +/* Copyright (C) 2015-2025 Espressif Systems (Shanghai) PTE LTD */ +/* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */ + syntax = "proto3"; /* Enums similar to ESP IDF */ @@ -28,9 +31,10 @@ enum Ctrl_WifiBw { } enum Ctrl_WifiPowerSave { - PS_Invalid = 0; + NO_PS = 0; MIN_MODEM = 1; MAX_MODEM = 2; + PS_Invalid = 3; } enum Ctrl_WifiSecProt { @@ -96,9 +100,16 @@ enum CtrlMsgId { Req_GetWifiCurrTxPower = 120; Req_ConfigHeartbeat = 121; + Req_EnableDisable = 122; + Req_GetFwVersion = 123; + Req_SetCountryCode = 124; + Req_GetCountryCode = 125; + Req_SetDhcpDnsStatus = 126; + Req_GetDhcpDnsStatus = 127; + Req_Custom_RPC_Unserialised_Msg = 128; /* Add new control path command response before Req_Max * and update Req_Max */ - Req_Max = 122; + Req_Max = 129; /** Response Msgs **/ Resp_Base = 200; @@ -130,9 +141,16 @@ enum CtrlMsgId { Resp_GetWifiCurrTxPower = 220; Resp_ConfigHeartbeat = 221; + Resp_EnableDisable = 222; + Resp_GetFwVersion = 223; + Resp_SetCountryCode = 224; + Resp_GetCountryCode = 225; + Resp_SetDhcpDnsStatus = 226; + Resp_GetDhcpDnsStatus = 227; + Resp_Custom_RPC_Unserialised_Msg = 228; /* Add new control path command response before Resp_Max * and update Resp_Max */ - Resp_Max = 222; + Resp_Max = 229; /** Event Msgs **/ Event_Base = 300; @@ -140,9 +158,22 @@ enum CtrlMsgId { Event_Heartbeat = 302; Event_StationDisconnectFromAP = 303; Event_StationDisconnectFromESPSoftAP = 304; + Event_StationConnectedToAP = 305; + Event_StationConnectedToESPSoftAP = 306; + Event_SetDhcpDnsStatus = 307; + Event_Custom_RPC_Unserialised_Msg = 308; /* Add new control path command notification before Event_Max * and update Event_Max */ - Event_Max = 305; + Event_Max = 309; +} + +enum HostedFeature { + Hosted_InvalidFeature = 0; + Hosted_Wifi = 1; + Hosted_Bluetooth = 2; + Hosted_Is_Network_Split_On = 3; + + /* Add your new features here and re-build prot using build_proto.sh */ } /* internal supporting structures for CtrlMsg */ @@ -213,6 +244,7 @@ message CtrlMsg_Resp_GetAPConfig { int32 chnl = 4; Ctrl_WifiSecProt sec_prot = 5; int32 resp = 6; + int32 band_mode = 7; } message CtrlMsg_Req_ConnectAP { @@ -221,11 +253,13 @@ message CtrlMsg_Req_ConnectAP { string bssid = 3; bool is_wpa3_supported = 4; int32 listen_interval = 5; + int32 band_mode = 6; } message CtrlMsg_Resp_ConnectAP { int32 resp = 1; bytes mac = 2; + int32 band_mode = 3; } message CtrlMsg_Req_GetSoftAPConfig { @@ -240,6 +274,7 @@ message CtrlMsg_Resp_GetSoftAPConfig { bool ssid_hidden = 6; int32 bw = 7; int32 resp = 8; + int32 band_mode = 9; } message CtrlMsg_Req_StartSoftAP { @@ -250,11 +285,13 @@ message CtrlMsg_Req_StartSoftAP { int32 max_conn = 5; bool ssid_hidden = 6; int32 bw = 7; + int32 band_mode = 8; } message CtrlMsg_Resp_StartSoftAP { int32 resp = 1; bytes mac = 2; + int32 band_mode = 3; } message CtrlMsg_Req_ScanResult { @@ -302,7 +339,7 @@ message CtrlMsg_Req_VendorIEData { int32 length = 2; bytes vendor_oui = 3; int32 vendor_oui_type = 4; - bytes payload = 5; + bytes payload = 5; } message CtrlMsg_Req_SetSoftAPVendorSpecificIE { @@ -341,6 +378,81 @@ message CtrlMsg_Resp_ConfigHeartbeat { int32 resp = 1; } +message CtrlMsg_Req_EnableDisable { + uint32 feature = 1; + bool enable = 2; +} + +message CtrlMsg_Resp_EnableDisable { + int32 resp = 1; +} + +message CtrlMsg_Req_GetFwVersion { +} + +message CtrlMsg_Resp_GetFwVersion { + int32 resp = 1; + string name = 2; + uint32 major1 = 3; + uint32 major2 = 4; + uint32 minor = 5; + uint32 rev_patch1 = 6; + uint32 rev_patch2 = 7; +} + +message CtrlMsg_Req_SetCountryCode { + bytes country = 1; + bool ieee80211d_enabled = 2; +} + +message CtrlMsg_Resp_SetCountryCode { + int32 resp = 1; +} + +message CtrlMsg_Req_GetCountryCode { +} + +message CtrlMsg_Resp_GetCountryCode { + int32 resp = 1; + bytes country = 2; +} + +message CtrlMsg_Req_SetDhcpDnsStatus { + int32 iface = 1; + int32 net_link_up = 2; + + int32 dhcp_up = 3; + bytes dhcp_ip = 4; + bytes dhcp_nm = 5; + bytes dhcp_gw = 6; + + int32 dns_up = 7; + bytes dns_ip = 8; + int32 dns_type = 9; +} + +message CtrlMsg_Resp_SetDhcpDnsStatus { + int32 resp = 1; +} + +message CtrlMsg_Req_GetDhcpDnsStatus { +} + +message CtrlMsg_Resp_GetDhcpDnsStatus { + int32 resp = 1; + int32 iface = 2; + int32 net_link_up = 3; + + int32 dhcp_up = 4; + bytes dhcp_ip = 5; + bytes dhcp_nm = 6; + bytes dhcp_gw = 7; + + int32 dns_up = 8; + bytes dns_ip = 9; + int32 dns_type = 10; +} + /** Event structure **/ message CtrlMsg_Event_ESPInit { bytes init_data = 1; @@ -352,11 +464,70 @@ message CtrlMsg_Event_Heartbeat { message CtrlMsg_Event_StationDisconnectFromAP { int32 resp = 1; + bytes ssid = 2; + uint32 ssid_len = 3; + bytes bssid = 4; + uint32 reason = 5; + int32 rssi = 6; } +message CtrlMsg_Event_StationConnectedToAP { + int32 resp = 1; + bytes ssid = 2; + uint32 ssid_len = 3; + bytes bssid = 4; + uint32 channel = 5; + int32 authmode = 6; + int32 aid = 7; +} + + message CtrlMsg_Event_StationDisconnectFromESPSoftAP { int32 resp = 1; bytes mac = 2; + uint32 aid = 3; + bool is_mesh_child = 4; + uint32 reason = 5; +} + +message CtrlMsg_Event_StationConnectedToESPSoftAP { + int32 resp = 1; + bytes mac = 2; + uint32 aid = 3; + bool is_mesh_child = 4; +} + +message CtrlMsg_Event_SetDhcpDnsStatus { + int32 iface = 1; + int32 net_link_up = 2; + + int32 dhcp_up = 3; + bytes dhcp_ip = 4; + bytes dhcp_nm = 5; + bytes dhcp_gw = 6; + + int32 dns_up = 7; + bytes dns_ip = 8; + int32 dns_type = 9; + int32 resp = 10; +} + +/* Add Custom RPC message structures after existing message structures to make it easily notice */ +message CtrlMsg_Req_CustomRpcUnserialisedMsg { + uint32 custom_msg_id = 1; + bytes data = 2; +} + +message CtrlMsg_Resp_CustomRpcUnserialisedMsg { + int32 resp = 1; + uint32 custom_msg_id = 2; + bytes data = 3; +} + +message CtrlMsg_Event_CustomRpcUnserialisedMsg { + int32 resp = 1; + uint32 custom_evt_id = 2; + bytes data = 3; } message CtrlMsg { @@ -366,6 +537,12 @@ message CtrlMsg { /* msg id */ CtrlMsgId msg_id = 2; + /* UID of message */ + int32 uid = 3; + + /* Request/response type: sync or async */ + uint32 req_resp_type = 4; + /* union of all msg ids */ oneof payload { /** Requests **/ @@ -395,6 +572,13 @@ message CtrlMsg { CtrlMsg_Req_SetWifiMaxTxPower req_set_wifi_max_tx_power = 119; CtrlMsg_Req_GetWifiCurrTxPower req_get_wifi_curr_tx_power = 120; CtrlMsg_Req_ConfigHeartbeat req_config_heartbeat = 121; + CtrlMsg_Req_EnableDisable req_enable_disable_feat = 122; + CtrlMsg_Req_GetFwVersion req_get_fw_version = 123; + CtrlMsg_Req_SetCountryCode req_set_country_code = 124; + CtrlMsg_Req_GetCountryCode req_get_country_code = 125; + CtrlMsg_Req_SetDhcpDnsStatus req_set_dhcp_dns_status = 126; + CtrlMsg_Req_GetDhcpDnsStatus req_get_dhcp_dns_status = 127; + CtrlMsg_Req_CustomRpcUnserialisedMsg req_custom_rpc_unserialised_msg = 128; /** Responses **/ CtrlMsg_Resp_GetMacAddress resp_get_mac_address = 201; @@ -422,11 +606,22 @@ message CtrlMsg { CtrlMsg_Resp_SetWifiMaxTxPower resp_set_wifi_max_tx_power = 219; CtrlMsg_Resp_GetWifiCurrTxPower resp_get_wifi_curr_tx_power = 220; CtrlMsg_Resp_ConfigHeartbeat resp_config_heartbeat = 221; + CtrlMsg_Resp_EnableDisable resp_enable_disable_feat = 222; + CtrlMsg_Resp_GetFwVersion resp_get_fw_version = 223; + CtrlMsg_Resp_SetCountryCode resp_set_country_code = 224; + CtrlMsg_Resp_GetCountryCode resp_get_country_code = 225; + CtrlMsg_Resp_SetDhcpDnsStatus resp_set_dhcp_dns_status = 226; + CtrlMsg_Resp_GetDhcpDnsStatus resp_get_dhcp_dns_status = 227; + CtrlMsg_Resp_CustomRpcUnserialisedMsg resp_custom_rpc_unserialised_msg = 228; /** Notifications **/ CtrlMsg_Event_ESPInit event_esp_init = 301; CtrlMsg_Event_Heartbeat event_heartbeat = 302; CtrlMsg_Event_StationDisconnectFromAP event_station_disconnect_from_AP = 303; CtrlMsg_Event_StationDisconnectFromESPSoftAP event_station_disconnect_from_ESP_SoftAP = 304; + CtrlMsg_Event_StationConnectedToAP event_station_connected_to_AP = 305; + CtrlMsg_Event_StationConnectedToESPSoftAP event_station_connected_to_ESP_SoftAP = 306; + CtrlMsg_Event_SetDhcpDnsStatus event_set_dhcp_dns_status = 307; + CtrlMsg_Event_CustomRpcUnserialisedMsg event_custom_rpc_unserialised_msg = 308; } } diff --git a/embassy-net-esp-hosted/src/lib.rs b/embassy-net-esp-hosted/src/lib.rs index 1fbed3e83..a6c806c46 100644 --- a/embassy-net-esp-hosted/src/lib.rs +++ b/embassy-net-esp-hosted/src/lib.rs @@ -340,6 +340,10 @@ where match payload { CtrlMsg_::Payload::EventEspInit(_) => self.shared.init_done(), CtrlMsg_::Payload::EventHeartbeat(_) => self.heartbeat_deadline = Instant::now() + HEARTBEAT_MAX_GAP, + CtrlMsg_::Payload::EventStationConnectedToAp(e) => { + info!("connected, code {}", e.resp); + self.state_ch.set_link_state(LinkState::Up); + } CtrlMsg_::Payload::EventStationDisconnectFromAp(e) => { info!("disconnected, code {}", e.resp); self.state_ch.set_link_state(LinkState::Down); -- cgit From 4827aca6470e23e94ba443ed821dc8df965b69f4 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Thu, 30 Oct 2025 12:28:50 +0100 Subject: net-esp-hosted: check in generated micropb code. This avoids a compile-time dependency on `protoc`. ideally micropb would have a cli tool so we could script this. see https://github.com/YuhanLiin/micropb/issues/30 --- embassy-net-esp-hosted/Cargo.toml | 3 - embassy-net-esp-hosted/build.rs | 33 - embassy-net-esp-hosted/src/lib.rs | 18 +- embassy-net-esp-hosted/src/proto.rs | 13764 ++++++++++++++++++++++++++++++++++ 4 files changed, 13771 insertions(+), 47 deletions(-) delete mode 100644 embassy-net-esp-hosted/build.rs create mode 100644 embassy-net-esp-hosted/src/proto.rs diff --git a/embassy-net-esp-hosted/Cargo.toml b/embassy-net-esp-hosted/Cargo.toml index 2442b3235..81096b024 100644 --- a/embassy-net-esp-hosted/Cargo.toml +++ b/embassy-net-esp-hosted/Cargo.toml @@ -28,9 +28,6 @@ embedded-hal-async = { version = "1.0" } micropb = { version = "0.4.0", default-features = false, features = ["container-heapless", "encode", "decode"] } heapless = "0.8" -[build-dependencies] -micropb-gen = "0.4.0" - [package.metadata.embassy_docs] src_base = "https://github.com/embassy-rs/embassy/blob/embassy-net-esp-hosted-v$VERSION/embassy-net-esp-hosted/src/" src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-net-esp-hosted/src/" diff --git a/embassy-net-esp-hosted/build.rs b/embassy-net-esp-hosted/build.rs deleted file mode 100644 index 1e9b8cffd..000000000 --- a/embassy-net-esp-hosted/build.rs +++ /dev/null @@ -1,33 +0,0 @@ -fn main() { - let out_dir = std::env::var("OUT_DIR").unwrap(); - - let mut g = micropb_gen::Generator::new(); - g.use_container_heapless(); - - g.configure( - ".", - micropb_gen::Config::new() - .max_bytes(32) // For ssid, mac, etc - strings - .max_len(16) // For repeated fields - .type_attributes("#[cfg_attr(feature = \"defmt\", derive(defmt::Format))]"), - ); - - // Special config for things that need to be larger - g.configure( - ".CtrlMsg_Req_OTAWrite.ota_data", - micropb_gen::Config::new().max_bytes(1024), - ); - g.configure( - ".CtrlMsg_Event_ESPInit.init_data", - micropb_gen::Config::new().max_bytes(64), - ); - g.configure( - ".CtrlMsg_Req_VendorIEData.payload", - micropb_gen::Config::new().max_bytes(64), - ); - - g.compile_protos(&["src/esp_hosted_config.proto"], format!("{}/proto.rs", out_dir)) - .unwrap(); - - println!("cargo:rerun-if-changed=src/esp_hosted_config.proto"); -} diff --git a/embassy-net-esp-hosted/src/lib.rs b/embassy-net-esp-hosted/src/lib.rs index a6c806c46..d882af8cf 100644 --- a/embassy-net-esp-hosted/src/lib.rs +++ b/embassy-net-esp-hosted/src/lib.rs @@ -12,17 +12,13 @@ use embedded_hal::digital::OutputPin; use crate::ioctl::{PendingIoctl, Shared}; use crate::proto::{CtrlMsg, CtrlMsg_}; -mod proto { - #![allow(unused)] - #![allow(non_snake_case)] - #![allow(non_camel_case_types)] - #![allow(non_upper_case_globals)] - #![allow(missing_docs)] - #![allow(clippy::all)] - - // Include the generated protobuf code from micropb-gen - include!(concat!(env!("OUT_DIR"), "/proto.rs")); -} +#[allow(unused)] +#[allow(non_snake_case)] +#[allow(non_camel_case_types)] +#[allow(non_upper_case_globals)] +#[allow(missing_docs)] +#[allow(clippy::all)] +mod proto; // must be first mod fmt; diff --git a/embassy-net-esp-hosted/src/proto.rs b/embassy-net-esp-hosted/src/proto.rs new file mode 100644 index 000000000..74c67bd61 --- /dev/null +++ b/embassy-net-esp-hosted/src/proto.rs @@ -0,0 +1,13764 @@ +/* +Generated with the following snippet. +Switch to a proper script when https://github.com/YuhanLiin/micropb/issues/30 is done + + let mut g = micropb_gen::Generator::new(); + g.use_container_heapless(); + + g.configure( + ".", + micropb_gen::Config::new() + .max_bytes(32) // For ssid, mac, etc - strings + .max_len(16) // For repeated fields + .type_attributes("#[cfg_attr(feature = \"defmt\", derive(defmt::Format))]"), + ); + + // Special config for things that need to be larger + g.configure( + ".CtrlMsg_Req_OTAWrite.ota_data", + micropb_gen::Config::new().max_bytes(1024), + ); + g.configure( + ".CtrlMsg_Event_ESPInit.init_data", + micropb_gen::Config::new().max_bytes(64), + ); + g.configure( + ".CtrlMsg_Req_VendorIEData.payload", + micropb_gen::Config::new().max_bytes(64), + ); + + g.compile_protos(&["src/esp_hosted_config.proto"], format!("{}/proto.rs", out_dir)) + .unwrap(); + +*/ + +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct ScanResult { + pub r#ssid: ::micropb::heapless::Vec, + pub r#chnl: u32, + pub r#rssi: i32, + pub r#bssid: ::micropb::heapless::Vec, + pub r#sec_prot: Ctrl_WifiSecProt, +} +impl ScanResult { + ///Return a reference to `ssid` + #[inline] + pub fn r#ssid(&self) -> &::micropb::heapless::Vec { + &self.r#ssid + } + ///Return a mutable reference to `ssid` + #[inline] + pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#ssid + } + ///Set the value of `ssid` + #[inline] + pub fn set_ssid(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#ssid = value.into(); + self + } + ///Builder method that sets the value of `ssid`. Useful for initializing the message. + #[inline] + pub fn init_ssid(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#ssid = value.into(); + self + } + ///Return a reference to `chnl` + #[inline] + pub fn r#chnl(&self) -> &u32 { + &self.r#chnl + } + ///Return a mutable reference to `chnl` + #[inline] + pub fn mut_chnl(&mut self) -> &mut u32 { + &mut self.r#chnl + } + ///Set the value of `chnl` + #[inline] + pub fn set_chnl(&mut self, value: u32) -> &mut Self { + self.r#chnl = value.into(); + self + } + ///Builder method that sets the value of `chnl`. Useful for initializing the message. + #[inline] + pub fn init_chnl(mut self, value: u32) -> Self { + self.r#chnl = value.into(); + self + } + ///Return a reference to `rssi` + #[inline] + pub fn r#rssi(&self) -> &i32 { + &self.r#rssi + } + ///Return a mutable reference to `rssi` + #[inline] + pub fn mut_rssi(&mut self) -> &mut i32 { + &mut self.r#rssi + } + ///Set the value of `rssi` + #[inline] + pub fn set_rssi(&mut self, value: i32) -> &mut Self { + self.r#rssi = value.into(); + self + } + ///Builder method that sets the value of `rssi`. Useful for initializing the message. + #[inline] + pub fn init_rssi(mut self, value: i32) -> Self { + self.r#rssi = value.into(); + self + } + ///Return a reference to `bssid` + #[inline] + pub fn r#bssid(&self) -> &::micropb::heapless::Vec { + &self.r#bssid + } + ///Return a mutable reference to `bssid` + #[inline] + pub fn mut_bssid(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#bssid + } + ///Set the value of `bssid` + #[inline] + pub fn set_bssid(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#bssid = value.into(); + self + } + ///Builder method that sets the value of `bssid`. Useful for initializing the message. + #[inline] + pub fn init_bssid(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#bssid = value.into(); + self + } + ///Return a reference to `sec_prot` + #[inline] + pub fn r#sec_prot(&self) -> &Ctrl_WifiSecProt { + &self.r#sec_prot + } + ///Return a mutable reference to `sec_prot` + #[inline] + pub fn mut_sec_prot(&mut self) -> &mut Ctrl_WifiSecProt { + &mut self.r#sec_prot + } + ///Set the value of `sec_prot` + #[inline] + pub fn set_sec_prot(&mut self, value: Ctrl_WifiSecProt) -> &mut Self { + self.r#sec_prot = value.into(); + self + } + ///Builder method that sets the value of `sec_prot`. Useful for initializing the message. + #[inline] + pub fn init_sec_prot(mut self, value: Ctrl_WifiSecProt) -> Self { + self.r#sec_prot = value.into(); + self + } +} +impl ::micropb::MessageDecode for ScanResult { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#ssid; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 2u32 => { + let mut_ref = &mut self.r#chnl; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 3u32 => { + let mut_ref = &mut self.r#rssi; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#bssid; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 5u32 => { + let mut_ref = &mut self.r#sec_prot; + { + let val = decoder.decode_int32().map(|n| Ctrl_WifiSecProt(n as _))?; + let val_ref = &val; + if val_ref.0 != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for ScanResult { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(Ctrl_WifiSecProt::_MAX_SIZE), |size| size + + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + encoder.encode_varint32(10u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#chnl; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#rssi; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#bssid; + if !val_ref.is_empty() { + encoder.encode_varint32(34u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#sec_prot; + if val_ref.0 != 0 { + encoder.encode_varint32(40u32)?; + encoder.encode_int32(val_ref.0 as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#chnl; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#rssi; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#bssid; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#sec_prot; + if val_ref.0 != 0 { + size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct ConnectedSTAList { + pub r#mac: ::micropb::heapless::Vec, + pub r#rssi: i32, +} +impl ConnectedSTAList { + ///Return a reference to `mac` + #[inline] + pub fn r#mac(&self) -> &::micropb::heapless::Vec { + &self.r#mac + } + ///Return a mutable reference to `mac` + #[inline] + pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#mac + } + ///Set the value of `mac` + #[inline] + pub fn set_mac(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#mac = value.into(); + self + } + ///Builder method that sets the value of `mac`. Useful for initializing the message. + #[inline] + pub fn init_mac(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#mac = value.into(); + self + } + ///Return a reference to `rssi` + #[inline] + pub fn r#rssi(&self) -> &i32 { + &self.r#rssi + } + ///Return a mutable reference to `rssi` + #[inline] + pub fn mut_rssi(&mut self) -> &mut i32 { + &mut self.r#rssi + } + ///Set the value of `rssi` + #[inline] + pub fn set_rssi(&mut self, value: i32) -> &mut Self { + self.r#rssi = value.into(); + self + } + ///Builder method that sets the value of `rssi`. Useful for initializing the message. + #[inline] + pub fn init_rssi(mut self, value: i32) -> Self { + self.r#rssi = value.into(); + self + } +} +impl ::micropb::MessageDecode for ConnectedSTAList { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#mac; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 2u32 => { + let mut_ref = &mut self.r#rssi; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for ConnectedSTAList { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + encoder.encode_varint32(10u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#rssi; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#rssi; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_GetMacAddress { + pub r#mode: i32, +} +impl CtrlMsg_Req_GetMacAddress { + ///Return a reference to `mode` + #[inline] + pub fn r#mode(&self) -> &i32 { + &self.r#mode + } + ///Return a mutable reference to `mode` + #[inline] + pub fn mut_mode(&mut self) -> &mut i32 { + &mut self.r#mode + } + ///Set the value of `mode` + #[inline] + pub fn set_mode(&mut self, value: i32) -> &mut Self { + self.r#mode = value.into(); + self + } + ///Builder method that sets the value of `mode`. Useful for initializing the message. + #[inline] + pub fn init_mode(mut self, value: i32) -> Self { + self.r#mode = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_GetMacAddress { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#mode; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_GetMacAddress { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#mode; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#mode; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_GetMacAddress { + pub r#mac: ::micropb::heapless::Vec, + pub r#resp: i32, +} +impl CtrlMsg_Resp_GetMacAddress { + ///Return a reference to `mac` + #[inline] + pub fn r#mac(&self) -> &::micropb::heapless::Vec { + &self.r#mac + } + ///Return a mutable reference to `mac` + #[inline] + pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#mac + } + ///Set the value of `mac` + #[inline] + pub fn set_mac(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#mac = value.into(); + self + } + ///Builder method that sets the value of `mac`. Useful for initializing the message. + #[inline] + pub fn init_mac(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#mac = value.into(); + self + } + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_GetMacAddress { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#mac; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 2u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_GetMacAddress { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + encoder.encode_varint32(10u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_GetMode {} +impl CtrlMsg_Req_GetMode {} +impl ::micropb::MessageDecode for CtrlMsg_Req_GetMode { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_GetMode { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_GetMode { + pub r#mode: i32, + pub r#resp: i32, +} +impl CtrlMsg_Resp_GetMode { + ///Return a reference to `mode` + #[inline] + pub fn r#mode(&self) -> &i32 { + &self.r#mode + } + ///Return a mutable reference to `mode` + #[inline] + pub fn mut_mode(&mut self) -> &mut i32 { + &mut self.r#mode + } + ///Set the value of `mode` + #[inline] + pub fn set_mode(&mut self, value: i32) -> &mut Self { + self.r#mode = value.into(); + self + } + ///Builder method that sets the value of `mode`. Useful for initializing the message. + #[inline] + pub fn init_mode(mut self, value: i32) -> Self { + self.r#mode = value.into(); + self + } + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_GetMode { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#mode; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_GetMode { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#mode; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#mode; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_SetMode { + pub r#mode: i32, +} +impl CtrlMsg_Req_SetMode { + ///Return a reference to `mode` + #[inline] + pub fn r#mode(&self) -> &i32 { + &self.r#mode + } + ///Return a mutable reference to `mode` + #[inline] + pub fn mut_mode(&mut self) -> &mut i32 { + &mut self.r#mode + } + ///Set the value of `mode` + #[inline] + pub fn set_mode(&mut self, value: i32) -> &mut Self { + self.r#mode = value.into(); + self + } + ///Builder method that sets the value of `mode`. Useful for initializing the message. + #[inline] + pub fn init_mode(mut self, value: i32) -> Self { + self.r#mode = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_SetMode { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#mode; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_SetMode { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#mode; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#mode; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_SetMode { + pub r#resp: i32, +} +impl CtrlMsg_Resp_SetMode { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_SetMode { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_SetMode { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_GetStatus {} +impl CtrlMsg_Req_GetStatus {} +impl ::micropb::MessageDecode for CtrlMsg_Req_GetStatus { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_GetStatus { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_GetStatus { + pub r#resp: i32, +} +impl CtrlMsg_Resp_GetStatus { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_GetStatus { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_GetStatus { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_SetMacAddress { + pub r#mac: ::micropb::heapless::Vec, + pub r#mode: i32, +} +impl CtrlMsg_Req_SetMacAddress { + ///Return a reference to `mac` + #[inline] + pub fn r#mac(&self) -> &::micropb::heapless::Vec { + &self.r#mac + } + ///Return a mutable reference to `mac` + #[inline] + pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#mac + } + ///Set the value of `mac` + #[inline] + pub fn set_mac(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#mac = value.into(); + self + } + ///Builder method that sets the value of `mac`. Useful for initializing the message. + #[inline] + pub fn init_mac(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#mac = value.into(); + self + } + ///Return a reference to `mode` + #[inline] + pub fn r#mode(&self) -> &i32 { + &self.r#mode + } + ///Return a mutable reference to `mode` + #[inline] + pub fn mut_mode(&mut self) -> &mut i32 { + &mut self.r#mode + } + ///Set the value of `mode` + #[inline] + pub fn set_mode(&mut self, value: i32) -> &mut Self { + self.r#mode = value.into(); + self + } + ///Builder method that sets the value of `mode`. Useful for initializing the message. + #[inline] + pub fn init_mode(mut self, value: i32) -> Self { + self.r#mode = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_SetMacAddress { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#mac; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 2u32 => { + let mut_ref = &mut self.r#mode; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_SetMacAddress { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + encoder.encode_varint32(10u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#mode; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#mode; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_SetMacAddress { + pub r#resp: i32, +} +impl CtrlMsg_Resp_SetMacAddress { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_SetMacAddress { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_SetMacAddress { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_GetAPConfig {} +impl CtrlMsg_Req_GetAPConfig {} +impl ::micropb::MessageDecode for CtrlMsg_Req_GetAPConfig { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_GetAPConfig { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_GetAPConfig { + pub r#ssid: ::micropb::heapless::Vec, + pub r#bssid: ::micropb::heapless::Vec, + pub r#rssi: i32, + pub r#chnl: i32, + pub r#sec_prot: Ctrl_WifiSecProt, + pub r#resp: i32, + pub r#band_mode: i32, +} +impl CtrlMsg_Resp_GetAPConfig { + ///Return a reference to `ssid` + #[inline] + pub fn r#ssid(&self) -> &::micropb::heapless::Vec { + &self.r#ssid + } + ///Return a mutable reference to `ssid` + #[inline] + pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#ssid + } + ///Set the value of `ssid` + #[inline] + pub fn set_ssid(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#ssid = value.into(); + self + } + ///Builder method that sets the value of `ssid`. Useful for initializing the message. + #[inline] + pub fn init_ssid(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#ssid = value.into(); + self + } + ///Return a reference to `bssid` + #[inline] + pub fn r#bssid(&self) -> &::micropb::heapless::Vec { + &self.r#bssid + } + ///Return a mutable reference to `bssid` + #[inline] + pub fn mut_bssid(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#bssid + } + ///Set the value of `bssid` + #[inline] + pub fn set_bssid(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#bssid = value.into(); + self + } + ///Builder method that sets the value of `bssid`. Useful for initializing the message. + #[inline] + pub fn init_bssid(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#bssid = value.into(); + self + } + ///Return a reference to `rssi` + #[inline] + pub fn r#rssi(&self) -> &i32 { + &self.r#rssi + } + ///Return a mutable reference to `rssi` + #[inline] + pub fn mut_rssi(&mut self) -> &mut i32 { + &mut self.r#rssi + } + ///Set the value of `rssi` + #[inline] + pub fn set_rssi(&mut self, value: i32) -> &mut Self { + self.r#rssi = value.into(); + self + } + ///Builder method that sets the value of `rssi`. Useful for initializing the message. + #[inline] + pub fn init_rssi(mut self, value: i32) -> Self { + self.r#rssi = value.into(); + self + } + ///Return a reference to `chnl` + #[inline] + pub fn r#chnl(&self) -> &i32 { + &self.r#chnl + } + ///Return a mutable reference to `chnl` + #[inline] + pub fn mut_chnl(&mut self) -> &mut i32 { + &mut self.r#chnl + } + ///Set the value of `chnl` + #[inline] + pub fn set_chnl(&mut self, value: i32) -> &mut Self { + self.r#chnl = value.into(); + self + } + ///Builder method that sets the value of `chnl`. Useful for initializing the message. + #[inline] + pub fn init_chnl(mut self, value: i32) -> Self { + self.r#chnl = value.into(); + self + } + ///Return a reference to `sec_prot` + #[inline] + pub fn r#sec_prot(&self) -> &Ctrl_WifiSecProt { + &self.r#sec_prot + } + ///Return a mutable reference to `sec_prot` + #[inline] + pub fn mut_sec_prot(&mut self) -> &mut Ctrl_WifiSecProt { + &mut self.r#sec_prot + } + ///Set the value of `sec_prot` + #[inline] + pub fn set_sec_prot(&mut self, value: Ctrl_WifiSecProt) -> &mut Self { + self.r#sec_prot = value.into(); + self + } + ///Builder method that sets the value of `sec_prot`. Useful for initializing the message. + #[inline] + pub fn init_sec_prot(mut self, value: Ctrl_WifiSecProt) -> Self { + self.r#sec_prot = value.into(); + self + } + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `band_mode` + #[inline] + pub fn r#band_mode(&self) -> &i32 { + &self.r#band_mode + } + ///Return a mutable reference to `band_mode` + #[inline] + pub fn mut_band_mode(&mut self) -> &mut i32 { + &mut self.r#band_mode + } + ///Set the value of `band_mode` + #[inline] + pub fn set_band_mode(&mut self, value: i32) -> &mut Self { + self.r#band_mode = value.into(); + self + } + ///Builder method that sets the value of `band_mode`. Useful for initializing the message. + #[inline] + pub fn init_band_mode(mut self, value: i32) -> Self { + self.r#band_mode = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_GetAPConfig { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#ssid; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 2u32 => { + let mut_ref = &mut self.r#bssid; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 3u32 => { + let mut_ref = &mut self.r#rssi; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#chnl; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 5u32 => { + let mut_ref = &mut self.r#sec_prot; + { + let val = decoder.decode_int32().map(|n| Ctrl_WifiSecProt(n as _))?; + let val_ref = &val; + if val_ref.0 != 0 { + *mut_ref = val as _; + } + }; + } + 6u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 7u32 => { + let mut_ref = &mut self.r#band_mode; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_GetAPConfig { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(Ctrl_WifiSecProt::_MAX_SIZE), |size| size + + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + encoder.encode_varint32(10u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#bssid; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#rssi; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#chnl; + if *val_ref != 0 { + encoder.encode_varint32(32u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#sec_prot; + if val_ref.0 != 0 { + encoder.encode_varint32(40u32)?; + encoder.encode_int32(val_ref.0 as _)?; + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(48u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#band_mode; + if *val_ref != 0 { + encoder.encode_varint32(56u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#bssid; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#rssi; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#chnl; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#sec_prot; + if val_ref.0 != 0 { + size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _); + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#band_mode; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_ConnectAP { + pub r#ssid: ::micropb::heapless::String<32>, + pub r#pwd: ::micropb::heapless::String<32>, + pub r#bssid: ::micropb::heapless::String<32>, + pub r#is_wpa3_supported: bool, + pub r#listen_interval: i32, + pub r#band_mode: i32, +} +impl CtrlMsg_Req_ConnectAP { + ///Return a reference to `ssid` + #[inline] + pub fn r#ssid(&self) -> &::micropb::heapless::String<32> { + &self.r#ssid + } + ///Return a mutable reference to `ssid` + #[inline] + pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::String<32> { + &mut self.r#ssid + } + ///Set the value of `ssid` + #[inline] + pub fn set_ssid(&mut self, value: ::micropb::heapless::String<32>) -> &mut Self { + self.r#ssid = value.into(); + self + } + ///Builder method that sets the value of `ssid`. Useful for initializing the message. + #[inline] + pub fn init_ssid(mut self, value: ::micropb::heapless::String<32>) -> Self { + self.r#ssid = value.into(); + self + } + ///Return a reference to `pwd` + #[inline] + pub fn r#pwd(&self) -> &::micropb::heapless::String<32> { + &self.r#pwd + } + ///Return a mutable reference to `pwd` + #[inline] + pub fn mut_pwd(&mut self) -> &mut ::micropb::heapless::String<32> { + &mut self.r#pwd + } + ///Set the value of `pwd` + #[inline] + pub fn set_pwd(&mut self, value: ::micropb::heapless::String<32>) -> &mut Self { + self.r#pwd = value.into(); + self + } + ///Builder method that sets the value of `pwd`. Useful for initializing the message. + #[inline] + pub fn init_pwd(mut self, value: ::micropb::heapless::String<32>) -> Self { + self.r#pwd = value.into(); + self + } + ///Return a reference to `bssid` + #[inline] + pub fn r#bssid(&self) -> &::micropb::heapless::String<32> { + &self.r#bssid + } + ///Return a mutable reference to `bssid` + #[inline] + pub fn mut_bssid(&mut self) -> &mut ::micropb::heapless::String<32> { + &mut self.r#bssid + } + ///Set the value of `bssid` + #[inline] + pub fn set_bssid(&mut self, value: ::micropb::heapless::String<32>) -> &mut Self { + self.r#bssid = value.into(); + self + } + ///Builder method that sets the value of `bssid`. Useful for initializing the message. + #[inline] + pub fn init_bssid(mut self, value: ::micropb::heapless::String<32>) -> Self { + self.r#bssid = value.into(); + self + } + ///Return a reference to `is_wpa3_supported` + #[inline] + pub fn r#is_wpa3_supported(&self) -> &bool { + &self.r#is_wpa3_supported + } + ///Return a mutable reference to `is_wpa3_supported` + #[inline] + pub fn mut_is_wpa3_supported(&mut self) -> &mut bool { + &mut self.r#is_wpa3_supported + } + ///Set the value of `is_wpa3_supported` + #[inline] + pub fn set_is_wpa3_supported(&mut self, value: bool) -> &mut Self { + self.r#is_wpa3_supported = value.into(); + self + } + ///Builder method that sets the value of `is_wpa3_supported`. Useful for initializing the message. + #[inline] + pub fn init_is_wpa3_supported(mut self, value: bool) -> Self { + self.r#is_wpa3_supported = value.into(); + self + } + ///Return a reference to `listen_interval` + #[inline] + pub fn r#listen_interval(&self) -> &i32 { + &self.r#listen_interval + } + ///Return a mutable reference to `listen_interval` + #[inline] + pub fn mut_listen_interval(&mut self) -> &mut i32 { + &mut self.r#listen_interval + } + ///Set the value of `listen_interval` + #[inline] + pub fn set_listen_interval(&mut self, value: i32) -> &mut Self { + self.r#listen_interval = value.into(); + self + } + ///Builder method that sets the value of `listen_interval`. Useful for initializing the message. + #[inline] + pub fn init_listen_interval(mut self, value: i32) -> Self { + self.r#listen_interval = value.into(); + self + } + ///Return a reference to `band_mode` + #[inline] + pub fn r#band_mode(&self) -> &i32 { + &self.r#band_mode + } + ///Return a mutable reference to `band_mode` + #[inline] + pub fn mut_band_mode(&mut self) -> &mut i32 { + &mut self.r#band_mode + } + ///Set the value of `band_mode` + #[inline] + pub fn set_band_mode(&mut self, value: i32) -> &mut Self { + self.r#band_mode = value.into(); + self + } + ///Builder method that sets the value of `band_mode`. Useful for initializing the message. + #[inline] + pub fn init_band_mode(mut self, value: i32) -> Self { + self.r#band_mode = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_ConnectAP { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#ssid; + { + decoder.decode_string(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 2u32 => { + let mut_ref = &mut self.r#pwd; + { + decoder.decode_string(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 3u32 => { + let mut_ref = &mut self.r#bssid; + { + decoder.decode_string(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 4u32 => { + let mut_ref = &mut self.r#is_wpa3_supported; + { + let val = decoder.decode_bool()?; + let val_ref = &val; + if *val_ref { + *mut_ref = val as _; + } + }; + } + 5u32 => { + let mut_ref = &mut self.r#listen_interval; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 6u32 => { + let mut_ref = &mut self.r#band_mode; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_ConnectAP { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + encoder.encode_varint32(10u32)?; + encoder.encode_string(val_ref)?; + } + } + { + let val_ref = &self.r#pwd; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_string(val_ref)?; + } + } + { + let val_ref = &self.r#bssid; + if !val_ref.is_empty() { + encoder.encode_varint32(26u32)?; + encoder.encode_string(val_ref)?; + } + } + { + let val_ref = &self.r#is_wpa3_supported; + if *val_ref { + encoder.encode_varint32(32u32)?; + encoder.encode_bool(*val_ref)?; + } + } + { + let val_ref = &self.r#listen_interval; + if *val_ref != 0 { + encoder.encode_varint32(40u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#band_mode; + if *val_ref != 0 { + encoder.encode_varint32(48u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#pwd; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#bssid; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#is_wpa3_supported; + if *val_ref { + size += 1usize + 1; + } + } + { + let val_ref = &self.r#listen_interval; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#band_mode; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_ConnectAP { + pub r#resp: i32, + pub r#mac: ::micropb::heapless::Vec, + pub r#band_mode: i32, +} +impl CtrlMsg_Resp_ConnectAP { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `mac` + #[inline] + pub fn r#mac(&self) -> &::micropb::heapless::Vec { + &self.r#mac + } + ///Return a mutable reference to `mac` + #[inline] + pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#mac + } + ///Set the value of `mac` + #[inline] + pub fn set_mac(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#mac = value.into(); + self + } + ///Builder method that sets the value of `mac`. Useful for initializing the message. + #[inline] + pub fn init_mac(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#mac = value.into(); + self + } + ///Return a reference to `band_mode` + #[inline] + pub fn r#band_mode(&self) -> &i32 { + &self.r#band_mode + } + ///Return a mutable reference to `band_mode` + #[inline] + pub fn mut_band_mode(&mut self) -> &mut i32 { + &mut self.r#band_mode + } + ///Set the value of `band_mode` + #[inline] + pub fn set_band_mode(&mut self, value: i32) -> &mut Self { + self.r#band_mode = value.into(); + self + } + ///Builder method that sets the value of `band_mode`. Useful for initializing the message. + #[inline] + pub fn init_band_mode(mut self, value: i32) -> Self { + self.r#band_mode = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_ConnectAP { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#mac; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 3u32 => { + let mut_ref = &mut self.r#band_mode; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_ConnectAP { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#band_mode; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#band_mode; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_GetSoftAPConfig {} +impl CtrlMsg_Req_GetSoftAPConfig {} +impl ::micropb::MessageDecode for CtrlMsg_Req_GetSoftAPConfig { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_GetSoftAPConfig { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_GetSoftAPConfig { + pub r#ssid: ::micropb::heapless::Vec, + pub r#pwd: ::micropb::heapless::Vec, + pub r#chnl: i32, + pub r#sec_prot: Ctrl_WifiSecProt, + pub r#max_conn: i32, + pub r#ssid_hidden: bool, + pub r#bw: i32, + pub r#resp: i32, + pub r#band_mode: i32, +} +impl CtrlMsg_Resp_GetSoftAPConfig { + ///Return a reference to `ssid` + #[inline] + pub fn r#ssid(&self) -> &::micropb::heapless::Vec { + &self.r#ssid + } + ///Return a mutable reference to `ssid` + #[inline] + pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#ssid + } + ///Set the value of `ssid` + #[inline] + pub fn set_ssid(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#ssid = value.into(); + self + } + ///Builder method that sets the value of `ssid`. Useful for initializing the message. + #[inline] + pub fn init_ssid(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#ssid = value.into(); + self + } + ///Return a reference to `pwd` + #[inline] + pub fn r#pwd(&self) -> &::micropb::heapless::Vec { + &self.r#pwd + } + ///Return a mutable reference to `pwd` + #[inline] + pub fn mut_pwd(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#pwd + } + ///Set the value of `pwd` + #[inline] + pub fn set_pwd(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#pwd = value.into(); + self + } + ///Builder method that sets the value of `pwd`. Useful for initializing the message. + #[inline] + pub fn init_pwd(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#pwd = value.into(); + self + } + ///Return a reference to `chnl` + #[inline] + pub fn r#chnl(&self) -> &i32 { + &self.r#chnl + } + ///Return a mutable reference to `chnl` + #[inline] + pub fn mut_chnl(&mut self) -> &mut i32 { + &mut self.r#chnl + } + ///Set the value of `chnl` + #[inline] + pub fn set_chnl(&mut self, value: i32) -> &mut Self { + self.r#chnl = value.into(); + self + } + ///Builder method that sets the value of `chnl`. Useful for initializing the message. + #[inline] + pub fn init_chnl(mut self, value: i32) -> Self { + self.r#chnl = value.into(); + self + } + ///Return a reference to `sec_prot` + #[inline] + pub fn r#sec_prot(&self) -> &Ctrl_WifiSecProt { + &self.r#sec_prot + } + ///Return a mutable reference to `sec_prot` + #[inline] + pub fn mut_sec_prot(&mut self) -> &mut Ctrl_WifiSecProt { + &mut self.r#sec_prot + } + ///Set the value of `sec_prot` + #[inline] + pub fn set_sec_prot(&mut self, value: Ctrl_WifiSecProt) -> &mut Self { + self.r#sec_prot = value.into(); + self + } + ///Builder method that sets the value of `sec_prot`. Useful for initializing the message. + #[inline] + pub fn init_sec_prot(mut self, value: Ctrl_WifiSecProt) -> Self { + self.r#sec_prot = value.into(); + self + } + ///Return a reference to `max_conn` + #[inline] + pub fn r#max_conn(&self) -> &i32 { + &self.r#max_conn + } + ///Return a mutable reference to `max_conn` + #[inline] + pub fn mut_max_conn(&mut self) -> &mut i32 { + &mut self.r#max_conn + } + ///Set the value of `max_conn` + #[inline] + pub fn set_max_conn(&mut self, value: i32) -> &mut Self { + self.r#max_conn = value.into(); + self + } + ///Builder method that sets the value of `max_conn`. Useful for initializing the message. + #[inline] + pub fn init_max_conn(mut self, value: i32) -> Self { + self.r#max_conn = value.into(); + self + } + ///Return a reference to `ssid_hidden` + #[inline] + pub fn r#ssid_hidden(&self) -> &bool { + &self.r#ssid_hidden + } + ///Return a mutable reference to `ssid_hidden` + #[inline] + pub fn mut_ssid_hidden(&mut self) -> &mut bool { + &mut self.r#ssid_hidden + } + ///Set the value of `ssid_hidden` + #[inline] + pub fn set_ssid_hidden(&mut self, value: bool) -> &mut Self { + self.r#ssid_hidden = value.into(); + self + } + ///Builder method that sets the value of `ssid_hidden`. Useful for initializing the message. + #[inline] + pub fn init_ssid_hidden(mut self, value: bool) -> Self { + self.r#ssid_hidden = value.into(); + self + } + ///Return a reference to `bw` + #[inline] + pub fn r#bw(&self) -> &i32 { + &self.r#bw + } + ///Return a mutable reference to `bw` + #[inline] + pub fn mut_bw(&mut self) -> &mut i32 { + &mut self.r#bw + } + ///Set the value of `bw` + #[inline] + pub fn set_bw(&mut self, value: i32) -> &mut Self { + self.r#bw = value.into(); + self + } + ///Builder method that sets the value of `bw`. Useful for initializing the message. + #[inline] + pub fn init_bw(mut self, value: i32) -> Self { + self.r#bw = value.into(); + self + } + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `band_mode` + #[inline] + pub fn r#band_mode(&self) -> &i32 { + &self.r#band_mode + } + ///Return a mutable reference to `band_mode` + #[inline] + pub fn mut_band_mode(&mut self) -> &mut i32 { + &mut self.r#band_mode + } + ///Set the value of `band_mode` + #[inline] + pub fn set_band_mode(&mut self, value: i32) -> &mut Self { + self.r#band_mode = value.into(); + self + } + ///Builder method that sets the value of `band_mode`. Useful for initializing the message. + #[inline] + pub fn init_band_mode(mut self, value: i32) -> Self { + self.r#band_mode = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_GetSoftAPConfig { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#ssid; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 2u32 => { + let mut_ref = &mut self.r#pwd; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 3u32 => { + let mut_ref = &mut self.r#chnl; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#sec_prot; + { + let val = decoder.decode_int32().map(|n| Ctrl_WifiSecProt(n as _))?; + let val_ref = &val; + if val_ref.0 != 0 { + *mut_ref = val as _; + } + }; + } + 5u32 => { + let mut_ref = &mut self.r#max_conn; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 6u32 => { + let mut_ref = &mut self.r#ssid_hidden; + { + let val = decoder.decode_bool()?; + let val_ref = &val; + if *val_ref { + *mut_ref = val as _; + } + }; + } + 7u32 => { + let mut_ref = &mut self.r#bw; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 8u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 9u32 => { + let mut_ref = &mut self.r#band_mode; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_GetSoftAPConfig { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(Ctrl_WifiSecProt::_MAX_SIZE), |size| size + + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + encoder.encode_varint32(10u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#pwd; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#chnl; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#sec_prot; + if val_ref.0 != 0 { + encoder.encode_varint32(32u32)?; + encoder.encode_int32(val_ref.0 as _)?; + } + } + { + let val_ref = &self.r#max_conn; + if *val_ref != 0 { + encoder.encode_varint32(40u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#ssid_hidden; + if *val_ref { + encoder.encode_varint32(48u32)?; + encoder.encode_bool(*val_ref)?; + } + } + { + let val_ref = &self.r#bw; + if *val_ref != 0 { + encoder.encode_varint32(56u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(64u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#band_mode; + if *val_ref != 0 { + encoder.encode_varint32(72u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#pwd; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#chnl; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#sec_prot; + if val_ref.0 != 0 { + size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _); + } + } + { + let val_ref = &self.r#max_conn; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#ssid_hidden; + if *val_ref { + size += 1usize + 1; + } + } + { + let val_ref = &self.r#bw; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#band_mode; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_StartSoftAP { + pub r#ssid: ::micropb::heapless::String<32>, + pub r#pwd: ::micropb::heapless::String<32>, + pub r#chnl: i32, + pub r#sec_prot: Ctrl_WifiSecProt, + pub r#max_conn: i32, + pub r#ssid_hidden: bool, + pub r#bw: i32, + pub r#band_mode: i32, +} +impl CtrlMsg_Req_StartSoftAP { + ///Return a reference to `ssid` + #[inline] + pub fn r#ssid(&self) -> &::micropb::heapless::String<32> { + &self.r#ssid + } + ///Return a mutable reference to `ssid` + #[inline] + pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::String<32> { + &mut self.r#ssid + } + ///Set the value of `ssid` + #[inline] + pub fn set_ssid(&mut self, value: ::micropb::heapless::String<32>) -> &mut Self { + self.r#ssid = value.into(); + self + } + ///Builder method that sets the value of `ssid`. Useful for initializing the message. + #[inline] + pub fn init_ssid(mut self, value: ::micropb::heapless::String<32>) -> Self { + self.r#ssid = value.into(); + self + } + ///Return a reference to `pwd` + #[inline] + pub fn r#pwd(&self) -> &::micropb::heapless::String<32> { + &self.r#pwd + } + ///Return a mutable reference to `pwd` + #[inline] + pub fn mut_pwd(&mut self) -> &mut ::micropb::heapless::String<32> { + &mut self.r#pwd + } + ///Set the value of `pwd` + #[inline] + pub fn set_pwd(&mut self, value: ::micropb::heapless::String<32>) -> &mut Self { + self.r#pwd = value.into(); + self + } + ///Builder method that sets the value of `pwd`. Useful for initializing the message. + #[inline] + pub fn init_pwd(mut self, value: ::micropb::heapless::String<32>) -> Self { + self.r#pwd = value.into(); + self + } + ///Return a reference to `chnl` + #[inline] + pub fn r#chnl(&self) -> &i32 { + &self.r#chnl + } + ///Return a mutable reference to `chnl` + #[inline] + pub fn mut_chnl(&mut self) -> &mut i32 { + &mut self.r#chnl + } + ///Set the value of `chnl` + #[inline] + pub fn set_chnl(&mut self, value: i32) -> &mut Self { + self.r#chnl = value.into(); + self + } + ///Builder method that sets the value of `chnl`. Useful for initializing the message. + #[inline] + pub fn init_chnl(mut self, value: i32) -> Self { + self.r#chnl = value.into(); + self + } + ///Return a reference to `sec_prot` + #[inline] + pub fn r#sec_prot(&self) -> &Ctrl_WifiSecProt { + &self.r#sec_prot + } + ///Return a mutable reference to `sec_prot` + #[inline] + pub fn mut_sec_prot(&mut self) -> &mut Ctrl_WifiSecProt { + &mut self.r#sec_prot + } + ///Set the value of `sec_prot` + #[inline] + pub fn set_sec_prot(&mut self, value: Ctrl_WifiSecProt) -> &mut Self { + self.r#sec_prot = value.into(); + self + } + ///Builder method that sets the value of `sec_prot`. Useful for initializing the message. + #[inline] + pub fn init_sec_prot(mut self, value: Ctrl_WifiSecProt) -> Self { + self.r#sec_prot = value.into(); + self + } + ///Return a reference to `max_conn` + #[inline] + pub fn r#max_conn(&self) -> &i32 { + &self.r#max_conn + } + ///Return a mutable reference to `max_conn` + #[inline] + pub fn mut_max_conn(&mut self) -> &mut i32 { + &mut self.r#max_conn + } + ///Set the value of `max_conn` + #[inline] + pub fn set_max_conn(&mut self, value: i32) -> &mut Self { + self.r#max_conn = value.into(); + self + } + ///Builder method that sets the value of `max_conn`. Useful for initializing the message. + #[inline] + pub fn init_max_conn(mut self, value: i32) -> Self { + self.r#max_conn = value.into(); + self + } + ///Return a reference to `ssid_hidden` + #[inline] + pub fn r#ssid_hidden(&self) -> &bool { + &self.r#ssid_hidden + } + ///Return a mutable reference to `ssid_hidden` + #[inline] + pub fn mut_ssid_hidden(&mut self) -> &mut bool { + &mut self.r#ssid_hidden + } + ///Set the value of `ssid_hidden` + #[inline] + pub fn set_ssid_hidden(&mut self, value: bool) -> &mut Self { + self.r#ssid_hidden = value.into(); + self + } + ///Builder method that sets the value of `ssid_hidden`. Useful for initializing the message. + #[inline] + pub fn init_ssid_hidden(mut self, value: bool) -> Self { + self.r#ssid_hidden = value.into(); + self + } + ///Return a reference to `bw` + #[inline] + pub fn r#bw(&self) -> &i32 { + &self.r#bw + } + ///Return a mutable reference to `bw` + #[inline] + pub fn mut_bw(&mut self) -> &mut i32 { + &mut self.r#bw + } + ///Set the value of `bw` + #[inline] + pub fn set_bw(&mut self, value: i32) -> &mut Self { + self.r#bw = value.into(); + self + } + ///Builder method that sets the value of `bw`. Useful for initializing the message. + #[inline] + pub fn init_bw(mut self, value: i32) -> Self { + self.r#bw = value.into(); + self + } + ///Return a reference to `band_mode` + #[inline] + pub fn r#band_mode(&self) -> &i32 { + &self.r#band_mode + } + ///Return a mutable reference to `band_mode` + #[inline] + pub fn mut_band_mode(&mut self) -> &mut i32 { + &mut self.r#band_mode + } + ///Set the value of `band_mode` + #[inline] + pub fn set_band_mode(&mut self, value: i32) -> &mut Self { + self.r#band_mode = value.into(); + self + } + ///Builder method that sets the value of `band_mode`. Useful for initializing the message. + #[inline] + pub fn init_band_mode(mut self, value: i32) -> Self { + self.r#band_mode = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_StartSoftAP { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#ssid; + { + decoder.decode_string(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 2u32 => { + let mut_ref = &mut self.r#pwd; + { + decoder.decode_string(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 3u32 => { + let mut_ref = &mut self.r#chnl; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#sec_prot; + { + let val = decoder.decode_int32().map(|n| Ctrl_WifiSecProt(n as _))?; + let val_ref = &val; + if val_ref.0 != 0 { + *mut_ref = val as _; + } + }; + } + 5u32 => { + let mut_ref = &mut self.r#max_conn; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 6u32 => { + let mut_ref = &mut self.r#ssid_hidden; + { + let val = decoder.decode_bool()?; + let val_ref = &val; + if *val_ref { + *mut_ref = val as _; + } + }; + } + 7u32 => { + let mut_ref = &mut self.r#bw; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 8u32 => { + let mut_ref = &mut self.r#band_mode; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_StartSoftAP { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(Ctrl_WifiSecProt::_MAX_SIZE), |size| size + + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + encoder.encode_varint32(10u32)?; + encoder.encode_string(val_ref)?; + } + } + { + let val_ref = &self.r#pwd; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_string(val_ref)?; + } + } + { + let val_ref = &self.r#chnl; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#sec_prot; + if val_ref.0 != 0 { + encoder.encode_varint32(32u32)?; + encoder.encode_int32(val_ref.0 as _)?; + } + } + { + let val_ref = &self.r#max_conn; + if *val_ref != 0 { + encoder.encode_varint32(40u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#ssid_hidden; + if *val_ref { + encoder.encode_varint32(48u32)?; + encoder.encode_bool(*val_ref)?; + } + } + { + let val_ref = &self.r#bw; + if *val_ref != 0 { + encoder.encode_varint32(56u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#band_mode; + if *val_ref != 0 { + encoder.encode_varint32(64u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#pwd; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#chnl; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#sec_prot; + if val_ref.0 != 0 { + size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _); + } + } + { + let val_ref = &self.r#max_conn; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#ssid_hidden; + if *val_ref { + size += 1usize + 1; + } + } + { + let val_ref = &self.r#bw; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#band_mode; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_StartSoftAP { + pub r#resp: i32, + pub r#mac: ::micropb::heapless::Vec, + pub r#band_mode: i32, +} +impl CtrlMsg_Resp_StartSoftAP { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `mac` + #[inline] + pub fn r#mac(&self) -> &::micropb::heapless::Vec { + &self.r#mac + } + ///Return a mutable reference to `mac` + #[inline] + pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#mac + } + ///Set the value of `mac` + #[inline] + pub fn set_mac(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#mac = value.into(); + self + } + ///Builder method that sets the value of `mac`. Useful for initializing the message. + #[inline] + pub fn init_mac(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#mac = value.into(); + self + } + ///Return a reference to `band_mode` + #[inline] + pub fn r#band_mode(&self) -> &i32 { + &self.r#band_mode + } + ///Return a mutable reference to `band_mode` + #[inline] + pub fn mut_band_mode(&mut self) -> &mut i32 { + &mut self.r#band_mode + } + ///Set the value of `band_mode` + #[inline] + pub fn set_band_mode(&mut self, value: i32) -> &mut Self { + self.r#band_mode = value.into(); + self + } + ///Builder method that sets the value of `band_mode`. Useful for initializing the message. + #[inline] + pub fn init_band_mode(mut self, value: i32) -> Self { + self.r#band_mode = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_StartSoftAP { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#mac; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 3u32 => { + let mut_ref = &mut self.r#band_mode; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_StartSoftAP { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#band_mode; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#band_mode; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_ScanResult {} +impl CtrlMsg_Req_ScanResult {} +impl ::micropb::MessageDecode for CtrlMsg_Req_ScanResult { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_ScanResult { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_ScanResult { + pub r#count: u32, + pub r#entries: ::micropb::heapless::Vec, + pub r#resp: i32, +} +impl CtrlMsg_Resp_ScanResult { + ///Return a reference to `count` + #[inline] + pub fn r#count(&self) -> &u32 { + &self.r#count + } + ///Return a mutable reference to `count` + #[inline] + pub fn mut_count(&mut self) -> &mut u32 { + &mut self.r#count + } + ///Set the value of `count` + #[inline] + pub fn set_count(&mut self, value: u32) -> &mut Self { + self.r#count = value.into(); + self + } + ///Builder method that sets the value of `count`. Useful for initializing the message. + #[inline] + pub fn init_count(mut self, value: u32) -> Self { + self.r#count = value.into(); + self + } + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_ScanResult { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#count; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut val: ScanResult = ::core::default::Default::default(); + let mut_ref = &mut val; + { + mut_ref.decode_len_delimited(decoder)?; + }; + if let (Err(_), false) = (self.r#entries.pb_push(val), decoder.ignore_repeated_cap_err) { + return Err(::micropb::DecodeError::Capacity); + } + } + 3u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_ScanResult { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| (size + 1usize) * 16usize + ) { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#count; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + for val_ref in self.r#entries.iter() { + encoder.encode_varint32(18u32)?; + val_ref.encode_len_delimited(encoder)?; + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#count; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + for val_ref in self.r#entries.iter() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_SoftAPConnectedSTA {} +impl CtrlMsg_Req_SoftAPConnectedSTA {} +impl ::micropb::MessageDecode for CtrlMsg_Req_SoftAPConnectedSTA { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_SoftAPConnectedSTA { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_SoftAPConnectedSTA { + pub r#num: u32, + pub r#stations: ::micropb::heapless::Vec, + pub r#resp: i32, +} +impl CtrlMsg_Resp_SoftAPConnectedSTA { + ///Return a reference to `num` + #[inline] + pub fn r#num(&self) -> &u32 { + &self.r#num + } + ///Return a mutable reference to `num` + #[inline] + pub fn mut_num(&mut self) -> &mut u32 { + &mut self.r#num + } + ///Set the value of `num` + #[inline] + pub fn set_num(&mut self, value: u32) -> &mut Self { + self.r#num = value.into(); + self + } + ///Builder method that sets the value of `num`. Useful for initializing the message. + #[inline] + pub fn init_num(mut self, value: u32) -> Self { + self.r#num = value.into(); + self + } + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_SoftAPConnectedSTA { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#num; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut val: ConnectedSTAList = ::core::default::Default::default(); + let mut_ref = &mut val; + { + mut_ref.decode_len_delimited(decoder)?; + }; + if let (Err(_), false) = (self.r#stations.pb_push(val), decoder.ignore_repeated_cap_err) { + return Err(::micropb::DecodeError::Capacity); + } + } + 3u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_SoftAPConnectedSTA { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| (size + 1usize) * 16usize + ) { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#num; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + for val_ref in self.r#stations.iter() { + encoder.encode_varint32(18u32)?; + val_ref.encode_len_delimited(encoder)?; + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#num; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + for val_ref in self.r#stations.iter() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_OTABegin {} +impl CtrlMsg_Req_OTABegin {} +impl ::micropb::MessageDecode for CtrlMsg_Req_OTABegin { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_OTABegin { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_OTABegin { + pub r#resp: i32, +} +impl CtrlMsg_Resp_OTABegin { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_OTABegin { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_OTABegin { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_OTAWrite { + pub r#ota_data: ::micropb::heapless::Vec, +} +impl CtrlMsg_Req_OTAWrite { + ///Return a reference to `ota_data` + #[inline] + pub fn r#ota_data(&self) -> &::micropb::heapless::Vec { + &self.r#ota_data + } + ///Return a mutable reference to `ota_data` + #[inline] + pub fn mut_ota_data(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#ota_data + } + ///Set the value of `ota_data` + #[inline] + pub fn set_ota_data(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#ota_data = value.into(); + self + } + ///Builder method that sets the value of `ota_data`. Useful for initializing the message. + #[inline] + pub fn init_ota_data(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#ota_data = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_OTAWrite { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#ota_data; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_OTAWrite { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(1026usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#ota_data; + if !val_ref.is_empty() { + encoder.encode_varint32(10u32)?; + encoder.encode_bytes(val_ref)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#ota_data; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_OTAWrite { + pub r#resp: i32, +} +impl CtrlMsg_Resp_OTAWrite { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_OTAWrite { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_OTAWrite { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_OTAEnd {} +impl CtrlMsg_Req_OTAEnd {} +impl ::micropb::MessageDecode for CtrlMsg_Req_OTAEnd { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_OTAEnd { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_OTAEnd { + pub r#resp: i32, +} +impl CtrlMsg_Resp_OTAEnd { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_OTAEnd { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_OTAEnd { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_VendorIEData { + pub r#element_id: i32, + pub r#length: i32, + pub r#vendor_oui: ::micropb::heapless::Vec, + pub r#vendor_oui_type: i32, + pub r#payload: ::micropb::heapless::Vec, +} +impl CtrlMsg_Req_VendorIEData { + ///Return a reference to `element_id` + #[inline] + pub fn r#element_id(&self) -> &i32 { + &self.r#element_id + } + ///Return a mutable reference to `element_id` + #[inline] + pub fn mut_element_id(&mut self) -> &mut i32 { + &mut self.r#element_id + } + ///Set the value of `element_id` + #[inline] + pub fn set_element_id(&mut self, value: i32) -> &mut Self { + self.r#element_id = value.into(); + self + } + ///Builder method that sets the value of `element_id`. Useful for initializing the message. + #[inline] + pub fn init_element_id(mut self, value: i32) -> Self { + self.r#element_id = value.into(); + self + } + ///Return a reference to `length` + #[inline] + pub fn r#length(&self) -> &i32 { + &self.r#length + } + ///Return a mutable reference to `length` + #[inline] + pub fn mut_length(&mut self) -> &mut i32 { + &mut self.r#length + } + ///Set the value of `length` + #[inline] + pub fn set_length(&mut self, value: i32) -> &mut Self { + self.r#length = value.into(); + self + } + ///Builder method that sets the value of `length`. Useful for initializing the message. + #[inline] + pub fn init_length(mut self, value: i32) -> Self { + self.r#length = value.into(); + self + } + ///Return a reference to `vendor_oui` + #[inline] + pub fn r#vendor_oui(&self) -> &::micropb::heapless::Vec { + &self.r#vendor_oui + } + ///Return a mutable reference to `vendor_oui` + #[inline] + pub fn mut_vendor_oui(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#vendor_oui + } + ///Set the value of `vendor_oui` + #[inline] + pub fn set_vendor_oui(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#vendor_oui = value.into(); + self + } + ///Builder method that sets the value of `vendor_oui`. Useful for initializing the message. + #[inline] + pub fn init_vendor_oui(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#vendor_oui = value.into(); + self + } + ///Return a reference to `vendor_oui_type` + #[inline] + pub fn r#vendor_oui_type(&self) -> &i32 { + &self.r#vendor_oui_type + } + ///Return a mutable reference to `vendor_oui_type` + #[inline] + pub fn mut_vendor_oui_type(&mut self) -> &mut i32 { + &mut self.r#vendor_oui_type + } + ///Set the value of `vendor_oui_type` + #[inline] + pub fn set_vendor_oui_type(&mut self, value: i32) -> &mut Self { + self.r#vendor_oui_type = value.into(); + self + } + ///Builder method that sets the value of `vendor_oui_type`. Useful for initializing the message. + #[inline] + pub fn init_vendor_oui_type(mut self, value: i32) -> Self { + self.r#vendor_oui_type = value.into(); + self + } + ///Return a reference to `payload` + #[inline] + pub fn r#payload(&self) -> &::micropb::heapless::Vec { + &self.r#payload + } + ///Return a mutable reference to `payload` + #[inline] + pub fn mut_payload(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#payload + } + ///Set the value of `payload` + #[inline] + pub fn set_payload(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#payload = value.into(); + self + } + ///Builder method that sets the value of `payload`. Useful for initializing the message. + #[inline] + pub fn init_payload(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#payload = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_VendorIEData { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#element_id; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#length; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 3u32 => { + let mut_ref = &mut self.r#vendor_oui; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 4u32 => { + let mut_ref = &mut self.r#vendor_oui_type; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 5u32 => { + let mut_ref = &mut self.r#payload; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_VendorIEData { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(65usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#element_id; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#length; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#vendor_oui; + if !val_ref.is_empty() { + encoder.encode_varint32(26u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#vendor_oui_type; + if *val_ref != 0 { + encoder.encode_varint32(32u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#payload; + if !val_ref.is_empty() { + encoder.encode_varint32(42u32)?; + encoder.encode_bytes(val_ref)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#element_id; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#length; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#vendor_oui; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#vendor_oui_type; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#payload; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + size + } +} +pub mod CtrlMsg_Req_SetSoftAPVendorSpecificIE_ { + #[derive(Debug, Default, PartialEq, Clone)] + #[cfg_attr(feature = "defmt", derive(defmt::Format))] + pub struct _Hazzer([u8; 1]); + impl _Hazzer { + ///New hazzer with all fields set to off + #[inline] + pub const fn _new() -> Self { + Self([0; 1]) + } + ///Query presence of `vendor_ie_data` + #[inline] + pub const fn r#vendor_ie_data(&self) -> bool { + (self.0[0] & 1) != 0 + } + ///Set presence of `vendor_ie_data` + #[inline] + pub const fn set_vendor_ie_data(&mut self) -> &mut Self { + let elem = &mut self.0[0]; + *elem |= 1; + self + } + ///Clear presence of `vendor_ie_data` + #[inline] + pub const fn clear_vendor_ie_data(&mut self) -> &mut Self { + let elem = &mut self.0[0]; + *elem &= !1; + self + } + ///Builder method that sets the presence of `vendor_ie_data`. Useful for initializing the Hazzer. + #[inline] + pub const fn init_vendor_ie_data(mut self) -> Self { + self.set_vendor_ie_data(); + self + } + } +} +#[derive(Debug, Default, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_SetSoftAPVendorSpecificIE { + pub r#enable: bool, + pub r#type: Ctrl_VendorIEType, + pub r#idx: Ctrl_VendorIEID, + pub r#vendor_ie_data: CtrlMsg_Req_VendorIEData, + pub _has: CtrlMsg_Req_SetSoftAPVendorSpecificIE_::_Hazzer, +} +impl ::core::cmp::PartialEq for CtrlMsg_Req_SetSoftAPVendorSpecificIE { + fn eq(&self, other: &Self) -> bool { + let mut ret = true; + ret &= (self.r#enable == other.r#enable); + ret &= (self.r#type == other.r#type); + ret &= (self.r#idx == other.r#idx); + ret &= (self.r#vendor_ie_data() == other.r#vendor_ie_data()); + ret + } +} +impl CtrlMsg_Req_SetSoftAPVendorSpecificIE { + ///Return a reference to `enable` + #[inline] + pub fn r#enable(&self) -> &bool { + &self.r#enable + } + ///Return a mutable reference to `enable` + #[inline] + pub fn mut_enable(&mut self) -> &mut bool { + &mut self.r#enable + } + ///Set the value of `enable` + #[inline] + pub fn set_enable(&mut self, value: bool) -> &mut Self { + self.r#enable = value.into(); + self + } + ///Builder method that sets the value of `enable`. Useful for initializing the message. + #[inline] + pub fn init_enable(mut self, value: bool) -> Self { + self.r#enable = value.into(); + self + } + ///Return a reference to `type` + #[inline] + pub fn r#type(&self) -> &Ctrl_VendorIEType { + &self.r#type + } + ///Return a mutable reference to `type` + #[inline] + pub fn mut_type(&mut self) -> &mut Ctrl_VendorIEType { + &mut self.r#type + } + ///Set the value of `type` + #[inline] + pub fn set_type(&mut self, value: Ctrl_VendorIEType) -> &mut Self { + self.r#type = value.into(); + self + } + ///Builder method that sets the value of `type`. Useful for initializing the message. + #[inline] + pub fn init_type(mut self, value: Ctrl_VendorIEType) -> Self { + self.r#type = value.into(); + self + } + ///Return a reference to `idx` + #[inline] + pub fn r#idx(&self) -> &Ctrl_VendorIEID { + &self.r#idx + } + ///Return a mutable reference to `idx` + #[inline] + pub fn mut_idx(&mut self) -> &mut Ctrl_VendorIEID { + &mut self.r#idx + } + ///Set the value of `idx` + #[inline] + pub fn set_idx(&mut self, value: Ctrl_VendorIEID) -> &mut Self { + self.r#idx = value.into(); + self + } + ///Builder method that sets the value of `idx`. Useful for initializing the message. + #[inline] + pub fn init_idx(mut self, value: Ctrl_VendorIEID) -> Self { + self.r#idx = value.into(); + self + } + ///Return a reference to `vendor_ie_data` as an `Option` + #[inline] + pub fn r#vendor_ie_data(&self) -> ::core::option::Option<&CtrlMsg_Req_VendorIEData> { + self._has.r#vendor_ie_data().then_some(&self.r#vendor_ie_data) + } + ///Set the value and presence of `vendor_ie_data` + #[inline] + pub fn set_vendor_ie_data(&mut self, value: CtrlMsg_Req_VendorIEData) -> &mut Self { + self._has.set_vendor_ie_data(); + self.r#vendor_ie_data = value.into(); + self + } + ///Return a mutable reference to `vendor_ie_data` as an `Option` + #[inline] + pub fn mut_vendor_ie_data(&mut self) -> ::core::option::Option<&mut CtrlMsg_Req_VendorIEData> { + self._has.r#vendor_ie_data().then_some(&mut self.r#vendor_ie_data) + } + ///Clear the presence of `vendor_ie_data` + #[inline] + pub fn clear_vendor_ie_data(&mut self) -> &mut Self { + self._has.clear_vendor_ie_data(); + self + } + ///Take the value of `vendor_ie_data` and clear its presence + #[inline] + pub fn take_vendor_ie_data(&mut self) -> ::core::option::Option { + let val = self + ._has + .r#vendor_ie_data() + .then(|| ::core::mem::take(&mut self.r#vendor_ie_data)); + self._has.clear_vendor_ie_data(); + val + } + ///Builder method that sets the value of `vendor_ie_data`. Useful for initializing the message. + #[inline] + pub fn init_vendor_ie_data(mut self, value: CtrlMsg_Req_VendorIEData) -> Self { + self.set_vendor_ie_data(value); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_SetSoftAPVendorSpecificIE { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#enable; + { + let val = decoder.decode_bool()?; + let val_ref = &val; + if *val_ref { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#type; + { + let val = decoder.decode_int32().map(|n| Ctrl_VendorIEType(n as _))?; + let val_ref = &val; + if val_ref.0 != 0 { + *mut_ref = val as _; + } + }; + } + 3u32 => { + let mut_ref = &mut self.r#idx; + { + let val = decoder.decode_int32().map(|n| Ctrl_VendorIEID(n as _))?; + let val_ref = &val; + if val_ref.0 != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#vendor_ie_data; + { + mut_ref.decode_len_delimited(decoder)?; + }; + self._has.set_vendor_ie_data(); + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_SetSoftAPVendorSpecificIE { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(Ctrl_VendorIEType::_MAX_SIZE), |size| size + + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(Ctrl_VendorIEID::_MAX_SIZE), |size| size + + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 1usize + ) { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#enable; + if *val_ref { + encoder.encode_varint32(8u32)?; + encoder.encode_bool(*val_ref)?; + } + } + { + let val_ref = &self.r#type; + if val_ref.0 != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_int32(val_ref.0 as _)?; + } + } + { + let val_ref = &self.r#idx; + if val_ref.0 != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(val_ref.0 as _)?; + } + } + { + if let ::core::option::Option::Some(val_ref) = self.r#vendor_ie_data() { + encoder.encode_varint32(34u32)?; + val_ref.encode_len_delimited(encoder)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#enable; + if *val_ref { + size += 1usize + 1; + } + } + { + let val_ref = &self.r#type; + if val_ref.0 != 0 { + size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _); + } + } + { + let val_ref = &self.r#idx; + if val_ref.0 != 0 { + size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _); + } + } + { + if let ::core::option::Option::Some(val_ref) = self.r#vendor_ie_data() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_SetSoftAPVendorSpecificIE { + pub r#resp: i32, +} +impl CtrlMsg_Resp_SetSoftAPVendorSpecificIE { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_SetSoftAPVendorSpecificIE { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_SetSoftAPVendorSpecificIE { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_SetWifiMaxTxPower { + pub r#wifi_max_tx_power: i32, +} +impl CtrlMsg_Req_SetWifiMaxTxPower { + ///Return a reference to `wifi_max_tx_power` + #[inline] + pub fn r#wifi_max_tx_power(&self) -> &i32 { + &self.r#wifi_max_tx_power + } + ///Return a mutable reference to `wifi_max_tx_power` + #[inline] + pub fn mut_wifi_max_tx_power(&mut self) -> &mut i32 { + &mut self.r#wifi_max_tx_power + } + ///Set the value of `wifi_max_tx_power` + #[inline] + pub fn set_wifi_max_tx_power(&mut self, value: i32) -> &mut Self { + self.r#wifi_max_tx_power = value.into(); + self + } + ///Builder method that sets the value of `wifi_max_tx_power`. Useful for initializing the message. + #[inline] + pub fn init_wifi_max_tx_power(mut self, value: i32) -> Self { + self.r#wifi_max_tx_power = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_SetWifiMaxTxPower { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#wifi_max_tx_power; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_SetWifiMaxTxPower { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#wifi_max_tx_power; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#wifi_max_tx_power; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_SetWifiMaxTxPower { + pub r#resp: i32, +} +impl CtrlMsg_Resp_SetWifiMaxTxPower { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_SetWifiMaxTxPower { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_SetWifiMaxTxPower { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_GetWifiCurrTxPower {} +impl CtrlMsg_Req_GetWifiCurrTxPower {} +impl ::micropb::MessageDecode for CtrlMsg_Req_GetWifiCurrTxPower { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_GetWifiCurrTxPower { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_GetWifiCurrTxPower { + pub r#wifi_curr_tx_power: i32, + pub r#resp: i32, +} +impl CtrlMsg_Resp_GetWifiCurrTxPower { + ///Return a reference to `wifi_curr_tx_power` + #[inline] + pub fn r#wifi_curr_tx_power(&self) -> &i32 { + &self.r#wifi_curr_tx_power + } + ///Return a mutable reference to `wifi_curr_tx_power` + #[inline] + pub fn mut_wifi_curr_tx_power(&mut self) -> &mut i32 { + &mut self.r#wifi_curr_tx_power + } + ///Set the value of `wifi_curr_tx_power` + #[inline] + pub fn set_wifi_curr_tx_power(&mut self, value: i32) -> &mut Self { + self.r#wifi_curr_tx_power = value.into(); + self + } + ///Builder method that sets the value of `wifi_curr_tx_power`. Useful for initializing the message. + #[inline] + pub fn init_wifi_curr_tx_power(mut self, value: i32) -> Self { + self.r#wifi_curr_tx_power = value.into(); + self + } + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_GetWifiCurrTxPower { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#wifi_curr_tx_power; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_GetWifiCurrTxPower { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#wifi_curr_tx_power; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#wifi_curr_tx_power; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_ConfigHeartbeat { + pub r#enable: bool, + pub r#duration: i32, +} +impl CtrlMsg_Req_ConfigHeartbeat { + ///Return a reference to `enable` + #[inline] + pub fn r#enable(&self) -> &bool { + &self.r#enable + } + ///Return a mutable reference to `enable` + #[inline] + pub fn mut_enable(&mut self) -> &mut bool { + &mut self.r#enable + } + ///Set the value of `enable` + #[inline] + pub fn set_enable(&mut self, value: bool) -> &mut Self { + self.r#enable = value.into(); + self + } + ///Builder method that sets the value of `enable`. Useful for initializing the message. + #[inline] + pub fn init_enable(mut self, value: bool) -> Self { + self.r#enable = value.into(); + self + } + ///Return a reference to `duration` + #[inline] + pub fn r#duration(&self) -> &i32 { + &self.r#duration + } + ///Return a mutable reference to `duration` + #[inline] + pub fn mut_duration(&mut self) -> &mut i32 { + &mut self.r#duration + } + ///Set the value of `duration` + #[inline] + pub fn set_duration(&mut self, value: i32) -> &mut Self { + self.r#duration = value.into(); + self + } + ///Builder method that sets the value of `duration`. Useful for initializing the message. + #[inline] + pub fn init_duration(mut self, value: i32) -> Self { + self.r#duration = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_ConfigHeartbeat { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#enable; + { + let val = decoder.decode_bool()?; + let val_ref = &val; + if *val_ref { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#duration; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_ConfigHeartbeat { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#enable; + if *val_ref { + encoder.encode_varint32(8u32)?; + encoder.encode_bool(*val_ref)?; + } + } + { + let val_ref = &self.r#duration; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#enable; + if *val_ref { + size += 1usize + 1; + } + } + { + let val_ref = &self.r#duration; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_ConfigHeartbeat { + pub r#resp: i32, +} +impl CtrlMsg_Resp_ConfigHeartbeat { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_ConfigHeartbeat { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_ConfigHeartbeat { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_EnableDisable { + pub r#feature: u32, + pub r#enable: bool, +} +impl CtrlMsg_Req_EnableDisable { + ///Return a reference to `feature` + #[inline] + pub fn r#feature(&self) -> &u32 { + &self.r#feature + } + ///Return a mutable reference to `feature` + #[inline] + pub fn mut_feature(&mut self) -> &mut u32 { + &mut self.r#feature + } + ///Set the value of `feature` + #[inline] + pub fn set_feature(&mut self, value: u32) -> &mut Self { + self.r#feature = value.into(); + self + } + ///Builder method that sets the value of `feature`. Useful for initializing the message. + #[inline] + pub fn init_feature(mut self, value: u32) -> Self { + self.r#feature = value.into(); + self + } + ///Return a reference to `enable` + #[inline] + pub fn r#enable(&self) -> &bool { + &self.r#enable + } + ///Return a mutable reference to `enable` + #[inline] + pub fn mut_enable(&mut self) -> &mut bool { + &mut self.r#enable + } + ///Set the value of `enable` + #[inline] + pub fn set_enable(&mut self, value: bool) -> &mut Self { + self.r#enable = value.into(); + self + } + ///Builder method that sets the value of `enable`. Useful for initializing the message. + #[inline] + pub fn init_enable(mut self, value: bool) -> Self { + self.r#enable = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_EnableDisable { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#feature; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#enable; + { + let val = decoder.decode_bool()?; + let val_ref = &val; + if *val_ref { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_EnableDisable { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#feature; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#enable; + if *val_ref { + encoder.encode_varint32(16u32)?; + encoder.encode_bool(*val_ref)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#feature; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#enable; + if *val_ref { + size += 1usize + 1; + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_EnableDisable { + pub r#resp: i32, +} +impl CtrlMsg_Resp_EnableDisable { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_EnableDisable { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_EnableDisable { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_GetFwVersion {} +impl CtrlMsg_Req_GetFwVersion {} +impl ::micropb::MessageDecode for CtrlMsg_Req_GetFwVersion { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_GetFwVersion { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_GetFwVersion { + pub r#resp: i32, + pub r#name: ::micropb::heapless::String<32>, + pub r#major1: u32, + pub r#major2: u32, + pub r#minor: u32, + pub r#rev_patch1: u32, + pub r#rev_patch2: u32, +} +impl CtrlMsg_Resp_GetFwVersion { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `name` + #[inline] + pub fn r#name(&self) -> &::micropb::heapless::String<32> { + &self.r#name + } + ///Return a mutable reference to `name` + #[inline] + pub fn mut_name(&mut self) -> &mut ::micropb::heapless::String<32> { + &mut self.r#name + } + ///Set the value of `name` + #[inline] + pub fn set_name(&mut self, value: ::micropb::heapless::String<32>) -> &mut Self { + self.r#name = value.into(); + self + } + ///Builder method that sets the value of `name`. Useful for initializing the message. + #[inline] + pub fn init_name(mut self, value: ::micropb::heapless::String<32>) -> Self { + self.r#name = value.into(); + self + } + ///Return a reference to `major1` + #[inline] + pub fn r#major1(&self) -> &u32 { + &self.r#major1 + } + ///Return a mutable reference to `major1` + #[inline] + pub fn mut_major1(&mut self) -> &mut u32 { + &mut self.r#major1 + } + ///Set the value of `major1` + #[inline] + pub fn set_major1(&mut self, value: u32) -> &mut Self { + self.r#major1 = value.into(); + self + } + ///Builder method that sets the value of `major1`. Useful for initializing the message. + #[inline] + pub fn init_major1(mut self, value: u32) -> Self { + self.r#major1 = value.into(); + self + } + ///Return a reference to `major2` + #[inline] + pub fn r#major2(&self) -> &u32 { + &self.r#major2 + } + ///Return a mutable reference to `major2` + #[inline] + pub fn mut_major2(&mut self) -> &mut u32 { + &mut self.r#major2 + } + ///Set the value of `major2` + #[inline] + pub fn set_major2(&mut self, value: u32) -> &mut Self { + self.r#major2 = value.into(); + self + } + ///Builder method that sets the value of `major2`. Useful for initializing the message. + #[inline] + pub fn init_major2(mut self, value: u32) -> Self { + self.r#major2 = value.into(); + self + } + ///Return a reference to `minor` + #[inline] + pub fn r#minor(&self) -> &u32 { + &self.r#minor + } + ///Return a mutable reference to `minor` + #[inline] + pub fn mut_minor(&mut self) -> &mut u32 { + &mut self.r#minor + } + ///Set the value of `minor` + #[inline] + pub fn set_minor(&mut self, value: u32) -> &mut Self { + self.r#minor = value.into(); + self + } + ///Builder method that sets the value of `minor`. Useful for initializing the message. + #[inline] + pub fn init_minor(mut self, value: u32) -> Self { + self.r#minor = value.into(); + self + } + ///Return a reference to `rev_patch1` + #[inline] + pub fn r#rev_patch1(&self) -> &u32 { + &self.r#rev_patch1 + } + ///Return a mutable reference to `rev_patch1` + #[inline] + pub fn mut_rev_patch1(&mut self) -> &mut u32 { + &mut self.r#rev_patch1 + } + ///Set the value of `rev_patch1` + #[inline] + pub fn set_rev_patch1(&mut self, value: u32) -> &mut Self { + self.r#rev_patch1 = value.into(); + self + } + ///Builder method that sets the value of `rev_patch1`. Useful for initializing the message. + #[inline] + pub fn init_rev_patch1(mut self, value: u32) -> Self { + self.r#rev_patch1 = value.into(); + self + } + ///Return a reference to `rev_patch2` + #[inline] + pub fn r#rev_patch2(&self) -> &u32 { + &self.r#rev_patch2 + } + ///Return a mutable reference to `rev_patch2` + #[inline] + pub fn mut_rev_patch2(&mut self) -> &mut u32 { + &mut self.r#rev_patch2 + } + ///Set the value of `rev_patch2` + #[inline] + pub fn set_rev_patch2(&mut self, value: u32) -> &mut Self { + self.r#rev_patch2 = value.into(); + self + } + ///Builder method that sets the value of `rev_patch2`. Useful for initializing the message. + #[inline] + pub fn init_rev_patch2(mut self, value: u32) -> Self { + self.r#rev_patch2 = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_GetFwVersion { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#name; + { + decoder.decode_string(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 3u32 => { + let mut_ref = &mut self.r#major1; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#major2; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 5u32 => { + let mut_ref = &mut self.r#minor; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 6u32 => { + let mut_ref = &mut self.r#rev_patch1; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 7u32 => { + let mut_ref = &mut self.r#rev_patch2; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_GetFwVersion { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#name; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_string(val_ref)?; + } + } + { + let val_ref = &self.r#major1; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#major2; + if *val_ref != 0 { + encoder.encode_varint32(32u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#minor; + if *val_ref != 0 { + encoder.encode_varint32(40u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#rev_patch1; + if *val_ref != 0 { + encoder.encode_varint32(48u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#rev_patch2; + if *val_ref != 0 { + encoder.encode_varint32(56u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#name; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#major1; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#major2; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#minor; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#rev_patch1; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#rev_patch2; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_SetCountryCode { + pub r#country: ::micropb::heapless::Vec, + pub r#ieee80211d_enabled: bool, +} +impl CtrlMsg_Req_SetCountryCode { + ///Return a reference to `country` + #[inline] + pub fn r#country(&self) -> &::micropb::heapless::Vec { + &self.r#country + } + ///Return a mutable reference to `country` + #[inline] + pub fn mut_country(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#country + } + ///Set the value of `country` + #[inline] + pub fn set_country(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#country = value.into(); + self + } + ///Builder method that sets the value of `country`. Useful for initializing the message. + #[inline] + pub fn init_country(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#country = value.into(); + self + } + ///Return a reference to `ieee80211d_enabled` + #[inline] + pub fn r#ieee80211d_enabled(&self) -> &bool { + &self.r#ieee80211d_enabled + } + ///Return a mutable reference to `ieee80211d_enabled` + #[inline] + pub fn mut_ieee80211d_enabled(&mut self) -> &mut bool { + &mut self.r#ieee80211d_enabled + } + ///Set the value of `ieee80211d_enabled` + #[inline] + pub fn set_ieee80211d_enabled(&mut self, value: bool) -> &mut Self { + self.r#ieee80211d_enabled = value.into(); + self + } + ///Builder method that sets the value of `ieee80211d_enabled`. Useful for initializing the message. + #[inline] + pub fn init_ieee80211d_enabled(mut self, value: bool) -> Self { + self.r#ieee80211d_enabled = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_SetCountryCode { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#country; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 2u32 => { + let mut_ref = &mut self.r#ieee80211d_enabled; + { + let val = decoder.decode_bool()?; + let val_ref = &val; + if *val_ref { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_SetCountryCode { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#country; + if !val_ref.is_empty() { + encoder.encode_varint32(10u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#ieee80211d_enabled; + if *val_ref { + encoder.encode_varint32(16u32)?; + encoder.encode_bool(*val_ref)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#country; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#ieee80211d_enabled; + if *val_ref { + size += 1usize + 1; + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_SetCountryCode { + pub r#resp: i32, +} +impl CtrlMsg_Resp_SetCountryCode { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_SetCountryCode { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_SetCountryCode { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_GetCountryCode {} +impl CtrlMsg_Req_GetCountryCode {} +impl ::micropb::MessageDecode for CtrlMsg_Req_GetCountryCode { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_GetCountryCode { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_GetCountryCode { + pub r#resp: i32, + pub r#country: ::micropb::heapless::Vec, +} +impl CtrlMsg_Resp_GetCountryCode { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `country` + #[inline] + pub fn r#country(&self) -> &::micropb::heapless::Vec { + &self.r#country + } + ///Return a mutable reference to `country` + #[inline] + pub fn mut_country(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#country + } + ///Set the value of `country` + #[inline] + pub fn set_country(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#country = value.into(); + self + } + ///Builder method that sets the value of `country`. Useful for initializing the message. + #[inline] + pub fn init_country(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#country = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_GetCountryCode { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#country; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_GetCountryCode { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#country; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_bytes(val_ref)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#country; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_SetDhcpDnsStatus { + pub r#iface: i32, + pub r#net_link_up: i32, + pub r#dhcp_up: i32, + pub r#dhcp_ip: ::micropb::heapless::Vec, + pub r#dhcp_nm: ::micropb::heapless::Vec, + pub r#dhcp_gw: ::micropb::heapless::Vec, + pub r#dns_up: i32, + pub r#dns_ip: ::micropb::heapless::Vec, + pub r#dns_type: i32, +} +impl CtrlMsg_Req_SetDhcpDnsStatus { + ///Return a reference to `iface` + #[inline] + pub fn r#iface(&self) -> &i32 { + &self.r#iface + } + ///Return a mutable reference to `iface` + #[inline] + pub fn mut_iface(&mut self) -> &mut i32 { + &mut self.r#iface + } + ///Set the value of `iface` + #[inline] + pub fn set_iface(&mut self, value: i32) -> &mut Self { + self.r#iface = value.into(); + self + } + ///Builder method that sets the value of `iface`. Useful for initializing the message. + #[inline] + pub fn init_iface(mut self, value: i32) -> Self { + self.r#iface = value.into(); + self + } + ///Return a reference to `net_link_up` + #[inline] + pub fn r#net_link_up(&self) -> &i32 { + &self.r#net_link_up + } + ///Return a mutable reference to `net_link_up` + #[inline] + pub fn mut_net_link_up(&mut self) -> &mut i32 { + &mut self.r#net_link_up + } + ///Set the value of `net_link_up` + #[inline] + pub fn set_net_link_up(&mut self, value: i32) -> &mut Self { + self.r#net_link_up = value.into(); + self + } + ///Builder method that sets the value of `net_link_up`. Useful for initializing the message. + #[inline] + pub fn init_net_link_up(mut self, value: i32) -> Self { + self.r#net_link_up = value.into(); + self + } + ///Return a reference to `dhcp_up` + #[inline] + pub fn r#dhcp_up(&self) -> &i32 { + &self.r#dhcp_up + } + ///Return a mutable reference to `dhcp_up` + #[inline] + pub fn mut_dhcp_up(&mut self) -> &mut i32 { + &mut self.r#dhcp_up + } + ///Set the value of `dhcp_up` + #[inline] + pub fn set_dhcp_up(&mut self, value: i32) -> &mut Self { + self.r#dhcp_up = value.into(); + self + } + ///Builder method that sets the value of `dhcp_up`. Useful for initializing the message. + #[inline] + pub fn init_dhcp_up(mut self, value: i32) -> Self { + self.r#dhcp_up = value.into(); + self + } + ///Return a reference to `dhcp_ip` + #[inline] + pub fn r#dhcp_ip(&self) -> &::micropb::heapless::Vec { + &self.r#dhcp_ip + } + ///Return a mutable reference to `dhcp_ip` + #[inline] + pub fn mut_dhcp_ip(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#dhcp_ip + } + ///Set the value of `dhcp_ip` + #[inline] + pub fn set_dhcp_ip(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#dhcp_ip = value.into(); + self + } + ///Builder method that sets the value of `dhcp_ip`. Useful for initializing the message. + #[inline] + pub fn init_dhcp_ip(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#dhcp_ip = value.into(); + self + } + ///Return a reference to `dhcp_nm` + #[inline] + pub fn r#dhcp_nm(&self) -> &::micropb::heapless::Vec { + &self.r#dhcp_nm + } + ///Return a mutable reference to `dhcp_nm` + #[inline] + pub fn mut_dhcp_nm(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#dhcp_nm + } + ///Set the value of `dhcp_nm` + #[inline] + pub fn set_dhcp_nm(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#dhcp_nm = value.into(); + self + } + ///Builder method that sets the value of `dhcp_nm`. Useful for initializing the message. + #[inline] + pub fn init_dhcp_nm(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#dhcp_nm = value.into(); + self + } + ///Return a reference to `dhcp_gw` + #[inline] + pub fn r#dhcp_gw(&self) -> &::micropb::heapless::Vec { + &self.r#dhcp_gw + } + ///Return a mutable reference to `dhcp_gw` + #[inline] + pub fn mut_dhcp_gw(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#dhcp_gw + } + ///Set the value of `dhcp_gw` + #[inline] + pub fn set_dhcp_gw(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#dhcp_gw = value.into(); + self + } + ///Builder method that sets the value of `dhcp_gw`. Useful for initializing the message. + #[inline] + pub fn init_dhcp_gw(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#dhcp_gw = value.into(); + self + } + ///Return a reference to `dns_up` + #[inline] + pub fn r#dns_up(&self) -> &i32 { + &self.r#dns_up + } + ///Return a mutable reference to `dns_up` + #[inline] + pub fn mut_dns_up(&mut self) -> &mut i32 { + &mut self.r#dns_up + } + ///Set the value of `dns_up` + #[inline] + pub fn set_dns_up(&mut self, value: i32) -> &mut Self { + self.r#dns_up = value.into(); + self + } + ///Builder method that sets the value of `dns_up`. Useful for initializing the message. + #[inline] + pub fn init_dns_up(mut self, value: i32) -> Self { + self.r#dns_up = value.into(); + self + } + ///Return a reference to `dns_ip` + #[inline] + pub fn r#dns_ip(&self) -> &::micropb::heapless::Vec { + &self.r#dns_ip + } + ///Return a mutable reference to `dns_ip` + #[inline] + pub fn mut_dns_ip(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#dns_ip + } + ///Set the value of `dns_ip` + #[inline] + pub fn set_dns_ip(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#dns_ip = value.into(); + self + } + ///Builder method that sets the value of `dns_ip`. Useful for initializing the message. + #[inline] + pub fn init_dns_ip(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#dns_ip = value.into(); + self + } + ///Return a reference to `dns_type` + #[inline] + pub fn r#dns_type(&self) -> &i32 { + &self.r#dns_type + } + ///Return a mutable reference to `dns_type` + #[inline] + pub fn mut_dns_type(&mut self) -> &mut i32 { + &mut self.r#dns_type + } + ///Set the value of `dns_type` + #[inline] + pub fn set_dns_type(&mut self, value: i32) -> &mut Self { + self.r#dns_type = value.into(); + self + } + ///Builder method that sets the value of `dns_type`. Useful for initializing the message. + #[inline] + pub fn init_dns_type(mut self, value: i32) -> Self { + self.r#dns_type = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_SetDhcpDnsStatus { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#iface; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#net_link_up; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 3u32 => { + let mut_ref = &mut self.r#dhcp_up; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#dhcp_ip; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 5u32 => { + let mut_ref = &mut self.r#dhcp_nm; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 6u32 => { + let mut_ref = &mut self.r#dhcp_gw; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 7u32 => { + let mut_ref = &mut self.r#dns_up; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 8u32 => { + let mut_ref = &mut self.r#dns_ip; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 9u32 => { + let mut_ref = &mut self.r#dns_type; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_SetDhcpDnsStatus { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#iface; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#net_link_up; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#dhcp_up; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#dhcp_ip; + if !val_ref.is_empty() { + encoder.encode_varint32(34u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#dhcp_nm; + if !val_ref.is_empty() { + encoder.encode_varint32(42u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#dhcp_gw; + if !val_ref.is_empty() { + encoder.encode_varint32(50u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#dns_up; + if *val_ref != 0 { + encoder.encode_varint32(56u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#dns_ip; + if !val_ref.is_empty() { + encoder.encode_varint32(66u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#dns_type; + if *val_ref != 0 { + encoder.encode_varint32(72u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#iface; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#net_link_up; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#dhcp_up; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#dhcp_ip; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#dhcp_nm; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#dhcp_gw; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#dns_up; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#dns_ip; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#dns_type; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_SetDhcpDnsStatus { + pub r#resp: i32, +} +impl CtrlMsg_Resp_SetDhcpDnsStatus { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_SetDhcpDnsStatus { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_SetDhcpDnsStatus { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_GetDhcpDnsStatus {} +impl CtrlMsg_Req_GetDhcpDnsStatus {} +impl ::micropb::MessageDecode for CtrlMsg_Req_GetDhcpDnsStatus { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_GetDhcpDnsStatus { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_GetDhcpDnsStatus { + pub r#resp: i32, + pub r#iface: i32, + pub r#net_link_up: i32, + pub r#dhcp_up: i32, + pub r#dhcp_ip: ::micropb::heapless::Vec, + pub r#dhcp_nm: ::micropb::heapless::Vec, + pub r#dhcp_gw: ::micropb::heapless::Vec, + pub r#dns_up: i32, + pub r#dns_ip: ::micropb::heapless::Vec, + pub r#dns_type: i32, +} +impl CtrlMsg_Resp_GetDhcpDnsStatus { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `iface` + #[inline] + pub fn r#iface(&self) -> &i32 { + &self.r#iface + } + ///Return a mutable reference to `iface` + #[inline] + pub fn mut_iface(&mut self) -> &mut i32 { + &mut self.r#iface + } + ///Set the value of `iface` + #[inline] + pub fn set_iface(&mut self, value: i32) -> &mut Self { + self.r#iface = value.into(); + self + } + ///Builder method that sets the value of `iface`. Useful for initializing the message. + #[inline] + pub fn init_iface(mut self, value: i32) -> Self { + self.r#iface = value.into(); + self + } + ///Return a reference to `net_link_up` + #[inline] + pub fn r#net_link_up(&self) -> &i32 { + &self.r#net_link_up + } + ///Return a mutable reference to `net_link_up` + #[inline] + pub fn mut_net_link_up(&mut self) -> &mut i32 { + &mut self.r#net_link_up + } + ///Set the value of `net_link_up` + #[inline] + pub fn set_net_link_up(&mut self, value: i32) -> &mut Self { + self.r#net_link_up = value.into(); + self + } + ///Builder method that sets the value of `net_link_up`. Useful for initializing the message. + #[inline] + pub fn init_net_link_up(mut self, value: i32) -> Self { + self.r#net_link_up = value.into(); + self + } + ///Return a reference to `dhcp_up` + #[inline] + pub fn r#dhcp_up(&self) -> &i32 { + &self.r#dhcp_up + } + ///Return a mutable reference to `dhcp_up` + #[inline] + pub fn mut_dhcp_up(&mut self) -> &mut i32 { + &mut self.r#dhcp_up + } + ///Set the value of `dhcp_up` + #[inline] + pub fn set_dhcp_up(&mut self, value: i32) -> &mut Self { + self.r#dhcp_up = value.into(); + self + } + ///Builder method that sets the value of `dhcp_up`. Useful for initializing the message. + #[inline] + pub fn init_dhcp_up(mut self, value: i32) -> Self { + self.r#dhcp_up = value.into(); + self + } + ///Return a reference to `dhcp_ip` + #[inline] + pub fn r#dhcp_ip(&self) -> &::micropb::heapless::Vec { + &self.r#dhcp_ip + } + ///Return a mutable reference to `dhcp_ip` + #[inline] + pub fn mut_dhcp_ip(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#dhcp_ip + } + ///Set the value of `dhcp_ip` + #[inline] + pub fn set_dhcp_ip(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#dhcp_ip = value.into(); + self + } + ///Builder method that sets the value of `dhcp_ip`. Useful for initializing the message. + #[inline] + pub fn init_dhcp_ip(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#dhcp_ip = value.into(); + self + } + ///Return a reference to `dhcp_nm` + #[inline] + pub fn r#dhcp_nm(&self) -> &::micropb::heapless::Vec { + &self.r#dhcp_nm + } + ///Return a mutable reference to `dhcp_nm` + #[inline] + pub fn mut_dhcp_nm(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#dhcp_nm + } + ///Set the value of `dhcp_nm` + #[inline] + pub fn set_dhcp_nm(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#dhcp_nm = value.into(); + self + } + ///Builder method that sets the value of `dhcp_nm`. Useful for initializing the message. + #[inline] + pub fn init_dhcp_nm(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#dhcp_nm = value.into(); + self + } + ///Return a reference to `dhcp_gw` + #[inline] + pub fn r#dhcp_gw(&self) -> &::micropb::heapless::Vec { + &self.r#dhcp_gw + } + ///Return a mutable reference to `dhcp_gw` + #[inline] + pub fn mut_dhcp_gw(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#dhcp_gw + } + ///Set the value of `dhcp_gw` + #[inline] + pub fn set_dhcp_gw(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#dhcp_gw = value.into(); + self + } + ///Builder method that sets the value of `dhcp_gw`. Useful for initializing the message. + #[inline] + pub fn init_dhcp_gw(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#dhcp_gw = value.into(); + self + } + ///Return a reference to `dns_up` + #[inline] + pub fn r#dns_up(&self) -> &i32 { + &self.r#dns_up + } + ///Return a mutable reference to `dns_up` + #[inline] + pub fn mut_dns_up(&mut self) -> &mut i32 { + &mut self.r#dns_up + } + ///Set the value of `dns_up` + #[inline] + pub fn set_dns_up(&mut self, value: i32) -> &mut Self { + self.r#dns_up = value.into(); + self + } + ///Builder method that sets the value of `dns_up`. Useful for initializing the message. + #[inline] + pub fn init_dns_up(mut self, value: i32) -> Self { + self.r#dns_up = value.into(); + self + } + ///Return a reference to `dns_ip` + #[inline] + pub fn r#dns_ip(&self) -> &::micropb::heapless::Vec { + &self.r#dns_ip + } + ///Return a mutable reference to `dns_ip` + #[inline] + pub fn mut_dns_ip(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#dns_ip + } + ///Set the value of `dns_ip` + #[inline] + pub fn set_dns_ip(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#dns_ip = value.into(); + self + } + ///Builder method that sets the value of `dns_ip`. Useful for initializing the message. + #[inline] + pub fn init_dns_ip(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#dns_ip = value.into(); + self + } + ///Return a reference to `dns_type` + #[inline] + pub fn r#dns_type(&self) -> &i32 { + &self.r#dns_type + } + ///Return a mutable reference to `dns_type` + #[inline] + pub fn mut_dns_type(&mut self) -> &mut i32 { + &mut self.r#dns_type + } + ///Set the value of `dns_type` + #[inline] + pub fn set_dns_type(&mut self, value: i32) -> &mut Self { + self.r#dns_type = value.into(); + self + } + ///Builder method that sets the value of `dns_type`. Useful for initializing the message. + #[inline] + pub fn init_dns_type(mut self, value: i32) -> Self { + self.r#dns_type = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_GetDhcpDnsStatus { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#iface; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 3u32 => { + let mut_ref = &mut self.r#net_link_up; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#dhcp_up; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 5u32 => { + let mut_ref = &mut self.r#dhcp_ip; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 6u32 => { + let mut_ref = &mut self.r#dhcp_nm; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 7u32 => { + let mut_ref = &mut self.r#dhcp_gw; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 8u32 => { + let mut_ref = &mut self.r#dns_up; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 9u32 => { + let mut_ref = &mut self.r#dns_ip; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 10u32 => { + let mut_ref = &mut self.r#dns_type; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_GetDhcpDnsStatus { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#iface; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#net_link_up; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#dhcp_up; + if *val_ref != 0 { + encoder.encode_varint32(32u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#dhcp_ip; + if !val_ref.is_empty() { + encoder.encode_varint32(42u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#dhcp_nm; + if !val_ref.is_empty() { + encoder.encode_varint32(50u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#dhcp_gw; + if !val_ref.is_empty() { + encoder.encode_varint32(58u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#dns_up; + if *val_ref != 0 { + encoder.encode_varint32(64u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#dns_ip; + if !val_ref.is_empty() { + encoder.encode_varint32(74u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#dns_type; + if *val_ref != 0 { + encoder.encode_varint32(80u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#iface; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#net_link_up; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#dhcp_up; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#dhcp_ip; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#dhcp_nm; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#dhcp_gw; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#dns_up; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#dns_ip; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#dns_type; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Event_ESPInit { + pub r#init_data: ::micropb::heapless::Vec, +} +impl CtrlMsg_Event_ESPInit { + ///Return a reference to `init_data` + #[inline] + pub fn r#init_data(&self) -> &::micropb::heapless::Vec { + &self.r#init_data + } + ///Return a mutable reference to `init_data` + #[inline] + pub fn mut_init_data(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#init_data + } + ///Set the value of `init_data` + #[inline] + pub fn set_init_data(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#init_data = value.into(); + self + } + ///Builder method that sets the value of `init_data`. Useful for initializing the message. + #[inline] + pub fn init_init_data(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#init_data = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Event_ESPInit { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#init_data; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Event_ESPInit { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(65usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#init_data; + if !val_ref.is_empty() { + encoder.encode_varint32(10u32)?; + encoder.encode_bytes(val_ref)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#init_data; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Event_Heartbeat { + pub r#hb_num: i32, +} +impl CtrlMsg_Event_Heartbeat { + ///Return a reference to `hb_num` + #[inline] + pub fn r#hb_num(&self) -> &i32 { + &self.r#hb_num + } + ///Return a mutable reference to `hb_num` + #[inline] + pub fn mut_hb_num(&mut self) -> &mut i32 { + &mut self.r#hb_num + } + ///Set the value of `hb_num` + #[inline] + pub fn set_hb_num(&mut self, value: i32) -> &mut Self { + self.r#hb_num = value.into(); + self + } + ///Builder method that sets the value of `hb_num`. Useful for initializing the message. + #[inline] + pub fn init_hb_num(mut self, value: i32) -> Self { + self.r#hb_num = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Event_Heartbeat { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#hb_num; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Event_Heartbeat { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#hb_num; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#hb_num; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Event_StationDisconnectFromAP { + pub r#resp: i32, + pub r#ssid: ::micropb::heapless::Vec, + pub r#ssid_len: u32, + pub r#bssid: ::micropb::heapless::Vec, + pub r#reason: u32, + pub r#rssi: i32, +} +impl CtrlMsg_Event_StationDisconnectFromAP { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `ssid` + #[inline] + pub fn r#ssid(&self) -> &::micropb::heapless::Vec { + &self.r#ssid + } + ///Return a mutable reference to `ssid` + #[inline] + pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#ssid + } + ///Set the value of `ssid` + #[inline] + pub fn set_ssid(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#ssid = value.into(); + self + } + ///Builder method that sets the value of `ssid`. Useful for initializing the message. + #[inline] + pub fn init_ssid(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#ssid = value.into(); + self + } + ///Return a reference to `ssid_len` + #[inline] + pub fn r#ssid_len(&self) -> &u32 { + &self.r#ssid_len + } + ///Return a mutable reference to `ssid_len` + #[inline] + pub fn mut_ssid_len(&mut self) -> &mut u32 { + &mut self.r#ssid_len + } + ///Set the value of `ssid_len` + #[inline] + pub fn set_ssid_len(&mut self, value: u32) -> &mut Self { + self.r#ssid_len = value.into(); + self + } + ///Builder method that sets the value of `ssid_len`. Useful for initializing the message. + #[inline] + pub fn init_ssid_len(mut self, value: u32) -> Self { + self.r#ssid_len = value.into(); + self + } + ///Return a reference to `bssid` + #[inline] + pub fn r#bssid(&self) -> &::micropb::heapless::Vec { + &self.r#bssid + } + ///Return a mutable reference to `bssid` + #[inline] + pub fn mut_bssid(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#bssid + } + ///Set the value of `bssid` + #[inline] + pub fn set_bssid(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#bssid = value.into(); + self + } + ///Builder method that sets the value of `bssid`. Useful for initializing the message. + #[inline] + pub fn init_bssid(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#bssid = value.into(); + self + } + ///Return a reference to `reason` + #[inline] + pub fn r#reason(&self) -> &u32 { + &self.r#reason + } + ///Return a mutable reference to `reason` + #[inline] + pub fn mut_reason(&mut self) -> &mut u32 { + &mut self.r#reason + } + ///Set the value of `reason` + #[inline] + pub fn set_reason(&mut self, value: u32) -> &mut Self { + self.r#reason = value.into(); + self + } + ///Builder method that sets the value of `reason`. Useful for initializing the message. + #[inline] + pub fn init_reason(mut self, value: u32) -> Self { + self.r#reason = value.into(); + self + } + ///Return a reference to `rssi` + #[inline] + pub fn r#rssi(&self) -> &i32 { + &self.r#rssi + } + ///Return a mutable reference to `rssi` + #[inline] + pub fn mut_rssi(&mut self) -> &mut i32 { + &mut self.r#rssi + } + ///Set the value of `rssi` + #[inline] + pub fn set_rssi(&mut self, value: i32) -> &mut Self { + self.r#rssi = value.into(); + self + } + ///Builder method that sets the value of `rssi`. Useful for initializing the message. + #[inline] + pub fn init_rssi(mut self, value: i32) -> Self { + self.r#rssi = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Event_StationDisconnectFromAP { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#ssid; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 3u32 => { + let mut_ref = &mut self.r#ssid_len; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#bssid; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 5u32 => { + let mut_ref = &mut self.r#reason; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 6u32 => { + let mut_ref = &mut self.r#rssi; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Event_StationDisconnectFromAP { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#ssid_len; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#bssid; + if !val_ref.is_empty() { + encoder.encode_varint32(34u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#reason; + if *val_ref != 0 { + encoder.encode_varint32(40u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#rssi; + if *val_ref != 0 { + encoder.encode_varint32(48u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#ssid_len; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#bssid; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#reason; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#rssi; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Event_StationConnectedToAP { + pub r#resp: i32, + pub r#ssid: ::micropb::heapless::Vec, + pub r#ssid_len: u32, + pub r#bssid: ::micropb::heapless::Vec, + pub r#channel: u32, + pub r#authmode: i32, + pub r#aid: i32, +} +impl CtrlMsg_Event_StationConnectedToAP { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `ssid` + #[inline] + pub fn r#ssid(&self) -> &::micropb::heapless::Vec { + &self.r#ssid + } + ///Return a mutable reference to `ssid` + #[inline] + pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#ssid + } + ///Set the value of `ssid` + #[inline] + pub fn set_ssid(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#ssid = value.into(); + self + } + ///Builder method that sets the value of `ssid`. Useful for initializing the message. + #[inline] + pub fn init_ssid(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#ssid = value.into(); + self + } + ///Return a reference to `ssid_len` + #[inline] + pub fn r#ssid_len(&self) -> &u32 { + &self.r#ssid_len + } + ///Return a mutable reference to `ssid_len` + #[inline] + pub fn mut_ssid_len(&mut self) -> &mut u32 { + &mut self.r#ssid_len + } + ///Set the value of `ssid_len` + #[inline] + pub fn set_ssid_len(&mut self, value: u32) -> &mut Self { + self.r#ssid_len = value.into(); + self + } + ///Builder method that sets the value of `ssid_len`. Useful for initializing the message. + #[inline] + pub fn init_ssid_len(mut self, value: u32) -> Self { + self.r#ssid_len = value.into(); + self + } + ///Return a reference to `bssid` + #[inline] + pub fn r#bssid(&self) -> &::micropb::heapless::Vec { + &self.r#bssid + } + ///Return a mutable reference to `bssid` + #[inline] + pub fn mut_bssid(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#bssid + } + ///Set the value of `bssid` + #[inline] + pub fn set_bssid(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#bssid = value.into(); + self + } + ///Builder method that sets the value of `bssid`. Useful for initializing the message. + #[inline] + pub fn init_bssid(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#bssid = value.into(); + self + } + ///Return a reference to `channel` + #[inline] + pub fn r#channel(&self) -> &u32 { + &self.r#channel + } + ///Return a mutable reference to `channel` + #[inline] + pub fn mut_channel(&mut self) -> &mut u32 { + &mut self.r#channel + } + ///Set the value of `channel` + #[inline] + pub fn set_channel(&mut self, value: u32) -> &mut Self { + self.r#channel = value.into(); + self + } + ///Builder method that sets the value of `channel`. Useful for initializing the message. + #[inline] + pub fn init_channel(mut self, value: u32) -> Self { + self.r#channel = value.into(); + self + } + ///Return a reference to `authmode` + #[inline] + pub fn r#authmode(&self) -> &i32 { + &self.r#authmode + } + ///Return a mutable reference to `authmode` + #[inline] + pub fn mut_authmode(&mut self) -> &mut i32 { + &mut self.r#authmode + } + ///Set the value of `authmode` + #[inline] + pub fn set_authmode(&mut self, value: i32) -> &mut Self { + self.r#authmode = value.into(); + self + } + ///Builder method that sets the value of `authmode`. Useful for initializing the message. + #[inline] + pub fn init_authmode(mut self, value: i32) -> Self { + self.r#authmode = value.into(); + self + } + ///Return a reference to `aid` + #[inline] + pub fn r#aid(&self) -> &i32 { + &self.r#aid + } + ///Return a mutable reference to `aid` + #[inline] + pub fn mut_aid(&mut self) -> &mut i32 { + &mut self.r#aid + } + ///Set the value of `aid` + #[inline] + pub fn set_aid(&mut self, value: i32) -> &mut Self { + self.r#aid = value.into(); + self + } + ///Builder method that sets the value of `aid`. Useful for initializing the message. + #[inline] + pub fn init_aid(mut self, value: i32) -> Self { + self.r#aid = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Event_StationConnectedToAP { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#ssid; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 3u32 => { + let mut_ref = &mut self.r#ssid_len; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#bssid; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 5u32 => { + let mut_ref = &mut self.r#channel; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 6u32 => { + let mut_ref = &mut self.r#authmode; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 7u32 => { + let mut_ref = &mut self.r#aid; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Event_StationConnectedToAP { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#ssid_len; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#bssid; + if !val_ref.is_empty() { + encoder.encode_varint32(34u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#channel; + if *val_ref != 0 { + encoder.encode_varint32(40u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#authmode; + if *val_ref != 0 { + encoder.encode_varint32(48u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#aid; + if *val_ref != 0 { + encoder.encode_varint32(56u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#ssid; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#ssid_len; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#bssid; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#channel; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#authmode; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#aid; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Event_StationDisconnectFromESPSoftAP { + pub r#resp: i32, + pub r#mac: ::micropb::heapless::Vec, + pub r#aid: u32, + pub r#is_mesh_child: bool, + pub r#reason: u32, +} +impl CtrlMsg_Event_StationDisconnectFromESPSoftAP { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `mac` + #[inline] + pub fn r#mac(&self) -> &::micropb::heapless::Vec { + &self.r#mac + } + ///Return a mutable reference to `mac` + #[inline] + pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#mac + } + ///Set the value of `mac` + #[inline] + pub fn set_mac(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#mac = value.into(); + self + } + ///Builder method that sets the value of `mac`. Useful for initializing the message. + #[inline] + pub fn init_mac(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#mac = value.into(); + self + } + ///Return a reference to `aid` + #[inline] + pub fn r#aid(&self) -> &u32 { + &self.r#aid + } + ///Return a mutable reference to `aid` + #[inline] + pub fn mut_aid(&mut self) -> &mut u32 { + &mut self.r#aid + } + ///Set the value of `aid` + #[inline] + pub fn set_aid(&mut self, value: u32) -> &mut Self { + self.r#aid = value.into(); + self + } + ///Builder method that sets the value of `aid`. Useful for initializing the message. + #[inline] + pub fn init_aid(mut self, value: u32) -> Self { + self.r#aid = value.into(); + self + } + ///Return a reference to `is_mesh_child` + #[inline] + pub fn r#is_mesh_child(&self) -> &bool { + &self.r#is_mesh_child + } + ///Return a mutable reference to `is_mesh_child` + #[inline] + pub fn mut_is_mesh_child(&mut self) -> &mut bool { + &mut self.r#is_mesh_child + } + ///Set the value of `is_mesh_child` + #[inline] + pub fn set_is_mesh_child(&mut self, value: bool) -> &mut Self { + self.r#is_mesh_child = value.into(); + self + } + ///Builder method that sets the value of `is_mesh_child`. Useful for initializing the message. + #[inline] + pub fn init_is_mesh_child(mut self, value: bool) -> Self { + self.r#is_mesh_child = value.into(); + self + } + ///Return a reference to `reason` + #[inline] + pub fn r#reason(&self) -> &u32 { + &self.r#reason + } + ///Return a mutable reference to `reason` + #[inline] + pub fn mut_reason(&mut self) -> &mut u32 { + &mut self.r#reason + } + ///Set the value of `reason` + #[inline] + pub fn set_reason(&mut self, value: u32) -> &mut Self { + self.r#reason = value.into(); + self + } + ///Builder method that sets the value of `reason`. Useful for initializing the message. + #[inline] + pub fn init_reason(mut self, value: u32) -> Self { + self.r#reason = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Event_StationDisconnectFromESPSoftAP { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#mac; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 3u32 => { + let mut_ref = &mut self.r#aid; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#is_mesh_child; + { + let val = decoder.decode_bool()?; + let val_ref = &val; + if *val_ref { + *mut_ref = val as _; + } + }; + } + 5u32 => { + let mut_ref = &mut self.r#reason; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Event_StationDisconnectFromESPSoftAP { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#aid; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#is_mesh_child; + if *val_ref { + encoder.encode_varint32(32u32)?; + encoder.encode_bool(*val_ref)?; + } + } + { + let val_ref = &self.r#reason; + if *val_ref != 0 { + encoder.encode_varint32(40u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#aid; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#is_mesh_child; + if *val_ref { + size += 1usize + 1; + } + } + { + let val_ref = &self.r#reason; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Event_StationConnectedToESPSoftAP { + pub r#resp: i32, + pub r#mac: ::micropb::heapless::Vec, + pub r#aid: u32, + pub r#is_mesh_child: bool, +} +impl CtrlMsg_Event_StationConnectedToESPSoftAP { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `mac` + #[inline] + pub fn r#mac(&self) -> &::micropb::heapless::Vec { + &self.r#mac + } + ///Return a mutable reference to `mac` + #[inline] + pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#mac + } + ///Set the value of `mac` + #[inline] + pub fn set_mac(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#mac = value.into(); + self + } + ///Builder method that sets the value of `mac`. Useful for initializing the message. + #[inline] + pub fn init_mac(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#mac = value.into(); + self + } + ///Return a reference to `aid` + #[inline] + pub fn r#aid(&self) -> &u32 { + &self.r#aid + } + ///Return a mutable reference to `aid` + #[inline] + pub fn mut_aid(&mut self) -> &mut u32 { + &mut self.r#aid + } + ///Set the value of `aid` + #[inline] + pub fn set_aid(&mut self, value: u32) -> &mut Self { + self.r#aid = value.into(); + self + } + ///Builder method that sets the value of `aid`. Useful for initializing the message. + #[inline] + pub fn init_aid(mut self, value: u32) -> Self { + self.r#aid = value.into(); + self + } + ///Return a reference to `is_mesh_child` + #[inline] + pub fn r#is_mesh_child(&self) -> &bool { + &self.r#is_mesh_child + } + ///Return a mutable reference to `is_mesh_child` + #[inline] + pub fn mut_is_mesh_child(&mut self) -> &mut bool { + &mut self.r#is_mesh_child + } + ///Set the value of `is_mesh_child` + #[inline] + pub fn set_is_mesh_child(&mut self, value: bool) -> &mut Self { + self.r#is_mesh_child = value.into(); + self + } + ///Builder method that sets the value of `is_mesh_child`. Useful for initializing the message. + #[inline] + pub fn init_is_mesh_child(mut self, value: bool) -> Self { + self.r#is_mesh_child = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Event_StationConnectedToESPSoftAP { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#mac; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 3u32 => { + let mut_ref = &mut self.r#aid; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#is_mesh_child; + { + let val = decoder.decode_bool()?; + let val_ref = &val; + if *val_ref { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Event_StationConnectedToESPSoftAP { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#aid; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#is_mesh_child; + if *val_ref { + encoder.encode_varint32(32u32)?; + encoder.encode_bool(*val_ref)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#mac; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#aid; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#is_mesh_child; + if *val_ref { + size += 1usize + 1; + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Event_SetDhcpDnsStatus { + pub r#iface: i32, + pub r#net_link_up: i32, + pub r#dhcp_up: i32, + pub r#dhcp_ip: ::micropb::heapless::Vec, + pub r#dhcp_nm: ::micropb::heapless::Vec, + pub r#dhcp_gw: ::micropb::heapless::Vec, + pub r#dns_up: i32, + pub r#dns_ip: ::micropb::heapless::Vec, + pub r#dns_type: i32, + pub r#resp: i32, +} +impl CtrlMsg_Event_SetDhcpDnsStatus { + ///Return a reference to `iface` + #[inline] + pub fn r#iface(&self) -> &i32 { + &self.r#iface + } + ///Return a mutable reference to `iface` + #[inline] + pub fn mut_iface(&mut self) -> &mut i32 { + &mut self.r#iface + } + ///Set the value of `iface` + #[inline] + pub fn set_iface(&mut self, value: i32) -> &mut Self { + self.r#iface = value.into(); + self + } + ///Builder method that sets the value of `iface`. Useful for initializing the message. + #[inline] + pub fn init_iface(mut self, value: i32) -> Self { + self.r#iface = value.into(); + self + } + ///Return a reference to `net_link_up` + #[inline] + pub fn r#net_link_up(&self) -> &i32 { + &self.r#net_link_up + } + ///Return a mutable reference to `net_link_up` + #[inline] + pub fn mut_net_link_up(&mut self) -> &mut i32 { + &mut self.r#net_link_up + } + ///Set the value of `net_link_up` + #[inline] + pub fn set_net_link_up(&mut self, value: i32) -> &mut Self { + self.r#net_link_up = value.into(); + self + } + ///Builder method that sets the value of `net_link_up`. Useful for initializing the message. + #[inline] + pub fn init_net_link_up(mut self, value: i32) -> Self { + self.r#net_link_up = value.into(); + self + } + ///Return a reference to `dhcp_up` + #[inline] + pub fn r#dhcp_up(&self) -> &i32 { + &self.r#dhcp_up + } + ///Return a mutable reference to `dhcp_up` + #[inline] + pub fn mut_dhcp_up(&mut self) -> &mut i32 { + &mut self.r#dhcp_up + } + ///Set the value of `dhcp_up` + #[inline] + pub fn set_dhcp_up(&mut self, value: i32) -> &mut Self { + self.r#dhcp_up = value.into(); + self + } + ///Builder method that sets the value of `dhcp_up`. Useful for initializing the message. + #[inline] + pub fn init_dhcp_up(mut self, value: i32) -> Self { + self.r#dhcp_up = value.into(); + self + } + ///Return a reference to `dhcp_ip` + #[inline] + pub fn r#dhcp_ip(&self) -> &::micropb::heapless::Vec { + &self.r#dhcp_ip + } + ///Return a mutable reference to `dhcp_ip` + #[inline] + pub fn mut_dhcp_ip(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#dhcp_ip + } + ///Set the value of `dhcp_ip` + #[inline] + pub fn set_dhcp_ip(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#dhcp_ip = value.into(); + self + } + ///Builder method that sets the value of `dhcp_ip`. Useful for initializing the message. + #[inline] + pub fn init_dhcp_ip(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#dhcp_ip = value.into(); + self + } + ///Return a reference to `dhcp_nm` + #[inline] + pub fn r#dhcp_nm(&self) -> &::micropb::heapless::Vec { + &self.r#dhcp_nm + } + ///Return a mutable reference to `dhcp_nm` + #[inline] + pub fn mut_dhcp_nm(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#dhcp_nm + } + ///Set the value of `dhcp_nm` + #[inline] + pub fn set_dhcp_nm(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#dhcp_nm = value.into(); + self + } + ///Builder method that sets the value of `dhcp_nm`. Useful for initializing the message. + #[inline] + pub fn init_dhcp_nm(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#dhcp_nm = value.into(); + self + } + ///Return a reference to `dhcp_gw` + #[inline] + pub fn r#dhcp_gw(&self) -> &::micropb::heapless::Vec { + &self.r#dhcp_gw + } + ///Return a mutable reference to `dhcp_gw` + #[inline] + pub fn mut_dhcp_gw(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#dhcp_gw + } + ///Set the value of `dhcp_gw` + #[inline] + pub fn set_dhcp_gw(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#dhcp_gw = value.into(); + self + } + ///Builder method that sets the value of `dhcp_gw`. Useful for initializing the message. + #[inline] + pub fn init_dhcp_gw(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#dhcp_gw = value.into(); + self + } + ///Return a reference to `dns_up` + #[inline] + pub fn r#dns_up(&self) -> &i32 { + &self.r#dns_up + } + ///Return a mutable reference to `dns_up` + #[inline] + pub fn mut_dns_up(&mut self) -> &mut i32 { + &mut self.r#dns_up + } + ///Set the value of `dns_up` + #[inline] + pub fn set_dns_up(&mut self, value: i32) -> &mut Self { + self.r#dns_up = value.into(); + self + } + ///Builder method that sets the value of `dns_up`. Useful for initializing the message. + #[inline] + pub fn init_dns_up(mut self, value: i32) -> Self { + self.r#dns_up = value.into(); + self + } + ///Return a reference to `dns_ip` + #[inline] + pub fn r#dns_ip(&self) -> &::micropb::heapless::Vec { + &self.r#dns_ip + } + ///Return a mutable reference to `dns_ip` + #[inline] + pub fn mut_dns_ip(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#dns_ip + } + ///Set the value of `dns_ip` + #[inline] + pub fn set_dns_ip(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#dns_ip = value.into(); + self + } + ///Builder method that sets the value of `dns_ip`. Useful for initializing the message. + #[inline] + pub fn init_dns_ip(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#dns_ip = value.into(); + self + } + ///Return a reference to `dns_type` + #[inline] + pub fn r#dns_type(&self) -> &i32 { + &self.r#dns_type + } + ///Return a mutable reference to `dns_type` + #[inline] + pub fn mut_dns_type(&mut self) -> &mut i32 { + &mut self.r#dns_type + } + ///Set the value of `dns_type` + #[inline] + pub fn set_dns_type(&mut self, value: i32) -> &mut Self { + self.r#dns_type = value.into(); + self + } + ///Builder method that sets the value of `dns_type`. Useful for initializing the message. + #[inline] + pub fn init_dns_type(mut self, value: i32) -> Self { + self.r#dns_type = value.into(); + self + } + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Event_SetDhcpDnsStatus { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#iface; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#net_link_up; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 3u32 => { + let mut_ref = &mut self.r#dhcp_up; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#dhcp_ip; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 5u32 => { + let mut_ref = &mut self.r#dhcp_nm; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 6u32 => { + let mut_ref = &mut self.r#dhcp_gw; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 7u32 => { + let mut_ref = &mut self.r#dns_up; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 8u32 => { + let mut_ref = &mut self.r#dns_ip; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + 9u32 => { + let mut_ref = &mut self.r#dns_type; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 10u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Event_SetDhcpDnsStatus { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#iface; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#net_link_up; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#dhcp_up; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#dhcp_ip; + if !val_ref.is_empty() { + encoder.encode_varint32(34u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#dhcp_nm; + if !val_ref.is_empty() { + encoder.encode_varint32(42u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#dhcp_gw; + if !val_ref.is_empty() { + encoder.encode_varint32(50u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#dns_up; + if *val_ref != 0 { + encoder.encode_varint32(56u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#dns_ip; + if !val_ref.is_empty() { + encoder.encode_varint32(66u32)?; + encoder.encode_bytes(val_ref)?; + } + } + { + let val_ref = &self.r#dns_type; + if *val_ref != 0 { + encoder.encode_varint32(72u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(80u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#iface; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#net_link_up; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#dhcp_up; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#dhcp_ip; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#dhcp_nm; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#dhcp_gw; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#dns_up; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#dns_ip; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + { + let val_ref = &self.r#dns_type; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Req_CustomRpcUnserialisedMsg { + pub r#custom_msg_id: u32, + pub r#data: ::micropb::heapless::Vec, +} +impl CtrlMsg_Req_CustomRpcUnserialisedMsg { + ///Return a reference to `custom_msg_id` + #[inline] + pub fn r#custom_msg_id(&self) -> &u32 { + &self.r#custom_msg_id + } + ///Return a mutable reference to `custom_msg_id` + #[inline] + pub fn mut_custom_msg_id(&mut self) -> &mut u32 { + &mut self.r#custom_msg_id + } + ///Set the value of `custom_msg_id` + #[inline] + pub fn set_custom_msg_id(&mut self, value: u32) -> &mut Self { + self.r#custom_msg_id = value.into(); + self + } + ///Builder method that sets the value of `custom_msg_id`. Useful for initializing the message. + #[inline] + pub fn init_custom_msg_id(mut self, value: u32) -> Self { + self.r#custom_msg_id = value.into(); + self + } + ///Return a reference to `data` + #[inline] + pub fn r#data(&self) -> &::micropb::heapless::Vec { + &self.r#data + } + ///Return a mutable reference to `data` + #[inline] + pub fn mut_data(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#data + } + ///Set the value of `data` + #[inline] + pub fn set_data(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#data = value.into(); + self + } + ///Builder method that sets the value of `data`. Useful for initializing the message. + #[inline] + pub fn init_data(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#data = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Req_CustomRpcUnserialisedMsg { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#custom_msg_id; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#data; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Req_CustomRpcUnserialisedMsg { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#custom_msg_id; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#data; + if !val_ref.is_empty() { + encoder.encode_varint32(18u32)?; + encoder.encode_bytes(val_ref)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#custom_msg_id; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#data; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Resp_CustomRpcUnserialisedMsg { + pub r#resp: i32, + pub r#custom_msg_id: u32, + pub r#data: ::micropb::heapless::Vec, +} +impl CtrlMsg_Resp_CustomRpcUnserialisedMsg { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `custom_msg_id` + #[inline] + pub fn r#custom_msg_id(&self) -> &u32 { + &self.r#custom_msg_id + } + ///Return a mutable reference to `custom_msg_id` + #[inline] + pub fn mut_custom_msg_id(&mut self) -> &mut u32 { + &mut self.r#custom_msg_id + } + ///Set the value of `custom_msg_id` + #[inline] + pub fn set_custom_msg_id(&mut self, value: u32) -> &mut Self { + self.r#custom_msg_id = value.into(); + self + } + ///Builder method that sets the value of `custom_msg_id`. Useful for initializing the message. + #[inline] + pub fn init_custom_msg_id(mut self, value: u32) -> Self { + self.r#custom_msg_id = value.into(); + self + } + ///Return a reference to `data` + #[inline] + pub fn r#data(&self) -> &::micropb::heapless::Vec { + &self.r#data + } + ///Return a mutable reference to `data` + #[inline] + pub fn mut_data(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#data + } + ///Set the value of `data` + #[inline] + pub fn set_data(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#data = value.into(); + self + } + ///Builder method that sets the value of `data`. Useful for initializing the message. + #[inline] + pub fn init_data(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#data = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Resp_CustomRpcUnserialisedMsg { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#custom_msg_id; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 3u32 => { + let mut_ref = &mut self.r#data; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Resp_CustomRpcUnserialisedMsg { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#custom_msg_id; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#data; + if !val_ref.is_empty() { + encoder.encode_varint32(26u32)?; + encoder.encode_bytes(val_ref)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#custom_msg_id; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#data; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + size + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg_Event_CustomRpcUnserialisedMsg { + pub r#resp: i32, + pub r#custom_evt_id: u32, + pub r#data: ::micropb::heapless::Vec, +} +impl CtrlMsg_Event_CustomRpcUnserialisedMsg { + ///Return a reference to `resp` + #[inline] + pub fn r#resp(&self) -> &i32 { + &self.r#resp + } + ///Return a mutable reference to `resp` + #[inline] + pub fn mut_resp(&mut self) -> &mut i32 { + &mut self.r#resp + } + ///Set the value of `resp` + #[inline] + pub fn set_resp(&mut self, value: i32) -> &mut Self { + self.r#resp = value.into(); + self + } + ///Builder method that sets the value of `resp`. Useful for initializing the message. + #[inline] + pub fn init_resp(mut self, value: i32) -> Self { + self.r#resp = value.into(); + self + } + ///Return a reference to `custom_evt_id` + #[inline] + pub fn r#custom_evt_id(&self) -> &u32 { + &self.r#custom_evt_id + } + ///Return a mutable reference to `custom_evt_id` + #[inline] + pub fn mut_custom_evt_id(&mut self) -> &mut u32 { + &mut self.r#custom_evt_id + } + ///Set the value of `custom_evt_id` + #[inline] + pub fn set_custom_evt_id(&mut self, value: u32) -> &mut Self { + self.r#custom_evt_id = value.into(); + self + } + ///Builder method that sets the value of `custom_evt_id`. Useful for initializing the message. + #[inline] + pub fn init_custom_evt_id(mut self, value: u32) -> Self { + self.r#custom_evt_id = value.into(); + self + } + ///Return a reference to `data` + #[inline] + pub fn r#data(&self) -> &::micropb::heapless::Vec { + &self.r#data + } + ///Return a mutable reference to `data` + #[inline] + pub fn mut_data(&mut self) -> &mut ::micropb::heapless::Vec { + &mut self.r#data + } + ///Set the value of `data` + #[inline] + pub fn set_data(&mut self, value: ::micropb::heapless::Vec) -> &mut Self { + self.r#data = value.into(); + self + } + ///Builder method that sets the value of `data`. Useful for initializing the message. + #[inline] + pub fn init_data(mut self, value: ::micropb::heapless::Vec) -> Self { + self.r#data = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg_Event_CustomRpcUnserialisedMsg { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#resp; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#custom_evt_id; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 3u32 => { + let mut_ref = &mut self.r#data; + { + decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?; + }; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg_Event_CustomRpcUnserialisedMsg { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#custom_evt_id; + if *val_ref != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#data; + if !val_ref.is_empty() { + encoder.encode_varint32(26u32)?; + encoder.encode_bytes(val_ref)?; + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#resp; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#custom_evt_id; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + { + let val_ref = &self.r#data; + if !val_ref.is_empty() { + size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len()); + } + } + size + } +} +pub mod CtrlMsg_ { + #[derive(Debug, PartialEq, Clone)] + #[cfg_attr(feature = "defmt", derive(defmt::Format))] + pub enum Payload { + ReqGetMacAddress(super::CtrlMsg_Req_GetMacAddress), + ReqSetMacAddress(super::CtrlMsg_Req_SetMacAddress), + ReqGetWifiMode(super::CtrlMsg_Req_GetMode), + ReqSetWifiMode(super::CtrlMsg_Req_SetMode), + ReqScanApList(super::CtrlMsg_Req_ScanResult), + ReqGetApConfig(super::CtrlMsg_Req_GetAPConfig), + ReqConnectAp(super::CtrlMsg_Req_ConnectAP), + ReqDisconnectAp(super::CtrlMsg_Req_GetStatus), + ReqGetSoftapConfig(super::CtrlMsg_Req_GetSoftAPConfig), + ReqSetSoftapVendorSpecificIe(super::CtrlMsg_Req_SetSoftAPVendorSpecificIE), + ReqStartSoftap(super::CtrlMsg_Req_StartSoftAP), + ReqSoftapConnectedStasList(super::CtrlMsg_Req_SoftAPConnectedSTA), + ReqStopSoftap(super::CtrlMsg_Req_GetStatus), + ReqSetPowerSaveMode(super::CtrlMsg_Req_SetMode), + ReqGetPowerSaveMode(super::CtrlMsg_Req_GetMode), + ReqOtaBegin(super::CtrlMsg_Req_OTABegin), + ReqOtaWrite(super::CtrlMsg_Req_OTAWrite), + ReqOtaEnd(super::CtrlMsg_Req_OTAEnd), + ReqSetWifiMaxTxPower(super::CtrlMsg_Req_SetWifiMaxTxPower), + ReqGetWifiCurrTxPower(super::CtrlMsg_Req_GetWifiCurrTxPower), + ReqConfigHeartbeat(super::CtrlMsg_Req_ConfigHeartbeat), + ReqEnableDisableFeat(super::CtrlMsg_Req_EnableDisable), + ReqGetFwVersion(super::CtrlMsg_Req_GetFwVersion), + ReqSetCountryCode(super::CtrlMsg_Req_SetCountryCode), + ReqGetCountryCode(super::CtrlMsg_Req_GetCountryCode), + ReqSetDhcpDnsStatus(super::CtrlMsg_Req_SetDhcpDnsStatus), + ReqGetDhcpDnsStatus(super::CtrlMsg_Req_GetDhcpDnsStatus), + ReqCustomRpcUnserialisedMsg(super::CtrlMsg_Req_CustomRpcUnserialisedMsg), + RespGetMacAddress(super::CtrlMsg_Resp_GetMacAddress), + RespSetMacAddress(super::CtrlMsg_Resp_SetMacAddress), + RespGetWifiMode(super::CtrlMsg_Resp_GetMode), + RespSetWifiMode(super::CtrlMsg_Resp_SetMode), + RespScanApList(super::CtrlMsg_Resp_ScanResult), + RespGetApConfig(super::CtrlMsg_Resp_GetAPConfig), + RespConnectAp(super::CtrlMsg_Resp_ConnectAP), + RespDisconnectAp(super::CtrlMsg_Resp_GetStatus), + RespGetSoftapConfig(super::CtrlMsg_Resp_GetSoftAPConfig), + RespSetSoftapVendorSpecificIe(super::CtrlMsg_Resp_SetSoftAPVendorSpecificIE), + RespStartSoftap(super::CtrlMsg_Resp_StartSoftAP), + RespSoftapConnectedStasList(super::CtrlMsg_Resp_SoftAPConnectedSTA), + RespStopSoftap(super::CtrlMsg_Resp_GetStatus), + RespSetPowerSaveMode(super::CtrlMsg_Resp_SetMode), + RespGetPowerSaveMode(super::CtrlMsg_Resp_GetMode), + RespOtaBegin(super::CtrlMsg_Resp_OTABegin), + RespOtaWrite(super::CtrlMsg_Resp_OTAWrite), + RespOtaEnd(super::CtrlMsg_Resp_OTAEnd), + RespSetWifiMaxTxPower(super::CtrlMsg_Resp_SetWifiMaxTxPower), + RespGetWifiCurrTxPower(super::CtrlMsg_Resp_GetWifiCurrTxPower), + RespConfigHeartbeat(super::CtrlMsg_Resp_ConfigHeartbeat), + RespEnableDisableFeat(super::CtrlMsg_Resp_EnableDisable), + RespGetFwVersion(super::CtrlMsg_Resp_GetFwVersion), + RespSetCountryCode(super::CtrlMsg_Resp_SetCountryCode), + RespGetCountryCode(super::CtrlMsg_Resp_GetCountryCode), + RespSetDhcpDnsStatus(super::CtrlMsg_Resp_SetDhcpDnsStatus), + RespGetDhcpDnsStatus(super::CtrlMsg_Resp_GetDhcpDnsStatus), + RespCustomRpcUnserialisedMsg(super::CtrlMsg_Resp_CustomRpcUnserialisedMsg), + EventEspInit(super::CtrlMsg_Event_ESPInit), + EventHeartbeat(super::CtrlMsg_Event_Heartbeat), + EventStationDisconnectFromAp(super::CtrlMsg_Event_StationDisconnectFromAP), + EventStationDisconnectFromEspSoftAp(super::CtrlMsg_Event_StationDisconnectFromESPSoftAP), + EventStationConnectedToAp(super::CtrlMsg_Event_StationConnectedToAP), + EventStationConnectedToEspSoftAp(super::CtrlMsg_Event_StationConnectedToESPSoftAP), + EventSetDhcpDnsStatus(super::CtrlMsg_Event_SetDhcpDnsStatus), + EventCustomRpcUnserialisedMsg(super::CtrlMsg_Event_CustomRpcUnserialisedMsg), + } +} +#[derive(Debug, Default, PartialEq, Clone)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsg { + pub r#msg_type: CtrlMsgType, + pub r#msg_id: CtrlMsgId, + pub r#uid: i32, + pub r#req_resp_type: u32, + pub r#payload: ::core::option::Option, +} +impl CtrlMsg { + ///Return a reference to `msg_type` + #[inline] + pub fn r#msg_type(&self) -> &CtrlMsgType { + &self.r#msg_type + } + ///Return a mutable reference to `msg_type` + #[inline] + pub fn mut_msg_type(&mut self) -> &mut CtrlMsgType { + &mut self.r#msg_type + } + ///Set the value of `msg_type` + #[inline] + pub fn set_msg_type(&mut self, value: CtrlMsgType) -> &mut Self { + self.r#msg_type = value.into(); + self + } + ///Builder method that sets the value of `msg_type`. Useful for initializing the message. + #[inline] + pub fn init_msg_type(mut self, value: CtrlMsgType) -> Self { + self.r#msg_type = value.into(); + self + } + ///Return a reference to `msg_id` + #[inline] + pub fn r#msg_id(&self) -> &CtrlMsgId { + &self.r#msg_id + } + ///Return a mutable reference to `msg_id` + #[inline] + pub fn mut_msg_id(&mut self) -> &mut CtrlMsgId { + &mut self.r#msg_id + } + ///Set the value of `msg_id` + #[inline] + pub fn set_msg_id(&mut self, value: CtrlMsgId) -> &mut Self { + self.r#msg_id = value.into(); + self + } + ///Builder method that sets the value of `msg_id`. Useful for initializing the message. + #[inline] + pub fn init_msg_id(mut self, value: CtrlMsgId) -> Self { + self.r#msg_id = value.into(); + self + } + ///Return a reference to `uid` + #[inline] + pub fn r#uid(&self) -> &i32 { + &self.r#uid + } + ///Return a mutable reference to `uid` + #[inline] + pub fn mut_uid(&mut self) -> &mut i32 { + &mut self.r#uid + } + ///Set the value of `uid` + #[inline] + pub fn set_uid(&mut self, value: i32) -> &mut Self { + self.r#uid = value.into(); + self + } + ///Builder method that sets the value of `uid`. Useful for initializing the message. + #[inline] + pub fn init_uid(mut self, value: i32) -> Self { + self.r#uid = value.into(); + self + } + ///Return a reference to `req_resp_type` + #[inline] + pub fn r#req_resp_type(&self) -> &u32 { + &self.r#req_resp_type + } + ///Return a mutable reference to `req_resp_type` + #[inline] + pub fn mut_req_resp_type(&mut self) -> &mut u32 { + &mut self.r#req_resp_type + } + ///Set the value of `req_resp_type` + #[inline] + pub fn set_req_resp_type(&mut self, value: u32) -> &mut Self { + self.r#req_resp_type = value.into(); + self + } + ///Builder method that sets the value of `req_resp_type`. Useful for initializing the message. + #[inline] + pub fn init_req_resp_type(mut self, value: u32) -> Self { + self.r#req_resp_type = value.into(); + self + } +} +impl ::micropb::MessageDecode for CtrlMsg { + fn decode( + &mut self, + decoder: &mut ::micropb::PbDecoder, + len: usize, + ) -> Result<(), ::micropb::DecodeError> { + use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec}; + let before = decoder.bytes_read(); + while decoder.bytes_read() - before < len { + let tag = decoder.decode_tag()?; + match tag.field_num() { + 0 => return Err(::micropb::DecodeError::ZeroField), + 1u32 => { + let mut_ref = &mut self.r#msg_type; + { + let val = decoder.decode_int32().map(|n| CtrlMsgType(n as _))?; + let val_ref = &val; + if val_ref.0 != 0 { + *mut_ref = val as _; + } + }; + } + 2u32 => { + let mut_ref = &mut self.r#msg_id; + { + let val = decoder.decode_int32().map(|n| CtrlMsgId(n as _))?; + let val_ref = &val; + if val_ref.0 != 0 { + *mut_ref = val as _; + } + }; + } + 3u32 => { + let mut_ref = &mut self.r#uid; + { + let val = decoder.decode_int32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 4u32 => { + let mut_ref = &mut self.r#req_resp_type; + { + let val = decoder.decode_varint32()?; + let val_ref = &val; + if *val_ref != 0 { + *mut_ref = val as _; + } + }; + } + 101u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqGetMacAddress(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetMacAddress( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 102u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqSetMacAddress(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetMacAddress( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 103u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqGetWifiMode(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetWifiMode( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 104u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqSetWifiMode(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetWifiMode( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 105u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqScanApList(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqScanApList( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 106u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqGetApConfig(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetApConfig( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 107u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqConnectAp(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqConnectAp( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 108u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqDisconnectAp(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqDisconnectAp( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 109u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqGetSoftapConfig(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetSoftapConfig( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 110u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqSetSoftapVendorSpecificIe(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetSoftapVendorSpecificIe( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 111u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqStartSoftap(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqStartSoftap( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 112u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqSoftapConnectedStasList(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSoftapConnectedStasList( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 113u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqStopSoftap(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqStopSoftap( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 114u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqSetPowerSaveMode(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetPowerSaveMode( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 115u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqGetPowerSaveMode(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetPowerSaveMode( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 116u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqOtaBegin(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqOtaBegin( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 117u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqOtaWrite(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqOtaWrite( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 118u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqOtaEnd(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqOtaEnd( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 119u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqSetWifiMaxTxPower(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetWifiMaxTxPower( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 120u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqGetWifiCurrTxPower(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetWifiCurrTxPower( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 121u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqConfigHeartbeat(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqConfigHeartbeat( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 122u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqEnableDisableFeat(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqEnableDisableFeat( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 123u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqGetFwVersion(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetFwVersion( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 124u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqSetCountryCode(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetCountryCode( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 125u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqGetCountryCode(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetCountryCode( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 126u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqSetDhcpDnsStatus(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetDhcpDnsStatus( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 127u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqGetDhcpDnsStatus(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetDhcpDnsStatus( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 128u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::ReqCustomRpcUnserialisedMsg(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqCustomRpcUnserialisedMsg( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 201u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespGetMacAddress(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetMacAddress( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 202u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespSetMacAddress(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSetMacAddress( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 203u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespGetWifiMode(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetWifiMode( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 204u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespSetWifiMode(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSetWifiMode( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 205u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespScanApList(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespScanApList( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 206u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespGetApConfig(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetApConfig( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 207u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespConnectAp(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespConnectAp( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 208u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespDisconnectAp(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespDisconnectAp( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 209u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespGetSoftapConfig(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetSoftapConfig( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 210u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespSetSoftapVendorSpecificIe(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some( + CtrlMsg_::Payload::RespSetSoftapVendorSpecificIe(::core::default::Default::default()), + ); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 211u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespStartSoftap(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespStartSoftap( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 212u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespSoftapConnectedStasList(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSoftapConnectedStasList( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 213u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespStopSoftap(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespStopSoftap( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 214u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespSetPowerSaveMode(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSetPowerSaveMode( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 215u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespGetPowerSaveMode(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetPowerSaveMode( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 216u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespOtaBegin(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespOtaBegin( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 217u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespOtaWrite(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespOtaWrite( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 218u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespOtaEnd(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespOtaEnd( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 219u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespSetWifiMaxTxPower(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSetWifiMaxTxPower( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 220u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespGetWifiCurrTxPower(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetWifiCurrTxPower( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 221u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespConfigHeartbeat(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespConfigHeartbeat( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 222u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespEnableDisableFeat(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespEnableDisableFeat( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 223u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespGetFwVersion(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetFwVersion( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 224u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespSetCountryCode(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSetCountryCode( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 225u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespGetCountryCode(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetCountryCode( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 226u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespSetDhcpDnsStatus(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSetDhcpDnsStatus( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 227u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespGetDhcpDnsStatus(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetDhcpDnsStatus( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 228u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::RespCustomRpcUnserialisedMsg(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespCustomRpcUnserialisedMsg( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 301u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::EventEspInit(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::EventEspInit( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 302u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::EventHeartbeat(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::EventHeartbeat( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 303u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::EventStationDisconnectFromAp(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::EventStationDisconnectFromAp( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 304u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::EventStationDisconnectFromEspSoftAp(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some( + CtrlMsg_::Payload::EventStationDisconnectFromEspSoftAp(::core::default::Default::default()), + ); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 305u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::EventStationConnectedToAp(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::EventStationConnectedToAp( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 306u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::EventStationConnectedToEspSoftAp(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some( + CtrlMsg_::Payload::EventStationConnectedToEspSoftAp(::core::default::Default::default()), + ); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 307u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::EventSetDhcpDnsStatus(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::EventSetDhcpDnsStatus( + ::core::default::Default::default(), + )); + }; + mut_ref.decode_len_delimited(decoder)?; + } + 308u32 => { + let mut_ref = loop { + if let ::core::option::Option::Some(variant) = &mut self.r#payload { + if let CtrlMsg_::Payload::EventCustomRpcUnserialisedMsg(variant) = &mut *variant { + break &mut *variant; + } + } + self.r#payload = ::core::option::Option::Some( + CtrlMsg_::Payload::EventCustomRpcUnserialisedMsg(::core::default::Default::default()), + ); + }; + mut_ref.decode_len_delimited(decoder)?; + } + _ => { + decoder.skip_wire_value(tag.wire_type())?; + } + } + } + Ok(()) + } +} +impl ::micropb::MessageEncode for CtrlMsg { + const MAX_SIZE: ::core::option::Option = 'msg: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(CtrlMsgType::_MAX_SIZE), |size| size + + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(CtrlMsgId::_MAX_SIZE), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = + ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize) + { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + if let ::core::option::Option::Some(size) = 'oneof: { + let mut max_size = 0; + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!(::MAX_SIZE, |size| { + ::micropb::size::sizeof_len_record(size) + }), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + if let ::core::option::Option::Some(size) = ::micropb::const_map!( + ::micropb::const_map!( + ::MAX_SIZE, + |size| ::micropb::size::sizeof_len_record(size) + ), + |size| size + 2usize + ) { + if size > max_size { + max_size = size; + } + } else { + break 'oneof (::core::option::Option::::None); + } + ::core::option::Option::Some(max_size) + } { + max_size += size; + } else { + break 'msg (::core::option::Option::::None); + }; + ::core::option::Option::Some(max_size) + }; + fn encode( + &self, + encoder: &mut ::micropb::PbEncoder, + ) -> Result<(), IMPL_MICROPB_WRITE::Error> { + use ::micropb::{FieldEncode, PbMap}; + { + let val_ref = &self.r#msg_type; + if val_ref.0 != 0 { + encoder.encode_varint32(8u32)?; + encoder.encode_int32(val_ref.0 as _)?; + } + } + { + let val_ref = &self.r#msg_id; + if val_ref.0 != 0 { + encoder.encode_varint32(16u32)?; + encoder.encode_int32(val_ref.0 as _)?; + } + } + { + let val_ref = &self.r#uid; + if *val_ref != 0 { + encoder.encode_varint32(24u32)?; + encoder.encode_int32(*val_ref as _)?; + } + } + { + let val_ref = &self.r#req_resp_type; + if *val_ref != 0 { + encoder.encode_varint32(32u32)?; + encoder.encode_varint32(*val_ref as _)?; + } + } + if let Some(oneof) = &self.r#payload { + match &*oneof { + CtrlMsg_::Payload::ReqGetMacAddress(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(810u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqSetMacAddress(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(818u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqGetWifiMode(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(826u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqSetWifiMode(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(834u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqScanApList(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(842u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqGetApConfig(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(850u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqConnectAp(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(858u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqDisconnectAp(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(866u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqGetSoftapConfig(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(874u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqSetSoftapVendorSpecificIe(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(882u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqStartSoftap(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(890u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqSoftapConnectedStasList(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(898u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqStopSoftap(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(906u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqSetPowerSaveMode(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(914u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqGetPowerSaveMode(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(922u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqOtaBegin(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(930u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqOtaWrite(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(938u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqOtaEnd(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(946u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqSetWifiMaxTxPower(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(954u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqGetWifiCurrTxPower(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(962u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqConfigHeartbeat(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(970u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqEnableDisableFeat(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(978u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqGetFwVersion(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(986u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqSetCountryCode(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(994u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqGetCountryCode(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1002u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqSetDhcpDnsStatus(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1010u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqGetDhcpDnsStatus(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1018u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::ReqCustomRpcUnserialisedMsg(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1026u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespGetMacAddress(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1610u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespSetMacAddress(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1618u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespGetWifiMode(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1626u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespSetWifiMode(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1634u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespScanApList(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1642u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespGetApConfig(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1650u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespConnectAp(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1658u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespDisconnectAp(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1666u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespGetSoftapConfig(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1674u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespSetSoftapVendorSpecificIe(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1682u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespStartSoftap(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1690u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespSoftapConnectedStasList(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1698u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespStopSoftap(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1706u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespSetPowerSaveMode(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1714u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespGetPowerSaveMode(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1722u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespOtaBegin(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1730u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespOtaWrite(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1738u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespOtaEnd(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1746u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespSetWifiMaxTxPower(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1754u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespGetWifiCurrTxPower(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1762u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespConfigHeartbeat(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1770u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespEnableDisableFeat(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1778u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespGetFwVersion(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1786u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespSetCountryCode(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1794u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespGetCountryCode(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1802u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespSetDhcpDnsStatus(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1810u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespGetDhcpDnsStatus(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1818u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::RespCustomRpcUnserialisedMsg(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(1826u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::EventEspInit(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(2410u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::EventHeartbeat(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(2418u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::EventStationDisconnectFromAp(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(2426u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::EventStationDisconnectFromEspSoftAp(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(2434u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::EventStationConnectedToAp(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(2442u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::EventStationConnectedToEspSoftAp(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(2450u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::EventSetDhcpDnsStatus(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(2458u32)?; + val_ref.encode_len_delimited(encoder)?; + } + CtrlMsg_::Payload::EventCustomRpcUnserialisedMsg(val_ref) => { + let val_ref = &*val_ref; + encoder.encode_varint32(2466u32)?; + val_ref.encode_len_delimited(encoder)?; + } + } + } + Ok(()) + } + fn compute_size(&self) -> usize { + use ::micropb::{FieldEncode, PbMap}; + let mut size = 0; + { + let val_ref = &self.r#msg_type; + if val_ref.0 != 0 { + size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _); + } + } + { + let val_ref = &self.r#msg_id; + if val_ref.0 != 0 { + size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _); + } + } + { + let val_ref = &self.r#uid; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _); + } + } + { + let val_ref = &self.r#req_resp_type; + if *val_ref != 0 { + size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _); + } + } + if let Some(oneof) = &self.r#payload { + match &*oneof { + CtrlMsg_::Payload::ReqGetMacAddress(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqSetMacAddress(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqGetWifiMode(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqSetWifiMode(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqScanApList(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqGetApConfig(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqConnectAp(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqDisconnectAp(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqGetSoftapConfig(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqSetSoftapVendorSpecificIe(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqStartSoftap(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqSoftapConnectedStasList(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqStopSoftap(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqSetPowerSaveMode(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqGetPowerSaveMode(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqOtaBegin(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqOtaWrite(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqOtaEnd(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqSetWifiMaxTxPower(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqGetWifiCurrTxPower(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqConfigHeartbeat(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqEnableDisableFeat(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqGetFwVersion(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqSetCountryCode(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqGetCountryCode(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqSetDhcpDnsStatus(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqGetDhcpDnsStatus(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::ReqCustomRpcUnserialisedMsg(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespGetMacAddress(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespSetMacAddress(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespGetWifiMode(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespSetWifiMode(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespScanApList(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespGetApConfig(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespConnectAp(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespDisconnectAp(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespGetSoftapConfig(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespSetSoftapVendorSpecificIe(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespStartSoftap(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespSoftapConnectedStasList(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespStopSoftap(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespSetPowerSaveMode(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespGetPowerSaveMode(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespOtaBegin(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespOtaWrite(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespOtaEnd(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespSetWifiMaxTxPower(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespGetWifiCurrTxPower(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespConfigHeartbeat(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespEnableDisableFeat(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespGetFwVersion(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespSetCountryCode(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespGetCountryCode(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespSetDhcpDnsStatus(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespGetDhcpDnsStatus(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::RespCustomRpcUnserialisedMsg(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::EventEspInit(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::EventHeartbeat(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::EventStationDisconnectFromAp(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::EventStationDisconnectFromEspSoftAp(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::EventStationConnectedToAp(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::EventStationConnectedToEspSoftAp(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::EventSetDhcpDnsStatus(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + CtrlMsg_::Payload::EventCustomRpcUnserialisedMsg(val_ref) => { + let val_ref = &*val_ref; + size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size()); + } + } + } + size + } +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[repr(transparent)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct Ctrl_VendorIEType(pub i32); +impl Ctrl_VendorIEType { + pub const _MAX_SIZE: usize = 10usize; + pub const Beacon: Self = Self(0); + pub const ProbeReq: Self = Self(1); + pub const ProbeResp: Self = Self(2); + pub const AssocReq: Self = Self(3); + pub const AssocResp: Self = Self(4); +} +impl core::default::Default for Ctrl_VendorIEType { + fn default() -> Self { + Self(0) + } +} +impl core::convert::From for Ctrl_VendorIEType { + fn from(val: i32) -> Self { + Self(val) + } +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[repr(transparent)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct Ctrl_VendorIEID(pub i32); +impl Ctrl_VendorIEID { + pub const _MAX_SIZE: usize = 10usize; + pub const Id0: Self = Self(0); + pub const Id1: Self = Self(1); +} +impl core::default::Default for Ctrl_VendorIEID { + fn default() -> Self { + Self(0) + } +} +impl core::convert::From for Ctrl_VendorIEID { + fn from(val: i32) -> Self { + Self(val) + } +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[repr(transparent)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct Ctrl_WifiMode(pub i32); +impl Ctrl_WifiMode { + pub const _MAX_SIZE: usize = 10usize; + pub const None: Self = Self(0); + pub const Sta: Self = Self(1); + pub const Ap: Self = Self(2); + pub const Apsta: Self = Self(3); +} +impl core::default::Default for Ctrl_WifiMode { + fn default() -> Self { + Self(0) + } +} +impl core::convert::From for Ctrl_WifiMode { + fn from(val: i32) -> Self { + Self(val) + } +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[repr(transparent)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct Ctrl_WifiBw(pub i32); +impl Ctrl_WifiBw { + pub const _MAX_SIZE: usize = 10usize; + pub const BwInvalid: Self = Self(0); + pub const Ht20: Self = Self(1); + pub const Ht40: Self = Self(2); +} +impl core::default::Default for Ctrl_WifiBw { + fn default() -> Self { + Self(0) + } +} +impl core::convert::From for Ctrl_WifiBw { + fn from(val: i32) -> Self { + Self(val) + } +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[repr(transparent)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct Ctrl_WifiPowerSave(pub i32); +impl Ctrl_WifiPowerSave { + pub const _MAX_SIZE: usize = 10usize; + pub const NoPs: Self = Self(0); + pub const MinModem: Self = Self(1); + pub const MaxModem: Self = Self(2); + pub const PsInvalid: Self = Self(3); +} +impl core::default::Default for Ctrl_WifiPowerSave { + fn default() -> Self { + Self(0) + } +} +impl core::convert::From for Ctrl_WifiPowerSave { + fn from(val: i32) -> Self { + Self(val) + } +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[repr(transparent)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct Ctrl_WifiSecProt(pub i32); +impl Ctrl_WifiSecProt { + pub const _MAX_SIZE: usize = 10usize; + pub const Open: Self = Self(0); + pub const Wep: Self = Self(1); + pub const WpaPsk: Self = Self(2); + pub const Wpa2Psk: Self = Self(3); + pub const WpaWpa2Psk: Self = Self(4); + pub const Wpa2Enterprise: Self = Self(5); + pub const Wpa3Psk: Self = Self(6); + pub const Wpa2Wpa3Psk: Self = Self(7); +} +impl core::default::Default for Ctrl_WifiSecProt { + fn default() -> Self { + Self(0) + } +} +impl core::convert::From for Ctrl_WifiSecProt { + fn from(val: i32) -> Self { + Self(val) + } +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[repr(transparent)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct Ctrl_Status(pub i32); +impl Ctrl_Status { + pub const _MAX_SIZE: usize = 10usize; + pub const Connected: Self = Self(0); + pub const NotConnected: Self = Self(1); + pub const NoApFound: Self = Self(2); + pub const ConnectionFail: Self = Self(3); + pub const InvalidArgument: Self = Self(4); + pub const OutOfRange: Self = Self(5); +} +impl core::default::Default for Ctrl_Status { + fn default() -> Self { + Self(0) + } +} +impl core::convert::From for Ctrl_Status { + fn from(val: i32) -> Self { + Self(val) + } +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[repr(transparent)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsgType(pub i32); +impl CtrlMsgType { + pub const _MAX_SIZE: usize = 10usize; + pub const MsgTypeInvalid: Self = Self(0); + pub const Req: Self = Self(1); + pub const Resp: Self = Self(2); + pub const Event: Self = Self(3); + pub const MsgTypeMax: Self = Self(4); +} +impl core::default::Default for CtrlMsgType { + fn default() -> Self { + Self(0) + } +} +impl core::convert::From for CtrlMsgType { + fn from(val: i32) -> Self { + Self(val) + } +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[repr(transparent)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct CtrlMsgId(pub i32); +impl CtrlMsgId { + pub const _MAX_SIZE: usize = 10usize; + pub const MsgIdInvalid: Self = Self(0); + pub const ReqBase: Self = Self(100); + pub const ReqGetMacAddress: Self = Self(101); + pub const ReqSetMacAddress: Self = Self(102); + pub const ReqGetWifiMode: Self = Self(103); + pub const ReqSetWifiMode: Self = Self(104); + pub const ReqGetApScanList: Self = Self(105); + pub const ReqGetApConfig: Self = Self(106); + pub const ReqConnectAp: Self = Self(107); + pub const ReqDisconnectAp: Self = Self(108); + pub const ReqGetSoftApConfig: Self = Self(109); + pub const ReqSetSoftApVendorSpecificIe: Self = Self(110); + pub const ReqStartSoftAp: Self = Self(111); + pub const ReqGetSoftApConnectedStaList: Self = Self(112); + pub const ReqStopSoftAp: Self = Self(113); + pub const ReqSetPowerSaveMode: Self = Self(114); + pub const ReqGetPowerSaveMode: Self = Self(115); + pub const ReqOtaBegin: Self = Self(116); + pub const ReqOtaWrite: Self = Self(117); + pub const ReqOtaEnd: Self = Self(118); + pub const ReqSetWifiMaxTxPower: Self = Self(119); + pub const ReqGetWifiCurrTxPower: Self = Self(120); + pub const ReqConfigHeartbeat: Self = Self(121); + pub const ReqEnableDisable: Self = Self(122); + pub const ReqGetFwVersion: Self = Self(123); + pub const ReqSetCountryCode: Self = Self(124); + pub const ReqGetCountryCode: Self = Self(125); + pub const ReqSetDhcpDnsStatus: Self = Self(126); + pub const ReqGetDhcpDnsStatus: Self = Self(127); + pub const ReqCustomRpcUnserialisedMsg: Self = Self(128); + pub const ReqMax: Self = Self(129); + pub const RespBase: Self = Self(200); + pub const RespGetMacAddress: Self = Self(201); + pub const RespSetMacAddress: Self = Self(202); + pub const RespGetWifiMode: Self = Self(203); + pub const RespSetWifiMode: Self = Self(204); + pub const RespGetApScanList: Self = Self(205); + pub const RespGetApConfig: Self = Self(206); + pub const RespConnectAp: Self = Self(207); + pub const RespDisconnectAp: Self = Self(208); + pub const RespGetSoftApConfig: Self = Self(209); + pub const RespSetSoftApVendorSpecificIe: Self = Self(210); + pub const RespStartSoftAp: Self = Self(211); + pub const RespGetSoftApConnectedStaList: Self = Self(212); + pub const RespStopSoftAp: Self = Self(213); + pub const RespSetPowerSaveMode: Self = Self(214); + pub const RespGetPowerSaveMode: Self = Self(215); + pub const RespOtaBegin: Self = Self(216); + pub const RespOtaWrite: Self = Self(217); + pub const RespOtaEnd: Self = Self(218); + pub const RespSetWifiMaxTxPower: Self = Self(219); + pub const RespGetWifiCurrTxPower: Self = Self(220); + pub const RespConfigHeartbeat: Self = Self(221); + pub const RespEnableDisable: Self = Self(222); + pub const RespGetFwVersion: Self = Self(223); + pub const RespSetCountryCode: Self = Self(224); + pub const RespGetCountryCode: Self = Self(225); + pub const RespSetDhcpDnsStatus: Self = Self(226); + pub const RespGetDhcpDnsStatus: Self = Self(227); + pub const RespCustomRpcUnserialisedMsg: Self = Self(228); + pub const RespMax: Self = Self(229); + pub const EventBase: Self = Self(300); + pub const EventEspInit: Self = Self(301); + pub const EventHeartbeat: Self = Self(302); + pub const EventStationDisconnectFromAp: Self = Self(303); + pub const EventStationDisconnectFromEspSoftAp: Self = Self(304); + pub const EventStationConnectedToAp: Self = Self(305); + pub const EventStationConnectedToEspSoftAp: Self = Self(306); + pub const EventSetDhcpDnsStatus: Self = Self(307); + pub const EventCustomRpcUnserialisedMsg: Self = Self(308); + pub const EventMax: Self = Self(309); +} +impl core::default::Default for CtrlMsgId { + fn default() -> Self { + Self(0) + } +} +impl core::convert::From for CtrlMsgId { + fn from(val: i32) -> Self { + Self(val) + } +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[repr(transparent)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct HostedFeature(pub i32); +impl HostedFeature { + pub const _MAX_SIZE: usize = 10usize; + pub const HostedInvalidFeature: Self = Self(0); + pub const HostedWifi: Self = Self(1); + pub const HostedBluetooth: Self = Self(2); + pub const HostedIsNetworkSplitOn: Self = Self(3); +} +impl core::default::Default for HostedFeature { + fn default() -> Self { + Self(0) + } +} +impl core::convert::From for HostedFeature { + fn from(val: i32) -> Self { + Self(val) + } +} -- cgit From a4344a3833510480c0fbee49af320a70c952975f Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Thu, 30 Oct 2025 12:30:55 +0100 Subject: net-esp-hosted: add changelog. --- embassy-net-esp-hosted/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/embassy-net-esp-hosted/CHANGELOG.md b/embassy-net-esp-hosted/CHANGELOG.md index 5153e3799..d8b912295 100644 --- a/embassy-net-esp-hosted/CHANGELOG.md +++ b/embassy-net-esp-hosted/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased - ReleaseDate +- Add an `Interface` trait to allow using other interface transports. +- Switch to `micropb` for protobuf. +- Update protos to latest `esp-hosted-fg`. + ## 0.2.1 - 2025-08-26 - First release with changelog. -- cgit