aboutsummaryrefslogtreecommitdiff
path: root/embassy-net-esp-hosted/src
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-net-esp-hosted/src')
-rw-r--r--embassy-net-esp-hosted/src/control.rs107
-rw-r--r--embassy-net-esp-hosted/src/esp_hosted_config.proto205
-rw-r--r--embassy-net-esp-hosted/src/iface.rs62
-rw-r--r--embassy-net-esp-hosted/src/ioctl.rs29
-rw-r--r--embassy-net-esp-hosted/src/lib.rs78
-rw-r--r--embassy-net-esp-hosted/src/proto.rs14242
6 files changed, 14081 insertions, 642 deletions
diff --git a/embassy-net-esp-hosted/src/control.rs b/embassy-net-esp-hosted/src/control.rs
index b1838a425..eb79593f6 100644
--- a/embassy-net-esp-hosted/src/control.rs
+++ b/embassy-net-esp-hosted/src/control.rs
@@ -1,6 +1,7 @@
1use embassy_net_driver_channel as ch; 1use embassy_net_driver_channel as ch;
2use embassy_net_driver_channel::driver::{HardwareAddress, LinkState}; 2use embassy_net_driver_channel::driver::{HardwareAddress, LinkState};
3use heapless::String; 3use heapless::String;
4use micropb::{MessageDecode, MessageEncode, PbEncoder};
4 5
5use crate::ioctl::Shared; 6use crate::ioctl::Shared;
6use crate::proto::{self, CtrlMsg}; 7use crate::proto::{self, CtrlMsg};
@@ -38,7 +39,7 @@ enum WifiMode {
38 ApSta = 3, 39 ApSta = 3,
39} 40}
40 41
41pub use proto::CtrlWifiSecProt as Security; 42pub use proto::Ctrl_WifiSecProt as Security;
42 43
43/// WiFi status. 44/// WiFi status.
44#[derive(Clone, Debug)] 45#[derive(Clone, Debug)]
@@ -59,19 +60,20 @@ pub struct Status {
59macro_rules! ioctl { 60macro_rules! ioctl {
60 ($self:ident, $req_variant:ident, $resp_variant:ident, $req:ident, $resp:ident) => { 61 ($self:ident, $req_variant:ident, $resp_variant:ident, $req:ident, $resp:ident) => {
61 let mut msg = proto::CtrlMsg { 62 let mut msg = proto::CtrlMsg {
62 msg_id: proto::CtrlMsgId::$req_variant as _, 63 msg_id: proto::CtrlMsgId::$req_variant,
63 msg_type: proto::CtrlMsgType::Req as _, 64 msg_type: proto::CtrlMsgType::Req,
64 payload: Some(proto::CtrlMsgPayload::$req_variant($req)), 65 payload: Some(proto::CtrlMsg_::Payload::$req_variant($req)),
66 req_resp_type: 0,
67 uid: 0,
65 }; 68 };
66 $self.ioctl(&mut msg).await?; 69 $self.ioctl(&mut msg).await?;
67 #[allow(unused_mut)] 70 #[allow(unused_mut)]
68 let Some(proto::CtrlMsgPayload::$resp_variant(mut $resp)) = msg.payload 71 let Some(proto::CtrlMsg_::Payload::$resp_variant(mut $resp)) = msg.payload else {
69 else {
70 warn!("unexpected response variant"); 72 warn!("unexpected response variant");
71 return Err(Error::Internal); 73 return Err(Error::Internal);
72 }; 74 };
73 if $resp.resp != 0 { 75 if $resp.resp != 0 {
74 return Err(Error::Failed($resp.resp)); 76 return Err(Error::Failed($resp.resp as u32));
75 } 77 }
76 }; 78 };
77} 79}
@@ -101,57 +103,107 @@ impl<'a> Control<'a> {
101 103
102 /// Get the current status. 104 /// Get the current status.
103 pub async fn get_status(&mut self) -> Result<Status, Error> { 105 pub async fn get_status(&mut self) -> Result<Status, Error> {
104 let req = proto::CtrlMsgReqGetApConfig {}; 106 let req = proto::CtrlMsg_Req_GetAPConfig {};
105 ioctl!(self, ReqGetApConfig, RespGetApConfig, req, resp); 107 ioctl!(self, ReqGetApConfig, RespGetApConfig, req, resp);
106 trim_nulls(&mut resp.ssid); 108 let ssid = core::str::from_utf8(&resp.ssid).map_err(|_| Error::Internal)?;
109 let ssid = String::try_from(ssid.trim_end_matches('\0')).map_err(|_| Error::Internal)?;
110 let bssid_str = core::str::from_utf8(&resp.bssid).map_err(|_| Error::Internal)?;
107 Ok(Status { 111 Ok(Status {
108 ssid: resp.ssid, 112 ssid,
109 bssid: parse_mac(&resp.bssid)?, 113 bssid: parse_mac(bssid_str)?,
110 rssi: resp.rssi as _, 114 rssi: resp.rssi as _,
111 channel: resp.chnl, 115 channel: resp.chnl as u32,
112 security: resp.sec_prot, 116 security: resp.sec_prot,
113 }) 117 })
114 } 118 }
115 119
116 /// Connect to the network identified by ssid using the provided password. 120 /// Connect to the network identified by ssid using the provided password.
117 pub async fn connect(&mut self, ssid: &str, password: &str) -> Result<(), Error> { 121 pub async fn connect(&mut self, ssid: &str, password: &str) -> Result<(), Error> {
118 let req = proto::CtrlMsgReqConnectAp { 122 const WIFI_BAND_MODE_AUTO: i32 = 3; // 2.4GHz + 5GHz
123
124 let req = proto::CtrlMsg_Req_ConnectAP {
119 ssid: unwrap!(String::try_from(ssid)), 125 ssid: unwrap!(String::try_from(ssid)),
120 pwd: unwrap!(String::try_from(password)), 126 pwd: unwrap!(String::try_from(password)),
121 bssid: String::new(), 127 bssid: String::new(),
122 listen_interval: 3, 128 listen_interval: 3,
123 is_wpa3_supported: true, 129 is_wpa3_supported: true,
130 band_mode: WIFI_BAND_MODE_AUTO,
124 }; 131 };
125 ioctl!(self, ReqConnectAp, RespConnectAp, req, resp); 132 ioctl!(self, ReqConnectAp, RespConnectAp, req, resp);
133
134 // TODO: in newer esp-hosted firmwares that added EventStationConnectedToAp
135 // the connect ioctl seems to be async, so we shouldn't immediately set LinkState::Up here.
126 self.state_ch.set_link_state(LinkState::Up); 136 self.state_ch.set_link_state(LinkState::Up);
137
127 Ok(()) 138 Ok(())
128 } 139 }
129 140
130 /// Disconnect from any currently connected network. 141 /// Disconnect from any currently connected network.
131 pub async fn disconnect(&mut self) -> Result<(), Error> { 142 pub async fn disconnect(&mut self) -> Result<(), Error> {
132 let req = proto::CtrlMsgReqGetStatus {}; 143 let req = proto::CtrlMsg_Req_GetStatus {};
133 ioctl!(self, ReqDisconnectAp, RespDisconnectAp, req, resp); 144 ioctl!(self, ReqDisconnectAp, RespDisconnectAp, req, resp);
134 self.state_ch.set_link_state(LinkState::Down); 145 self.state_ch.set_link_state(LinkState::Down);
135 Ok(()) 146 Ok(())
136 } 147 }
137 148
149 /// Initiate a firmware update.
150 pub async fn ota_begin(&mut self) -> Result<(), Error> {
151 let req = proto::CtrlMsg_Req_OTABegin {};
152 ioctl!(self, ReqOtaBegin, RespOtaBegin, req, resp);
153 Ok(())
154 }
155
156 /// Write slice of firmware to a device.
157 ///
158 /// [`ota_begin`] must be called first.
159 ///
160 /// The slice is split into chunks that can be sent across
161 /// the ioctl protocol to the wifi adapter.
162 pub async fn ota_write(&mut self, data: &[u8]) -> Result<(), Error> {
163 for chunk in data.chunks(256) {
164 let req = proto::CtrlMsg_Req_OTAWrite {
165 ota_data: heapless::Vec::from_slice(chunk).unwrap(),
166 };
167 ioctl!(self, ReqOtaWrite, RespOtaWrite, req, resp);
168 }
169 Ok(())
170 }
171
172 /// End the OTA session.
173 ///
174 /// [`ota_begin`] must be called first.
175 ///
176 /// NOTE: Will reset the wifi adapter after 5 seconds.
177 pub async fn ota_end(&mut self) -> Result<(), Error> {
178 let req = proto::CtrlMsg_Req_OTAEnd {};
179 ioctl!(self, ReqOtaEnd, RespOtaEnd, req, resp);
180 self.shared.ota_done();
181 // Wait for re-init
182 self.init().await?;
183 Ok(())
184 }
185
138 /// duration in seconds, clamped to [10, 3600] 186 /// duration in seconds, clamped to [10, 3600]
139 async fn set_heartbeat(&mut self, duration: u32) -> Result<(), Error> { 187 async fn set_heartbeat(&mut self, duration: u32) -> Result<(), Error> {
140 let req = proto::CtrlMsgReqConfigHeartbeat { enable: true, duration }; 188 let req = proto::CtrlMsg_Req_ConfigHeartbeat {
189 enable: true,
190 duration: duration as i32,
191 };
141 ioctl!(self, ReqConfigHeartbeat, RespConfigHeartbeat, req, resp); 192 ioctl!(self, ReqConfigHeartbeat, RespConfigHeartbeat, req, resp);
142 Ok(()) 193 Ok(())
143 } 194 }
144 195
145 async fn get_mac_addr(&mut self) -> Result<[u8; 6], Error> { 196 async fn get_mac_addr(&mut self) -> Result<[u8; 6], Error> {
146 let req = proto::CtrlMsgReqGetMacAddress { 197 let req = proto::CtrlMsg_Req_GetMacAddress {
147 mode: WifiMode::Sta as _, 198 mode: WifiMode::Sta as _,
148 }; 199 };
149 ioctl!(self, ReqGetMacAddress, RespGetMacAddress, req, resp); 200 ioctl!(self, ReqGetMacAddress, RespGetMacAddress, req, resp);
150 parse_mac(&resp.mac) 201 let mac_str = core::str::from_utf8(&resp.mac).map_err(|_| Error::Internal)?;
202 parse_mac(mac_str)
151 } 203 }
152 204
153 async fn set_wifi_mode(&mut self, mode: u32) -> Result<(), Error> { 205 async fn set_wifi_mode(&mut self, mode: u32) -> Result<(), Error> {
154 let req = proto::CtrlMsgReqSetMode { mode }; 206 let req = proto::CtrlMsg_Req_SetMode { mode: mode as i32 };
155 ioctl!(self, ReqSetWifiMode, RespSetWifiMode, req, resp); 207 ioctl!(self, ReqSetWifiMode, RespSetWifiMode, req, resp);
156 208
157 Ok(()) 209 Ok(())
@@ -160,12 +212,17 @@ impl<'a> Control<'a> {
160 async fn ioctl(&mut self, msg: &mut CtrlMsg) -> Result<(), Error> { 212 async fn ioctl(&mut self, msg: &mut CtrlMsg) -> Result<(), Error> {
161 debug!("ioctl req: {:?}", &msg); 213 debug!("ioctl req: {:?}", &msg);
162 214
163 let mut buf = [0u8; 128]; 215 // Theoretical max overhead is 29 bytes. Biggest message is OTA write with 256 bytes.
216 let mut buf = [0u8; 256 + 29];
217 let buf_len = buf.len();
164 218
165 let req_len = noproto::write(msg, &mut buf).map_err(|_| { 219 let mut encoder = PbEncoder::new(&mut buf[..]);
220 msg.encode(&mut encoder).map_err(|_| {
166 warn!("failed to serialize control request"); 221 warn!("failed to serialize control request");
167 Error::Internal 222 Error::Internal
168 })?; 223 })?;
224 let remaining = encoder.into_writer();
225 let req_len = buf_len - remaining.len();
169 226
170 struct CancelOnDrop<'a>(&'a Shared); 227 struct CancelOnDrop<'a>(&'a Shared);
171 228
@@ -187,8 +244,8 @@ impl<'a> Control<'a> {
187 244
188 ioctl.defuse(); 245 ioctl.defuse();
189 246
190 *msg = noproto::read(&buf[..resp_len]).map_err(|_| { 247 msg.decode_from_bytes(&buf[..resp_len]).map_err(|_| {
191 warn!("failed to serialize control request"); 248 warn!("failed to deserialize control response");
192 Error::Internal 249 Error::Internal
193 })?; 250 })?;
194 debug!("ioctl resp: {:?}", msg); 251 debug!("ioctl resp: {:?}", msg);
@@ -222,9 +279,3 @@ fn parse_mac(mac: &str) -> Result<[u8; 6], Error> {
222 } 279 }
223 Ok(res) 280 Ok(res)
224} 281}
225
226fn trim_nulls<const N: usize>(s: &mut String<N>) {
227 while s.chars().rev().next() == Some(0 as char) {
228 s.pop();
229 }
230}
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 @@
1/* Copyright (C) 2015-2025 Espressif Systems (Shanghai) PTE LTD */
2/* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */
3
1syntax = "proto3"; 4syntax = "proto3";
2 5
3/* Enums similar to ESP IDF */ 6/* Enums similar to ESP IDF */
@@ -28,9 +31,10 @@ enum Ctrl_WifiBw {
28} 31}
29 32
30enum Ctrl_WifiPowerSave { 33enum Ctrl_WifiPowerSave {
31 PS_Invalid = 0; 34 NO_PS = 0;
32 MIN_MODEM = 1; 35 MIN_MODEM = 1;
33 MAX_MODEM = 2; 36 MAX_MODEM = 2;
37 PS_Invalid = 3;
34} 38}
35 39
36enum Ctrl_WifiSecProt { 40enum Ctrl_WifiSecProt {
@@ -96,9 +100,16 @@ enum CtrlMsgId {
96 Req_GetWifiCurrTxPower = 120; 100 Req_GetWifiCurrTxPower = 120;
97 101
98 Req_ConfigHeartbeat = 121; 102 Req_ConfigHeartbeat = 121;
103 Req_EnableDisable = 122;
104 Req_GetFwVersion = 123;
105 Req_SetCountryCode = 124;
106 Req_GetCountryCode = 125;
107 Req_SetDhcpDnsStatus = 126;
108 Req_GetDhcpDnsStatus = 127;
109 Req_Custom_RPC_Unserialised_Msg = 128;
99 /* Add new control path command response before Req_Max 110 /* Add new control path command response before Req_Max
100 * and update Req_Max */ 111 * and update Req_Max */
101 Req_Max = 122; 112 Req_Max = 129;
102 113
103 /** Response Msgs **/ 114 /** Response Msgs **/
104 Resp_Base = 200; 115 Resp_Base = 200;
@@ -130,9 +141,16 @@ enum CtrlMsgId {
130 Resp_GetWifiCurrTxPower = 220; 141 Resp_GetWifiCurrTxPower = 220;
131 142
132 Resp_ConfigHeartbeat = 221; 143 Resp_ConfigHeartbeat = 221;
144 Resp_EnableDisable = 222;
145 Resp_GetFwVersion = 223;
146 Resp_SetCountryCode = 224;
147 Resp_GetCountryCode = 225;
148 Resp_SetDhcpDnsStatus = 226;
149 Resp_GetDhcpDnsStatus = 227;
150 Resp_Custom_RPC_Unserialised_Msg = 228;
133 /* Add new control path command response before Resp_Max 151 /* Add new control path command response before Resp_Max
134 * and update Resp_Max */ 152 * and update Resp_Max */
135 Resp_Max = 222; 153 Resp_Max = 229;
136 154
137 /** Event Msgs **/ 155 /** Event Msgs **/
138 Event_Base = 300; 156 Event_Base = 300;
@@ -140,9 +158,22 @@ enum CtrlMsgId {
140 Event_Heartbeat = 302; 158 Event_Heartbeat = 302;
141 Event_StationDisconnectFromAP = 303; 159 Event_StationDisconnectFromAP = 303;
142 Event_StationDisconnectFromESPSoftAP = 304; 160 Event_StationDisconnectFromESPSoftAP = 304;
161 Event_StationConnectedToAP = 305;
162 Event_StationConnectedToESPSoftAP = 306;
163 Event_SetDhcpDnsStatus = 307;
164 Event_Custom_RPC_Unserialised_Msg = 308;
143 /* Add new control path command notification before Event_Max 165 /* Add new control path command notification before Event_Max
144 * and update Event_Max */ 166 * and update Event_Max */
145 Event_Max = 305; 167 Event_Max = 309;
168}
169
170enum HostedFeature {
171 Hosted_InvalidFeature = 0;
172 Hosted_Wifi = 1;
173 Hosted_Bluetooth = 2;
174 Hosted_Is_Network_Split_On = 3;
175
176 /* Add your new features here and re-build prot using build_proto.sh */
146} 177}
147 178
148/* internal supporting structures for CtrlMsg */ 179/* internal supporting structures for CtrlMsg */
@@ -213,6 +244,7 @@ message CtrlMsg_Resp_GetAPConfig {
213 int32 chnl = 4; 244 int32 chnl = 4;
214 Ctrl_WifiSecProt sec_prot = 5; 245 Ctrl_WifiSecProt sec_prot = 5;
215 int32 resp = 6; 246 int32 resp = 6;
247 int32 band_mode = 7;
216} 248}
217 249
218message CtrlMsg_Req_ConnectAP { 250message CtrlMsg_Req_ConnectAP {
@@ -221,11 +253,13 @@ message CtrlMsg_Req_ConnectAP {
221 string bssid = 3; 253 string bssid = 3;
222 bool is_wpa3_supported = 4; 254 bool is_wpa3_supported = 4;
223 int32 listen_interval = 5; 255 int32 listen_interval = 5;
256 int32 band_mode = 6;
224} 257}
225 258
226message CtrlMsg_Resp_ConnectAP { 259message CtrlMsg_Resp_ConnectAP {
227 int32 resp = 1; 260 int32 resp = 1;
228 bytes mac = 2; 261 bytes mac = 2;
262 int32 band_mode = 3;
229} 263}
230 264
231message CtrlMsg_Req_GetSoftAPConfig { 265message CtrlMsg_Req_GetSoftAPConfig {
@@ -240,6 +274,7 @@ message CtrlMsg_Resp_GetSoftAPConfig {
240 bool ssid_hidden = 6; 274 bool ssid_hidden = 6;
241 int32 bw = 7; 275 int32 bw = 7;
242 int32 resp = 8; 276 int32 resp = 8;
277 int32 band_mode = 9;
243} 278}
244 279
245message CtrlMsg_Req_StartSoftAP { 280message CtrlMsg_Req_StartSoftAP {
@@ -250,11 +285,13 @@ message CtrlMsg_Req_StartSoftAP {
250 int32 max_conn = 5; 285 int32 max_conn = 5;
251 bool ssid_hidden = 6; 286 bool ssid_hidden = 6;
252 int32 bw = 7; 287 int32 bw = 7;
288 int32 band_mode = 8;
253} 289}
254 290
255message CtrlMsg_Resp_StartSoftAP { 291message CtrlMsg_Resp_StartSoftAP {
256 int32 resp = 1; 292 int32 resp = 1;
257 bytes mac = 2; 293 bytes mac = 2;
294 int32 band_mode = 3;
258} 295}
259 296
260message CtrlMsg_Req_ScanResult { 297message CtrlMsg_Req_ScanResult {
@@ -302,7 +339,7 @@ message CtrlMsg_Req_VendorIEData {
302 int32 length = 2; 339 int32 length = 2;
303 bytes vendor_oui = 3; 340 bytes vendor_oui = 3;
304 int32 vendor_oui_type = 4; 341 int32 vendor_oui_type = 4;
305 bytes payload = 5; 342 bytes payload = 5;
306} 343}
307 344
308message CtrlMsg_Req_SetSoftAPVendorSpecificIE { 345message CtrlMsg_Req_SetSoftAPVendorSpecificIE {
@@ -341,6 +378,81 @@ message CtrlMsg_Resp_ConfigHeartbeat {
341 int32 resp = 1; 378 int32 resp = 1;
342} 379}
343 380
381message CtrlMsg_Req_EnableDisable {
382 uint32 feature = 1;
383 bool enable = 2;
384}
385
386message CtrlMsg_Resp_EnableDisable {
387 int32 resp = 1;
388}
389
390message CtrlMsg_Req_GetFwVersion {
391}
392
393message CtrlMsg_Resp_GetFwVersion {
394 int32 resp = 1;
395 string name = 2;
396 uint32 major1 = 3;
397 uint32 major2 = 4;
398 uint32 minor = 5;
399 uint32 rev_patch1 = 6;
400 uint32 rev_patch2 = 7;
401}
402
403message CtrlMsg_Req_SetCountryCode {
404 bytes country = 1;
405 bool ieee80211d_enabled = 2;
406}
407
408message CtrlMsg_Resp_SetCountryCode {
409 int32 resp = 1;
410}
411
412message CtrlMsg_Req_GetCountryCode {
413}
414
415message CtrlMsg_Resp_GetCountryCode {
416 int32 resp = 1;
417 bytes country = 2;
418}
419
420message CtrlMsg_Req_SetDhcpDnsStatus {
421 int32 iface = 1;
422 int32 net_link_up = 2;
423
424 int32 dhcp_up = 3;
425 bytes dhcp_ip = 4;
426 bytes dhcp_nm = 5;
427 bytes dhcp_gw = 6;
428
429 int32 dns_up = 7;
430 bytes dns_ip = 8;
431 int32 dns_type = 9;
432}
433
434message CtrlMsg_Resp_SetDhcpDnsStatus {
435 int32 resp = 1;
436}
437
438message CtrlMsg_Req_GetDhcpDnsStatus {
439}
440
441message CtrlMsg_Resp_GetDhcpDnsStatus {
442 int32 resp = 1;
443 int32 iface = 2;
444 int32 net_link_up = 3;
445
446 int32 dhcp_up = 4;
447 bytes dhcp_ip = 5;
448 bytes dhcp_nm = 6;
449 bytes dhcp_gw = 7;
450
451 int32 dns_up = 8;
452 bytes dns_ip = 9;
453 int32 dns_type = 10;
454}
455
344/** Event structure **/ 456/** Event structure **/
345message CtrlMsg_Event_ESPInit { 457message CtrlMsg_Event_ESPInit {
346 bytes init_data = 1; 458 bytes init_data = 1;
@@ -352,11 +464,70 @@ message CtrlMsg_Event_Heartbeat {
352 464
353message CtrlMsg_Event_StationDisconnectFromAP { 465message CtrlMsg_Event_StationDisconnectFromAP {
354 int32 resp = 1; 466 int32 resp = 1;
467 bytes ssid = 2;
468 uint32 ssid_len = 3;
469 bytes bssid = 4;
470 uint32 reason = 5;
471 int32 rssi = 6;
355} 472}
356 473
474message CtrlMsg_Event_StationConnectedToAP {
475 int32 resp = 1;
476 bytes ssid = 2;
477 uint32 ssid_len = 3;
478 bytes bssid = 4;
479 uint32 channel = 5;
480 int32 authmode = 6;
481 int32 aid = 7;
482}
483
484
357message CtrlMsg_Event_StationDisconnectFromESPSoftAP { 485message CtrlMsg_Event_StationDisconnectFromESPSoftAP {
358 int32 resp = 1; 486 int32 resp = 1;
359 bytes mac = 2; 487 bytes mac = 2;
488 uint32 aid = 3;
489 bool is_mesh_child = 4;
490 uint32 reason = 5;
491}
492
493message CtrlMsg_Event_StationConnectedToESPSoftAP {
494 int32 resp = 1;
495 bytes mac = 2;
496 uint32 aid = 3;
497 bool is_mesh_child = 4;
498}
499
500message CtrlMsg_Event_SetDhcpDnsStatus {
501 int32 iface = 1;
502 int32 net_link_up = 2;
503
504 int32 dhcp_up = 3;
505 bytes dhcp_ip = 4;
506 bytes dhcp_nm = 5;
507 bytes dhcp_gw = 6;
508
509 int32 dns_up = 7;
510 bytes dns_ip = 8;
511 int32 dns_type = 9;
512 int32 resp = 10;
513}
514
515/* Add Custom RPC message structures after existing message structures to make it easily notice */
516message CtrlMsg_Req_CustomRpcUnserialisedMsg {
517 uint32 custom_msg_id = 1;
518 bytes data = 2;
519}
520
521message CtrlMsg_Resp_CustomRpcUnserialisedMsg {
522 int32 resp = 1;
523 uint32 custom_msg_id = 2;
524 bytes data = 3;
525}
526
527message CtrlMsg_Event_CustomRpcUnserialisedMsg {
528 int32 resp = 1;
529 uint32 custom_evt_id = 2;
530 bytes data = 3;
360} 531}
361 532
362message CtrlMsg { 533message CtrlMsg {
@@ -366,6 +537,12 @@ message CtrlMsg {
366 /* msg id */ 537 /* msg id */
367 CtrlMsgId msg_id = 2; 538 CtrlMsgId msg_id = 2;
368 539
540 /* UID of message */
541 int32 uid = 3;
542
543 /* Request/response type: sync or async */
544 uint32 req_resp_type = 4;
545
369 /* union of all msg ids */ 546 /* union of all msg ids */
370 oneof payload { 547 oneof payload {
371 /** Requests **/ 548 /** Requests **/
@@ -395,6 +572,13 @@ message CtrlMsg {
395 CtrlMsg_Req_SetWifiMaxTxPower req_set_wifi_max_tx_power = 119; 572 CtrlMsg_Req_SetWifiMaxTxPower req_set_wifi_max_tx_power = 119;
396 CtrlMsg_Req_GetWifiCurrTxPower req_get_wifi_curr_tx_power = 120; 573 CtrlMsg_Req_GetWifiCurrTxPower req_get_wifi_curr_tx_power = 120;
397 CtrlMsg_Req_ConfigHeartbeat req_config_heartbeat = 121; 574 CtrlMsg_Req_ConfigHeartbeat req_config_heartbeat = 121;
575 CtrlMsg_Req_EnableDisable req_enable_disable_feat = 122;
576 CtrlMsg_Req_GetFwVersion req_get_fw_version = 123;
577 CtrlMsg_Req_SetCountryCode req_set_country_code = 124;
578 CtrlMsg_Req_GetCountryCode req_get_country_code = 125;
579 CtrlMsg_Req_SetDhcpDnsStatus req_set_dhcp_dns_status = 126;
580 CtrlMsg_Req_GetDhcpDnsStatus req_get_dhcp_dns_status = 127;
581 CtrlMsg_Req_CustomRpcUnserialisedMsg req_custom_rpc_unserialised_msg = 128;
398 582
399 /** Responses **/ 583 /** Responses **/
400 CtrlMsg_Resp_GetMacAddress resp_get_mac_address = 201; 584 CtrlMsg_Resp_GetMacAddress resp_get_mac_address = 201;
@@ -422,11 +606,22 @@ message CtrlMsg {
422 CtrlMsg_Resp_SetWifiMaxTxPower resp_set_wifi_max_tx_power = 219; 606 CtrlMsg_Resp_SetWifiMaxTxPower resp_set_wifi_max_tx_power = 219;
423 CtrlMsg_Resp_GetWifiCurrTxPower resp_get_wifi_curr_tx_power = 220; 607 CtrlMsg_Resp_GetWifiCurrTxPower resp_get_wifi_curr_tx_power = 220;
424 CtrlMsg_Resp_ConfigHeartbeat resp_config_heartbeat = 221; 608 CtrlMsg_Resp_ConfigHeartbeat resp_config_heartbeat = 221;
609 CtrlMsg_Resp_EnableDisable resp_enable_disable_feat = 222;
610 CtrlMsg_Resp_GetFwVersion resp_get_fw_version = 223;
611 CtrlMsg_Resp_SetCountryCode resp_set_country_code = 224;
612 CtrlMsg_Resp_GetCountryCode resp_get_country_code = 225;
613 CtrlMsg_Resp_SetDhcpDnsStatus resp_set_dhcp_dns_status = 226;
614 CtrlMsg_Resp_GetDhcpDnsStatus resp_get_dhcp_dns_status = 227;
615 CtrlMsg_Resp_CustomRpcUnserialisedMsg resp_custom_rpc_unserialised_msg = 228;
425 616
426 /** Notifications **/ 617 /** Notifications **/
427 CtrlMsg_Event_ESPInit event_esp_init = 301; 618 CtrlMsg_Event_ESPInit event_esp_init = 301;
428 CtrlMsg_Event_Heartbeat event_heartbeat = 302; 619 CtrlMsg_Event_Heartbeat event_heartbeat = 302;
429 CtrlMsg_Event_StationDisconnectFromAP event_station_disconnect_from_AP = 303; 620 CtrlMsg_Event_StationDisconnectFromAP event_station_disconnect_from_AP = 303;
430 CtrlMsg_Event_StationDisconnectFromESPSoftAP event_station_disconnect_from_ESP_SoftAP = 304; 621 CtrlMsg_Event_StationDisconnectFromESPSoftAP event_station_disconnect_from_ESP_SoftAP = 304;
622 CtrlMsg_Event_StationConnectedToAP event_station_connected_to_AP = 305;
623 CtrlMsg_Event_StationConnectedToESPSoftAP event_station_connected_to_ESP_SoftAP = 306;
624 CtrlMsg_Event_SetDhcpDnsStatus event_set_dhcp_dns_status = 307;
625 CtrlMsg_Event_CustomRpcUnserialisedMsg event_custom_rpc_unserialised_msg = 308;
431 } 626 }
432} 627}
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 @@
1use embassy_time::Timer;
2use embedded_hal::digital::InputPin;
3use embedded_hal_async::digital::Wait;
4use embedded_hal_async::spi::SpiDevice;
5
6/// Physical interface trait for communicating with the ESP chip.
7pub trait Interface {
8 /// Wait for the HANDSHAKE signal indicating the ESP is ready for a new transaction.
9 async fn wait_for_handshake(&mut self);
10
11 /// Wait for the READY signal indicating the ESP has data to send.
12 async fn wait_for_ready(&mut self);
13
14 /// Perform a SPI transfer, exchanging data with the ESP chip.
15 async fn transfer(&mut self, rx: &mut [u8], tx: &[u8]);
16}
17
18/// Standard SPI interface.
19///
20/// This interface is what's implemented in the upstream `esp-hosted-fg` firmware. It uses:
21/// - An `SpiDevice` for SPI communication (CS is handled by the device)
22/// - A handshake pin that signals when the ESP is ready for a new transaction
23/// - A ready pin that indicates when the ESP has data to send
24pub struct SpiInterface<SPI, IN> {
25 spi: SPI,
26 handshake: IN,
27 ready: IN,
28}
29
30impl<SPI, IN> SpiInterface<SPI, IN>
31where
32 SPI: SpiDevice,
33 IN: InputPin + Wait,
34{
35 /// Create a new SpiInterface.
36 pub fn new(spi: SPI, handshake: IN, ready: IN) -> Self {
37 Self { spi, handshake, ready }
38 }
39}
40
41impl<SPI, IN> Interface for SpiInterface<SPI, IN>
42where
43 SPI: SpiDevice,
44 IN: InputPin + Wait,
45{
46 async fn wait_for_handshake(&mut self) {
47 self.handshake.wait_for_high().await.unwrap();
48 }
49
50 async fn wait_for_ready(&mut self) {
51 self.ready.wait_for_high().await.unwrap();
52 }
53
54 async fn transfer(&mut self, rx: &mut [u8], tx: &[u8]) {
55 self.spi.transfer(rx, tx).await.unwrap();
56
57 // The esp-hosted firmware deasserts the HANDSHAKE pin a few us AFTER ending the SPI transfer
58 // If we check it again too fast, we'll see it's high from the previous transfer, and if we send it
59 // data it will get lost.
60 Timer::after_micros(100).await;
61 }
62}
diff --git a/embassy-net-esp-hosted/src/ioctl.rs b/embassy-net-esp-hosted/src/ioctl.rs
index 512023206..de0f867e8 100644
--- a/embassy-net-esp-hosted/src/ioctl.rs
+++ b/embassy-net-esp-hosted/src/ioctl.rs
@@ -1,5 +1,5 @@
1use core::cell::RefCell; 1use core::cell::RefCell;
2use core::future::{poll_fn, Future}; 2use core::future::{Future, poll_fn};
3use core::task::Poll; 3use core::task::Poll;
4 4
5use embassy_sync::waitqueue::WakerRegistration; 5use embassy_sync::waitqueue::WakerRegistration;
@@ -23,16 +23,23 @@ pub struct Shared(RefCell<SharedInner>);
23 23
24struct SharedInner { 24struct SharedInner {
25 ioctl: IoctlState, 25 ioctl: IoctlState,
26 is_init: bool, 26 state: ControlState,
27 control_waker: WakerRegistration, 27 control_waker: WakerRegistration,
28 runner_waker: WakerRegistration, 28 runner_waker: WakerRegistration,
29} 29}
30 30
31#[derive(Clone, Copy)]
32pub(crate) enum ControlState {
33 Init,
34 Reboot,
35 Ready,
36}
37
31impl Shared { 38impl Shared {
32 pub fn new() -> Self { 39 pub fn new() -> Self {
33 Self(RefCell::new(SharedInner { 40 Self(RefCell::new(SharedInner {
34 ioctl: IoctlState::Done { resp_len: 0 }, 41 ioctl: IoctlState::Done { resp_len: 0 },
35 is_init: false, 42 state: ControlState::Init,
36 control_waker: WakerRegistration::new(), 43 control_waker: WakerRegistration::new(),
37 runner_waker: WakerRegistration::new(), 44 runner_waker: WakerRegistration::new(),
38 })) 45 }))
@@ -99,18 +106,30 @@ impl Shared {
99 } 106 }
100 } 107 }
101 108
109 // ota
110 pub fn ota_done(&self) {
111 let mut this = self.0.borrow_mut();
112 this.state = ControlState::Reboot;
113 }
114
102 // // // // // // // // // // // // // // // // // // // // 115 // // // // // // // // // // // // // // // // // // // //
116 //
117 // check if ota is in progress
118 pub(crate) fn state(&self) -> ControlState {
119 let this = self.0.borrow();
120 this.state
121 }
103 122
104 pub fn init_done(&self) { 123 pub fn init_done(&self) {
105 let mut this = self.0.borrow_mut(); 124 let mut this = self.0.borrow_mut();
106 this.is_init = true; 125 this.state = ControlState::Ready;
107 this.control_waker.wake(); 126 this.control_waker.wake();
108 } 127 }
109 128
110 pub fn init_wait(&self) -> impl Future<Output = ()> + '_ { 129 pub fn init_wait(&self) -> impl Future<Output = ()> + '_ {
111 poll_fn(|cx| { 130 poll_fn(|cx| {
112 let mut this = self.0.borrow_mut(); 131 let mut this = self.0.borrow_mut();
113 if this.is_init { 132 if let ControlState::Ready = this.state {
114 Poll::Ready(()) 133 Poll::Ready(())
115 } else { 134 } else {
116 this.control_waker.register(cx.waker()); 135 this.control_waker.register(cx.waker());
diff --git a/embassy-net-esp-hosted/src/lib.rs b/embassy-net-esp-hosted/src/lib.rs
index f05e2a70a..2c7377281 100644
--- a/embassy-net-esp-hosted/src/lib.rs
+++ b/embassy-net-esp-hosted/src/lib.rs
@@ -1,27 +1,34 @@
1#![no_std] 1#![no_std]
2#![doc = include_str!("../README.md")] 2#![doc = include_str!("../README.md")]
3#![warn(missing_docs)] 3#![warn(missing_docs)]
4#![allow(async_fn_in_trait)]
4 5
5use embassy_futures::select::{select4, Either4}; 6use embassy_futures::select::{Either4, select4};
6use embassy_net_driver_channel as ch; 7use embassy_net_driver_channel as ch;
7use embassy_net_driver_channel::driver::LinkState; 8use embassy_net_driver_channel::driver::LinkState;
8use embassy_time::{Duration, Instant, Timer}; 9use embassy_time::{Duration, Instant, Timer};
9use embedded_hal::digital::{InputPin, OutputPin}; 10use embedded_hal::digital::OutputPin;
10use embedded_hal_async::digital::Wait;
11use embedded_hal_async::spi::SpiDevice;
12 11
13use crate::ioctl::{PendingIoctl, Shared}; 12use crate::ioctl::{PendingIoctl, Shared};
14use crate::proto::{CtrlMsg, CtrlMsgPayload}; 13use crate::proto::{CtrlMsg, CtrlMsg_};
15 14
15#[allow(unused)]
16#[allow(non_snake_case)]
17#[allow(non_camel_case_types)]
18#[allow(non_upper_case_globals)]
19#[allow(missing_docs)]
20#[allow(clippy::all)]
16mod proto; 21mod proto;
17 22
18// must be first 23// must be first
19mod fmt; 24mod fmt;
20 25
21mod control; 26mod control;
27mod iface;
22mod ioctl; 28mod ioctl;
23 29
24pub use control::*; 30pub use control::*;
31pub use iface::*;
25 32
26const MTU: usize = 1514; 33const MTU: usize = 1514;
27 34
@@ -118,20 +125,17 @@ impl State {
118/// Type alias for network driver. 125/// Type alias for network driver.
119pub type NetDriver<'a> = ch::Device<'a, MTU>; 126pub type NetDriver<'a> = ch::Device<'a, MTU>;
120 127
121/// Create a new esp-hosted driver using the provided state, SPI peripheral and pins. 128/// Create a new esp-hosted driver using the provided state, interface, and reset pin.
122/// 129///
123/// Returns a device handle for interfacing with embassy-net, a control handle for 130/// Returns a device handle for interfacing with embassy-net, a control handle for
124/// interacting with the driver, and a runner for communicating with the WiFi device. 131/// interacting with the driver, and a runner for communicating with the WiFi device.
125pub async fn new<'a, SPI, IN, OUT>( 132pub async fn new<'a, I, OUT>(
126 state: &'a mut State, 133 state: &'a mut State,
127 spi: SPI, 134 iface: I,
128 handshake: IN,
129 ready: IN,
130 reset: OUT, 135 reset: OUT,
131) -> (NetDriver<'a>, Control<'a>, Runner<'a, SPI, IN, OUT>) 136) -> (NetDriver<'a>, Control<'a>, Runner<'a, I, OUT>)
132where 137where
133 SPI: SpiDevice, 138 I: Interface,
134 IN: InputPin + Wait,
135 OUT: OutputPin, 139 OUT: OutputPin,
136{ 140{
137 let (ch_runner, device) = ch::new(&mut state.ch, ch::driver::HardwareAddress::Ethernet([0; 6])); 141 let (ch_runner, device) = ch::new(&mut state.ch, ch::driver::HardwareAddress::Ethernet([0; 6]));
@@ -142,10 +146,8 @@ where
142 state_ch, 146 state_ch,
143 shared: &state.shared, 147 shared: &state.shared,
144 next_seq: 1, 148 next_seq: 1,
145 handshake,
146 ready,
147 reset, 149 reset,
148 spi, 150 iface,
149 heartbeat_deadline: Instant::now() + HEARTBEAT_MAX_GAP, 151 heartbeat_deadline: Instant::now() + HEARTBEAT_MAX_GAP,
150 }; 152 };
151 153
@@ -153,7 +155,7 @@ where
153} 155}
154 156
155/// Runner for communicating with the WiFi device. 157/// Runner for communicating with the WiFi device.
156pub struct Runner<'a, SPI, IN, OUT> { 158pub struct Runner<'a, I, OUT> {
157 ch: ch::Runner<'a, MTU>, 159 ch: ch::Runner<'a, MTU>,
158 state_ch: ch::StateRunner<'a>, 160 state_ch: ch::StateRunner<'a>,
159 shared: &'a Shared, 161 shared: &'a Shared,
@@ -161,16 +163,13 @@ pub struct Runner<'a, SPI, IN, OUT> {
161 next_seq: u16, 163 next_seq: u16,
162 heartbeat_deadline: Instant, 164 heartbeat_deadline: Instant,
163 165
164 spi: SPI, 166 iface: I,
165 handshake: IN,
166 ready: IN,
167 reset: OUT, 167 reset: OUT,
168} 168}
169 169
170impl<'a, SPI, IN, OUT> Runner<'a, SPI, IN, OUT> 170impl<'a, I, OUT> Runner<'a, I, OUT>
171where 171where
172 SPI: SpiDevice, 172 I: Interface,
173 IN: InputPin + Wait,
174 OUT: OutputPin, 173 OUT: OutputPin,
175{ 174{
176 /// Run the packet processing. 175 /// Run the packet processing.
@@ -185,11 +184,11 @@ where
185 let mut rx_buf = [0u8; MAX_SPI_BUFFER_SIZE]; 184 let mut rx_buf = [0u8; MAX_SPI_BUFFER_SIZE];
186 185
187 loop { 186 loop {
188 self.handshake.wait_for_high().await.unwrap(); 187 self.iface.wait_for_handshake().await;
189 188
190 let ioctl = self.shared.ioctl_wait_pending(); 189 let ioctl = self.shared.ioctl_wait_pending();
191 let tx = self.ch.tx_buf(); 190 let tx = self.ch.tx_buf();
192 let ev = async { self.ready.wait_for_high().await.unwrap() }; 191 let ev = async { self.iface.wait_for_ready().await };
193 let hb = Timer::at(self.heartbeat_deadline); 192 let hb = Timer::at(self.heartbeat_deadline);
194 193
195 match select4(ioctl, tx, ev, hb).await { 194 match select4(ioctl, tx, ev, hb).await {
@@ -235,6 +234,11 @@ where
235 tx_buf[..PayloadHeader::SIZE].fill(0); 234 tx_buf[..PayloadHeader::SIZE].fill(0);
236 } 235 }
237 Either4::Fourth(()) => { 236 Either4::Fourth(()) => {
237 // Extend the deadline if initializing
238 if let ioctl::ControlState::Reboot = self.shared.state() {
239 self.heartbeat_deadline = Instant::now() + HEARTBEAT_MAX_GAP;
240 continue;
241 }
238 panic!("heartbeat from esp32 stopped") 242 panic!("heartbeat from esp32 stopped")
239 } 243 }
240 } 244 }
@@ -243,15 +247,9 @@ where
243 trace!("tx: {:02x}", &tx_buf[..40]); 247 trace!("tx: {:02x}", &tx_buf[..40]);
244 } 248 }
245 249
246 self.spi.transfer(&mut rx_buf, &tx_buf).await.unwrap(); 250 self.iface.transfer(&mut rx_buf, &tx_buf).await;
247 251
248 // The esp-hosted firmware deasserts the HANSHAKE pin a few us AFTER ending the SPI transfer
249 // If we check it again too fast, we'll see it's high from the previous transfer, and if we send it
250 // data it will get lost.
251 // Make sure we check it after 100us at minimum.
252 let delay_until = Instant::now() + Duration::from_micros(100);
253 self.handle_rx(&mut rx_buf); 252 self.handle_rx(&mut rx_buf);
254 Timer::at(delay_until).await;
255 } 253 }
256 } 254 }
257 255
@@ -326,10 +324,12 @@ where
326 } 324 }
327 325
328 fn handle_event(&mut self, data: &[u8]) { 326 fn handle_event(&mut self, data: &[u8]) {
329 let Ok(event) = noproto::read::<CtrlMsg>(data) else { 327 use micropb::MessageDecode;
328 let mut event = CtrlMsg::default();
329 if event.decode_from_bytes(data).is_err() {
330 warn!("failed to parse event"); 330 warn!("failed to parse event");
331 return; 331 return;
332 }; 332 }
333 333
334 debug!("event: {:?}", &event); 334 debug!("event: {:?}", &event);
335 335
@@ -339,9 +339,13 @@ where
339 }; 339 };
340 340
341 match payload { 341 match payload {
342 CtrlMsgPayload::EventEspInit(_) => self.shared.init_done(), 342 CtrlMsg_::Payload::EventEspInit(_) => self.shared.init_done(),
343 CtrlMsgPayload::EventHeartbeat(_) => self.heartbeat_deadline = Instant::now() + HEARTBEAT_MAX_GAP, 343 CtrlMsg_::Payload::EventHeartbeat(_) => self.heartbeat_deadline = Instant::now() + HEARTBEAT_MAX_GAP,
344 CtrlMsgPayload::EventStationDisconnectFromAp(e) => { 344 CtrlMsg_::Payload::EventStationConnectedToAp(e) => {
345 info!("connected, code {}", e.resp);
346 self.state_ch.set_link_state(LinkState::Up);
347 }
348 CtrlMsg_::Payload::EventStationDisconnectFromAp(e) => {
345 info!("disconnected, code {}", e.resp); 349 info!("disconnected, code {}", e.resp);
346 self.state_ch.set_link_state(LinkState::Down); 350 self.state_ch.set_link_state(LinkState::Down);
347 } 351 }
diff --git a/embassy-net-esp-hosted/src/proto.rs b/embassy-net-esp-hosted/src/proto.rs
index 089ded677..09bec8984 100644
--- a/embassy-net-esp-hosted/src/proto.rs
+++ b/embassy-net-esp-hosted/src/proto.rs
@@ -1,656 +1,13764 @@
1#![allow(unused)] 1/*
2Generated with the following snippet.
3Switch to a proper script when https://github.com/YuhanLiin/micropb/issues/30 is done
2 4
3use heapless::{String, Vec}; 5 let mut g = micropb_gen::Generator::new();
6 g.use_container_heapless();
4 7
5/// internal supporting structures for CtrlMsg 8 g.configure(
9 ".",
10 micropb_gen::Config::new()
11 .max_bytes(32) // For ssid, mac, etc - strings
12 .max_len(16) // For repeated fields
13 .type_attributes("#[cfg_attr(feature = \"defmt\", derive(defmt::Format))]"),
14 );
6 15
7#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 16 // Special config for things that need to be larger
8#[cfg_attr(feature = "defmt", derive(defmt::Format))] 17 g.configure(
9pub(crate) struct ScanResult { 18 ".CtrlMsg_Req_OTAWrite.ota_data",
10 #[noproto(tag = "1")] 19 micropb_gen::Config::new().max_bytes(256),
11 pub ssid: String<32>, 20 );
12 #[noproto(tag = "2")] 21 g.configure(
13 pub chnl: u32, 22 ".CtrlMsg_Event_ESPInit.init_data",
14 #[noproto(tag = "3")] 23 micropb_gen::Config::new().max_bytes(64),
15 pub rssi: u32, 24 );
16 #[noproto(tag = "4")] 25 g.configure(
17 pub bssid: String<32>, 26 ".CtrlMsg_Req_VendorIEData.payload",
18 #[noproto(tag = "5")] 27 micropb_gen::Config::new().max_bytes(64),
19 pub sec_prot: CtrlWifiSecProt, 28 );
20} 29
30 g.compile_protos(&["src/esp_hosted_config.proto"], format!("{}/proto.rs", out_dir))
31 .unwrap();
32
33*/
21 34
22#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 35#[derive(Debug, Default, PartialEq, Clone)]
23#[cfg_attr(feature = "defmt", derive(defmt::Format))] 36#[cfg_attr(feature = "defmt", derive(defmt::Format))]
24pub(crate) struct ConnectedStaList { 37pub struct ScanResult {
25 #[noproto(tag = "1")] 38 pub r#ssid: ::micropb::heapless::Vec<u8, 32>,
26 pub mac: String<32>, 39 pub r#chnl: u32,
27 #[noproto(tag = "2")] 40 pub r#rssi: i32,
28 pub rssi: u32, 41 pub r#bssid: ::micropb::heapless::Vec<u8, 32>,
42 pub r#sec_prot: Ctrl_WifiSecProt,
29} 43}
30/// * Req/Resp structure * 44impl ScanResult {
31 45 ///Return a reference to `ssid`
32#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 46 #[inline]
47 pub fn r#ssid(&self) -> &::micropb::heapless::Vec<u8, 32> {
48 &self.r#ssid
49 }
50 ///Return a mutable reference to `ssid`
51 #[inline]
52 pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
53 &mut self.r#ssid
54 }
55 ///Set the value of `ssid`
56 #[inline]
57 pub fn set_ssid(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
58 self.r#ssid = value.into();
59 self
60 }
61 ///Builder method that sets the value of `ssid`. Useful for initializing the message.
62 #[inline]
63 pub fn init_ssid(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
64 self.r#ssid = value.into();
65 self
66 }
67 ///Return a reference to `chnl`
68 #[inline]
69 pub fn r#chnl(&self) -> &u32 {
70 &self.r#chnl
71 }
72 ///Return a mutable reference to `chnl`
73 #[inline]
74 pub fn mut_chnl(&mut self) -> &mut u32 {
75 &mut self.r#chnl
76 }
77 ///Set the value of `chnl`
78 #[inline]
79 pub fn set_chnl(&mut self, value: u32) -> &mut Self {
80 self.r#chnl = value.into();
81 self
82 }
83 ///Builder method that sets the value of `chnl`. Useful for initializing the message.
84 #[inline]
85 pub fn init_chnl(mut self, value: u32) -> Self {
86 self.r#chnl = value.into();
87 self
88 }
89 ///Return a reference to `rssi`
90 #[inline]
91 pub fn r#rssi(&self) -> &i32 {
92 &self.r#rssi
93 }
94 ///Return a mutable reference to `rssi`
95 #[inline]
96 pub fn mut_rssi(&mut self) -> &mut i32 {
97 &mut self.r#rssi
98 }
99 ///Set the value of `rssi`
100 #[inline]
101 pub fn set_rssi(&mut self, value: i32) -> &mut Self {
102 self.r#rssi = value.into();
103 self
104 }
105 ///Builder method that sets the value of `rssi`. Useful for initializing the message.
106 #[inline]
107 pub fn init_rssi(mut self, value: i32) -> Self {
108 self.r#rssi = value.into();
109 self
110 }
111 ///Return a reference to `bssid`
112 #[inline]
113 pub fn r#bssid(&self) -> &::micropb::heapless::Vec<u8, 32> {
114 &self.r#bssid
115 }
116 ///Return a mutable reference to `bssid`
117 #[inline]
118 pub fn mut_bssid(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
119 &mut self.r#bssid
120 }
121 ///Set the value of `bssid`
122 #[inline]
123 pub fn set_bssid(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
124 self.r#bssid = value.into();
125 self
126 }
127 ///Builder method that sets the value of `bssid`. Useful for initializing the message.
128 #[inline]
129 pub fn init_bssid(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
130 self.r#bssid = value.into();
131 self
132 }
133 ///Return a reference to `sec_prot`
134 #[inline]
135 pub fn r#sec_prot(&self) -> &Ctrl_WifiSecProt {
136 &self.r#sec_prot
137 }
138 ///Return a mutable reference to `sec_prot`
139 #[inline]
140 pub fn mut_sec_prot(&mut self) -> &mut Ctrl_WifiSecProt {
141 &mut self.r#sec_prot
142 }
143 ///Set the value of `sec_prot`
144 #[inline]
145 pub fn set_sec_prot(&mut self, value: Ctrl_WifiSecProt) -> &mut Self {
146 self.r#sec_prot = value.into();
147 self
148 }
149 ///Builder method that sets the value of `sec_prot`. Useful for initializing the message.
150 #[inline]
151 pub fn init_sec_prot(mut self, value: Ctrl_WifiSecProt) -> Self {
152 self.r#sec_prot = value.into();
153 self
154 }
155}
156impl ::micropb::MessageDecode for ScanResult {
157 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
158 &mut self,
159 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
160 len: usize,
161 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
162 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
163 let before = decoder.bytes_read();
164 while decoder.bytes_read() - before < len {
165 let tag = decoder.decode_tag()?;
166 match tag.field_num() {
167 0 => return Err(::micropb::DecodeError::ZeroField),
168 1u32 => {
169 let mut_ref = &mut self.r#ssid;
170 {
171 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
172 };
173 }
174 2u32 => {
175 let mut_ref = &mut self.r#chnl;
176 {
177 let val = decoder.decode_varint32()?;
178 let val_ref = &val;
179 if *val_ref != 0 {
180 *mut_ref = val as _;
181 }
182 };
183 }
184 3u32 => {
185 let mut_ref = &mut self.r#rssi;
186 {
187 let val = decoder.decode_int32()?;
188 let val_ref = &val;
189 if *val_ref != 0 {
190 *mut_ref = val as _;
191 }
192 };
193 }
194 4u32 => {
195 let mut_ref = &mut self.r#bssid;
196 {
197 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
198 };
199 }
200 5u32 => {
201 let mut_ref = &mut self.r#sec_prot;
202 {
203 let val = decoder.decode_int32().map(|n| Ctrl_WifiSecProt(n as _))?;
204 let val_ref = &val;
205 if val_ref.0 != 0 {
206 *mut_ref = val as _;
207 }
208 };
209 }
210 _ => {
211 decoder.skip_wire_value(tag.wire_type())?;
212 }
213 }
214 }
215 Ok(())
216 }
217}
218impl ::micropb::MessageEncode for ScanResult {
219 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
220 let mut max_size = 0;
221 if let ::core::option::Option::Some(size) =
222 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
223 {
224 max_size += size;
225 } else {
226 break 'msg (::core::option::Option::<usize>::None);
227 };
228 if let ::core::option::Option::Some(size) =
229 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
230 {
231 max_size += size;
232 } else {
233 break 'msg (::core::option::Option::<usize>::None);
234 };
235 if let ::core::option::Option::Some(size) =
236 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
237 {
238 max_size += size;
239 } else {
240 break 'msg (::core::option::Option::<usize>::None);
241 };
242 if let ::core::option::Option::Some(size) =
243 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
244 {
245 max_size += size;
246 } else {
247 break 'msg (::core::option::Option::<usize>::None);
248 };
249 if let ::core::option::Option::Some(size) =
250 ::micropb::const_map!(::core::option::Option::Some(Ctrl_WifiSecProt::_MAX_SIZE), |size| size
251 + 1usize)
252 {
253 max_size += size;
254 } else {
255 break 'msg (::core::option::Option::<usize>::None);
256 };
257 ::core::option::Option::Some(max_size)
258 };
259 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
260 &self,
261 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
262 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
263 use ::micropb::{FieldEncode, PbMap};
264 {
265 let val_ref = &self.r#ssid;
266 if !val_ref.is_empty() {
267 encoder.encode_varint32(10u32)?;
268 encoder.encode_bytes(val_ref)?;
269 }
270 }
271 {
272 let val_ref = &self.r#chnl;
273 if *val_ref != 0 {
274 encoder.encode_varint32(16u32)?;
275 encoder.encode_varint32(*val_ref as _)?;
276 }
277 }
278 {
279 let val_ref = &self.r#rssi;
280 if *val_ref != 0 {
281 encoder.encode_varint32(24u32)?;
282 encoder.encode_int32(*val_ref as _)?;
283 }
284 }
285 {
286 let val_ref = &self.r#bssid;
287 if !val_ref.is_empty() {
288 encoder.encode_varint32(34u32)?;
289 encoder.encode_bytes(val_ref)?;
290 }
291 }
292 {
293 let val_ref = &self.r#sec_prot;
294 if val_ref.0 != 0 {
295 encoder.encode_varint32(40u32)?;
296 encoder.encode_int32(val_ref.0 as _)?;
297 }
298 }
299 Ok(())
300 }
301 fn compute_size(&self) -> usize {
302 use ::micropb::{FieldEncode, PbMap};
303 let mut size = 0;
304 {
305 let val_ref = &self.r#ssid;
306 if !val_ref.is_empty() {
307 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
308 }
309 }
310 {
311 let val_ref = &self.r#chnl;
312 if *val_ref != 0 {
313 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
314 }
315 }
316 {
317 let val_ref = &self.r#rssi;
318 if *val_ref != 0 {
319 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
320 }
321 }
322 {
323 let val_ref = &self.r#bssid;
324 if !val_ref.is_empty() {
325 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
326 }
327 }
328 {
329 let val_ref = &self.r#sec_prot;
330 if val_ref.0 != 0 {
331 size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _);
332 }
333 }
334 size
335 }
336}
337#[derive(Debug, Default, PartialEq, Clone)]
33#[cfg_attr(feature = "defmt", derive(defmt::Format))] 338#[cfg_attr(feature = "defmt", derive(defmt::Format))]
34pub(crate) struct CtrlMsgReqGetMacAddress { 339pub struct ConnectedSTAList {
35 #[noproto(tag = "1")] 340 pub r#mac: ::micropb::heapless::Vec<u8, 32>,
36 pub mode: u32, 341 pub r#rssi: i32,
37} 342}
38 343impl ConnectedSTAList {
39#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 344 ///Return a reference to `mac`
345 #[inline]
346 pub fn r#mac(&self) -> &::micropb::heapless::Vec<u8, 32> {
347 &self.r#mac
348 }
349 ///Return a mutable reference to `mac`
350 #[inline]
351 pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
352 &mut self.r#mac
353 }
354 ///Set the value of `mac`
355 #[inline]
356 pub fn set_mac(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
357 self.r#mac = value.into();
358 self
359 }
360 ///Builder method that sets the value of `mac`. Useful for initializing the message.
361 #[inline]
362 pub fn init_mac(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
363 self.r#mac = value.into();
364 self
365 }
366 ///Return a reference to `rssi`
367 #[inline]
368 pub fn r#rssi(&self) -> &i32 {
369 &self.r#rssi
370 }
371 ///Return a mutable reference to `rssi`
372 #[inline]
373 pub fn mut_rssi(&mut self) -> &mut i32 {
374 &mut self.r#rssi
375 }
376 ///Set the value of `rssi`
377 #[inline]
378 pub fn set_rssi(&mut self, value: i32) -> &mut Self {
379 self.r#rssi = value.into();
380 self
381 }
382 ///Builder method that sets the value of `rssi`. Useful for initializing the message.
383 #[inline]
384 pub fn init_rssi(mut self, value: i32) -> Self {
385 self.r#rssi = value.into();
386 self
387 }
388}
389impl ::micropb::MessageDecode for ConnectedSTAList {
390 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
391 &mut self,
392 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
393 len: usize,
394 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
395 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
396 let before = decoder.bytes_read();
397 while decoder.bytes_read() - before < len {
398 let tag = decoder.decode_tag()?;
399 match tag.field_num() {
400 0 => return Err(::micropb::DecodeError::ZeroField),
401 1u32 => {
402 let mut_ref = &mut self.r#mac;
403 {
404 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
405 };
406 }
407 2u32 => {
408 let mut_ref = &mut self.r#rssi;
409 {
410 let val = decoder.decode_int32()?;
411 let val_ref = &val;
412 if *val_ref != 0 {
413 *mut_ref = val as _;
414 }
415 };
416 }
417 _ => {
418 decoder.skip_wire_value(tag.wire_type())?;
419 }
420 }
421 }
422 Ok(())
423 }
424}
425impl ::micropb::MessageEncode for ConnectedSTAList {
426 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
427 let mut max_size = 0;
428 if let ::core::option::Option::Some(size) =
429 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
430 {
431 max_size += size;
432 } else {
433 break 'msg (::core::option::Option::<usize>::None);
434 };
435 if let ::core::option::Option::Some(size) =
436 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
437 {
438 max_size += size;
439 } else {
440 break 'msg (::core::option::Option::<usize>::None);
441 };
442 ::core::option::Option::Some(max_size)
443 };
444 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
445 &self,
446 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
447 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
448 use ::micropb::{FieldEncode, PbMap};
449 {
450 let val_ref = &self.r#mac;
451 if !val_ref.is_empty() {
452 encoder.encode_varint32(10u32)?;
453 encoder.encode_bytes(val_ref)?;
454 }
455 }
456 {
457 let val_ref = &self.r#rssi;
458 if *val_ref != 0 {
459 encoder.encode_varint32(16u32)?;
460 encoder.encode_int32(*val_ref as _)?;
461 }
462 }
463 Ok(())
464 }
465 fn compute_size(&self) -> usize {
466 use ::micropb::{FieldEncode, PbMap};
467 let mut size = 0;
468 {
469 let val_ref = &self.r#mac;
470 if !val_ref.is_empty() {
471 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
472 }
473 }
474 {
475 let val_ref = &self.r#rssi;
476 if *val_ref != 0 {
477 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
478 }
479 }
480 size
481 }
482}
483#[derive(Debug, Default, PartialEq, Clone)]
40#[cfg_attr(feature = "defmt", derive(defmt::Format))] 484#[cfg_attr(feature = "defmt", derive(defmt::Format))]
41pub(crate) struct CtrlMsgRespGetMacAddress { 485pub struct CtrlMsg_Req_GetMacAddress {
42 #[noproto(tag = "1")] 486 pub r#mode: i32,
43 pub mac: String<32>,
44 #[noproto(tag = "2")]
45 pub resp: u32,
46} 487}
47 488impl CtrlMsg_Req_GetMacAddress {
48#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 489 ///Return a reference to `mode`
490 #[inline]
491 pub fn r#mode(&self) -> &i32 {
492 &self.r#mode
493 }
494 ///Return a mutable reference to `mode`
495 #[inline]
496 pub fn mut_mode(&mut self) -> &mut i32 {
497 &mut self.r#mode
498 }
499 ///Set the value of `mode`
500 #[inline]
501 pub fn set_mode(&mut self, value: i32) -> &mut Self {
502 self.r#mode = value.into();
503 self
504 }
505 ///Builder method that sets the value of `mode`. Useful for initializing the message.
506 #[inline]
507 pub fn init_mode(mut self, value: i32) -> Self {
508 self.r#mode = value.into();
509 self
510 }
511}
512impl ::micropb::MessageDecode for CtrlMsg_Req_GetMacAddress {
513 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
514 &mut self,
515 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
516 len: usize,
517 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
518 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
519 let before = decoder.bytes_read();
520 while decoder.bytes_read() - before < len {
521 let tag = decoder.decode_tag()?;
522 match tag.field_num() {
523 0 => return Err(::micropb::DecodeError::ZeroField),
524 1u32 => {
525 let mut_ref = &mut self.r#mode;
526 {
527 let val = decoder.decode_int32()?;
528 let val_ref = &val;
529 if *val_ref != 0 {
530 *mut_ref = val as _;
531 }
532 };
533 }
534 _ => {
535 decoder.skip_wire_value(tag.wire_type())?;
536 }
537 }
538 }
539 Ok(())
540 }
541}
542impl ::micropb::MessageEncode for CtrlMsg_Req_GetMacAddress {
543 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
544 let mut max_size = 0;
545 if let ::core::option::Option::Some(size) =
546 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
547 {
548 max_size += size;
549 } else {
550 break 'msg (::core::option::Option::<usize>::None);
551 };
552 ::core::option::Option::Some(max_size)
553 };
554 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
555 &self,
556 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
557 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
558 use ::micropb::{FieldEncode, PbMap};
559 {
560 let val_ref = &self.r#mode;
561 if *val_ref != 0 {
562 encoder.encode_varint32(8u32)?;
563 encoder.encode_int32(*val_ref as _)?;
564 }
565 }
566 Ok(())
567 }
568 fn compute_size(&self) -> usize {
569 use ::micropb::{FieldEncode, PbMap};
570 let mut size = 0;
571 {
572 let val_ref = &self.r#mode;
573 if *val_ref != 0 {
574 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
575 }
576 }
577 size
578 }
579}
580#[derive(Debug, Default, PartialEq, Clone)]
49#[cfg_attr(feature = "defmt", derive(defmt::Format))] 581#[cfg_attr(feature = "defmt", derive(defmt::Format))]
50pub(crate) struct CtrlMsgReqGetMode {} 582pub struct CtrlMsg_Resp_GetMacAddress {
51 583 pub r#mac: ::micropb::heapless::Vec<u8, 32>,
52#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 584 pub r#resp: i32,
585}
586impl CtrlMsg_Resp_GetMacAddress {
587 ///Return a reference to `mac`
588 #[inline]
589 pub fn r#mac(&self) -> &::micropb::heapless::Vec<u8, 32> {
590 &self.r#mac
591 }
592 ///Return a mutable reference to `mac`
593 #[inline]
594 pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
595 &mut self.r#mac
596 }
597 ///Set the value of `mac`
598 #[inline]
599 pub fn set_mac(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
600 self.r#mac = value.into();
601 self
602 }
603 ///Builder method that sets the value of `mac`. Useful for initializing the message.
604 #[inline]
605 pub fn init_mac(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
606 self.r#mac = value.into();
607 self
608 }
609 ///Return a reference to `resp`
610 #[inline]
611 pub fn r#resp(&self) -> &i32 {
612 &self.r#resp
613 }
614 ///Return a mutable reference to `resp`
615 #[inline]
616 pub fn mut_resp(&mut self) -> &mut i32 {
617 &mut self.r#resp
618 }
619 ///Set the value of `resp`
620 #[inline]
621 pub fn set_resp(&mut self, value: i32) -> &mut Self {
622 self.r#resp = value.into();
623 self
624 }
625 ///Builder method that sets the value of `resp`. Useful for initializing the message.
626 #[inline]
627 pub fn init_resp(mut self, value: i32) -> Self {
628 self.r#resp = value.into();
629 self
630 }
631}
632impl ::micropb::MessageDecode for CtrlMsg_Resp_GetMacAddress {
633 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
634 &mut self,
635 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
636 len: usize,
637 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
638 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
639 let before = decoder.bytes_read();
640 while decoder.bytes_read() - before < len {
641 let tag = decoder.decode_tag()?;
642 match tag.field_num() {
643 0 => return Err(::micropb::DecodeError::ZeroField),
644 1u32 => {
645 let mut_ref = &mut self.r#mac;
646 {
647 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
648 };
649 }
650 2u32 => {
651 let mut_ref = &mut self.r#resp;
652 {
653 let val = decoder.decode_int32()?;
654 let val_ref = &val;
655 if *val_ref != 0 {
656 *mut_ref = val as _;
657 }
658 };
659 }
660 _ => {
661 decoder.skip_wire_value(tag.wire_type())?;
662 }
663 }
664 }
665 Ok(())
666 }
667}
668impl ::micropb::MessageEncode for CtrlMsg_Resp_GetMacAddress {
669 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
670 let mut max_size = 0;
671 if let ::core::option::Option::Some(size) =
672 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
673 {
674 max_size += size;
675 } else {
676 break 'msg (::core::option::Option::<usize>::None);
677 };
678 if let ::core::option::Option::Some(size) =
679 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
680 {
681 max_size += size;
682 } else {
683 break 'msg (::core::option::Option::<usize>::None);
684 };
685 ::core::option::Option::Some(max_size)
686 };
687 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
688 &self,
689 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
690 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
691 use ::micropb::{FieldEncode, PbMap};
692 {
693 let val_ref = &self.r#mac;
694 if !val_ref.is_empty() {
695 encoder.encode_varint32(10u32)?;
696 encoder.encode_bytes(val_ref)?;
697 }
698 }
699 {
700 let val_ref = &self.r#resp;
701 if *val_ref != 0 {
702 encoder.encode_varint32(16u32)?;
703 encoder.encode_int32(*val_ref as _)?;
704 }
705 }
706 Ok(())
707 }
708 fn compute_size(&self) -> usize {
709 use ::micropb::{FieldEncode, PbMap};
710 let mut size = 0;
711 {
712 let val_ref = &self.r#mac;
713 if !val_ref.is_empty() {
714 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
715 }
716 }
717 {
718 let val_ref = &self.r#resp;
719 if *val_ref != 0 {
720 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
721 }
722 }
723 size
724 }
725}
726#[derive(Debug, Default, PartialEq, Clone)]
53#[cfg_attr(feature = "defmt", derive(defmt::Format))] 727#[cfg_attr(feature = "defmt", derive(defmt::Format))]
54pub(crate) struct CtrlMsgRespGetMode { 728pub struct CtrlMsg_Req_GetMode {}
55 #[noproto(tag = "1")] 729impl CtrlMsg_Req_GetMode {}
56 pub mode: u32, 730impl ::micropb::MessageDecode for CtrlMsg_Req_GetMode {
57 #[noproto(tag = "2")] 731 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
58 pub resp: u32, 732 &mut self,
733 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
734 len: usize,
735 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
736 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
737 let before = decoder.bytes_read();
738 while decoder.bytes_read() - before < len {
739 let tag = decoder.decode_tag()?;
740 match tag.field_num() {
741 0 => return Err(::micropb::DecodeError::ZeroField),
742 _ => {
743 decoder.skip_wire_value(tag.wire_type())?;
744 }
745 }
746 }
747 Ok(())
748 }
59} 749}
60 750impl ::micropb::MessageEncode for CtrlMsg_Req_GetMode {
61#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 751 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
752 let mut max_size = 0;
753 ::core::option::Option::Some(max_size)
754 };
755 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
756 &self,
757 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
758 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
759 use ::micropb::{FieldEncode, PbMap};
760 Ok(())
761 }
762 fn compute_size(&self) -> usize {
763 use ::micropb::{FieldEncode, PbMap};
764 let mut size = 0;
765 size
766 }
767}
768#[derive(Debug, Default, PartialEq, Clone)]
62#[cfg_attr(feature = "defmt", derive(defmt::Format))] 769#[cfg_attr(feature = "defmt", derive(defmt::Format))]
63pub(crate) struct CtrlMsgReqSetMode { 770pub struct CtrlMsg_Resp_GetMode {
64 #[noproto(tag = "1")] 771 pub r#mode: i32,
65 pub mode: u32, 772 pub r#resp: i32,
66} 773}
67 774impl CtrlMsg_Resp_GetMode {
68#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 775 ///Return a reference to `mode`
776 #[inline]
777 pub fn r#mode(&self) -> &i32 {
778 &self.r#mode
779 }
780 ///Return a mutable reference to `mode`
781 #[inline]
782 pub fn mut_mode(&mut self) -> &mut i32 {
783 &mut self.r#mode
784 }
785 ///Set the value of `mode`
786 #[inline]
787 pub fn set_mode(&mut self, value: i32) -> &mut Self {
788 self.r#mode = value.into();
789 self
790 }
791 ///Builder method that sets the value of `mode`. Useful for initializing the message.
792 #[inline]
793 pub fn init_mode(mut self, value: i32) -> Self {
794 self.r#mode = value.into();
795 self
796 }
797 ///Return a reference to `resp`
798 #[inline]
799 pub fn r#resp(&self) -> &i32 {
800 &self.r#resp
801 }
802 ///Return a mutable reference to `resp`
803 #[inline]
804 pub fn mut_resp(&mut self) -> &mut i32 {
805 &mut self.r#resp
806 }
807 ///Set the value of `resp`
808 #[inline]
809 pub fn set_resp(&mut self, value: i32) -> &mut Self {
810 self.r#resp = value.into();
811 self
812 }
813 ///Builder method that sets the value of `resp`. Useful for initializing the message.
814 #[inline]
815 pub fn init_resp(mut self, value: i32) -> Self {
816 self.r#resp = value.into();
817 self
818 }
819}
820impl ::micropb::MessageDecode for CtrlMsg_Resp_GetMode {
821 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
822 &mut self,
823 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
824 len: usize,
825 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
826 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
827 let before = decoder.bytes_read();
828 while decoder.bytes_read() - before < len {
829 let tag = decoder.decode_tag()?;
830 match tag.field_num() {
831 0 => return Err(::micropb::DecodeError::ZeroField),
832 1u32 => {
833 let mut_ref = &mut self.r#mode;
834 {
835 let val = decoder.decode_int32()?;
836 let val_ref = &val;
837 if *val_ref != 0 {
838 *mut_ref = val as _;
839 }
840 };
841 }
842 2u32 => {
843 let mut_ref = &mut self.r#resp;
844 {
845 let val = decoder.decode_int32()?;
846 let val_ref = &val;
847 if *val_ref != 0 {
848 *mut_ref = val as _;
849 }
850 };
851 }
852 _ => {
853 decoder.skip_wire_value(tag.wire_type())?;
854 }
855 }
856 }
857 Ok(())
858 }
859}
860impl ::micropb::MessageEncode for CtrlMsg_Resp_GetMode {
861 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
862 let mut max_size = 0;
863 if let ::core::option::Option::Some(size) =
864 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
865 {
866 max_size += size;
867 } else {
868 break 'msg (::core::option::Option::<usize>::None);
869 };
870 if let ::core::option::Option::Some(size) =
871 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
872 {
873 max_size += size;
874 } else {
875 break 'msg (::core::option::Option::<usize>::None);
876 };
877 ::core::option::Option::Some(max_size)
878 };
879 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
880 &self,
881 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
882 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
883 use ::micropb::{FieldEncode, PbMap};
884 {
885 let val_ref = &self.r#mode;
886 if *val_ref != 0 {
887 encoder.encode_varint32(8u32)?;
888 encoder.encode_int32(*val_ref as _)?;
889 }
890 }
891 {
892 let val_ref = &self.r#resp;
893 if *val_ref != 0 {
894 encoder.encode_varint32(16u32)?;
895 encoder.encode_int32(*val_ref as _)?;
896 }
897 }
898 Ok(())
899 }
900 fn compute_size(&self) -> usize {
901 use ::micropb::{FieldEncode, PbMap};
902 let mut size = 0;
903 {
904 let val_ref = &self.r#mode;
905 if *val_ref != 0 {
906 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
907 }
908 }
909 {
910 let val_ref = &self.r#resp;
911 if *val_ref != 0 {
912 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
913 }
914 }
915 size
916 }
917}
918#[derive(Debug, Default, PartialEq, Clone)]
69#[cfg_attr(feature = "defmt", derive(defmt::Format))] 919#[cfg_attr(feature = "defmt", derive(defmt::Format))]
70pub(crate) struct CtrlMsgRespSetMode { 920pub struct CtrlMsg_Req_SetMode {
71 #[noproto(tag = "1")] 921 pub r#mode: i32,
72 pub resp: u32,
73} 922}
74 923impl CtrlMsg_Req_SetMode {
75#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 924 ///Return a reference to `mode`
925 #[inline]
926 pub fn r#mode(&self) -> &i32 {
927 &self.r#mode
928 }
929 ///Return a mutable reference to `mode`
930 #[inline]
931 pub fn mut_mode(&mut self) -> &mut i32 {
932 &mut self.r#mode
933 }
934 ///Set the value of `mode`
935 #[inline]
936 pub fn set_mode(&mut self, value: i32) -> &mut Self {
937 self.r#mode = value.into();
938 self
939 }
940 ///Builder method that sets the value of `mode`. Useful for initializing the message.
941 #[inline]
942 pub fn init_mode(mut self, value: i32) -> Self {
943 self.r#mode = value.into();
944 self
945 }
946}
947impl ::micropb::MessageDecode for CtrlMsg_Req_SetMode {
948 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
949 &mut self,
950 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
951 len: usize,
952 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
953 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
954 let before = decoder.bytes_read();
955 while decoder.bytes_read() - before < len {
956 let tag = decoder.decode_tag()?;
957 match tag.field_num() {
958 0 => return Err(::micropb::DecodeError::ZeroField),
959 1u32 => {
960 let mut_ref = &mut self.r#mode;
961 {
962 let val = decoder.decode_int32()?;
963 let val_ref = &val;
964 if *val_ref != 0 {
965 *mut_ref = val as _;
966 }
967 };
968 }
969 _ => {
970 decoder.skip_wire_value(tag.wire_type())?;
971 }
972 }
973 }
974 Ok(())
975 }
976}
977impl ::micropb::MessageEncode for CtrlMsg_Req_SetMode {
978 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
979 let mut max_size = 0;
980 if let ::core::option::Option::Some(size) =
981 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
982 {
983 max_size += size;
984 } else {
985 break 'msg (::core::option::Option::<usize>::None);
986 };
987 ::core::option::Option::Some(max_size)
988 };
989 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
990 &self,
991 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
992 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
993 use ::micropb::{FieldEncode, PbMap};
994 {
995 let val_ref = &self.r#mode;
996 if *val_ref != 0 {
997 encoder.encode_varint32(8u32)?;
998 encoder.encode_int32(*val_ref as _)?;
999 }
1000 }
1001 Ok(())
1002 }
1003 fn compute_size(&self) -> usize {
1004 use ::micropb::{FieldEncode, PbMap};
1005 let mut size = 0;
1006 {
1007 let val_ref = &self.r#mode;
1008 if *val_ref != 0 {
1009 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
1010 }
1011 }
1012 size
1013 }
1014}
1015#[derive(Debug, Default, PartialEq, Clone)]
76#[cfg_attr(feature = "defmt", derive(defmt::Format))] 1016#[cfg_attr(feature = "defmt", derive(defmt::Format))]
77pub(crate) struct CtrlMsgReqGetStatus {} 1017pub struct CtrlMsg_Resp_SetMode {
78 1018 pub r#resp: i32,
79#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 1019}
1020impl CtrlMsg_Resp_SetMode {
1021 ///Return a reference to `resp`
1022 #[inline]
1023 pub fn r#resp(&self) -> &i32 {
1024 &self.r#resp
1025 }
1026 ///Return a mutable reference to `resp`
1027 #[inline]
1028 pub fn mut_resp(&mut self) -> &mut i32 {
1029 &mut self.r#resp
1030 }
1031 ///Set the value of `resp`
1032 #[inline]
1033 pub fn set_resp(&mut self, value: i32) -> &mut Self {
1034 self.r#resp = value.into();
1035 self
1036 }
1037 ///Builder method that sets the value of `resp`. Useful for initializing the message.
1038 #[inline]
1039 pub fn init_resp(mut self, value: i32) -> Self {
1040 self.r#resp = value.into();
1041 self
1042 }
1043}
1044impl ::micropb::MessageDecode for CtrlMsg_Resp_SetMode {
1045 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
1046 &mut self,
1047 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
1048 len: usize,
1049 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
1050 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
1051 let before = decoder.bytes_read();
1052 while decoder.bytes_read() - before < len {
1053 let tag = decoder.decode_tag()?;
1054 match tag.field_num() {
1055 0 => return Err(::micropb::DecodeError::ZeroField),
1056 1u32 => {
1057 let mut_ref = &mut self.r#resp;
1058 {
1059 let val = decoder.decode_int32()?;
1060 let val_ref = &val;
1061 if *val_ref != 0 {
1062 *mut_ref = val as _;
1063 }
1064 };
1065 }
1066 _ => {
1067 decoder.skip_wire_value(tag.wire_type())?;
1068 }
1069 }
1070 }
1071 Ok(())
1072 }
1073}
1074impl ::micropb::MessageEncode for CtrlMsg_Resp_SetMode {
1075 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
1076 let mut max_size = 0;
1077 if let ::core::option::Option::Some(size) =
1078 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
1079 {
1080 max_size += size;
1081 } else {
1082 break 'msg (::core::option::Option::<usize>::None);
1083 };
1084 ::core::option::Option::Some(max_size)
1085 };
1086 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
1087 &self,
1088 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
1089 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
1090 use ::micropb::{FieldEncode, PbMap};
1091 {
1092 let val_ref = &self.r#resp;
1093 if *val_ref != 0 {
1094 encoder.encode_varint32(8u32)?;
1095 encoder.encode_int32(*val_ref as _)?;
1096 }
1097 }
1098 Ok(())
1099 }
1100 fn compute_size(&self) -> usize {
1101 use ::micropb::{FieldEncode, PbMap};
1102 let mut size = 0;
1103 {
1104 let val_ref = &self.r#resp;
1105 if *val_ref != 0 {
1106 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
1107 }
1108 }
1109 size
1110 }
1111}
1112#[derive(Debug, Default, PartialEq, Clone)]
80#[cfg_attr(feature = "defmt", derive(defmt::Format))] 1113#[cfg_attr(feature = "defmt", derive(defmt::Format))]
81pub(crate) struct CtrlMsgRespGetStatus { 1114pub struct CtrlMsg_Req_GetStatus {}
82 #[noproto(tag = "1")] 1115impl CtrlMsg_Req_GetStatus {}
83 pub resp: u32, 1116impl ::micropb::MessageDecode for CtrlMsg_Req_GetStatus {
1117 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
1118 &mut self,
1119 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
1120 len: usize,
1121 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
1122 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
1123 let before = decoder.bytes_read();
1124 while decoder.bytes_read() - before < len {
1125 let tag = decoder.decode_tag()?;
1126 match tag.field_num() {
1127 0 => return Err(::micropb::DecodeError::ZeroField),
1128 _ => {
1129 decoder.skip_wire_value(tag.wire_type())?;
1130 }
1131 }
1132 }
1133 Ok(())
1134 }
84} 1135}
85 1136impl ::micropb::MessageEncode for CtrlMsg_Req_GetStatus {
86#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 1137 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
1138 let mut max_size = 0;
1139 ::core::option::Option::Some(max_size)
1140 };
1141 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
1142 &self,
1143 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
1144 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
1145 use ::micropb::{FieldEncode, PbMap};
1146 Ok(())
1147 }
1148 fn compute_size(&self) -> usize {
1149 use ::micropb::{FieldEncode, PbMap};
1150 let mut size = 0;
1151 size
1152 }
1153}
1154#[derive(Debug, Default, PartialEq, Clone)]
87#[cfg_attr(feature = "defmt", derive(defmt::Format))] 1155#[cfg_attr(feature = "defmt", derive(defmt::Format))]
88pub(crate) struct CtrlMsgReqSetMacAddress { 1156pub struct CtrlMsg_Resp_GetStatus {
89 #[noproto(tag = "1")] 1157 pub r#resp: i32,
90 pub mac: String<32>,
91 #[noproto(tag = "2")]
92 pub mode: u32,
93} 1158}
94 1159impl CtrlMsg_Resp_GetStatus {
95#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 1160 ///Return a reference to `resp`
1161 #[inline]
1162 pub fn r#resp(&self) -> &i32 {
1163 &self.r#resp
1164 }
1165 ///Return a mutable reference to `resp`
1166 #[inline]
1167 pub fn mut_resp(&mut self) -> &mut i32 {
1168 &mut self.r#resp
1169 }
1170 ///Set the value of `resp`
1171 #[inline]
1172 pub fn set_resp(&mut self, value: i32) -> &mut Self {
1173 self.r#resp = value.into();
1174 self
1175 }
1176 ///Builder method that sets the value of `resp`. Useful for initializing the message.
1177 #[inline]
1178 pub fn init_resp(mut self, value: i32) -> Self {
1179 self.r#resp = value.into();
1180 self
1181 }
1182}
1183impl ::micropb::MessageDecode for CtrlMsg_Resp_GetStatus {
1184 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
1185 &mut self,
1186 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
1187 len: usize,
1188 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
1189 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
1190 let before = decoder.bytes_read();
1191 while decoder.bytes_read() - before < len {
1192 let tag = decoder.decode_tag()?;
1193 match tag.field_num() {
1194 0 => return Err(::micropb::DecodeError::ZeroField),
1195 1u32 => {
1196 let mut_ref = &mut self.r#resp;
1197 {
1198 let val = decoder.decode_int32()?;
1199 let val_ref = &val;
1200 if *val_ref != 0 {
1201 *mut_ref = val as _;
1202 }
1203 };
1204 }
1205 _ => {
1206 decoder.skip_wire_value(tag.wire_type())?;
1207 }
1208 }
1209 }
1210 Ok(())
1211 }
1212}
1213impl ::micropb::MessageEncode for CtrlMsg_Resp_GetStatus {
1214 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
1215 let mut max_size = 0;
1216 if let ::core::option::Option::Some(size) =
1217 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
1218 {
1219 max_size += size;
1220 } else {
1221 break 'msg (::core::option::Option::<usize>::None);
1222 };
1223 ::core::option::Option::Some(max_size)
1224 };
1225 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
1226 &self,
1227 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
1228 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
1229 use ::micropb::{FieldEncode, PbMap};
1230 {
1231 let val_ref = &self.r#resp;
1232 if *val_ref != 0 {
1233 encoder.encode_varint32(8u32)?;
1234 encoder.encode_int32(*val_ref as _)?;
1235 }
1236 }
1237 Ok(())
1238 }
1239 fn compute_size(&self) -> usize {
1240 use ::micropb::{FieldEncode, PbMap};
1241 let mut size = 0;
1242 {
1243 let val_ref = &self.r#resp;
1244 if *val_ref != 0 {
1245 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
1246 }
1247 }
1248 size
1249 }
1250}
1251#[derive(Debug, Default, PartialEq, Clone)]
96#[cfg_attr(feature = "defmt", derive(defmt::Format))] 1252#[cfg_attr(feature = "defmt", derive(defmt::Format))]
97pub(crate) struct CtrlMsgRespSetMacAddress { 1253pub struct CtrlMsg_Req_SetMacAddress {
98 #[noproto(tag = "1")] 1254 pub r#mac: ::micropb::heapless::Vec<u8, 32>,
99 pub resp: u32, 1255 pub r#mode: i32,
100} 1256}
101 1257impl CtrlMsg_Req_SetMacAddress {
102#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 1258 ///Return a reference to `mac`
1259 #[inline]
1260 pub fn r#mac(&self) -> &::micropb::heapless::Vec<u8, 32> {
1261 &self.r#mac
1262 }
1263 ///Return a mutable reference to `mac`
1264 #[inline]
1265 pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
1266 &mut self.r#mac
1267 }
1268 ///Set the value of `mac`
1269 #[inline]
1270 pub fn set_mac(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
1271 self.r#mac = value.into();
1272 self
1273 }
1274 ///Builder method that sets the value of `mac`. Useful for initializing the message.
1275 #[inline]
1276 pub fn init_mac(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
1277 self.r#mac = value.into();
1278 self
1279 }
1280 ///Return a reference to `mode`
1281 #[inline]
1282 pub fn r#mode(&self) -> &i32 {
1283 &self.r#mode
1284 }
1285 ///Return a mutable reference to `mode`
1286 #[inline]
1287 pub fn mut_mode(&mut self) -> &mut i32 {
1288 &mut self.r#mode
1289 }
1290 ///Set the value of `mode`
1291 #[inline]
1292 pub fn set_mode(&mut self, value: i32) -> &mut Self {
1293 self.r#mode = value.into();
1294 self
1295 }
1296 ///Builder method that sets the value of `mode`. Useful for initializing the message.
1297 #[inline]
1298 pub fn init_mode(mut self, value: i32) -> Self {
1299 self.r#mode = value.into();
1300 self
1301 }
1302}
1303impl ::micropb::MessageDecode for CtrlMsg_Req_SetMacAddress {
1304 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
1305 &mut self,
1306 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
1307 len: usize,
1308 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
1309 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
1310 let before = decoder.bytes_read();
1311 while decoder.bytes_read() - before < len {
1312 let tag = decoder.decode_tag()?;
1313 match tag.field_num() {
1314 0 => return Err(::micropb::DecodeError::ZeroField),
1315 1u32 => {
1316 let mut_ref = &mut self.r#mac;
1317 {
1318 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
1319 };
1320 }
1321 2u32 => {
1322 let mut_ref = &mut self.r#mode;
1323 {
1324 let val = decoder.decode_int32()?;
1325 let val_ref = &val;
1326 if *val_ref != 0 {
1327 *mut_ref = val as _;
1328 }
1329 };
1330 }
1331 _ => {
1332 decoder.skip_wire_value(tag.wire_type())?;
1333 }
1334 }
1335 }
1336 Ok(())
1337 }
1338}
1339impl ::micropb::MessageEncode for CtrlMsg_Req_SetMacAddress {
1340 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
1341 let mut max_size = 0;
1342 if let ::core::option::Option::Some(size) =
1343 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
1344 {
1345 max_size += size;
1346 } else {
1347 break 'msg (::core::option::Option::<usize>::None);
1348 };
1349 if let ::core::option::Option::Some(size) =
1350 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
1351 {
1352 max_size += size;
1353 } else {
1354 break 'msg (::core::option::Option::<usize>::None);
1355 };
1356 ::core::option::Option::Some(max_size)
1357 };
1358 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
1359 &self,
1360 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
1361 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
1362 use ::micropb::{FieldEncode, PbMap};
1363 {
1364 let val_ref = &self.r#mac;
1365 if !val_ref.is_empty() {
1366 encoder.encode_varint32(10u32)?;
1367 encoder.encode_bytes(val_ref)?;
1368 }
1369 }
1370 {
1371 let val_ref = &self.r#mode;
1372 if *val_ref != 0 {
1373 encoder.encode_varint32(16u32)?;
1374 encoder.encode_int32(*val_ref as _)?;
1375 }
1376 }
1377 Ok(())
1378 }
1379 fn compute_size(&self) -> usize {
1380 use ::micropb::{FieldEncode, PbMap};
1381 let mut size = 0;
1382 {
1383 let val_ref = &self.r#mac;
1384 if !val_ref.is_empty() {
1385 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
1386 }
1387 }
1388 {
1389 let val_ref = &self.r#mode;
1390 if *val_ref != 0 {
1391 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
1392 }
1393 }
1394 size
1395 }
1396}
1397#[derive(Debug, Default, PartialEq, Clone)]
103#[cfg_attr(feature = "defmt", derive(defmt::Format))] 1398#[cfg_attr(feature = "defmt", derive(defmt::Format))]
104pub(crate) struct CtrlMsgReqGetApConfig {} 1399pub struct CtrlMsg_Resp_SetMacAddress {
105 1400 pub r#resp: i32,
106#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)]
107#[cfg_attr(feature = "defmt", derive(defmt::Format))]
108pub(crate) struct CtrlMsgRespGetApConfig {
109 #[noproto(tag = "1")]
110 pub ssid: String<32>,
111 #[noproto(tag = "2")]
112 pub bssid: String<32>,
113 #[noproto(tag = "3")]
114 pub rssi: u32,
115 #[noproto(tag = "4")]
116 pub chnl: u32,
117 #[noproto(tag = "5")]
118 pub sec_prot: CtrlWifiSecProt,
119 #[noproto(tag = "6")]
120 pub resp: u32,
121} 1401}
122 1402impl CtrlMsg_Resp_SetMacAddress {
123#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 1403 ///Return a reference to `resp`
124#[cfg_attr(feature = "defmt", derive(defmt::Format))] 1404 #[inline]
125pub(crate) struct CtrlMsgReqConnectAp { 1405 pub fn r#resp(&self) -> &i32 {
126 #[noproto(tag = "1")] 1406 &self.r#resp
127 pub ssid: String<32>, 1407 }
128 #[noproto(tag = "2")] 1408 ///Return a mutable reference to `resp`
129 pub pwd: String<32>, 1409 #[inline]
130 #[noproto(tag = "3")] 1410 pub fn mut_resp(&mut self) -> &mut i32 {
131 pub bssid: String<32>, 1411 &mut self.r#resp
132 #[noproto(tag = "4")] 1412 }
133 pub is_wpa3_supported: bool, 1413 ///Set the value of `resp`
134 #[noproto(tag = "5")] 1414 #[inline]
135 pub listen_interval: u32, 1415 pub fn set_resp(&mut self, value: i32) -> &mut Self {
1416 self.r#resp = value.into();
1417 self
1418 }
1419 ///Builder method that sets the value of `resp`. Useful for initializing the message.
1420 #[inline]
1421 pub fn init_resp(mut self, value: i32) -> Self {
1422 self.r#resp = value.into();
1423 self
1424 }
136} 1425}
137 1426impl ::micropb::MessageDecode for CtrlMsg_Resp_SetMacAddress {
138#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 1427 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
1428 &mut self,
1429 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
1430 len: usize,
1431 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
1432 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
1433 let before = decoder.bytes_read();
1434 while decoder.bytes_read() - before < len {
1435 let tag = decoder.decode_tag()?;
1436 match tag.field_num() {
1437 0 => return Err(::micropb::DecodeError::ZeroField),
1438 1u32 => {
1439 let mut_ref = &mut self.r#resp;
1440 {
1441 let val = decoder.decode_int32()?;
1442 let val_ref = &val;
1443 if *val_ref != 0 {
1444 *mut_ref = val as _;
1445 }
1446 };
1447 }
1448 _ => {
1449 decoder.skip_wire_value(tag.wire_type())?;
1450 }
1451 }
1452 }
1453 Ok(())
1454 }
1455}
1456impl ::micropb::MessageEncode for CtrlMsg_Resp_SetMacAddress {
1457 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
1458 let mut max_size = 0;
1459 if let ::core::option::Option::Some(size) =
1460 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
1461 {
1462 max_size += size;
1463 } else {
1464 break 'msg (::core::option::Option::<usize>::None);
1465 };
1466 ::core::option::Option::Some(max_size)
1467 };
1468 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
1469 &self,
1470 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
1471 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
1472 use ::micropb::{FieldEncode, PbMap};
1473 {
1474 let val_ref = &self.r#resp;
1475 if *val_ref != 0 {
1476 encoder.encode_varint32(8u32)?;
1477 encoder.encode_int32(*val_ref as _)?;
1478 }
1479 }
1480 Ok(())
1481 }
1482 fn compute_size(&self) -> usize {
1483 use ::micropb::{FieldEncode, PbMap};
1484 let mut size = 0;
1485 {
1486 let val_ref = &self.r#resp;
1487 if *val_ref != 0 {
1488 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
1489 }
1490 }
1491 size
1492 }
1493}
1494#[derive(Debug, Default, PartialEq, Clone)]
139#[cfg_attr(feature = "defmt", derive(defmt::Format))] 1495#[cfg_attr(feature = "defmt", derive(defmt::Format))]
140pub(crate) struct CtrlMsgRespConnectAp { 1496pub struct CtrlMsg_Req_GetAPConfig {}
141 #[noproto(tag = "1")] 1497impl CtrlMsg_Req_GetAPConfig {}
142 pub resp: u32, 1498impl ::micropb::MessageDecode for CtrlMsg_Req_GetAPConfig {
143 #[noproto(tag = "2")] 1499 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
144 pub mac: String<32>, 1500 &mut self,
1501 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
1502 len: usize,
1503 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
1504 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
1505 let before = decoder.bytes_read();
1506 while decoder.bytes_read() - before < len {
1507 let tag = decoder.decode_tag()?;
1508 match tag.field_num() {
1509 0 => return Err(::micropb::DecodeError::ZeroField),
1510 _ => {
1511 decoder.skip_wire_value(tag.wire_type())?;
1512 }
1513 }
1514 }
1515 Ok(())
1516 }
145} 1517}
146 1518impl ::micropb::MessageEncode for CtrlMsg_Req_GetAPConfig {
147#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 1519 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
1520 let mut max_size = 0;
1521 ::core::option::Option::Some(max_size)
1522 };
1523 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
1524 &self,
1525 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
1526 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
1527 use ::micropb::{FieldEncode, PbMap};
1528 Ok(())
1529 }
1530 fn compute_size(&self) -> usize {
1531 use ::micropb::{FieldEncode, PbMap};
1532 let mut size = 0;
1533 size
1534 }
1535}
1536#[derive(Debug, Default, PartialEq, Clone)]
148#[cfg_attr(feature = "defmt", derive(defmt::Format))] 1537#[cfg_attr(feature = "defmt", derive(defmt::Format))]
149pub(crate) struct CtrlMsgReqGetSoftApConfig {} 1538pub struct CtrlMsg_Resp_GetAPConfig {
150 1539 pub r#ssid: ::micropb::heapless::Vec<u8, 32>,
151#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 1540 pub r#bssid: ::micropb::heapless::Vec<u8, 32>,
152#[cfg_attr(feature = "defmt", derive(defmt::Format))] 1541 pub r#rssi: i32,
153pub(crate) struct CtrlMsgRespGetSoftApConfig { 1542 pub r#chnl: i32,
154 #[noproto(tag = "1")] 1543 pub r#sec_prot: Ctrl_WifiSecProt,
155 pub ssid: String<32>, 1544 pub r#resp: i32,
156 #[noproto(tag = "2")] 1545 pub r#band_mode: i32,
157 pub pwd: String<32>,
158 #[noproto(tag = "3")]
159 pub chnl: u32,
160 #[noproto(tag = "4")]
161 pub sec_prot: CtrlWifiSecProt,
162 #[noproto(tag = "5")]
163 pub max_conn: u32,
164 #[noproto(tag = "6")]
165 pub ssid_hidden: bool,
166 #[noproto(tag = "7")]
167 pub bw: u32,
168 #[noproto(tag = "8")]
169 pub resp: u32,
170} 1546}
171 1547impl CtrlMsg_Resp_GetAPConfig {
172#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 1548 ///Return a reference to `ssid`
173#[cfg_attr(feature = "defmt", derive(defmt::Format))] 1549 #[inline]
174pub(crate) struct CtrlMsgReqStartSoftAp { 1550 pub fn r#ssid(&self) -> &::micropb::heapless::Vec<u8, 32> {
175 #[noproto(tag = "1")] 1551 &self.r#ssid
176 pub ssid: String<32>, 1552 }
177 #[noproto(tag = "2")] 1553 ///Return a mutable reference to `ssid`
178 pub pwd: String<32>, 1554 #[inline]
179 #[noproto(tag = "3")] 1555 pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
180 pub chnl: u32, 1556 &mut self.r#ssid
181 #[noproto(tag = "4")] 1557 }
182 pub sec_prot: CtrlWifiSecProt, 1558 ///Set the value of `ssid`
183 #[noproto(tag = "5")] 1559 #[inline]
184 pub max_conn: u32, 1560 pub fn set_ssid(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
185 #[noproto(tag = "6")] 1561 self.r#ssid = value.into();
186 pub ssid_hidden: bool, 1562 self
187 #[noproto(tag = "7")] 1563 }
188 pub bw: u32, 1564 ///Builder method that sets the value of `ssid`. Useful for initializing the message.
1565 #[inline]
1566 pub fn init_ssid(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
1567 self.r#ssid = value.into();
1568 self
1569 }
1570 ///Return a reference to `bssid`
1571 #[inline]
1572 pub fn r#bssid(&self) -> &::micropb::heapless::Vec<u8, 32> {
1573 &self.r#bssid
1574 }
1575 ///Return a mutable reference to `bssid`
1576 #[inline]
1577 pub fn mut_bssid(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
1578 &mut self.r#bssid
1579 }
1580 ///Set the value of `bssid`
1581 #[inline]
1582 pub fn set_bssid(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
1583 self.r#bssid = value.into();
1584 self
1585 }
1586 ///Builder method that sets the value of `bssid`. Useful for initializing the message.
1587 #[inline]
1588 pub fn init_bssid(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
1589 self.r#bssid = value.into();
1590 self
1591 }
1592 ///Return a reference to `rssi`
1593 #[inline]
1594 pub fn r#rssi(&self) -> &i32 {
1595 &self.r#rssi
1596 }
1597 ///Return a mutable reference to `rssi`
1598 #[inline]
1599 pub fn mut_rssi(&mut self) -> &mut i32 {
1600 &mut self.r#rssi
1601 }
1602 ///Set the value of `rssi`
1603 #[inline]
1604 pub fn set_rssi(&mut self, value: i32) -> &mut Self {
1605 self.r#rssi = value.into();
1606 self
1607 }
1608 ///Builder method that sets the value of `rssi`. Useful for initializing the message.
1609 #[inline]
1610 pub fn init_rssi(mut self, value: i32) -> Self {
1611 self.r#rssi = value.into();
1612 self
1613 }
1614 ///Return a reference to `chnl`
1615 #[inline]
1616 pub fn r#chnl(&self) -> &i32 {
1617 &self.r#chnl
1618 }
1619 ///Return a mutable reference to `chnl`
1620 #[inline]
1621 pub fn mut_chnl(&mut self) -> &mut i32 {
1622 &mut self.r#chnl
1623 }
1624 ///Set the value of `chnl`
1625 #[inline]
1626 pub fn set_chnl(&mut self, value: i32) -> &mut Self {
1627 self.r#chnl = value.into();
1628 self
1629 }
1630 ///Builder method that sets the value of `chnl`. Useful for initializing the message.
1631 #[inline]
1632 pub fn init_chnl(mut self, value: i32) -> Self {
1633 self.r#chnl = value.into();
1634 self
1635 }
1636 ///Return a reference to `sec_prot`
1637 #[inline]
1638 pub fn r#sec_prot(&self) -> &Ctrl_WifiSecProt {
1639 &self.r#sec_prot
1640 }
1641 ///Return a mutable reference to `sec_prot`
1642 #[inline]
1643 pub fn mut_sec_prot(&mut self) -> &mut Ctrl_WifiSecProt {
1644 &mut self.r#sec_prot
1645 }
1646 ///Set the value of `sec_prot`
1647 #[inline]
1648 pub fn set_sec_prot(&mut self, value: Ctrl_WifiSecProt) -> &mut Self {
1649 self.r#sec_prot = value.into();
1650 self
1651 }
1652 ///Builder method that sets the value of `sec_prot`. Useful for initializing the message.
1653 #[inline]
1654 pub fn init_sec_prot(mut self, value: Ctrl_WifiSecProt) -> Self {
1655 self.r#sec_prot = value.into();
1656 self
1657 }
1658 ///Return a reference to `resp`
1659 #[inline]
1660 pub fn r#resp(&self) -> &i32 {
1661 &self.r#resp
1662 }
1663 ///Return a mutable reference to `resp`
1664 #[inline]
1665 pub fn mut_resp(&mut self) -> &mut i32 {
1666 &mut self.r#resp
1667 }
1668 ///Set the value of `resp`
1669 #[inline]
1670 pub fn set_resp(&mut self, value: i32) -> &mut Self {
1671 self.r#resp = value.into();
1672 self
1673 }
1674 ///Builder method that sets the value of `resp`. Useful for initializing the message.
1675 #[inline]
1676 pub fn init_resp(mut self, value: i32) -> Self {
1677 self.r#resp = value.into();
1678 self
1679 }
1680 ///Return a reference to `band_mode`
1681 #[inline]
1682 pub fn r#band_mode(&self) -> &i32 {
1683 &self.r#band_mode
1684 }
1685 ///Return a mutable reference to `band_mode`
1686 #[inline]
1687 pub fn mut_band_mode(&mut self) -> &mut i32 {
1688 &mut self.r#band_mode
1689 }
1690 ///Set the value of `band_mode`
1691 #[inline]
1692 pub fn set_band_mode(&mut self, value: i32) -> &mut Self {
1693 self.r#band_mode = value.into();
1694 self
1695 }
1696 ///Builder method that sets the value of `band_mode`. Useful for initializing the message.
1697 #[inline]
1698 pub fn init_band_mode(mut self, value: i32) -> Self {
1699 self.r#band_mode = value.into();
1700 self
1701 }
189} 1702}
190 1703impl ::micropb::MessageDecode for CtrlMsg_Resp_GetAPConfig {
191#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 1704 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
1705 &mut self,
1706 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
1707 len: usize,
1708 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
1709 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
1710 let before = decoder.bytes_read();
1711 while decoder.bytes_read() - before < len {
1712 let tag = decoder.decode_tag()?;
1713 match tag.field_num() {
1714 0 => return Err(::micropb::DecodeError::ZeroField),
1715 1u32 => {
1716 let mut_ref = &mut self.r#ssid;
1717 {
1718 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
1719 };
1720 }
1721 2u32 => {
1722 let mut_ref = &mut self.r#bssid;
1723 {
1724 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
1725 };
1726 }
1727 3u32 => {
1728 let mut_ref = &mut self.r#rssi;
1729 {
1730 let val = decoder.decode_int32()?;
1731 let val_ref = &val;
1732 if *val_ref != 0 {
1733 *mut_ref = val as _;
1734 }
1735 };
1736 }
1737 4u32 => {
1738 let mut_ref = &mut self.r#chnl;
1739 {
1740 let val = decoder.decode_int32()?;
1741 let val_ref = &val;
1742 if *val_ref != 0 {
1743 *mut_ref = val as _;
1744 }
1745 };
1746 }
1747 5u32 => {
1748 let mut_ref = &mut self.r#sec_prot;
1749 {
1750 let val = decoder.decode_int32().map(|n| Ctrl_WifiSecProt(n as _))?;
1751 let val_ref = &val;
1752 if val_ref.0 != 0 {
1753 *mut_ref = val as _;
1754 }
1755 };
1756 }
1757 6u32 => {
1758 let mut_ref = &mut self.r#resp;
1759 {
1760 let val = decoder.decode_int32()?;
1761 let val_ref = &val;
1762 if *val_ref != 0 {
1763 *mut_ref = val as _;
1764 }
1765 };
1766 }
1767 7u32 => {
1768 let mut_ref = &mut self.r#band_mode;
1769 {
1770 let val = decoder.decode_int32()?;
1771 let val_ref = &val;
1772 if *val_ref != 0 {
1773 *mut_ref = val as _;
1774 }
1775 };
1776 }
1777 _ => {
1778 decoder.skip_wire_value(tag.wire_type())?;
1779 }
1780 }
1781 }
1782 Ok(())
1783 }
1784}
1785impl ::micropb::MessageEncode for CtrlMsg_Resp_GetAPConfig {
1786 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
1787 let mut max_size = 0;
1788 if let ::core::option::Option::Some(size) =
1789 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
1790 {
1791 max_size += size;
1792 } else {
1793 break 'msg (::core::option::Option::<usize>::None);
1794 };
1795 if let ::core::option::Option::Some(size) =
1796 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
1797 {
1798 max_size += size;
1799 } else {
1800 break 'msg (::core::option::Option::<usize>::None);
1801 };
1802 if let ::core::option::Option::Some(size) =
1803 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
1804 {
1805 max_size += size;
1806 } else {
1807 break 'msg (::core::option::Option::<usize>::None);
1808 };
1809 if let ::core::option::Option::Some(size) =
1810 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
1811 {
1812 max_size += size;
1813 } else {
1814 break 'msg (::core::option::Option::<usize>::None);
1815 };
1816 if let ::core::option::Option::Some(size) =
1817 ::micropb::const_map!(::core::option::Option::Some(Ctrl_WifiSecProt::_MAX_SIZE), |size| size
1818 + 1usize)
1819 {
1820 max_size += size;
1821 } else {
1822 break 'msg (::core::option::Option::<usize>::None);
1823 };
1824 if let ::core::option::Option::Some(size) =
1825 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
1826 {
1827 max_size += size;
1828 } else {
1829 break 'msg (::core::option::Option::<usize>::None);
1830 };
1831 if let ::core::option::Option::Some(size) =
1832 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
1833 {
1834 max_size += size;
1835 } else {
1836 break 'msg (::core::option::Option::<usize>::None);
1837 };
1838 ::core::option::Option::Some(max_size)
1839 };
1840 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
1841 &self,
1842 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
1843 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
1844 use ::micropb::{FieldEncode, PbMap};
1845 {
1846 let val_ref = &self.r#ssid;
1847 if !val_ref.is_empty() {
1848 encoder.encode_varint32(10u32)?;
1849 encoder.encode_bytes(val_ref)?;
1850 }
1851 }
1852 {
1853 let val_ref = &self.r#bssid;
1854 if !val_ref.is_empty() {
1855 encoder.encode_varint32(18u32)?;
1856 encoder.encode_bytes(val_ref)?;
1857 }
1858 }
1859 {
1860 let val_ref = &self.r#rssi;
1861 if *val_ref != 0 {
1862 encoder.encode_varint32(24u32)?;
1863 encoder.encode_int32(*val_ref as _)?;
1864 }
1865 }
1866 {
1867 let val_ref = &self.r#chnl;
1868 if *val_ref != 0 {
1869 encoder.encode_varint32(32u32)?;
1870 encoder.encode_int32(*val_ref as _)?;
1871 }
1872 }
1873 {
1874 let val_ref = &self.r#sec_prot;
1875 if val_ref.0 != 0 {
1876 encoder.encode_varint32(40u32)?;
1877 encoder.encode_int32(val_ref.0 as _)?;
1878 }
1879 }
1880 {
1881 let val_ref = &self.r#resp;
1882 if *val_ref != 0 {
1883 encoder.encode_varint32(48u32)?;
1884 encoder.encode_int32(*val_ref as _)?;
1885 }
1886 }
1887 {
1888 let val_ref = &self.r#band_mode;
1889 if *val_ref != 0 {
1890 encoder.encode_varint32(56u32)?;
1891 encoder.encode_int32(*val_ref as _)?;
1892 }
1893 }
1894 Ok(())
1895 }
1896 fn compute_size(&self) -> usize {
1897 use ::micropb::{FieldEncode, PbMap};
1898 let mut size = 0;
1899 {
1900 let val_ref = &self.r#ssid;
1901 if !val_ref.is_empty() {
1902 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
1903 }
1904 }
1905 {
1906 let val_ref = &self.r#bssid;
1907 if !val_ref.is_empty() {
1908 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
1909 }
1910 }
1911 {
1912 let val_ref = &self.r#rssi;
1913 if *val_ref != 0 {
1914 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
1915 }
1916 }
1917 {
1918 let val_ref = &self.r#chnl;
1919 if *val_ref != 0 {
1920 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
1921 }
1922 }
1923 {
1924 let val_ref = &self.r#sec_prot;
1925 if val_ref.0 != 0 {
1926 size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _);
1927 }
1928 }
1929 {
1930 let val_ref = &self.r#resp;
1931 if *val_ref != 0 {
1932 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
1933 }
1934 }
1935 {
1936 let val_ref = &self.r#band_mode;
1937 if *val_ref != 0 {
1938 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
1939 }
1940 }
1941 size
1942 }
1943}
1944#[derive(Debug, Default, PartialEq, Clone)]
192#[cfg_attr(feature = "defmt", derive(defmt::Format))] 1945#[cfg_attr(feature = "defmt", derive(defmt::Format))]
193pub(crate) struct CtrlMsgRespStartSoftAp { 1946pub struct CtrlMsg_Req_ConnectAP {
194 #[noproto(tag = "1")] 1947 pub r#ssid: ::micropb::heapless::String<32>,
195 pub resp: u32, 1948 pub r#pwd: ::micropb::heapless::String<32>,
196 #[noproto(tag = "2")] 1949 pub r#bssid: ::micropb::heapless::String<32>,
197 pub mac: String<32>, 1950 pub r#is_wpa3_supported: bool,
1951 pub r#listen_interval: i32,
1952 pub r#band_mode: i32,
198} 1953}
199 1954impl CtrlMsg_Req_ConnectAP {
200#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 1955 ///Return a reference to `ssid`
1956 #[inline]
1957 pub fn r#ssid(&self) -> &::micropb::heapless::String<32> {
1958 &self.r#ssid
1959 }
1960 ///Return a mutable reference to `ssid`
1961 #[inline]
1962 pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::String<32> {
1963 &mut self.r#ssid
1964 }
1965 ///Set the value of `ssid`
1966 #[inline]
1967 pub fn set_ssid(&mut self, value: ::micropb::heapless::String<32>) -> &mut Self {
1968 self.r#ssid = value.into();
1969 self
1970 }
1971 ///Builder method that sets the value of `ssid`. Useful for initializing the message.
1972 #[inline]
1973 pub fn init_ssid(mut self, value: ::micropb::heapless::String<32>) -> Self {
1974 self.r#ssid = value.into();
1975 self
1976 }
1977 ///Return a reference to `pwd`
1978 #[inline]
1979 pub fn r#pwd(&self) -> &::micropb::heapless::String<32> {
1980 &self.r#pwd
1981 }
1982 ///Return a mutable reference to `pwd`
1983 #[inline]
1984 pub fn mut_pwd(&mut self) -> &mut ::micropb::heapless::String<32> {
1985 &mut self.r#pwd
1986 }
1987 ///Set the value of `pwd`
1988 #[inline]
1989 pub fn set_pwd(&mut self, value: ::micropb::heapless::String<32>) -> &mut Self {
1990 self.r#pwd = value.into();
1991 self
1992 }
1993 ///Builder method that sets the value of `pwd`. Useful for initializing the message.
1994 #[inline]
1995 pub fn init_pwd(mut self, value: ::micropb::heapless::String<32>) -> Self {
1996 self.r#pwd = value.into();
1997 self
1998 }
1999 ///Return a reference to `bssid`
2000 #[inline]
2001 pub fn r#bssid(&self) -> &::micropb::heapless::String<32> {
2002 &self.r#bssid
2003 }
2004 ///Return a mutable reference to `bssid`
2005 #[inline]
2006 pub fn mut_bssid(&mut self) -> &mut ::micropb::heapless::String<32> {
2007 &mut self.r#bssid
2008 }
2009 ///Set the value of `bssid`
2010 #[inline]
2011 pub fn set_bssid(&mut self, value: ::micropb::heapless::String<32>) -> &mut Self {
2012 self.r#bssid = value.into();
2013 self
2014 }
2015 ///Builder method that sets the value of `bssid`. Useful for initializing the message.
2016 #[inline]
2017 pub fn init_bssid(mut self, value: ::micropb::heapless::String<32>) -> Self {
2018 self.r#bssid = value.into();
2019 self
2020 }
2021 ///Return a reference to `is_wpa3_supported`
2022 #[inline]
2023 pub fn r#is_wpa3_supported(&self) -> &bool {
2024 &self.r#is_wpa3_supported
2025 }
2026 ///Return a mutable reference to `is_wpa3_supported`
2027 #[inline]
2028 pub fn mut_is_wpa3_supported(&mut self) -> &mut bool {
2029 &mut self.r#is_wpa3_supported
2030 }
2031 ///Set the value of `is_wpa3_supported`
2032 #[inline]
2033 pub fn set_is_wpa3_supported(&mut self, value: bool) -> &mut Self {
2034 self.r#is_wpa3_supported = value.into();
2035 self
2036 }
2037 ///Builder method that sets the value of `is_wpa3_supported`. Useful for initializing the message.
2038 #[inline]
2039 pub fn init_is_wpa3_supported(mut self, value: bool) -> Self {
2040 self.r#is_wpa3_supported = value.into();
2041 self
2042 }
2043 ///Return a reference to `listen_interval`
2044 #[inline]
2045 pub fn r#listen_interval(&self) -> &i32 {
2046 &self.r#listen_interval
2047 }
2048 ///Return a mutable reference to `listen_interval`
2049 #[inline]
2050 pub fn mut_listen_interval(&mut self) -> &mut i32 {
2051 &mut self.r#listen_interval
2052 }
2053 ///Set the value of `listen_interval`
2054 #[inline]
2055 pub fn set_listen_interval(&mut self, value: i32) -> &mut Self {
2056 self.r#listen_interval = value.into();
2057 self
2058 }
2059 ///Builder method that sets the value of `listen_interval`. Useful for initializing the message.
2060 #[inline]
2061 pub fn init_listen_interval(mut self, value: i32) -> Self {
2062 self.r#listen_interval = value.into();
2063 self
2064 }
2065 ///Return a reference to `band_mode`
2066 #[inline]
2067 pub fn r#band_mode(&self) -> &i32 {
2068 &self.r#band_mode
2069 }
2070 ///Return a mutable reference to `band_mode`
2071 #[inline]
2072 pub fn mut_band_mode(&mut self) -> &mut i32 {
2073 &mut self.r#band_mode
2074 }
2075 ///Set the value of `band_mode`
2076 #[inline]
2077 pub fn set_band_mode(&mut self, value: i32) -> &mut Self {
2078 self.r#band_mode = value.into();
2079 self
2080 }
2081 ///Builder method that sets the value of `band_mode`. Useful for initializing the message.
2082 #[inline]
2083 pub fn init_band_mode(mut self, value: i32) -> Self {
2084 self.r#band_mode = value.into();
2085 self
2086 }
2087}
2088impl ::micropb::MessageDecode for CtrlMsg_Req_ConnectAP {
2089 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
2090 &mut self,
2091 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
2092 len: usize,
2093 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
2094 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
2095 let before = decoder.bytes_read();
2096 while decoder.bytes_read() - before < len {
2097 let tag = decoder.decode_tag()?;
2098 match tag.field_num() {
2099 0 => return Err(::micropb::DecodeError::ZeroField),
2100 1u32 => {
2101 let mut_ref = &mut self.r#ssid;
2102 {
2103 decoder.decode_string(mut_ref, ::micropb::Presence::Implicit)?;
2104 };
2105 }
2106 2u32 => {
2107 let mut_ref = &mut self.r#pwd;
2108 {
2109 decoder.decode_string(mut_ref, ::micropb::Presence::Implicit)?;
2110 };
2111 }
2112 3u32 => {
2113 let mut_ref = &mut self.r#bssid;
2114 {
2115 decoder.decode_string(mut_ref, ::micropb::Presence::Implicit)?;
2116 };
2117 }
2118 4u32 => {
2119 let mut_ref = &mut self.r#is_wpa3_supported;
2120 {
2121 let val = decoder.decode_bool()?;
2122 let val_ref = &val;
2123 if *val_ref {
2124 *mut_ref = val as _;
2125 }
2126 };
2127 }
2128 5u32 => {
2129 let mut_ref = &mut self.r#listen_interval;
2130 {
2131 let val = decoder.decode_int32()?;
2132 let val_ref = &val;
2133 if *val_ref != 0 {
2134 *mut_ref = val as _;
2135 }
2136 };
2137 }
2138 6u32 => {
2139 let mut_ref = &mut self.r#band_mode;
2140 {
2141 let val = decoder.decode_int32()?;
2142 let val_ref = &val;
2143 if *val_ref != 0 {
2144 *mut_ref = val as _;
2145 }
2146 };
2147 }
2148 _ => {
2149 decoder.skip_wire_value(tag.wire_type())?;
2150 }
2151 }
2152 }
2153 Ok(())
2154 }
2155}
2156impl ::micropb::MessageEncode for CtrlMsg_Req_ConnectAP {
2157 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
2158 let mut max_size = 0;
2159 if let ::core::option::Option::Some(size) =
2160 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
2161 {
2162 max_size += size;
2163 } else {
2164 break 'msg (::core::option::Option::<usize>::None);
2165 };
2166 if let ::core::option::Option::Some(size) =
2167 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
2168 {
2169 max_size += size;
2170 } else {
2171 break 'msg (::core::option::Option::<usize>::None);
2172 };
2173 if let ::core::option::Option::Some(size) =
2174 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
2175 {
2176 max_size += size;
2177 } else {
2178 break 'msg (::core::option::Option::<usize>::None);
2179 };
2180 if let ::core::option::Option::Some(size) =
2181 ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize)
2182 {
2183 max_size += size;
2184 } else {
2185 break 'msg (::core::option::Option::<usize>::None);
2186 };
2187 if let ::core::option::Option::Some(size) =
2188 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
2189 {
2190 max_size += size;
2191 } else {
2192 break 'msg (::core::option::Option::<usize>::None);
2193 };
2194 if let ::core::option::Option::Some(size) =
2195 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
2196 {
2197 max_size += size;
2198 } else {
2199 break 'msg (::core::option::Option::<usize>::None);
2200 };
2201 ::core::option::Option::Some(max_size)
2202 };
2203 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
2204 &self,
2205 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
2206 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
2207 use ::micropb::{FieldEncode, PbMap};
2208 {
2209 let val_ref = &self.r#ssid;
2210 if !val_ref.is_empty() {
2211 encoder.encode_varint32(10u32)?;
2212 encoder.encode_string(val_ref)?;
2213 }
2214 }
2215 {
2216 let val_ref = &self.r#pwd;
2217 if !val_ref.is_empty() {
2218 encoder.encode_varint32(18u32)?;
2219 encoder.encode_string(val_ref)?;
2220 }
2221 }
2222 {
2223 let val_ref = &self.r#bssid;
2224 if !val_ref.is_empty() {
2225 encoder.encode_varint32(26u32)?;
2226 encoder.encode_string(val_ref)?;
2227 }
2228 }
2229 {
2230 let val_ref = &self.r#is_wpa3_supported;
2231 if *val_ref {
2232 encoder.encode_varint32(32u32)?;
2233 encoder.encode_bool(*val_ref)?;
2234 }
2235 }
2236 {
2237 let val_ref = &self.r#listen_interval;
2238 if *val_ref != 0 {
2239 encoder.encode_varint32(40u32)?;
2240 encoder.encode_int32(*val_ref as _)?;
2241 }
2242 }
2243 {
2244 let val_ref = &self.r#band_mode;
2245 if *val_ref != 0 {
2246 encoder.encode_varint32(48u32)?;
2247 encoder.encode_int32(*val_ref as _)?;
2248 }
2249 }
2250 Ok(())
2251 }
2252 fn compute_size(&self) -> usize {
2253 use ::micropb::{FieldEncode, PbMap};
2254 let mut size = 0;
2255 {
2256 let val_ref = &self.r#ssid;
2257 if !val_ref.is_empty() {
2258 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
2259 }
2260 }
2261 {
2262 let val_ref = &self.r#pwd;
2263 if !val_ref.is_empty() {
2264 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
2265 }
2266 }
2267 {
2268 let val_ref = &self.r#bssid;
2269 if !val_ref.is_empty() {
2270 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
2271 }
2272 }
2273 {
2274 let val_ref = &self.r#is_wpa3_supported;
2275 if *val_ref {
2276 size += 1usize + 1;
2277 }
2278 }
2279 {
2280 let val_ref = &self.r#listen_interval;
2281 if *val_ref != 0 {
2282 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
2283 }
2284 }
2285 {
2286 let val_ref = &self.r#band_mode;
2287 if *val_ref != 0 {
2288 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
2289 }
2290 }
2291 size
2292 }
2293}
2294#[derive(Debug, Default, PartialEq, Clone)]
201#[cfg_attr(feature = "defmt", derive(defmt::Format))] 2295#[cfg_attr(feature = "defmt", derive(defmt::Format))]
202pub(crate) struct CtrlMsgReqScanResult {} 2296pub struct CtrlMsg_Resp_ConnectAP {
203 2297 pub r#resp: i32,
204#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 2298 pub r#mac: ::micropb::heapless::Vec<u8, 32>,
2299 pub r#band_mode: i32,
2300}
2301impl CtrlMsg_Resp_ConnectAP {
2302 ///Return a reference to `resp`
2303 #[inline]
2304 pub fn r#resp(&self) -> &i32 {
2305 &self.r#resp
2306 }
2307 ///Return a mutable reference to `resp`
2308 #[inline]
2309 pub fn mut_resp(&mut self) -> &mut i32 {
2310 &mut self.r#resp
2311 }
2312 ///Set the value of `resp`
2313 #[inline]
2314 pub fn set_resp(&mut self, value: i32) -> &mut Self {
2315 self.r#resp = value.into();
2316 self
2317 }
2318 ///Builder method that sets the value of `resp`. Useful for initializing the message.
2319 #[inline]
2320 pub fn init_resp(mut self, value: i32) -> Self {
2321 self.r#resp = value.into();
2322 self
2323 }
2324 ///Return a reference to `mac`
2325 #[inline]
2326 pub fn r#mac(&self) -> &::micropb::heapless::Vec<u8, 32> {
2327 &self.r#mac
2328 }
2329 ///Return a mutable reference to `mac`
2330 #[inline]
2331 pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
2332 &mut self.r#mac
2333 }
2334 ///Set the value of `mac`
2335 #[inline]
2336 pub fn set_mac(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
2337 self.r#mac = value.into();
2338 self
2339 }
2340 ///Builder method that sets the value of `mac`. Useful for initializing the message.
2341 #[inline]
2342 pub fn init_mac(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
2343 self.r#mac = value.into();
2344 self
2345 }
2346 ///Return a reference to `band_mode`
2347 #[inline]
2348 pub fn r#band_mode(&self) -> &i32 {
2349 &self.r#band_mode
2350 }
2351 ///Return a mutable reference to `band_mode`
2352 #[inline]
2353 pub fn mut_band_mode(&mut self) -> &mut i32 {
2354 &mut self.r#band_mode
2355 }
2356 ///Set the value of `band_mode`
2357 #[inline]
2358 pub fn set_band_mode(&mut self, value: i32) -> &mut Self {
2359 self.r#band_mode = value.into();
2360 self
2361 }
2362 ///Builder method that sets the value of `band_mode`. Useful for initializing the message.
2363 #[inline]
2364 pub fn init_band_mode(mut self, value: i32) -> Self {
2365 self.r#band_mode = value.into();
2366 self
2367 }
2368}
2369impl ::micropb::MessageDecode for CtrlMsg_Resp_ConnectAP {
2370 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
2371 &mut self,
2372 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
2373 len: usize,
2374 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
2375 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
2376 let before = decoder.bytes_read();
2377 while decoder.bytes_read() - before < len {
2378 let tag = decoder.decode_tag()?;
2379 match tag.field_num() {
2380 0 => return Err(::micropb::DecodeError::ZeroField),
2381 1u32 => {
2382 let mut_ref = &mut self.r#resp;
2383 {
2384 let val = decoder.decode_int32()?;
2385 let val_ref = &val;
2386 if *val_ref != 0 {
2387 *mut_ref = val as _;
2388 }
2389 };
2390 }
2391 2u32 => {
2392 let mut_ref = &mut self.r#mac;
2393 {
2394 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
2395 };
2396 }
2397 3u32 => {
2398 let mut_ref = &mut self.r#band_mode;
2399 {
2400 let val = decoder.decode_int32()?;
2401 let val_ref = &val;
2402 if *val_ref != 0 {
2403 *mut_ref = val as _;
2404 }
2405 };
2406 }
2407 _ => {
2408 decoder.skip_wire_value(tag.wire_type())?;
2409 }
2410 }
2411 }
2412 Ok(())
2413 }
2414}
2415impl ::micropb::MessageEncode for CtrlMsg_Resp_ConnectAP {
2416 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
2417 let mut max_size = 0;
2418 if let ::core::option::Option::Some(size) =
2419 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
2420 {
2421 max_size += size;
2422 } else {
2423 break 'msg (::core::option::Option::<usize>::None);
2424 };
2425 if let ::core::option::Option::Some(size) =
2426 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
2427 {
2428 max_size += size;
2429 } else {
2430 break 'msg (::core::option::Option::<usize>::None);
2431 };
2432 if let ::core::option::Option::Some(size) =
2433 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
2434 {
2435 max_size += size;
2436 } else {
2437 break 'msg (::core::option::Option::<usize>::None);
2438 };
2439 ::core::option::Option::Some(max_size)
2440 };
2441 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
2442 &self,
2443 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
2444 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
2445 use ::micropb::{FieldEncode, PbMap};
2446 {
2447 let val_ref = &self.r#resp;
2448 if *val_ref != 0 {
2449 encoder.encode_varint32(8u32)?;
2450 encoder.encode_int32(*val_ref as _)?;
2451 }
2452 }
2453 {
2454 let val_ref = &self.r#mac;
2455 if !val_ref.is_empty() {
2456 encoder.encode_varint32(18u32)?;
2457 encoder.encode_bytes(val_ref)?;
2458 }
2459 }
2460 {
2461 let val_ref = &self.r#band_mode;
2462 if *val_ref != 0 {
2463 encoder.encode_varint32(24u32)?;
2464 encoder.encode_int32(*val_ref as _)?;
2465 }
2466 }
2467 Ok(())
2468 }
2469 fn compute_size(&self) -> usize {
2470 use ::micropb::{FieldEncode, PbMap};
2471 let mut size = 0;
2472 {
2473 let val_ref = &self.r#resp;
2474 if *val_ref != 0 {
2475 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
2476 }
2477 }
2478 {
2479 let val_ref = &self.r#mac;
2480 if !val_ref.is_empty() {
2481 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
2482 }
2483 }
2484 {
2485 let val_ref = &self.r#band_mode;
2486 if *val_ref != 0 {
2487 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
2488 }
2489 }
2490 size
2491 }
2492}
2493#[derive(Debug, Default, PartialEq, Clone)]
205#[cfg_attr(feature = "defmt", derive(defmt::Format))] 2494#[cfg_attr(feature = "defmt", derive(defmt::Format))]
206pub(crate) struct CtrlMsgRespScanResult { 2495pub struct CtrlMsg_Req_GetSoftAPConfig {}
207 #[noproto(tag = "1")] 2496impl CtrlMsg_Req_GetSoftAPConfig {}
208 pub count: u32, 2497impl ::micropb::MessageDecode for CtrlMsg_Req_GetSoftAPConfig {
209 #[noproto(repeated, tag = "2")] 2498 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
210 pub entries: Vec<ScanResult, 16>, 2499 &mut self,
211 #[noproto(tag = "3")] 2500 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
212 pub resp: u32, 2501 len: usize,
2502 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
2503 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
2504 let before = decoder.bytes_read();
2505 while decoder.bytes_read() - before < len {
2506 let tag = decoder.decode_tag()?;
2507 match tag.field_num() {
2508 0 => return Err(::micropb::DecodeError::ZeroField),
2509 _ => {
2510 decoder.skip_wire_value(tag.wire_type())?;
2511 }
2512 }
2513 }
2514 Ok(())
2515 }
213} 2516}
214 2517impl ::micropb::MessageEncode for CtrlMsg_Req_GetSoftAPConfig {
215#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 2518 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
2519 let mut max_size = 0;
2520 ::core::option::Option::Some(max_size)
2521 };
2522 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
2523 &self,
2524 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
2525 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
2526 use ::micropb::{FieldEncode, PbMap};
2527 Ok(())
2528 }
2529 fn compute_size(&self) -> usize {
2530 use ::micropb::{FieldEncode, PbMap};
2531 let mut size = 0;
2532 size
2533 }
2534}
2535#[derive(Debug, Default, PartialEq, Clone)]
216#[cfg_attr(feature = "defmt", derive(defmt::Format))] 2536#[cfg_attr(feature = "defmt", derive(defmt::Format))]
217pub(crate) struct CtrlMsgReqSoftApConnectedSta {} 2537pub struct CtrlMsg_Resp_GetSoftAPConfig {
218 2538 pub r#ssid: ::micropb::heapless::Vec<u8, 32>,
219#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 2539 pub r#pwd: ::micropb::heapless::Vec<u8, 32>,
2540 pub r#chnl: i32,
2541 pub r#sec_prot: Ctrl_WifiSecProt,
2542 pub r#max_conn: i32,
2543 pub r#ssid_hidden: bool,
2544 pub r#bw: i32,
2545 pub r#resp: i32,
2546 pub r#band_mode: i32,
2547}
2548impl CtrlMsg_Resp_GetSoftAPConfig {
2549 ///Return a reference to `ssid`
2550 #[inline]
2551 pub fn r#ssid(&self) -> &::micropb::heapless::Vec<u8, 32> {
2552 &self.r#ssid
2553 }
2554 ///Return a mutable reference to `ssid`
2555 #[inline]
2556 pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
2557 &mut self.r#ssid
2558 }
2559 ///Set the value of `ssid`
2560 #[inline]
2561 pub fn set_ssid(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
2562 self.r#ssid = value.into();
2563 self
2564 }
2565 ///Builder method that sets the value of `ssid`. Useful for initializing the message.
2566 #[inline]
2567 pub fn init_ssid(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
2568 self.r#ssid = value.into();
2569 self
2570 }
2571 ///Return a reference to `pwd`
2572 #[inline]
2573 pub fn r#pwd(&self) -> &::micropb::heapless::Vec<u8, 32> {
2574 &self.r#pwd
2575 }
2576 ///Return a mutable reference to `pwd`
2577 #[inline]
2578 pub fn mut_pwd(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
2579 &mut self.r#pwd
2580 }
2581 ///Set the value of `pwd`
2582 #[inline]
2583 pub fn set_pwd(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
2584 self.r#pwd = value.into();
2585 self
2586 }
2587 ///Builder method that sets the value of `pwd`. Useful for initializing the message.
2588 #[inline]
2589 pub fn init_pwd(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
2590 self.r#pwd = value.into();
2591 self
2592 }
2593 ///Return a reference to `chnl`
2594 #[inline]
2595 pub fn r#chnl(&self) -> &i32 {
2596 &self.r#chnl
2597 }
2598 ///Return a mutable reference to `chnl`
2599 #[inline]
2600 pub fn mut_chnl(&mut self) -> &mut i32 {
2601 &mut self.r#chnl
2602 }
2603 ///Set the value of `chnl`
2604 #[inline]
2605 pub fn set_chnl(&mut self, value: i32) -> &mut Self {
2606 self.r#chnl = value.into();
2607 self
2608 }
2609 ///Builder method that sets the value of `chnl`. Useful for initializing the message.
2610 #[inline]
2611 pub fn init_chnl(mut self, value: i32) -> Self {
2612 self.r#chnl = value.into();
2613 self
2614 }
2615 ///Return a reference to `sec_prot`
2616 #[inline]
2617 pub fn r#sec_prot(&self) -> &Ctrl_WifiSecProt {
2618 &self.r#sec_prot
2619 }
2620 ///Return a mutable reference to `sec_prot`
2621 #[inline]
2622 pub fn mut_sec_prot(&mut self) -> &mut Ctrl_WifiSecProt {
2623 &mut self.r#sec_prot
2624 }
2625 ///Set the value of `sec_prot`
2626 #[inline]
2627 pub fn set_sec_prot(&mut self, value: Ctrl_WifiSecProt) -> &mut Self {
2628 self.r#sec_prot = value.into();
2629 self
2630 }
2631 ///Builder method that sets the value of `sec_prot`. Useful for initializing the message.
2632 #[inline]
2633 pub fn init_sec_prot(mut self, value: Ctrl_WifiSecProt) -> Self {
2634 self.r#sec_prot = value.into();
2635 self
2636 }
2637 ///Return a reference to `max_conn`
2638 #[inline]
2639 pub fn r#max_conn(&self) -> &i32 {
2640 &self.r#max_conn
2641 }
2642 ///Return a mutable reference to `max_conn`
2643 #[inline]
2644 pub fn mut_max_conn(&mut self) -> &mut i32 {
2645 &mut self.r#max_conn
2646 }
2647 ///Set the value of `max_conn`
2648 #[inline]
2649 pub fn set_max_conn(&mut self, value: i32) -> &mut Self {
2650 self.r#max_conn = value.into();
2651 self
2652 }
2653 ///Builder method that sets the value of `max_conn`. Useful for initializing the message.
2654 #[inline]
2655 pub fn init_max_conn(mut self, value: i32) -> Self {
2656 self.r#max_conn = value.into();
2657 self
2658 }
2659 ///Return a reference to `ssid_hidden`
2660 #[inline]
2661 pub fn r#ssid_hidden(&self) -> &bool {
2662 &self.r#ssid_hidden
2663 }
2664 ///Return a mutable reference to `ssid_hidden`
2665 #[inline]
2666 pub fn mut_ssid_hidden(&mut self) -> &mut bool {
2667 &mut self.r#ssid_hidden
2668 }
2669 ///Set the value of `ssid_hidden`
2670 #[inline]
2671 pub fn set_ssid_hidden(&mut self, value: bool) -> &mut Self {
2672 self.r#ssid_hidden = value.into();
2673 self
2674 }
2675 ///Builder method that sets the value of `ssid_hidden`. Useful for initializing the message.
2676 #[inline]
2677 pub fn init_ssid_hidden(mut self, value: bool) -> Self {
2678 self.r#ssid_hidden = value.into();
2679 self
2680 }
2681 ///Return a reference to `bw`
2682 #[inline]
2683 pub fn r#bw(&self) -> &i32 {
2684 &self.r#bw
2685 }
2686 ///Return a mutable reference to `bw`
2687 #[inline]
2688 pub fn mut_bw(&mut self) -> &mut i32 {
2689 &mut self.r#bw
2690 }
2691 ///Set the value of `bw`
2692 #[inline]
2693 pub fn set_bw(&mut self, value: i32) -> &mut Self {
2694 self.r#bw = value.into();
2695 self
2696 }
2697 ///Builder method that sets the value of `bw`. Useful for initializing the message.
2698 #[inline]
2699 pub fn init_bw(mut self, value: i32) -> Self {
2700 self.r#bw = value.into();
2701 self
2702 }
2703 ///Return a reference to `resp`
2704 #[inline]
2705 pub fn r#resp(&self) -> &i32 {
2706 &self.r#resp
2707 }
2708 ///Return a mutable reference to `resp`
2709 #[inline]
2710 pub fn mut_resp(&mut self) -> &mut i32 {
2711 &mut self.r#resp
2712 }
2713 ///Set the value of `resp`
2714 #[inline]
2715 pub fn set_resp(&mut self, value: i32) -> &mut Self {
2716 self.r#resp = value.into();
2717 self
2718 }
2719 ///Builder method that sets the value of `resp`. Useful for initializing the message.
2720 #[inline]
2721 pub fn init_resp(mut self, value: i32) -> Self {
2722 self.r#resp = value.into();
2723 self
2724 }
2725 ///Return a reference to `band_mode`
2726 #[inline]
2727 pub fn r#band_mode(&self) -> &i32 {
2728 &self.r#band_mode
2729 }
2730 ///Return a mutable reference to `band_mode`
2731 #[inline]
2732 pub fn mut_band_mode(&mut self) -> &mut i32 {
2733 &mut self.r#band_mode
2734 }
2735 ///Set the value of `band_mode`
2736 #[inline]
2737 pub fn set_band_mode(&mut self, value: i32) -> &mut Self {
2738 self.r#band_mode = value.into();
2739 self
2740 }
2741 ///Builder method that sets the value of `band_mode`. Useful for initializing the message.
2742 #[inline]
2743 pub fn init_band_mode(mut self, value: i32) -> Self {
2744 self.r#band_mode = value.into();
2745 self
2746 }
2747}
2748impl ::micropb::MessageDecode for CtrlMsg_Resp_GetSoftAPConfig {
2749 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
2750 &mut self,
2751 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
2752 len: usize,
2753 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
2754 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
2755 let before = decoder.bytes_read();
2756 while decoder.bytes_read() - before < len {
2757 let tag = decoder.decode_tag()?;
2758 match tag.field_num() {
2759 0 => return Err(::micropb::DecodeError::ZeroField),
2760 1u32 => {
2761 let mut_ref = &mut self.r#ssid;
2762 {
2763 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
2764 };
2765 }
2766 2u32 => {
2767 let mut_ref = &mut self.r#pwd;
2768 {
2769 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
2770 };
2771 }
2772 3u32 => {
2773 let mut_ref = &mut self.r#chnl;
2774 {
2775 let val = decoder.decode_int32()?;
2776 let val_ref = &val;
2777 if *val_ref != 0 {
2778 *mut_ref = val as _;
2779 }
2780 };
2781 }
2782 4u32 => {
2783 let mut_ref = &mut self.r#sec_prot;
2784 {
2785 let val = decoder.decode_int32().map(|n| Ctrl_WifiSecProt(n as _))?;
2786 let val_ref = &val;
2787 if val_ref.0 != 0 {
2788 *mut_ref = val as _;
2789 }
2790 };
2791 }
2792 5u32 => {
2793 let mut_ref = &mut self.r#max_conn;
2794 {
2795 let val = decoder.decode_int32()?;
2796 let val_ref = &val;
2797 if *val_ref != 0 {
2798 *mut_ref = val as _;
2799 }
2800 };
2801 }
2802 6u32 => {
2803 let mut_ref = &mut self.r#ssid_hidden;
2804 {
2805 let val = decoder.decode_bool()?;
2806 let val_ref = &val;
2807 if *val_ref {
2808 *mut_ref = val as _;
2809 }
2810 };
2811 }
2812 7u32 => {
2813 let mut_ref = &mut self.r#bw;
2814 {
2815 let val = decoder.decode_int32()?;
2816 let val_ref = &val;
2817 if *val_ref != 0 {
2818 *mut_ref = val as _;
2819 }
2820 };
2821 }
2822 8u32 => {
2823 let mut_ref = &mut self.r#resp;
2824 {
2825 let val = decoder.decode_int32()?;
2826 let val_ref = &val;
2827 if *val_ref != 0 {
2828 *mut_ref = val as _;
2829 }
2830 };
2831 }
2832 9u32 => {
2833 let mut_ref = &mut self.r#band_mode;
2834 {
2835 let val = decoder.decode_int32()?;
2836 let val_ref = &val;
2837 if *val_ref != 0 {
2838 *mut_ref = val as _;
2839 }
2840 };
2841 }
2842 _ => {
2843 decoder.skip_wire_value(tag.wire_type())?;
2844 }
2845 }
2846 }
2847 Ok(())
2848 }
2849}
2850impl ::micropb::MessageEncode for CtrlMsg_Resp_GetSoftAPConfig {
2851 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
2852 let mut max_size = 0;
2853 if let ::core::option::Option::Some(size) =
2854 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
2855 {
2856 max_size += size;
2857 } else {
2858 break 'msg (::core::option::Option::<usize>::None);
2859 };
2860 if let ::core::option::Option::Some(size) =
2861 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
2862 {
2863 max_size += size;
2864 } else {
2865 break 'msg (::core::option::Option::<usize>::None);
2866 };
2867 if let ::core::option::Option::Some(size) =
2868 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
2869 {
2870 max_size += size;
2871 } else {
2872 break 'msg (::core::option::Option::<usize>::None);
2873 };
2874 if let ::core::option::Option::Some(size) =
2875 ::micropb::const_map!(::core::option::Option::Some(Ctrl_WifiSecProt::_MAX_SIZE), |size| size
2876 + 1usize)
2877 {
2878 max_size += size;
2879 } else {
2880 break 'msg (::core::option::Option::<usize>::None);
2881 };
2882 if let ::core::option::Option::Some(size) =
2883 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
2884 {
2885 max_size += size;
2886 } else {
2887 break 'msg (::core::option::Option::<usize>::None);
2888 };
2889 if let ::core::option::Option::Some(size) =
2890 ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize)
2891 {
2892 max_size += size;
2893 } else {
2894 break 'msg (::core::option::Option::<usize>::None);
2895 };
2896 if let ::core::option::Option::Some(size) =
2897 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
2898 {
2899 max_size += size;
2900 } else {
2901 break 'msg (::core::option::Option::<usize>::None);
2902 };
2903 if let ::core::option::Option::Some(size) =
2904 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
2905 {
2906 max_size += size;
2907 } else {
2908 break 'msg (::core::option::Option::<usize>::None);
2909 };
2910 if let ::core::option::Option::Some(size) =
2911 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
2912 {
2913 max_size += size;
2914 } else {
2915 break 'msg (::core::option::Option::<usize>::None);
2916 };
2917 ::core::option::Option::Some(max_size)
2918 };
2919 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
2920 &self,
2921 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
2922 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
2923 use ::micropb::{FieldEncode, PbMap};
2924 {
2925 let val_ref = &self.r#ssid;
2926 if !val_ref.is_empty() {
2927 encoder.encode_varint32(10u32)?;
2928 encoder.encode_bytes(val_ref)?;
2929 }
2930 }
2931 {
2932 let val_ref = &self.r#pwd;
2933 if !val_ref.is_empty() {
2934 encoder.encode_varint32(18u32)?;
2935 encoder.encode_bytes(val_ref)?;
2936 }
2937 }
2938 {
2939 let val_ref = &self.r#chnl;
2940 if *val_ref != 0 {
2941 encoder.encode_varint32(24u32)?;
2942 encoder.encode_int32(*val_ref as _)?;
2943 }
2944 }
2945 {
2946 let val_ref = &self.r#sec_prot;
2947 if val_ref.0 != 0 {
2948 encoder.encode_varint32(32u32)?;
2949 encoder.encode_int32(val_ref.0 as _)?;
2950 }
2951 }
2952 {
2953 let val_ref = &self.r#max_conn;
2954 if *val_ref != 0 {
2955 encoder.encode_varint32(40u32)?;
2956 encoder.encode_int32(*val_ref as _)?;
2957 }
2958 }
2959 {
2960 let val_ref = &self.r#ssid_hidden;
2961 if *val_ref {
2962 encoder.encode_varint32(48u32)?;
2963 encoder.encode_bool(*val_ref)?;
2964 }
2965 }
2966 {
2967 let val_ref = &self.r#bw;
2968 if *val_ref != 0 {
2969 encoder.encode_varint32(56u32)?;
2970 encoder.encode_int32(*val_ref as _)?;
2971 }
2972 }
2973 {
2974 let val_ref = &self.r#resp;
2975 if *val_ref != 0 {
2976 encoder.encode_varint32(64u32)?;
2977 encoder.encode_int32(*val_ref as _)?;
2978 }
2979 }
2980 {
2981 let val_ref = &self.r#band_mode;
2982 if *val_ref != 0 {
2983 encoder.encode_varint32(72u32)?;
2984 encoder.encode_int32(*val_ref as _)?;
2985 }
2986 }
2987 Ok(())
2988 }
2989 fn compute_size(&self) -> usize {
2990 use ::micropb::{FieldEncode, PbMap};
2991 let mut size = 0;
2992 {
2993 let val_ref = &self.r#ssid;
2994 if !val_ref.is_empty() {
2995 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
2996 }
2997 }
2998 {
2999 let val_ref = &self.r#pwd;
3000 if !val_ref.is_empty() {
3001 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
3002 }
3003 }
3004 {
3005 let val_ref = &self.r#chnl;
3006 if *val_ref != 0 {
3007 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
3008 }
3009 }
3010 {
3011 let val_ref = &self.r#sec_prot;
3012 if val_ref.0 != 0 {
3013 size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _);
3014 }
3015 }
3016 {
3017 let val_ref = &self.r#max_conn;
3018 if *val_ref != 0 {
3019 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
3020 }
3021 }
3022 {
3023 let val_ref = &self.r#ssid_hidden;
3024 if *val_ref {
3025 size += 1usize + 1;
3026 }
3027 }
3028 {
3029 let val_ref = &self.r#bw;
3030 if *val_ref != 0 {
3031 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
3032 }
3033 }
3034 {
3035 let val_ref = &self.r#resp;
3036 if *val_ref != 0 {
3037 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
3038 }
3039 }
3040 {
3041 let val_ref = &self.r#band_mode;
3042 if *val_ref != 0 {
3043 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
3044 }
3045 }
3046 size
3047 }
3048}
3049#[derive(Debug, Default, PartialEq, Clone)]
220#[cfg_attr(feature = "defmt", derive(defmt::Format))] 3050#[cfg_attr(feature = "defmt", derive(defmt::Format))]
221pub(crate) struct CtrlMsgRespSoftApConnectedSta { 3051pub struct CtrlMsg_Req_StartSoftAP {
222 #[noproto(tag = "1")] 3052 pub r#ssid: ::micropb::heapless::String<32>,
223 pub num: u32, 3053 pub r#pwd: ::micropb::heapless::String<32>,
224 #[noproto(repeated, tag = "2")] 3054 pub r#chnl: i32,
225 pub stations: Vec<ConnectedStaList, 16>, 3055 pub r#sec_prot: Ctrl_WifiSecProt,
226 #[noproto(tag = "3")] 3056 pub r#max_conn: i32,
227 pub resp: u32, 3057 pub r#ssid_hidden: bool,
3058 pub r#bw: i32,
3059 pub r#band_mode: i32,
228} 3060}
229 3061impl CtrlMsg_Req_StartSoftAP {
230#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 3062 ///Return a reference to `ssid`
3063 #[inline]
3064 pub fn r#ssid(&self) -> &::micropb::heapless::String<32> {
3065 &self.r#ssid
3066 }
3067 ///Return a mutable reference to `ssid`
3068 #[inline]
3069 pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::String<32> {
3070 &mut self.r#ssid
3071 }
3072 ///Set the value of `ssid`
3073 #[inline]
3074 pub fn set_ssid(&mut self, value: ::micropb::heapless::String<32>) -> &mut Self {
3075 self.r#ssid = value.into();
3076 self
3077 }
3078 ///Builder method that sets the value of `ssid`. Useful for initializing the message.
3079 #[inline]
3080 pub fn init_ssid(mut self, value: ::micropb::heapless::String<32>) -> Self {
3081 self.r#ssid = value.into();
3082 self
3083 }
3084 ///Return a reference to `pwd`
3085 #[inline]
3086 pub fn r#pwd(&self) -> &::micropb::heapless::String<32> {
3087 &self.r#pwd
3088 }
3089 ///Return a mutable reference to `pwd`
3090 #[inline]
3091 pub fn mut_pwd(&mut self) -> &mut ::micropb::heapless::String<32> {
3092 &mut self.r#pwd
3093 }
3094 ///Set the value of `pwd`
3095 #[inline]
3096 pub fn set_pwd(&mut self, value: ::micropb::heapless::String<32>) -> &mut Self {
3097 self.r#pwd = value.into();
3098 self
3099 }
3100 ///Builder method that sets the value of `pwd`. Useful for initializing the message.
3101 #[inline]
3102 pub fn init_pwd(mut self, value: ::micropb::heapless::String<32>) -> Self {
3103 self.r#pwd = value.into();
3104 self
3105 }
3106 ///Return a reference to `chnl`
3107 #[inline]
3108 pub fn r#chnl(&self) -> &i32 {
3109 &self.r#chnl
3110 }
3111 ///Return a mutable reference to `chnl`
3112 #[inline]
3113 pub fn mut_chnl(&mut self) -> &mut i32 {
3114 &mut self.r#chnl
3115 }
3116 ///Set the value of `chnl`
3117 #[inline]
3118 pub fn set_chnl(&mut self, value: i32) -> &mut Self {
3119 self.r#chnl = value.into();
3120 self
3121 }
3122 ///Builder method that sets the value of `chnl`. Useful for initializing the message.
3123 #[inline]
3124 pub fn init_chnl(mut self, value: i32) -> Self {
3125 self.r#chnl = value.into();
3126 self
3127 }
3128 ///Return a reference to `sec_prot`
3129 #[inline]
3130 pub fn r#sec_prot(&self) -> &Ctrl_WifiSecProt {
3131 &self.r#sec_prot
3132 }
3133 ///Return a mutable reference to `sec_prot`
3134 #[inline]
3135 pub fn mut_sec_prot(&mut self) -> &mut Ctrl_WifiSecProt {
3136 &mut self.r#sec_prot
3137 }
3138 ///Set the value of `sec_prot`
3139 #[inline]
3140 pub fn set_sec_prot(&mut self, value: Ctrl_WifiSecProt) -> &mut Self {
3141 self.r#sec_prot = value.into();
3142 self
3143 }
3144 ///Builder method that sets the value of `sec_prot`. Useful for initializing the message.
3145 #[inline]
3146 pub fn init_sec_prot(mut self, value: Ctrl_WifiSecProt) -> Self {
3147 self.r#sec_prot = value.into();
3148 self
3149 }
3150 ///Return a reference to `max_conn`
3151 #[inline]
3152 pub fn r#max_conn(&self) -> &i32 {
3153 &self.r#max_conn
3154 }
3155 ///Return a mutable reference to `max_conn`
3156 #[inline]
3157 pub fn mut_max_conn(&mut self) -> &mut i32 {
3158 &mut self.r#max_conn
3159 }
3160 ///Set the value of `max_conn`
3161 #[inline]
3162 pub fn set_max_conn(&mut self, value: i32) -> &mut Self {
3163 self.r#max_conn = value.into();
3164 self
3165 }
3166 ///Builder method that sets the value of `max_conn`. Useful for initializing the message.
3167 #[inline]
3168 pub fn init_max_conn(mut self, value: i32) -> Self {
3169 self.r#max_conn = value.into();
3170 self
3171 }
3172 ///Return a reference to `ssid_hidden`
3173 #[inline]
3174 pub fn r#ssid_hidden(&self) -> &bool {
3175 &self.r#ssid_hidden
3176 }
3177 ///Return a mutable reference to `ssid_hidden`
3178 #[inline]
3179 pub fn mut_ssid_hidden(&mut self) -> &mut bool {
3180 &mut self.r#ssid_hidden
3181 }
3182 ///Set the value of `ssid_hidden`
3183 #[inline]
3184 pub fn set_ssid_hidden(&mut self, value: bool) -> &mut Self {
3185 self.r#ssid_hidden = value.into();
3186 self
3187 }
3188 ///Builder method that sets the value of `ssid_hidden`. Useful for initializing the message.
3189 #[inline]
3190 pub fn init_ssid_hidden(mut self, value: bool) -> Self {
3191 self.r#ssid_hidden = value.into();
3192 self
3193 }
3194 ///Return a reference to `bw`
3195 #[inline]
3196 pub fn r#bw(&self) -> &i32 {
3197 &self.r#bw
3198 }
3199 ///Return a mutable reference to `bw`
3200 #[inline]
3201 pub fn mut_bw(&mut self) -> &mut i32 {
3202 &mut self.r#bw
3203 }
3204 ///Set the value of `bw`
3205 #[inline]
3206 pub fn set_bw(&mut self, value: i32) -> &mut Self {
3207 self.r#bw = value.into();
3208 self
3209 }
3210 ///Builder method that sets the value of `bw`. Useful for initializing the message.
3211 #[inline]
3212 pub fn init_bw(mut self, value: i32) -> Self {
3213 self.r#bw = value.into();
3214 self
3215 }
3216 ///Return a reference to `band_mode`
3217 #[inline]
3218 pub fn r#band_mode(&self) -> &i32 {
3219 &self.r#band_mode
3220 }
3221 ///Return a mutable reference to `band_mode`
3222 #[inline]
3223 pub fn mut_band_mode(&mut self) -> &mut i32 {
3224 &mut self.r#band_mode
3225 }
3226 ///Set the value of `band_mode`
3227 #[inline]
3228 pub fn set_band_mode(&mut self, value: i32) -> &mut Self {
3229 self.r#band_mode = value.into();
3230 self
3231 }
3232 ///Builder method that sets the value of `band_mode`. Useful for initializing the message.
3233 #[inline]
3234 pub fn init_band_mode(mut self, value: i32) -> Self {
3235 self.r#band_mode = value.into();
3236 self
3237 }
3238}
3239impl ::micropb::MessageDecode for CtrlMsg_Req_StartSoftAP {
3240 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
3241 &mut self,
3242 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
3243 len: usize,
3244 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
3245 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
3246 let before = decoder.bytes_read();
3247 while decoder.bytes_read() - before < len {
3248 let tag = decoder.decode_tag()?;
3249 match tag.field_num() {
3250 0 => return Err(::micropb::DecodeError::ZeroField),
3251 1u32 => {
3252 let mut_ref = &mut self.r#ssid;
3253 {
3254 decoder.decode_string(mut_ref, ::micropb::Presence::Implicit)?;
3255 };
3256 }
3257 2u32 => {
3258 let mut_ref = &mut self.r#pwd;
3259 {
3260 decoder.decode_string(mut_ref, ::micropb::Presence::Implicit)?;
3261 };
3262 }
3263 3u32 => {
3264 let mut_ref = &mut self.r#chnl;
3265 {
3266 let val = decoder.decode_int32()?;
3267 let val_ref = &val;
3268 if *val_ref != 0 {
3269 *mut_ref = val as _;
3270 }
3271 };
3272 }
3273 4u32 => {
3274 let mut_ref = &mut self.r#sec_prot;
3275 {
3276 let val = decoder.decode_int32().map(|n| Ctrl_WifiSecProt(n as _))?;
3277 let val_ref = &val;
3278 if val_ref.0 != 0 {
3279 *mut_ref = val as _;
3280 }
3281 };
3282 }
3283 5u32 => {
3284 let mut_ref = &mut self.r#max_conn;
3285 {
3286 let val = decoder.decode_int32()?;
3287 let val_ref = &val;
3288 if *val_ref != 0 {
3289 *mut_ref = val as _;
3290 }
3291 };
3292 }
3293 6u32 => {
3294 let mut_ref = &mut self.r#ssid_hidden;
3295 {
3296 let val = decoder.decode_bool()?;
3297 let val_ref = &val;
3298 if *val_ref {
3299 *mut_ref = val as _;
3300 }
3301 };
3302 }
3303 7u32 => {
3304 let mut_ref = &mut self.r#bw;
3305 {
3306 let val = decoder.decode_int32()?;
3307 let val_ref = &val;
3308 if *val_ref != 0 {
3309 *mut_ref = val as _;
3310 }
3311 };
3312 }
3313 8u32 => {
3314 let mut_ref = &mut self.r#band_mode;
3315 {
3316 let val = decoder.decode_int32()?;
3317 let val_ref = &val;
3318 if *val_ref != 0 {
3319 *mut_ref = val as _;
3320 }
3321 };
3322 }
3323 _ => {
3324 decoder.skip_wire_value(tag.wire_type())?;
3325 }
3326 }
3327 }
3328 Ok(())
3329 }
3330}
3331impl ::micropb::MessageEncode for CtrlMsg_Req_StartSoftAP {
3332 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
3333 let mut max_size = 0;
3334 if let ::core::option::Option::Some(size) =
3335 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
3336 {
3337 max_size += size;
3338 } else {
3339 break 'msg (::core::option::Option::<usize>::None);
3340 };
3341 if let ::core::option::Option::Some(size) =
3342 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
3343 {
3344 max_size += size;
3345 } else {
3346 break 'msg (::core::option::Option::<usize>::None);
3347 };
3348 if let ::core::option::Option::Some(size) =
3349 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
3350 {
3351 max_size += size;
3352 } else {
3353 break 'msg (::core::option::Option::<usize>::None);
3354 };
3355 if let ::core::option::Option::Some(size) =
3356 ::micropb::const_map!(::core::option::Option::Some(Ctrl_WifiSecProt::_MAX_SIZE), |size| size
3357 + 1usize)
3358 {
3359 max_size += size;
3360 } else {
3361 break 'msg (::core::option::Option::<usize>::None);
3362 };
3363 if let ::core::option::Option::Some(size) =
3364 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
3365 {
3366 max_size += size;
3367 } else {
3368 break 'msg (::core::option::Option::<usize>::None);
3369 };
3370 if let ::core::option::Option::Some(size) =
3371 ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize)
3372 {
3373 max_size += size;
3374 } else {
3375 break 'msg (::core::option::Option::<usize>::None);
3376 };
3377 if let ::core::option::Option::Some(size) =
3378 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
3379 {
3380 max_size += size;
3381 } else {
3382 break 'msg (::core::option::Option::<usize>::None);
3383 };
3384 if let ::core::option::Option::Some(size) =
3385 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
3386 {
3387 max_size += size;
3388 } else {
3389 break 'msg (::core::option::Option::<usize>::None);
3390 };
3391 ::core::option::Option::Some(max_size)
3392 };
3393 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
3394 &self,
3395 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
3396 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
3397 use ::micropb::{FieldEncode, PbMap};
3398 {
3399 let val_ref = &self.r#ssid;
3400 if !val_ref.is_empty() {
3401 encoder.encode_varint32(10u32)?;
3402 encoder.encode_string(val_ref)?;
3403 }
3404 }
3405 {
3406 let val_ref = &self.r#pwd;
3407 if !val_ref.is_empty() {
3408 encoder.encode_varint32(18u32)?;
3409 encoder.encode_string(val_ref)?;
3410 }
3411 }
3412 {
3413 let val_ref = &self.r#chnl;
3414 if *val_ref != 0 {
3415 encoder.encode_varint32(24u32)?;
3416 encoder.encode_int32(*val_ref as _)?;
3417 }
3418 }
3419 {
3420 let val_ref = &self.r#sec_prot;
3421 if val_ref.0 != 0 {
3422 encoder.encode_varint32(32u32)?;
3423 encoder.encode_int32(val_ref.0 as _)?;
3424 }
3425 }
3426 {
3427 let val_ref = &self.r#max_conn;
3428 if *val_ref != 0 {
3429 encoder.encode_varint32(40u32)?;
3430 encoder.encode_int32(*val_ref as _)?;
3431 }
3432 }
3433 {
3434 let val_ref = &self.r#ssid_hidden;
3435 if *val_ref {
3436 encoder.encode_varint32(48u32)?;
3437 encoder.encode_bool(*val_ref)?;
3438 }
3439 }
3440 {
3441 let val_ref = &self.r#bw;
3442 if *val_ref != 0 {
3443 encoder.encode_varint32(56u32)?;
3444 encoder.encode_int32(*val_ref as _)?;
3445 }
3446 }
3447 {
3448 let val_ref = &self.r#band_mode;
3449 if *val_ref != 0 {
3450 encoder.encode_varint32(64u32)?;
3451 encoder.encode_int32(*val_ref as _)?;
3452 }
3453 }
3454 Ok(())
3455 }
3456 fn compute_size(&self) -> usize {
3457 use ::micropb::{FieldEncode, PbMap};
3458 let mut size = 0;
3459 {
3460 let val_ref = &self.r#ssid;
3461 if !val_ref.is_empty() {
3462 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
3463 }
3464 }
3465 {
3466 let val_ref = &self.r#pwd;
3467 if !val_ref.is_empty() {
3468 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
3469 }
3470 }
3471 {
3472 let val_ref = &self.r#chnl;
3473 if *val_ref != 0 {
3474 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
3475 }
3476 }
3477 {
3478 let val_ref = &self.r#sec_prot;
3479 if val_ref.0 != 0 {
3480 size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _);
3481 }
3482 }
3483 {
3484 let val_ref = &self.r#max_conn;
3485 if *val_ref != 0 {
3486 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
3487 }
3488 }
3489 {
3490 let val_ref = &self.r#ssid_hidden;
3491 if *val_ref {
3492 size += 1usize + 1;
3493 }
3494 }
3495 {
3496 let val_ref = &self.r#bw;
3497 if *val_ref != 0 {
3498 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
3499 }
3500 }
3501 {
3502 let val_ref = &self.r#band_mode;
3503 if *val_ref != 0 {
3504 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
3505 }
3506 }
3507 size
3508 }
3509}
3510#[derive(Debug, Default, PartialEq, Clone)]
231#[cfg_attr(feature = "defmt", derive(defmt::Format))] 3511#[cfg_attr(feature = "defmt", derive(defmt::Format))]
232pub(crate) struct CtrlMsgReqOtaBegin {} 3512pub struct CtrlMsg_Resp_StartSoftAP {
233 3513 pub r#resp: i32,
234#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 3514 pub r#mac: ::micropb::heapless::Vec<u8, 32>,
3515 pub r#band_mode: i32,
3516}
3517impl CtrlMsg_Resp_StartSoftAP {
3518 ///Return a reference to `resp`
3519 #[inline]
3520 pub fn r#resp(&self) -> &i32 {
3521 &self.r#resp
3522 }
3523 ///Return a mutable reference to `resp`
3524 #[inline]
3525 pub fn mut_resp(&mut self) -> &mut i32 {
3526 &mut self.r#resp
3527 }
3528 ///Set the value of `resp`
3529 #[inline]
3530 pub fn set_resp(&mut self, value: i32) -> &mut Self {
3531 self.r#resp = value.into();
3532 self
3533 }
3534 ///Builder method that sets the value of `resp`. Useful for initializing the message.
3535 #[inline]
3536 pub fn init_resp(mut self, value: i32) -> Self {
3537 self.r#resp = value.into();
3538 self
3539 }
3540 ///Return a reference to `mac`
3541 #[inline]
3542 pub fn r#mac(&self) -> &::micropb::heapless::Vec<u8, 32> {
3543 &self.r#mac
3544 }
3545 ///Return a mutable reference to `mac`
3546 #[inline]
3547 pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
3548 &mut self.r#mac
3549 }
3550 ///Set the value of `mac`
3551 #[inline]
3552 pub fn set_mac(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
3553 self.r#mac = value.into();
3554 self
3555 }
3556 ///Builder method that sets the value of `mac`. Useful for initializing the message.
3557 #[inline]
3558 pub fn init_mac(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
3559 self.r#mac = value.into();
3560 self
3561 }
3562 ///Return a reference to `band_mode`
3563 #[inline]
3564 pub fn r#band_mode(&self) -> &i32 {
3565 &self.r#band_mode
3566 }
3567 ///Return a mutable reference to `band_mode`
3568 #[inline]
3569 pub fn mut_band_mode(&mut self) -> &mut i32 {
3570 &mut self.r#band_mode
3571 }
3572 ///Set the value of `band_mode`
3573 #[inline]
3574 pub fn set_band_mode(&mut self, value: i32) -> &mut Self {
3575 self.r#band_mode = value.into();
3576 self
3577 }
3578 ///Builder method that sets the value of `band_mode`. Useful for initializing the message.
3579 #[inline]
3580 pub fn init_band_mode(mut self, value: i32) -> Self {
3581 self.r#band_mode = value.into();
3582 self
3583 }
3584}
3585impl ::micropb::MessageDecode for CtrlMsg_Resp_StartSoftAP {
3586 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
3587 &mut self,
3588 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
3589 len: usize,
3590 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
3591 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
3592 let before = decoder.bytes_read();
3593 while decoder.bytes_read() - before < len {
3594 let tag = decoder.decode_tag()?;
3595 match tag.field_num() {
3596 0 => return Err(::micropb::DecodeError::ZeroField),
3597 1u32 => {
3598 let mut_ref = &mut self.r#resp;
3599 {
3600 let val = decoder.decode_int32()?;
3601 let val_ref = &val;
3602 if *val_ref != 0 {
3603 *mut_ref = val as _;
3604 }
3605 };
3606 }
3607 2u32 => {
3608 let mut_ref = &mut self.r#mac;
3609 {
3610 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
3611 };
3612 }
3613 3u32 => {
3614 let mut_ref = &mut self.r#band_mode;
3615 {
3616 let val = decoder.decode_int32()?;
3617 let val_ref = &val;
3618 if *val_ref != 0 {
3619 *mut_ref = val as _;
3620 }
3621 };
3622 }
3623 _ => {
3624 decoder.skip_wire_value(tag.wire_type())?;
3625 }
3626 }
3627 }
3628 Ok(())
3629 }
3630}
3631impl ::micropb::MessageEncode for CtrlMsg_Resp_StartSoftAP {
3632 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
3633 let mut max_size = 0;
3634 if let ::core::option::Option::Some(size) =
3635 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
3636 {
3637 max_size += size;
3638 } else {
3639 break 'msg (::core::option::Option::<usize>::None);
3640 };
3641 if let ::core::option::Option::Some(size) =
3642 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
3643 {
3644 max_size += size;
3645 } else {
3646 break 'msg (::core::option::Option::<usize>::None);
3647 };
3648 if let ::core::option::Option::Some(size) =
3649 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
3650 {
3651 max_size += size;
3652 } else {
3653 break 'msg (::core::option::Option::<usize>::None);
3654 };
3655 ::core::option::Option::Some(max_size)
3656 };
3657 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
3658 &self,
3659 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
3660 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
3661 use ::micropb::{FieldEncode, PbMap};
3662 {
3663 let val_ref = &self.r#resp;
3664 if *val_ref != 0 {
3665 encoder.encode_varint32(8u32)?;
3666 encoder.encode_int32(*val_ref as _)?;
3667 }
3668 }
3669 {
3670 let val_ref = &self.r#mac;
3671 if !val_ref.is_empty() {
3672 encoder.encode_varint32(18u32)?;
3673 encoder.encode_bytes(val_ref)?;
3674 }
3675 }
3676 {
3677 let val_ref = &self.r#band_mode;
3678 if *val_ref != 0 {
3679 encoder.encode_varint32(24u32)?;
3680 encoder.encode_int32(*val_ref as _)?;
3681 }
3682 }
3683 Ok(())
3684 }
3685 fn compute_size(&self) -> usize {
3686 use ::micropb::{FieldEncode, PbMap};
3687 let mut size = 0;
3688 {
3689 let val_ref = &self.r#resp;
3690 if *val_ref != 0 {
3691 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
3692 }
3693 }
3694 {
3695 let val_ref = &self.r#mac;
3696 if !val_ref.is_empty() {
3697 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
3698 }
3699 }
3700 {
3701 let val_ref = &self.r#band_mode;
3702 if *val_ref != 0 {
3703 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
3704 }
3705 }
3706 size
3707 }
3708}
3709#[derive(Debug, Default, PartialEq, Clone)]
235#[cfg_attr(feature = "defmt", derive(defmt::Format))] 3710#[cfg_attr(feature = "defmt", derive(defmt::Format))]
236pub(crate) struct CtrlMsgRespOtaBegin { 3711pub struct CtrlMsg_Req_ScanResult {}
237 #[noproto(tag = "1")] 3712impl CtrlMsg_Req_ScanResult {}
238 pub resp: u32, 3713impl ::micropb::MessageDecode for CtrlMsg_Req_ScanResult {
3714 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
3715 &mut self,
3716 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
3717 len: usize,
3718 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
3719 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
3720 let before = decoder.bytes_read();
3721 while decoder.bytes_read() - before < len {
3722 let tag = decoder.decode_tag()?;
3723 match tag.field_num() {
3724 0 => return Err(::micropb::DecodeError::ZeroField),
3725 _ => {
3726 decoder.skip_wire_value(tag.wire_type())?;
3727 }
3728 }
3729 }
3730 Ok(())
3731 }
239} 3732}
240 3733impl ::micropb::MessageEncode for CtrlMsg_Req_ScanResult {
241#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 3734 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
3735 let mut max_size = 0;
3736 ::core::option::Option::Some(max_size)
3737 };
3738 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
3739 &self,
3740 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
3741 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
3742 use ::micropb::{FieldEncode, PbMap};
3743 Ok(())
3744 }
3745 fn compute_size(&self) -> usize {
3746 use ::micropb::{FieldEncode, PbMap};
3747 let mut size = 0;
3748 size
3749 }
3750}
3751#[derive(Debug, Default, PartialEq, Clone)]
242#[cfg_attr(feature = "defmt", derive(defmt::Format))] 3752#[cfg_attr(feature = "defmt", derive(defmt::Format))]
243pub(crate) struct CtrlMsgReqOtaWrite { 3753pub struct CtrlMsg_Resp_ScanResult {
244 #[noproto(tag = "1")] 3754 pub r#count: u32,
245 pub ota_data: Vec<u8, 1024>, 3755 pub r#entries: ::micropb::heapless::Vec<ScanResult, 16>,
3756 pub r#resp: i32,
246} 3757}
247 3758impl CtrlMsg_Resp_ScanResult {
248#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 3759 ///Return a reference to `count`
3760 #[inline]
3761 pub fn r#count(&self) -> &u32 {
3762 &self.r#count
3763 }
3764 ///Return a mutable reference to `count`
3765 #[inline]
3766 pub fn mut_count(&mut self) -> &mut u32 {
3767 &mut self.r#count
3768 }
3769 ///Set the value of `count`
3770 #[inline]
3771 pub fn set_count(&mut self, value: u32) -> &mut Self {
3772 self.r#count = value.into();
3773 self
3774 }
3775 ///Builder method that sets the value of `count`. Useful for initializing the message.
3776 #[inline]
3777 pub fn init_count(mut self, value: u32) -> Self {
3778 self.r#count = value.into();
3779 self
3780 }
3781 ///Return a reference to `resp`
3782 #[inline]
3783 pub fn r#resp(&self) -> &i32 {
3784 &self.r#resp
3785 }
3786 ///Return a mutable reference to `resp`
3787 #[inline]
3788 pub fn mut_resp(&mut self) -> &mut i32 {
3789 &mut self.r#resp
3790 }
3791 ///Set the value of `resp`
3792 #[inline]
3793 pub fn set_resp(&mut self, value: i32) -> &mut Self {
3794 self.r#resp = value.into();
3795 self
3796 }
3797 ///Builder method that sets the value of `resp`. Useful for initializing the message.
3798 #[inline]
3799 pub fn init_resp(mut self, value: i32) -> Self {
3800 self.r#resp = value.into();
3801 self
3802 }
3803}
3804impl ::micropb::MessageDecode for CtrlMsg_Resp_ScanResult {
3805 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
3806 &mut self,
3807 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
3808 len: usize,
3809 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
3810 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
3811 let before = decoder.bytes_read();
3812 while decoder.bytes_read() - before < len {
3813 let tag = decoder.decode_tag()?;
3814 match tag.field_num() {
3815 0 => return Err(::micropb::DecodeError::ZeroField),
3816 1u32 => {
3817 let mut_ref = &mut self.r#count;
3818 {
3819 let val = decoder.decode_varint32()?;
3820 let val_ref = &val;
3821 if *val_ref != 0 {
3822 *mut_ref = val as _;
3823 }
3824 };
3825 }
3826 2u32 => {
3827 let mut val: ScanResult = ::core::default::Default::default();
3828 let mut_ref = &mut val;
3829 {
3830 mut_ref.decode_len_delimited(decoder)?;
3831 };
3832 if let (Err(_), false) = (self.r#entries.pb_push(val), decoder.ignore_repeated_cap_err) {
3833 return Err(::micropb::DecodeError::Capacity);
3834 }
3835 }
3836 3u32 => {
3837 let mut_ref = &mut self.r#resp;
3838 {
3839 let val = decoder.decode_int32()?;
3840 let val_ref = &val;
3841 if *val_ref != 0 {
3842 *mut_ref = val as _;
3843 }
3844 };
3845 }
3846 _ => {
3847 decoder.skip_wire_value(tag.wire_type())?;
3848 }
3849 }
3850 }
3851 Ok(())
3852 }
3853}
3854impl ::micropb::MessageEncode for CtrlMsg_Resp_ScanResult {
3855 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
3856 let mut max_size = 0;
3857 if let ::core::option::Option::Some(size) =
3858 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
3859 {
3860 max_size += size;
3861 } else {
3862 break 'msg (::core::option::Option::<usize>::None);
3863 };
3864 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
3865 ::micropb::const_map!(<ScanResult as ::micropb::MessageEncode>::MAX_SIZE, |size| {
3866 ::micropb::size::sizeof_len_record(size)
3867 }),
3868 |size| (size + 1usize) * 16usize
3869 ) {
3870 max_size += size;
3871 } else {
3872 break 'msg (::core::option::Option::<usize>::None);
3873 };
3874 if let ::core::option::Option::Some(size) =
3875 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
3876 {
3877 max_size += size;
3878 } else {
3879 break 'msg (::core::option::Option::<usize>::None);
3880 };
3881 ::core::option::Option::Some(max_size)
3882 };
3883 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
3884 &self,
3885 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
3886 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
3887 use ::micropb::{FieldEncode, PbMap};
3888 {
3889 let val_ref = &self.r#count;
3890 if *val_ref != 0 {
3891 encoder.encode_varint32(8u32)?;
3892 encoder.encode_varint32(*val_ref as _)?;
3893 }
3894 }
3895 {
3896 for val_ref in self.r#entries.iter() {
3897 encoder.encode_varint32(18u32)?;
3898 val_ref.encode_len_delimited(encoder)?;
3899 }
3900 }
3901 {
3902 let val_ref = &self.r#resp;
3903 if *val_ref != 0 {
3904 encoder.encode_varint32(24u32)?;
3905 encoder.encode_int32(*val_ref as _)?;
3906 }
3907 }
3908 Ok(())
3909 }
3910 fn compute_size(&self) -> usize {
3911 use ::micropb::{FieldEncode, PbMap};
3912 let mut size = 0;
3913 {
3914 let val_ref = &self.r#count;
3915 if *val_ref != 0 {
3916 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
3917 }
3918 }
3919 {
3920 for val_ref in self.r#entries.iter() {
3921 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
3922 }
3923 }
3924 {
3925 let val_ref = &self.r#resp;
3926 if *val_ref != 0 {
3927 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
3928 }
3929 }
3930 size
3931 }
3932}
3933#[derive(Debug, Default, PartialEq, Clone)]
249#[cfg_attr(feature = "defmt", derive(defmt::Format))] 3934#[cfg_attr(feature = "defmt", derive(defmt::Format))]
250pub(crate) struct CtrlMsgRespOtaWrite { 3935pub struct CtrlMsg_Req_SoftAPConnectedSTA {}
251 #[noproto(tag = "1")] 3936impl CtrlMsg_Req_SoftAPConnectedSTA {}
252 pub resp: u32, 3937impl ::micropb::MessageDecode for CtrlMsg_Req_SoftAPConnectedSTA {
3938 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
3939 &mut self,
3940 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
3941 len: usize,
3942 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
3943 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
3944 let before = decoder.bytes_read();
3945 while decoder.bytes_read() - before < len {
3946 let tag = decoder.decode_tag()?;
3947 match tag.field_num() {
3948 0 => return Err(::micropb::DecodeError::ZeroField),
3949 _ => {
3950 decoder.skip_wire_value(tag.wire_type())?;
3951 }
3952 }
3953 }
3954 Ok(())
3955 }
253} 3956}
254 3957impl ::micropb::MessageEncode for CtrlMsg_Req_SoftAPConnectedSTA {
255#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 3958 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
3959 let mut max_size = 0;
3960 ::core::option::Option::Some(max_size)
3961 };
3962 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
3963 &self,
3964 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
3965 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
3966 use ::micropb::{FieldEncode, PbMap};
3967 Ok(())
3968 }
3969 fn compute_size(&self) -> usize {
3970 use ::micropb::{FieldEncode, PbMap};
3971 let mut size = 0;
3972 size
3973 }
3974}
3975#[derive(Debug, Default, PartialEq, Clone)]
256#[cfg_attr(feature = "defmt", derive(defmt::Format))] 3976#[cfg_attr(feature = "defmt", derive(defmt::Format))]
257pub(crate) struct CtrlMsgReqOtaEnd {} 3977pub struct CtrlMsg_Resp_SoftAPConnectedSTA {
258 3978 pub r#num: u32,
259#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 3979 pub r#stations: ::micropb::heapless::Vec<ConnectedSTAList, 16>,
3980 pub r#resp: i32,
3981}
3982impl CtrlMsg_Resp_SoftAPConnectedSTA {
3983 ///Return a reference to `num`
3984 #[inline]
3985 pub fn r#num(&self) -> &u32 {
3986 &self.r#num
3987 }
3988 ///Return a mutable reference to `num`
3989 #[inline]
3990 pub fn mut_num(&mut self) -> &mut u32 {
3991 &mut self.r#num
3992 }
3993 ///Set the value of `num`
3994 #[inline]
3995 pub fn set_num(&mut self, value: u32) -> &mut Self {
3996 self.r#num = value.into();
3997 self
3998 }
3999 ///Builder method that sets the value of `num`. Useful for initializing the message.
4000 #[inline]
4001 pub fn init_num(mut self, value: u32) -> Self {
4002 self.r#num = value.into();
4003 self
4004 }
4005 ///Return a reference to `resp`
4006 #[inline]
4007 pub fn r#resp(&self) -> &i32 {
4008 &self.r#resp
4009 }
4010 ///Return a mutable reference to `resp`
4011 #[inline]
4012 pub fn mut_resp(&mut self) -> &mut i32 {
4013 &mut self.r#resp
4014 }
4015 ///Set the value of `resp`
4016 #[inline]
4017 pub fn set_resp(&mut self, value: i32) -> &mut Self {
4018 self.r#resp = value.into();
4019 self
4020 }
4021 ///Builder method that sets the value of `resp`. Useful for initializing the message.
4022 #[inline]
4023 pub fn init_resp(mut self, value: i32) -> Self {
4024 self.r#resp = value.into();
4025 self
4026 }
4027}
4028impl ::micropb::MessageDecode for CtrlMsg_Resp_SoftAPConnectedSTA {
4029 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
4030 &mut self,
4031 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
4032 len: usize,
4033 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
4034 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
4035 let before = decoder.bytes_read();
4036 while decoder.bytes_read() - before < len {
4037 let tag = decoder.decode_tag()?;
4038 match tag.field_num() {
4039 0 => return Err(::micropb::DecodeError::ZeroField),
4040 1u32 => {
4041 let mut_ref = &mut self.r#num;
4042 {
4043 let val = decoder.decode_varint32()?;
4044 let val_ref = &val;
4045 if *val_ref != 0 {
4046 *mut_ref = val as _;
4047 }
4048 };
4049 }
4050 2u32 => {
4051 let mut val: ConnectedSTAList = ::core::default::Default::default();
4052 let mut_ref = &mut val;
4053 {
4054 mut_ref.decode_len_delimited(decoder)?;
4055 };
4056 if let (Err(_), false) = (self.r#stations.pb_push(val), decoder.ignore_repeated_cap_err) {
4057 return Err(::micropb::DecodeError::Capacity);
4058 }
4059 }
4060 3u32 => {
4061 let mut_ref = &mut self.r#resp;
4062 {
4063 let val = decoder.decode_int32()?;
4064 let val_ref = &val;
4065 if *val_ref != 0 {
4066 *mut_ref = val as _;
4067 }
4068 };
4069 }
4070 _ => {
4071 decoder.skip_wire_value(tag.wire_type())?;
4072 }
4073 }
4074 }
4075 Ok(())
4076 }
4077}
4078impl ::micropb::MessageEncode for CtrlMsg_Resp_SoftAPConnectedSTA {
4079 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
4080 let mut max_size = 0;
4081 if let ::core::option::Option::Some(size) =
4082 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
4083 {
4084 max_size += size;
4085 } else {
4086 break 'msg (::core::option::Option::<usize>::None);
4087 };
4088 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
4089 ::micropb::const_map!(<ConnectedSTAList as ::micropb::MessageEncode>::MAX_SIZE, |size| {
4090 ::micropb::size::sizeof_len_record(size)
4091 }),
4092 |size| (size + 1usize) * 16usize
4093 ) {
4094 max_size += size;
4095 } else {
4096 break 'msg (::core::option::Option::<usize>::None);
4097 };
4098 if let ::core::option::Option::Some(size) =
4099 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
4100 {
4101 max_size += size;
4102 } else {
4103 break 'msg (::core::option::Option::<usize>::None);
4104 };
4105 ::core::option::Option::Some(max_size)
4106 };
4107 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
4108 &self,
4109 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
4110 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
4111 use ::micropb::{FieldEncode, PbMap};
4112 {
4113 let val_ref = &self.r#num;
4114 if *val_ref != 0 {
4115 encoder.encode_varint32(8u32)?;
4116 encoder.encode_varint32(*val_ref as _)?;
4117 }
4118 }
4119 {
4120 for val_ref in self.r#stations.iter() {
4121 encoder.encode_varint32(18u32)?;
4122 val_ref.encode_len_delimited(encoder)?;
4123 }
4124 }
4125 {
4126 let val_ref = &self.r#resp;
4127 if *val_ref != 0 {
4128 encoder.encode_varint32(24u32)?;
4129 encoder.encode_int32(*val_ref as _)?;
4130 }
4131 }
4132 Ok(())
4133 }
4134 fn compute_size(&self) -> usize {
4135 use ::micropb::{FieldEncode, PbMap};
4136 let mut size = 0;
4137 {
4138 let val_ref = &self.r#num;
4139 if *val_ref != 0 {
4140 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
4141 }
4142 }
4143 {
4144 for val_ref in self.r#stations.iter() {
4145 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
4146 }
4147 }
4148 {
4149 let val_ref = &self.r#resp;
4150 if *val_ref != 0 {
4151 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
4152 }
4153 }
4154 size
4155 }
4156}
4157#[derive(Debug, Default, PartialEq, Clone)]
260#[cfg_attr(feature = "defmt", derive(defmt::Format))] 4158#[cfg_attr(feature = "defmt", derive(defmt::Format))]
261pub(crate) struct CtrlMsgRespOtaEnd { 4159pub struct CtrlMsg_Req_OTABegin {}
262 #[noproto(tag = "1")] 4160impl CtrlMsg_Req_OTABegin {}
263 pub resp: u32, 4161impl ::micropb::MessageDecode for CtrlMsg_Req_OTABegin {
4162 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
4163 &mut self,
4164 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
4165 len: usize,
4166 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
4167 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
4168 let before = decoder.bytes_read();
4169 while decoder.bytes_read() - before < len {
4170 let tag = decoder.decode_tag()?;
4171 match tag.field_num() {
4172 0 => return Err(::micropb::DecodeError::ZeroField),
4173 _ => {
4174 decoder.skip_wire_value(tag.wire_type())?;
4175 }
4176 }
4177 }
4178 Ok(())
4179 }
264} 4180}
265 4181impl ::micropb::MessageEncode for CtrlMsg_Req_OTABegin {
266#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 4182 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
267#[cfg_attr(feature = "defmt", derive(defmt::Format))] 4183 let mut max_size = 0;
268pub(crate) struct CtrlMsgReqVendorIeData { 4184 ::core::option::Option::Some(max_size)
269 #[noproto(tag = "1")] 4185 };
270 pub element_id: u32, 4186 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
271 #[noproto(tag = "2")] 4187 &self,
272 pub length: u32, 4188 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
273 #[noproto(tag = "3")] 4189 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
274 pub vendor_oui: Vec<u8, 8>, 4190 use ::micropb::{FieldEncode, PbMap};
275 #[noproto(tag = "4")] 4191 Ok(())
276 pub vendor_oui_type: u32, 4192 }
277 #[noproto(tag = "5")] 4193 fn compute_size(&self) -> usize {
278 pub payload: Vec<u8, 64>, 4194 use ::micropb::{FieldEncode, PbMap};
4195 let mut size = 0;
4196 size
4197 }
279} 4198}
280 4199#[derive(Debug, Default, PartialEq, Clone)]
281#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 4200#[cfg_attr(feature = "defmt", derive(defmt::Format))]
282#[cfg_attr(feature = "defmt", derive(defmt::Format))] 4201pub struct CtrlMsg_Resp_OTABegin {
283pub(crate) struct CtrlMsgReqSetSoftApVendorSpecificIe { 4202 pub r#resp: i32,
284 #[noproto(tag = "1")]
285 pub enable: bool,
286 #[noproto(tag = "2")]
287 pub r#type: CtrlVendorIeType,
288 #[noproto(tag = "3")]
289 pub idx: CtrlVendorIeid,
290 #[noproto(optional, tag = "4")]
291 pub vendor_ie_data: Option<CtrlMsgReqVendorIeData>,
292} 4203}
293 4204impl CtrlMsg_Resp_OTABegin {
294#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 4205 ///Return a reference to `resp`
4206 #[inline]
4207 pub fn r#resp(&self) -> &i32 {
4208 &self.r#resp
4209 }
4210 ///Return a mutable reference to `resp`
4211 #[inline]
4212 pub fn mut_resp(&mut self) -> &mut i32 {
4213 &mut self.r#resp
4214 }
4215 ///Set the value of `resp`
4216 #[inline]
4217 pub fn set_resp(&mut self, value: i32) -> &mut Self {
4218 self.r#resp = value.into();
4219 self
4220 }
4221 ///Builder method that sets the value of `resp`. Useful for initializing the message.
4222 #[inline]
4223 pub fn init_resp(mut self, value: i32) -> Self {
4224 self.r#resp = value.into();
4225 self
4226 }
4227}
4228impl ::micropb::MessageDecode for CtrlMsg_Resp_OTABegin {
4229 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
4230 &mut self,
4231 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
4232 len: usize,
4233 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
4234 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
4235 let before = decoder.bytes_read();
4236 while decoder.bytes_read() - before < len {
4237 let tag = decoder.decode_tag()?;
4238 match tag.field_num() {
4239 0 => return Err(::micropb::DecodeError::ZeroField),
4240 1u32 => {
4241 let mut_ref = &mut self.r#resp;
4242 {
4243 let val = decoder.decode_int32()?;
4244 let val_ref = &val;
4245 if *val_ref != 0 {
4246 *mut_ref = val as _;
4247 }
4248 };
4249 }
4250 _ => {
4251 decoder.skip_wire_value(tag.wire_type())?;
4252 }
4253 }
4254 }
4255 Ok(())
4256 }
4257}
4258impl ::micropb::MessageEncode for CtrlMsg_Resp_OTABegin {
4259 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
4260 let mut max_size = 0;
4261 if let ::core::option::Option::Some(size) =
4262 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
4263 {
4264 max_size += size;
4265 } else {
4266 break 'msg (::core::option::Option::<usize>::None);
4267 };
4268 ::core::option::Option::Some(max_size)
4269 };
4270 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
4271 &self,
4272 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
4273 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
4274 use ::micropb::{FieldEncode, PbMap};
4275 {
4276 let val_ref = &self.r#resp;
4277 if *val_ref != 0 {
4278 encoder.encode_varint32(8u32)?;
4279 encoder.encode_int32(*val_ref as _)?;
4280 }
4281 }
4282 Ok(())
4283 }
4284 fn compute_size(&self) -> usize {
4285 use ::micropb::{FieldEncode, PbMap};
4286 let mut size = 0;
4287 {
4288 let val_ref = &self.r#resp;
4289 if *val_ref != 0 {
4290 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
4291 }
4292 }
4293 size
4294 }
4295}
4296#[derive(Debug, Default, PartialEq, Clone)]
295#[cfg_attr(feature = "defmt", derive(defmt::Format))] 4297#[cfg_attr(feature = "defmt", derive(defmt::Format))]
296pub(crate) struct CtrlMsgRespSetSoftApVendorSpecificIe { 4298pub struct CtrlMsg_Req_OTAWrite {
297 #[noproto(tag = "1")] 4299 pub r#ota_data: ::micropb::heapless::Vec<u8, 256>,
298 pub resp: u32,
299} 4300}
300 4301impl CtrlMsg_Req_OTAWrite {
301#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 4302 ///Return a reference to `ota_data`
4303 #[inline]
4304 pub fn r#ota_data(&self) -> &::micropb::heapless::Vec<u8, 256> {
4305 &self.r#ota_data
4306 }
4307 ///Return a mutable reference to `ota_data`
4308 #[inline]
4309 pub fn mut_ota_data(&mut self) -> &mut ::micropb::heapless::Vec<u8, 256> {
4310 &mut self.r#ota_data
4311 }
4312 ///Set the value of `ota_data`
4313 #[inline]
4314 pub fn set_ota_data(&mut self, value: ::micropb::heapless::Vec<u8, 256>) -> &mut Self {
4315 self.r#ota_data = value.into();
4316 self
4317 }
4318 ///Builder method that sets the value of `ota_data`. Useful for initializing the message.
4319 #[inline]
4320 pub fn init_ota_data(mut self, value: ::micropb::heapless::Vec<u8, 256>) -> Self {
4321 self.r#ota_data = value.into();
4322 self
4323 }
4324}
4325impl ::micropb::MessageDecode for CtrlMsg_Req_OTAWrite {
4326 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
4327 &mut self,
4328 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
4329 len: usize,
4330 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
4331 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
4332 let before = decoder.bytes_read();
4333 while decoder.bytes_read() - before < len {
4334 let tag = decoder.decode_tag()?;
4335 match tag.field_num() {
4336 0 => return Err(::micropb::DecodeError::ZeroField),
4337 1u32 => {
4338 let mut_ref = &mut self.r#ota_data;
4339 {
4340 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
4341 };
4342 }
4343 _ => {
4344 decoder.skip_wire_value(tag.wire_type())?;
4345 }
4346 }
4347 }
4348 Ok(())
4349 }
4350}
4351impl ::micropb::MessageEncode for CtrlMsg_Req_OTAWrite {
4352 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
4353 let mut max_size = 0;
4354 if let ::core::option::Option::Some(size) =
4355 ::micropb::const_map!(::core::option::Option::Some(1026usize), |size| size + 1usize)
4356 {
4357 max_size += size;
4358 } else {
4359 break 'msg (::core::option::Option::<usize>::None);
4360 };
4361 ::core::option::Option::Some(max_size)
4362 };
4363 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
4364 &self,
4365 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
4366 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
4367 use ::micropb::{FieldEncode, PbMap};
4368 {
4369 let val_ref = &self.r#ota_data;
4370 if !val_ref.is_empty() {
4371 encoder.encode_varint32(10u32)?;
4372 encoder.encode_bytes(val_ref)?;
4373 }
4374 }
4375 Ok(())
4376 }
4377 fn compute_size(&self) -> usize {
4378 use ::micropb::{FieldEncode, PbMap};
4379 let mut size = 0;
4380 {
4381 let val_ref = &self.r#ota_data;
4382 if !val_ref.is_empty() {
4383 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
4384 }
4385 }
4386 size
4387 }
4388}
4389#[derive(Debug, Default, PartialEq, Clone)]
302#[cfg_attr(feature = "defmt", derive(defmt::Format))] 4390#[cfg_attr(feature = "defmt", derive(defmt::Format))]
303pub(crate) struct CtrlMsgReqSetWifiMaxTxPower { 4391pub struct CtrlMsg_Resp_OTAWrite {
304 #[noproto(tag = "1")] 4392 pub r#resp: i32,
305 pub wifi_max_tx_power: u32,
306} 4393}
307 4394impl CtrlMsg_Resp_OTAWrite {
308#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 4395 ///Return a reference to `resp`
4396 #[inline]
4397 pub fn r#resp(&self) -> &i32 {
4398 &self.r#resp
4399 }
4400 ///Return a mutable reference to `resp`
4401 #[inline]
4402 pub fn mut_resp(&mut self) -> &mut i32 {
4403 &mut self.r#resp
4404 }
4405 ///Set the value of `resp`
4406 #[inline]
4407 pub fn set_resp(&mut self, value: i32) -> &mut Self {
4408 self.r#resp = value.into();
4409 self
4410 }
4411 ///Builder method that sets the value of `resp`. Useful for initializing the message.
4412 #[inline]
4413 pub fn init_resp(mut self, value: i32) -> Self {
4414 self.r#resp = value.into();
4415 self
4416 }
4417}
4418impl ::micropb::MessageDecode for CtrlMsg_Resp_OTAWrite {
4419 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
4420 &mut self,
4421 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
4422 len: usize,
4423 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
4424 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
4425 let before = decoder.bytes_read();
4426 while decoder.bytes_read() - before < len {
4427 let tag = decoder.decode_tag()?;
4428 match tag.field_num() {
4429 0 => return Err(::micropb::DecodeError::ZeroField),
4430 1u32 => {
4431 let mut_ref = &mut self.r#resp;
4432 {
4433 let val = decoder.decode_int32()?;
4434 let val_ref = &val;
4435 if *val_ref != 0 {
4436 *mut_ref = val as _;
4437 }
4438 };
4439 }
4440 _ => {
4441 decoder.skip_wire_value(tag.wire_type())?;
4442 }
4443 }
4444 }
4445 Ok(())
4446 }
4447}
4448impl ::micropb::MessageEncode for CtrlMsg_Resp_OTAWrite {
4449 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
4450 let mut max_size = 0;
4451 if let ::core::option::Option::Some(size) =
4452 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
4453 {
4454 max_size += size;
4455 } else {
4456 break 'msg (::core::option::Option::<usize>::None);
4457 };
4458 ::core::option::Option::Some(max_size)
4459 };
4460 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
4461 &self,
4462 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
4463 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
4464 use ::micropb::{FieldEncode, PbMap};
4465 {
4466 let val_ref = &self.r#resp;
4467 if *val_ref != 0 {
4468 encoder.encode_varint32(8u32)?;
4469 encoder.encode_int32(*val_ref as _)?;
4470 }
4471 }
4472 Ok(())
4473 }
4474 fn compute_size(&self) -> usize {
4475 use ::micropb::{FieldEncode, PbMap};
4476 let mut size = 0;
4477 {
4478 let val_ref = &self.r#resp;
4479 if *val_ref != 0 {
4480 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
4481 }
4482 }
4483 size
4484 }
4485}
4486#[derive(Debug, Default, PartialEq, Clone)]
309#[cfg_attr(feature = "defmt", derive(defmt::Format))] 4487#[cfg_attr(feature = "defmt", derive(defmt::Format))]
310pub(crate) struct CtrlMsgRespSetWifiMaxTxPower { 4488pub struct CtrlMsg_Req_OTAEnd {}
311 #[noproto(tag = "1")] 4489impl CtrlMsg_Req_OTAEnd {}
312 pub resp: u32, 4490impl ::micropb::MessageDecode for CtrlMsg_Req_OTAEnd {
4491 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
4492 &mut self,
4493 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
4494 len: usize,
4495 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
4496 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
4497 let before = decoder.bytes_read();
4498 while decoder.bytes_read() - before < len {
4499 let tag = decoder.decode_tag()?;
4500 match tag.field_num() {
4501 0 => return Err(::micropb::DecodeError::ZeroField),
4502 _ => {
4503 decoder.skip_wire_value(tag.wire_type())?;
4504 }
4505 }
4506 }
4507 Ok(())
4508 }
313} 4509}
314 4510impl ::micropb::MessageEncode for CtrlMsg_Req_OTAEnd {
315#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 4511 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
4512 let mut max_size = 0;
4513 ::core::option::Option::Some(max_size)
4514 };
4515 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
4516 &self,
4517 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
4518 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
4519 use ::micropb::{FieldEncode, PbMap};
4520 Ok(())
4521 }
4522 fn compute_size(&self) -> usize {
4523 use ::micropb::{FieldEncode, PbMap};
4524 let mut size = 0;
4525 size
4526 }
4527}
4528#[derive(Debug, Default, PartialEq, Clone)]
316#[cfg_attr(feature = "defmt", derive(defmt::Format))] 4529#[cfg_attr(feature = "defmt", derive(defmt::Format))]
317pub(crate) struct CtrlMsgReqGetWifiCurrTxPower {} 4530pub struct CtrlMsg_Resp_OTAEnd {
318 4531 pub r#resp: i32,
319#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 4532}
4533impl CtrlMsg_Resp_OTAEnd {
4534 ///Return a reference to `resp`
4535 #[inline]
4536 pub fn r#resp(&self) -> &i32 {
4537 &self.r#resp
4538 }
4539 ///Return a mutable reference to `resp`
4540 #[inline]
4541 pub fn mut_resp(&mut self) -> &mut i32 {
4542 &mut self.r#resp
4543 }
4544 ///Set the value of `resp`
4545 #[inline]
4546 pub fn set_resp(&mut self, value: i32) -> &mut Self {
4547 self.r#resp = value.into();
4548 self
4549 }
4550 ///Builder method that sets the value of `resp`. Useful for initializing the message.
4551 #[inline]
4552 pub fn init_resp(mut self, value: i32) -> Self {
4553 self.r#resp = value.into();
4554 self
4555 }
4556}
4557impl ::micropb::MessageDecode for CtrlMsg_Resp_OTAEnd {
4558 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
4559 &mut self,
4560 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
4561 len: usize,
4562 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
4563 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
4564 let before = decoder.bytes_read();
4565 while decoder.bytes_read() - before < len {
4566 let tag = decoder.decode_tag()?;
4567 match tag.field_num() {
4568 0 => return Err(::micropb::DecodeError::ZeroField),
4569 1u32 => {
4570 let mut_ref = &mut self.r#resp;
4571 {
4572 let val = decoder.decode_int32()?;
4573 let val_ref = &val;
4574 if *val_ref != 0 {
4575 *mut_ref = val as _;
4576 }
4577 };
4578 }
4579 _ => {
4580 decoder.skip_wire_value(tag.wire_type())?;
4581 }
4582 }
4583 }
4584 Ok(())
4585 }
4586}
4587impl ::micropb::MessageEncode for CtrlMsg_Resp_OTAEnd {
4588 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
4589 let mut max_size = 0;
4590 if let ::core::option::Option::Some(size) =
4591 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
4592 {
4593 max_size += size;
4594 } else {
4595 break 'msg (::core::option::Option::<usize>::None);
4596 };
4597 ::core::option::Option::Some(max_size)
4598 };
4599 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
4600 &self,
4601 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
4602 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
4603 use ::micropb::{FieldEncode, PbMap};
4604 {
4605 let val_ref = &self.r#resp;
4606 if *val_ref != 0 {
4607 encoder.encode_varint32(8u32)?;
4608 encoder.encode_int32(*val_ref as _)?;
4609 }
4610 }
4611 Ok(())
4612 }
4613 fn compute_size(&self) -> usize {
4614 use ::micropb::{FieldEncode, PbMap};
4615 let mut size = 0;
4616 {
4617 let val_ref = &self.r#resp;
4618 if *val_ref != 0 {
4619 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
4620 }
4621 }
4622 size
4623 }
4624}
4625#[derive(Debug, Default, PartialEq, Clone)]
320#[cfg_attr(feature = "defmt", derive(defmt::Format))] 4626#[cfg_attr(feature = "defmt", derive(defmt::Format))]
321pub(crate) struct CtrlMsgRespGetWifiCurrTxPower { 4627pub struct CtrlMsg_Req_VendorIEData {
322 #[noproto(tag = "1")] 4628 pub r#element_id: i32,
323 pub wifi_curr_tx_power: u32, 4629 pub r#length: i32,
324 #[noproto(tag = "2")] 4630 pub r#vendor_oui: ::micropb::heapless::Vec<u8, 32>,
325 pub resp: u32, 4631 pub r#vendor_oui_type: i32,
4632 pub r#payload: ::micropb::heapless::Vec<u8, 64>,
326} 4633}
327 4634impl CtrlMsg_Req_VendorIEData {
328#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 4635 ///Return a reference to `element_id`
4636 #[inline]
4637 pub fn r#element_id(&self) -> &i32 {
4638 &self.r#element_id
4639 }
4640 ///Return a mutable reference to `element_id`
4641 #[inline]
4642 pub fn mut_element_id(&mut self) -> &mut i32 {
4643 &mut self.r#element_id
4644 }
4645 ///Set the value of `element_id`
4646 #[inline]
4647 pub fn set_element_id(&mut self, value: i32) -> &mut Self {
4648 self.r#element_id = value.into();
4649 self
4650 }
4651 ///Builder method that sets the value of `element_id`. Useful for initializing the message.
4652 #[inline]
4653 pub fn init_element_id(mut self, value: i32) -> Self {
4654 self.r#element_id = value.into();
4655 self
4656 }
4657 ///Return a reference to `length`
4658 #[inline]
4659 pub fn r#length(&self) -> &i32 {
4660 &self.r#length
4661 }
4662 ///Return a mutable reference to `length`
4663 #[inline]
4664 pub fn mut_length(&mut self) -> &mut i32 {
4665 &mut self.r#length
4666 }
4667 ///Set the value of `length`
4668 #[inline]
4669 pub fn set_length(&mut self, value: i32) -> &mut Self {
4670 self.r#length = value.into();
4671 self
4672 }
4673 ///Builder method that sets the value of `length`. Useful for initializing the message.
4674 #[inline]
4675 pub fn init_length(mut self, value: i32) -> Self {
4676 self.r#length = value.into();
4677 self
4678 }
4679 ///Return a reference to `vendor_oui`
4680 #[inline]
4681 pub fn r#vendor_oui(&self) -> &::micropb::heapless::Vec<u8, 32> {
4682 &self.r#vendor_oui
4683 }
4684 ///Return a mutable reference to `vendor_oui`
4685 #[inline]
4686 pub fn mut_vendor_oui(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
4687 &mut self.r#vendor_oui
4688 }
4689 ///Set the value of `vendor_oui`
4690 #[inline]
4691 pub fn set_vendor_oui(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
4692 self.r#vendor_oui = value.into();
4693 self
4694 }
4695 ///Builder method that sets the value of `vendor_oui`. Useful for initializing the message.
4696 #[inline]
4697 pub fn init_vendor_oui(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
4698 self.r#vendor_oui = value.into();
4699 self
4700 }
4701 ///Return a reference to `vendor_oui_type`
4702 #[inline]
4703 pub fn r#vendor_oui_type(&self) -> &i32 {
4704 &self.r#vendor_oui_type
4705 }
4706 ///Return a mutable reference to `vendor_oui_type`
4707 #[inline]
4708 pub fn mut_vendor_oui_type(&mut self) -> &mut i32 {
4709 &mut self.r#vendor_oui_type
4710 }
4711 ///Set the value of `vendor_oui_type`
4712 #[inline]
4713 pub fn set_vendor_oui_type(&mut self, value: i32) -> &mut Self {
4714 self.r#vendor_oui_type = value.into();
4715 self
4716 }
4717 ///Builder method that sets the value of `vendor_oui_type`. Useful for initializing the message.
4718 #[inline]
4719 pub fn init_vendor_oui_type(mut self, value: i32) -> Self {
4720 self.r#vendor_oui_type = value.into();
4721 self
4722 }
4723 ///Return a reference to `payload`
4724 #[inline]
4725 pub fn r#payload(&self) -> &::micropb::heapless::Vec<u8, 64> {
4726 &self.r#payload
4727 }
4728 ///Return a mutable reference to `payload`
4729 #[inline]
4730 pub fn mut_payload(&mut self) -> &mut ::micropb::heapless::Vec<u8, 64> {
4731 &mut self.r#payload
4732 }
4733 ///Set the value of `payload`
4734 #[inline]
4735 pub fn set_payload(&mut self, value: ::micropb::heapless::Vec<u8, 64>) -> &mut Self {
4736 self.r#payload = value.into();
4737 self
4738 }
4739 ///Builder method that sets the value of `payload`. Useful for initializing the message.
4740 #[inline]
4741 pub fn init_payload(mut self, value: ::micropb::heapless::Vec<u8, 64>) -> Self {
4742 self.r#payload = value.into();
4743 self
4744 }
4745}
4746impl ::micropb::MessageDecode for CtrlMsg_Req_VendorIEData {
4747 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
4748 &mut self,
4749 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
4750 len: usize,
4751 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
4752 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
4753 let before = decoder.bytes_read();
4754 while decoder.bytes_read() - before < len {
4755 let tag = decoder.decode_tag()?;
4756 match tag.field_num() {
4757 0 => return Err(::micropb::DecodeError::ZeroField),
4758 1u32 => {
4759 let mut_ref = &mut self.r#element_id;
4760 {
4761 let val = decoder.decode_int32()?;
4762 let val_ref = &val;
4763 if *val_ref != 0 {
4764 *mut_ref = val as _;
4765 }
4766 };
4767 }
4768 2u32 => {
4769 let mut_ref = &mut self.r#length;
4770 {
4771 let val = decoder.decode_int32()?;
4772 let val_ref = &val;
4773 if *val_ref != 0 {
4774 *mut_ref = val as _;
4775 }
4776 };
4777 }
4778 3u32 => {
4779 let mut_ref = &mut self.r#vendor_oui;
4780 {
4781 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
4782 };
4783 }
4784 4u32 => {
4785 let mut_ref = &mut self.r#vendor_oui_type;
4786 {
4787 let val = decoder.decode_int32()?;
4788 let val_ref = &val;
4789 if *val_ref != 0 {
4790 *mut_ref = val as _;
4791 }
4792 };
4793 }
4794 5u32 => {
4795 let mut_ref = &mut self.r#payload;
4796 {
4797 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
4798 };
4799 }
4800 _ => {
4801 decoder.skip_wire_value(tag.wire_type())?;
4802 }
4803 }
4804 }
4805 Ok(())
4806 }
4807}
4808impl ::micropb::MessageEncode for CtrlMsg_Req_VendorIEData {
4809 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
4810 let mut max_size = 0;
4811 if let ::core::option::Option::Some(size) =
4812 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
4813 {
4814 max_size += size;
4815 } else {
4816 break 'msg (::core::option::Option::<usize>::None);
4817 };
4818 if let ::core::option::Option::Some(size) =
4819 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
4820 {
4821 max_size += size;
4822 } else {
4823 break 'msg (::core::option::Option::<usize>::None);
4824 };
4825 if let ::core::option::Option::Some(size) =
4826 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
4827 {
4828 max_size += size;
4829 } else {
4830 break 'msg (::core::option::Option::<usize>::None);
4831 };
4832 if let ::core::option::Option::Some(size) =
4833 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
4834 {
4835 max_size += size;
4836 } else {
4837 break 'msg (::core::option::Option::<usize>::None);
4838 };
4839 if let ::core::option::Option::Some(size) =
4840 ::micropb::const_map!(::core::option::Option::Some(65usize), |size| size + 1usize)
4841 {
4842 max_size += size;
4843 } else {
4844 break 'msg (::core::option::Option::<usize>::None);
4845 };
4846 ::core::option::Option::Some(max_size)
4847 };
4848 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
4849 &self,
4850 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
4851 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
4852 use ::micropb::{FieldEncode, PbMap};
4853 {
4854 let val_ref = &self.r#element_id;
4855 if *val_ref != 0 {
4856 encoder.encode_varint32(8u32)?;
4857 encoder.encode_int32(*val_ref as _)?;
4858 }
4859 }
4860 {
4861 let val_ref = &self.r#length;
4862 if *val_ref != 0 {
4863 encoder.encode_varint32(16u32)?;
4864 encoder.encode_int32(*val_ref as _)?;
4865 }
4866 }
4867 {
4868 let val_ref = &self.r#vendor_oui;
4869 if !val_ref.is_empty() {
4870 encoder.encode_varint32(26u32)?;
4871 encoder.encode_bytes(val_ref)?;
4872 }
4873 }
4874 {
4875 let val_ref = &self.r#vendor_oui_type;
4876 if *val_ref != 0 {
4877 encoder.encode_varint32(32u32)?;
4878 encoder.encode_int32(*val_ref as _)?;
4879 }
4880 }
4881 {
4882 let val_ref = &self.r#payload;
4883 if !val_ref.is_empty() {
4884 encoder.encode_varint32(42u32)?;
4885 encoder.encode_bytes(val_ref)?;
4886 }
4887 }
4888 Ok(())
4889 }
4890 fn compute_size(&self) -> usize {
4891 use ::micropb::{FieldEncode, PbMap};
4892 let mut size = 0;
4893 {
4894 let val_ref = &self.r#element_id;
4895 if *val_ref != 0 {
4896 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
4897 }
4898 }
4899 {
4900 let val_ref = &self.r#length;
4901 if *val_ref != 0 {
4902 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
4903 }
4904 }
4905 {
4906 let val_ref = &self.r#vendor_oui;
4907 if !val_ref.is_empty() {
4908 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
4909 }
4910 }
4911 {
4912 let val_ref = &self.r#vendor_oui_type;
4913 if *val_ref != 0 {
4914 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
4915 }
4916 }
4917 {
4918 let val_ref = &self.r#payload;
4919 if !val_ref.is_empty() {
4920 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
4921 }
4922 }
4923 size
4924 }
4925}
4926pub mod CtrlMsg_Req_SetSoftAPVendorSpecificIE_ {
4927 #[derive(Debug, Default, PartialEq, Clone)]
4928 #[cfg_attr(feature = "defmt", derive(defmt::Format))]
4929 pub struct _Hazzer([u8; 1]);
4930 impl _Hazzer {
4931 ///New hazzer with all fields set to off
4932 #[inline]
4933 pub const fn _new() -> Self {
4934 Self([0; 1])
4935 }
4936 ///Query presence of `vendor_ie_data`
4937 #[inline]
4938 pub const fn r#vendor_ie_data(&self) -> bool {
4939 (self.0[0] & 1) != 0
4940 }
4941 ///Set presence of `vendor_ie_data`
4942 #[inline]
4943 pub const fn set_vendor_ie_data(&mut self) -> &mut Self {
4944 let elem = &mut self.0[0];
4945 *elem |= 1;
4946 self
4947 }
4948 ///Clear presence of `vendor_ie_data`
4949 #[inline]
4950 pub const fn clear_vendor_ie_data(&mut self) -> &mut Self {
4951 let elem = &mut self.0[0];
4952 *elem &= !1;
4953 self
4954 }
4955 ///Builder method that sets the presence of `vendor_ie_data`. Useful for initializing the Hazzer.
4956 #[inline]
4957 pub const fn init_vendor_ie_data(mut self) -> Self {
4958 self.set_vendor_ie_data();
4959 self
4960 }
4961 }
4962}
4963#[derive(Debug, Default, Clone)]
329#[cfg_attr(feature = "defmt", derive(defmt::Format))] 4964#[cfg_attr(feature = "defmt", derive(defmt::Format))]
330pub(crate) struct CtrlMsgReqConfigHeartbeat { 4965pub struct CtrlMsg_Req_SetSoftAPVendorSpecificIE {
331 #[noproto(tag = "1")] 4966 pub r#enable: bool,
332 pub enable: bool, 4967 pub r#type: Ctrl_VendorIEType,
333 #[noproto(tag = "2")] 4968 pub r#idx: Ctrl_VendorIEID,
334 pub duration: u32, 4969 pub r#vendor_ie_data: CtrlMsg_Req_VendorIEData,
4970 pub _has: CtrlMsg_Req_SetSoftAPVendorSpecificIE_::_Hazzer,
335} 4971}
336 4972impl ::core::cmp::PartialEq for CtrlMsg_Req_SetSoftAPVendorSpecificIE {
337#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 4973 fn eq(&self, other: &Self) -> bool {
4974 let mut ret = true;
4975 ret &= (self.r#enable == other.r#enable);
4976 ret &= (self.r#type == other.r#type);
4977 ret &= (self.r#idx == other.r#idx);
4978 ret &= (self.r#vendor_ie_data() == other.r#vendor_ie_data());
4979 ret
4980 }
4981}
4982impl CtrlMsg_Req_SetSoftAPVendorSpecificIE {
4983 ///Return a reference to `enable`
4984 #[inline]
4985 pub fn r#enable(&self) -> &bool {
4986 &self.r#enable
4987 }
4988 ///Return a mutable reference to `enable`
4989 #[inline]
4990 pub fn mut_enable(&mut self) -> &mut bool {
4991 &mut self.r#enable
4992 }
4993 ///Set the value of `enable`
4994 #[inline]
4995 pub fn set_enable(&mut self, value: bool) -> &mut Self {
4996 self.r#enable = value.into();
4997 self
4998 }
4999 ///Builder method that sets the value of `enable`. Useful for initializing the message.
5000 #[inline]
5001 pub fn init_enable(mut self, value: bool) -> Self {
5002 self.r#enable = value.into();
5003 self
5004 }
5005 ///Return a reference to `type`
5006 #[inline]
5007 pub fn r#type(&self) -> &Ctrl_VendorIEType {
5008 &self.r#type
5009 }
5010 ///Return a mutable reference to `type`
5011 #[inline]
5012 pub fn mut_type(&mut self) -> &mut Ctrl_VendorIEType {
5013 &mut self.r#type
5014 }
5015 ///Set the value of `type`
5016 #[inline]
5017 pub fn set_type(&mut self, value: Ctrl_VendorIEType) -> &mut Self {
5018 self.r#type = value.into();
5019 self
5020 }
5021 ///Builder method that sets the value of `type`. Useful for initializing the message.
5022 #[inline]
5023 pub fn init_type(mut self, value: Ctrl_VendorIEType) -> Self {
5024 self.r#type = value.into();
5025 self
5026 }
5027 ///Return a reference to `idx`
5028 #[inline]
5029 pub fn r#idx(&self) -> &Ctrl_VendorIEID {
5030 &self.r#idx
5031 }
5032 ///Return a mutable reference to `idx`
5033 #[inline]
5034 pub fn mut_idx(&mut self) -> &mut Ctrl_VendorIEID {
5035 &mut self.r#idx
5036 }
5037 ///Set the value of `idx`
5038 #[inline]
5039 pub fn set_idx(&mut self, value: Ctrl_VendorIEID) -> &mut Self {
5040 self.r#idx = value.into();
5041 self
5042 }
5043 ///Builder method that sets the value of `idx`. Useful for initializing the message.
5044 #[inline]
5045 pub fn init_idx(mut self, value: Ctrl_VendorIEID) -> Self {
5046 self.r#idx = value.into();
5047 self
5048 }
5049 ///Return a reference to `vendor_ie_data` as an `Option`
5050 #[inline]
5051 pub fn r#vendor_ie_data(&self) -> ::core::option::Option<&CtrlMsg_Req_VendorIEData> {
5052 self._has.r#vendor_ie_data().then_some(&self.r#vendor_ie_data)
5053 }
5054 ///Set the value and presence of `vendor_ie_data`
5055 #[inline]
5056 pub fn set_vendor_ie_data(&mut self, value: CtrlMsg_Req_VendorIEData) -> &mut Self {
5057 self._has.set_vendor_ie_data();
5058 self.r#vendor_ie_data = value.into();
5059 self
5060 }
5061 ///Return a mutable reference to `vendor_ie_data` as an `Option`
5062 #[inline]
5063 pub fn mut_vendor_ie_data(&mut self) -> ::core::option::Option<&mut CtrlMsg_Req_VendorIEData> {
5064 self._has.r#vendor_ie_data().then_some(&mut self.r#vendor_ie_data)
5065 }
5066 ///Clear the presence of `vendor_ie_data`
5067 #[inline]
5068 pub fn clear_vendor_ie_data(&mut self) -> &mut Self {
5069 self._has.clear_vendor_ie_data();
5070 self
5071 }
5072 ///Take the value of `vendor_ie_data` and clear its presence
5073 #[inline]
5074 pub fn take_vendor_ie_data(&mut self) -> ::core::option::Option<CtrlMsg_Req_VendorIEData> {
5075 let val = self
5076 ._has
5077 .r#vendor_ie_data()
5078 .then(|| ::core::mem::take(&mut self.r#vendor_ie_data));
5079 self._has.clear_vendor_ie_data();
5080 val
5081 }
5082 ///Builder method that sets the value of `vendor_ie_data`. Useful for initializing the message.
5083 #[inline]
5084 pub fn init_vendor_ie_data(mut self, value: CtrlMsg_Req_VendorIEData) -> Self {
5085 self.set_vendor_ie_data(value);
5086 self
5087 }
5088}
5089impl ::micropb::MessageDecode for CtrlMsg_Req_SetSoftAPVendorSpecificIE {
5090 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
5091 &mut self,
5092 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
5093 len: usize,
5094 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
5095 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
5096 let before = decoder.bytes_read();
5097 while decoder.bytes_read() - before < len {
5098 let tag = decoder.decode_tag()?;
5099 match tag.field_num() {
5100 0 => return Err(::micropb::DecodeError::ZeroField),
5101 1u32 => {
5102 let mut_ref = &mut self.r#enable;
5103 {
5104 let val = decoder.decode_bool()?;
5105 let val_ref = &val;
5106 if *val_ref {
5107 *mut_ref = val as _;
5108 }
5109 };
5110 }
5111 2u32 => {
5112 let mut_ref = &mut self.r#type;
5113 {
5114 let val = decoder.decode_int32().map(|n| Ctrl_VendorIEType(n as _))?;
5115 let val_ref = &val;
5116 if val_ref.0 != 0 {
5117 *mut_ref = val as _;
5118 }
5119 };
5120 }
5121 3u32 => {
5122 let mut_ref = &mut self.r#idx;
5123 {
5124 let val = decoder.decode_int32().map(|n| Ctrl_VendorIEID(n as _))?;
5125 let val_ref = &val;
5126 if val_ref.0 != 0 {
5127 *mut_ref = val as _;
5128 }
5129 };
5130 }
5131 4u32 => {
5132 let mut_ref = &mut self.r#vendor_ie_data;
5133 {
5134 mut_ref.decode_len_delimited(decoder)?;
5135 };
5136 self._has.set_vendor_ie_data();
5137 }
5138 _ => {
5139 decoder.skip_wire_value(tag.wire_type())?;
5140 }
5141 }
5142 }
5143 Ok(())
5144 }
5145}
5146impl ::micropb::MessageEncode for CtrlMsg_Req_SetSoftAPVendorSpecificIE {
5147 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
5148 let mut max_size = 0;
5149 if let ::core::option::Option::Some(size) =
5150 ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize)
5151 {
5152 max_size += size;
5153 } else {
5154 break 'msg (::core::option::Option::<usize>::None);
5155 };
5156 if let ::core::option::Option::Some(size) =
5157 ::micropb::const_map!(::core::option::Option::Some(Ctrl_VendorIEType::_MAX_SIZE), |size| size
5158 + 1usize)
5159 {
5160 max_size += size;
5161 } else {
5162 break 'msg (::core::option::Option::<usize>::None);
5163 };
5164 if let ::core::option::Option::Some(size) =
5165 ::micropb::const_map!(::core::option::Option::Some(Ctrl_VendorIEID::_MAX_SIZE), |size| size
5166 + 1usize)
5167 {
5168 max_size += size;
5169 } else {
5170 break 'msg (::core::option::Option::<usize>::None);
5171 };
5172 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
5173 ::micropb::const_map!(
5174 <CtrlMsg_Req_VendorIEData as ::micropb::MessageEncode>::MAX_SIZE,
5175 |size| ::micropb::size::sizeof_len_record(size)
5176 ),
5177 |size| size + 1usize
5178 ) {
5179 max_size += size;
5180 } else {
5181 break 'msg (::core::option::Option::<usize>::None);
5182 };
5183 ::core::option::Option::Some(max_size)
5184 };
5185 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
5186 &self,
5187 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
5188 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
5189 use ::micropb::{FieldEncode, PbMap};
5190 {
5191 let val_ref = &self.r#enable;
5192 if *val_ref {
5193 encoder.encode_varint32(8u32)?;
5194 encoder.encode_bool(*val_ref)?;
5195 }
5196 }
5197 {
5198 let val_ref = &self.r#type;
5199 if val_ref.0 != 0 {
5200 encoder.encode_varint32(16u32)?;
5201 encoder.encode_int32(val_ref.0 as _)?;
5202 }
5203 }
5204 {
5205 let val_ref = &self.r#idx;
5206 if val_ref.0 != 0 {
5207 encoder.encode_varint32(24u32)?;
5208 encoder.encode_int32(val_ref.0 as _)?;
5209 }
5210 }
5211 {
5212 if let ::core::option::Option::Some(val_ref) = self.r#vendor_ie_data() {
5213 encoder.encode_varint32(34u32)?;
5214 val_ref.encode_len_delimited(encoder)?;
5215 }
5216 }
5217 Ok(())
5218 }
5219 fn compute_size(&self) -> usize {
5220 use ::micropb::{FieldEncode, PbMap};
5221 let mut size = 0;
5222 {
5223 let val_ref = &self.r#enable;
5224 if *val_ref {
5225 size += 1usize + 1;
5226 }
5227 }
5228 {
5229 let val_ref = &self.r#type;
5230 if val_ref.0 != 0 {
5231 size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _);
5232 }
5233 }
5234 {
5235 let val_ref = &self.r#idx;
5236 if val_ref.0 != 0 {
5237 size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _);
5238 }
5239 }
5240 {
5241 if let ::core::option::Option::Some(val_ref) = self.r#vendor_ie_data() {
5242 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
5243 }
5244 }
5245 size
5246 }
5247}
5248#[derive(Debug, Default, PartialEq, Clone)]
338#[cfg_attr(feature = "defmt", derive(defmt::Format))] 5249#[cfg_attr(feature = "defmt", derive(defmt::Format))]
339pub(crate) struct CtrlMsgRespConfigHeartbeat { 5250pub struct CtrlMsg_Resp_SetSoftAPVendorSpecificIE {
340 #[noproto(tag = "1")] 5251 pub r#resp: i32,
341 pub resp: u32,
342} 5252}
343/// * Event structure * 5253impl CtrlMsg_Resp_SetSoftAPVendorSpecificIE {
344 5254 ///Return a reference to `resp`
345#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 5255 #[inline]
5256 pub fn r#resp(&self) -> &i32 {
5257 &self.r#resp
5258 }
5259 ///Return a mutable reference to `resp`
5260 #[inline]
5261 pub fn mut_resp(&mut self) -> &mut i32 {
5262 &mut self.r#resp
5263 }
5264 ///Set the value of `resp`
5265 #[inline]
5266 pub fn set_resp(&mut self, value: i32) -> &mut Self {
5267 self.r#resp = value.into();
5268 self
5269 }
5270 ///Builder method that sets the value of `resp`. Useful for initializing the message.
5271 #[inline]
5272 pub fn init_resp(mut self, value: i32) -> Self {
5273 self.r#resp = value.into();
5274 self
5275 }
5276}
5277impl ::micropb::MessageDecode for CtrlMsg_Resp_SetSoftAPVendorSpecificIE {
5278 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
5279 &mut self,
5280 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
5281 len: usize,
5282 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
5283 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
5284 let before = decoder.bytes_read();
5285 while decoder.bytes_read() - before < len {
5286 let tag = decoder.decode_tag()?;
5287 match tag.field_num() {
5288 0 => return Err(::micropb::DecodeError::ZeroField),
5289 1u32 => {
5290 let mut_ref = &mut self.r#resp;
5291 {
5292 let val = decoder.decode_int32()?;
5293 let val_ref = &val;
5294 if *val_ref != 0 {
5295 *mut_ref = val as _;
5296 }
5297 };
5298 }
5299 _ => {
5300 decoder.skip_wire_value(tag.wire_type())?;
5301 }
5302 }
5303 }
5304 Ok(())
5305 }
5306}
5307impl ::micropb::MessageEncode for CtrlMsg_Resp_SetSoftAPVendorSpecificIE {
5308 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
5309 let mut max_size = 0;
5310 if let ::core::option::Option::Some(size) =
5311 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
5312 {
5313 max_size += size;
5314 } else {
5315 break 'msg (::core::option::Option::<usize>::None);
5316 };
5317 ::core::option::Option::Some(max_size)
5318 };
5319 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
5320 &self,
5321 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
5322 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
5323 use ::micropb::{FieldEncode, PbMap};
5324 {
5325 let val_ref = &self.r#resp;
5326 if *val_ref != 0 {
5327 encoder.encode_varint32(8u32)?;
5328 encoder.encode_int32(*val_ref as _)?;
5329 }
5330 }
5331 Ok(())
5332 }
5333 fn compute_size(&self) -> usize {
5334 use ::micropb::{FieldEncode, PbMap};
5335 let mut size = 0;
5336 {
5337 let val_ref = &self.r#resp;
5338 if *val_ref != 0 {
5339 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
5340 }
5341 }
5342 size
5343 }
5344}
5345#[derive(Debug, Default, PartialEq, Clone)]
346#[cfg_attr(feature = "defmt", derive(defmt::Format))] 5346#[cfg_attr(feature = "defmt", derive(defmt::Format))]
347pub(crate) struct CtrlMsgEventEspInit { 5347pub struct CtrlMsg_Req_SetWifiMaxTxPower {
348 #[noproto(tag = "1")] 5348 pub r#wifi_max_tx_power: i32,
349 pub init_data: Vec<u8, 64>,
350} 5349}
351 5350impl CtrlMsg_Req_SetWifiMaxTxPower {
352#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 5351 ///Return a reference to `wifi_max_tx_power`
5352 #[inline]
5353 pub fn r#wifi_max_tx_power(&self) -> &i32 {
5354 &self.r#wifi_max_tx_power
5355 }
5356 ///Return a mutable reference to `wifi_max_tx_power`
5357 #[inline]
5358 pub fn mut_wifi_max_tx_power(&mut self) -> &mut i32 {
5359 &mut self.r#wifi_max_tx_power
5360 }
5361 ///Set the value of `wifi_max_tx_power`
5362 #[inline]
5363 pub fn set_wifi_max_tx_power(&mut self, value: i32) -> &mut Self {
5364 self.r#wifi_max_tx_power = value.into();
5365 self
5366 }
5367 ///Builder method that sets the value of `wifi_max_tx_power`. Useful for initializing the message.
5368 #[inline]
5369 pub fn init_wifi_max_tx_power(mut self, value: i32) -> Self {
5370 self.r#wifi_max_tx_power = value.into();
5371 self
5372 }
5373}
5374impl ::micropb::MessageDecode for CtrlMsg_Req_SetWifiMaxTxPower {
5375 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
5376 &mut self,
5377 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
5378 len: usize,
5379 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
5380 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
5381 let before = decoder.bytes_read();
5382 while decoder.bytes_read() - before < len {
5383 let tag = decoder.decode_tag()?;
5384 match tag.field_num() {
5385 0 => return Err(::micropb::DecodeError::ZeroField),
5386 1u32 => {
5387 let mut_ref = &mut self.r#wifi_max_tx_power;
5388 {
5389 let val = decoder.decode_int32()?;
5390 let val_ref = &val;
5391 if *val_ref != 0 {
5392 *mut_ref = val as _;
5393 }
5394 };
5395 }
5396 _ => {
5397 decoder.skip_wire_value(tag.wire_type())?;
5398 }
5399 }
5400 }
5401 Ok(())
5402 }
5403}
5404impl ::micropb::MessageEncode for CtrlMsg_Req_SetWifiMaxTxPower {
5405 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
5406 let mut max_size = 0;
5407 if let ::core::option::Option::Some(size) =
5408 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
5409 {
5410 max_size += size;
5411 } else {
5412 break 'msg (::core::option::Option::<usize>::None);
5413 };
5414 ::core::option::Option::Some(max_size)
5415 };
5416 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
5417 &self,
5418 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
5419 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
5420 use ::micropb::{FieldEncode, PbMap};
5421 {
5422 let val_ref = &self.r#wifi_max_tx_power;
5423 if *val_ref != 0 {
5424 encoder.encode_varint32(8u32)?;
5425 encoder.encode_int32(*val_ref as _)?;
5426 }
5427 }
5428 Ok(())
5429 }
5430 fn compute_size(&self) -> usize {
5431 use ::micropb::{FieldEncode, PbMap};
5432 let mut size = 0;
5433 {
5434 let val_ref = &self.r#wifi_max_tx_power;
5435 if *val_ref != 0 {
5436 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
5437 }
5438 }
5439 size
5440 }
5441}
5442#[derive(Debug, Default, PartialEq, Clone)]
353#[cfg_attr(feature = "defmt", derive(defmt::Format))] 5443#[cfg_attr(feature = "defmt", derive(defmt::Format))]
354pub(crate) struct CtrlMsgEventHeartbeat { 5444pub struct CtrlMsg_Resp_SetWifiMaxTxPower {
355 #[noproto(tag = "1")] 5445 pub r#resp: i32,
356 pub hb_num: u32,
357} 5446}
358 5447impl CtrlMsg_Resp_SetWifiMaxTxPower {
359#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 5448 ///Return a reference to `resp`
5449 #[inline]
5450 pub fn r#resp(&self) -> &i32 {
5451 &self.r#resp
5452 }
5453 ///Return a mutable reference to `resp`
5454 #[inline]
5455 pub fn mut_resp(&mut self) -> &mut i32 {
5456 &mut self.r#resp
5457 }
5458 ///Set the value of `resp`
5459 #[inline]
5460 pub fn set_resp(&mut self, value: i32) -> &mut Self {
5461 self.r#resp = value.into();
5462 self
5463 }
5464 ///Builder method that sets the value of `resp`. Useful for initializing the message.
5465 #[inline]
5466 pub fn init_resp(mut self, value: i32) -> Self {
5467 self.r#resp = value.into();
5468 self
5469 }
5470}
5471impl ::micropb::MessageDecode for CtrlMsg_Resp_SetWifiMaxTxPower {
5472 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
5473 &mut self,
5474 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
5475 len: usize,
5476 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
5477 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
5478 let before = decoder.bytes_read();
5479 while decoder.bytes_read() - before < len {
5480 let tag = decoder.decode_tag()?;
5481 match tag.field_num() {
5482 0 => return Err(::micropb::DecodeError::ZeroField),
5483 1u32 => {
5484 let mut_ref = &mut self.r#resp;
5485 {
5486 let val = decoder.decode_int32()?;
5487 let val_ref = &val;
5488 if *val_ref != 0 {
5489 *mut_ref = val as _;
5490 }
5491 };
5492 }
5493 _ => {
5494 decoder.skip_wire_value(tag.wire_type())?;
5495 }
5496 }
5497 }
5498 Ok(())
5499 }
5500}
5501impl ::micropb::MessageEncode for CtrlMsg_Resp_SetWifiMaxTxPower {
5502 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
5503 let mut max_size = 0;
5504 if let ::core::option::Option::Some(size) =
5505 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
5506 {
5507 max_size += size;
5508 } else {
5509 break 'msg (::core::option::Option::<usize>::None);
5510 };
5511 ::core::option::Option::Some(max_size)
5512 };
5513 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
5514 &self,
5515 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
5516 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
5517 use ::micropb::{FieldEncode, PbMap};
5518 {
5519 let val_ref = &self.r#resp;
5520 if *val_ref != 0 {
5521 encoder.encode_varint32(8u32)?;
5522 encoder.encode_int32(*val_ref as _)?;
5523 }
5524 }
5525 Ok(())
5526 }
5527 fn compute_size(&self) -> usize {
5528 use ::micropb::{FieldEncode, PbMap};
5529 let mut size = 0;
5530 {
5531 let val_ref = &self.r#resp;
5532 if *val_ref != 0 {
5533 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
5534 }
5535 }
5536 size
5537 }
5538}
5539#[derive(Debug, Default, PartialEq, Clone)]
360#[cfg_attr(feature = "defmt", derive(defmt::Format))] 5540#[cfg_attr(feature = "defmt", derive(defmt::Format))]
361pub(crate) struct CtrlMsgEventStationDisconnectFromAp { 5541pub struct CtrlMsg_Req_GetWifiCurrTxPower {}
362 #[noproto(tag = "1")] 5542impl CtrlMsg_Req_GetWifiCurrTxPower {}
363 pub resp: u32, 5543impl ::micropb::MessageDecode for CtrlMsg_Req_GetWifiCurrTxPower {
5544 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
5545 &mut self,
5546 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
5547 len: usize,
5548 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
5549 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
5550 let before = decoder.bytes_read();
5551 while decoder.bytes_read() - before < len {
5552 let tag = decoder.decode_tag()?;
5553 match tag.field_num() {
5554 0 => return Err(::micropb::DecodeError::ZeroField),
5555 _ => {
5556 decoder.skip_wire_value(tag.wire_type())?;
5557 }
5558 }
5559 }
5560 Ok(())
5561 }
364} 5562}
365 5563impl ::micropb::MessageEncode for CtrlMsg_Req_GetWifiCurrTxPower {
366#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 5564 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
5565 let mut max_size = 0;
5566 ::core::option::Option::Some(max_size)
5567 };
5568 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
5569 &self,
5570 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
5571 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
5572 use ::micropb::{FieldEncode, PbMap};
5573 Ok(())
5574 }
5575 fn compute_size(&self) -> usize {
5576 use ::micropb::{FieldEncode, PbMap};
5577 let mut size = 0;
5578 size
5579 }
5580}
5581#[derive(Debug, Default, PartialEq, Clone)]
367#[cfg_attr(feature = "defmt", derive(defmt::Format))] 5582#[cfg_attr(feature = "defmt", derive(defmt::Format))]
368pub(crate) struct CtrlMsgEventStationDisconnectFromEspSoftAp { 5583pub struct CtrlMsg_Resp_GetWifiCurrTxPower {
369 #[noproto(tag = "1")] 5584 pub r#wifi_curr_tx_power: i32,
370 pub resp: u32, 5585 pub r#resp: i32,
371 #[noproto(tag = "2")]
372 pub mac: String<32>,
373} 5586}
374 5587impl CtrlMsg_Resp_GetWifiCurrTxPower {
375#[derive(Debug, Default, Clone, Eq, PartialEq, noproto::Message)] 5588 ///Return a reference to `wifi_curr_tx_power`
376#[cfg_attr(feature = "defmt", derive(defmt::Format))] 5589 #[inline]
377pub(crate) struct CtrlMsg { 5590 pub fn r#wifi_curr_tx_power(&self) -> &i32 {
378 /// msg_type could be req, resp or Event 5591 &self.r#wifi_curr_tx_power
379 #[noproto(tag = "1")] 5592 }
380 pub msg_type: CtrlMsgType, 5593 ///Return a mutable reference to `wifi_curr_tx_power`
381 /// msg id 5594 #[inline]
382 #[noproto(tag = "2")] 5595 pub fn mut_wifi_curr_tx_power(&mut self) -> &mut i32 {
383 pub msg_id: CtrlMsgId, 5596 &mut self.r#wifi_curr_tx_power
384 /// union of all msg ids 5597 }
385 #[noproto( 5598 ///Set the value of `wifi_curr_tx_power`
386 oneof, 5599 #[inline]
387 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" 5600 pub fn set_wifi_curr_tx_power(&mut self, value: i32) -> &mut Self {
388 )] 5601 self.r#wifi_curr_tx_power = value.into();
389 pub payload: Option<CtrlMsgPayload>, 5602 self
5603 }
5604 ///Builder method that sets the value of `wifi_curr_tx_power`. Useful for initializing the message.
5605 #[inline]
5606 pub fn init_wifi_curr_tx_power(mut self, value: i32) -> Self {
5607 self.r#wifi_curr_tx_power = value.into();
5608 self
5609 }
5610 ///Return a reference to `resp`
5611 #[inline]
5612 pub fn r#resp(&self) -> &i32 {
5613 &self.r#resp
5614 }
5615 ///Return a mutable reference to `resp`
5616 #[inline]
5617 pub fn mut_resp(&mut self) -> &mut i32 {
5618 &mut self.r#resp
5619 }
5620 ///Set the value of `resp`
5621 #[inline]
5622 pub fn set_resp(&mut self, value: i32) -> &mut Self {
5623 self.r#resp = value.into();
5624 self
5625 }
5626 ///Builder method that sets the value of `resp`. Useful for initializing the message.
5627 #[inline]
5628 pub fn init_resp(mut self, value: i32) -> Self {
5629 self.r#resp = value.into();
5630 self
5631 }
390} 5632}
391 5633impl ::micropb::MessageDecode for CtrlMsg_Resp_GetWifiCurrTxPower {
392/// union of all msg ids 5634 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
393#[derive(Debug, Clone, Eq, PartialEq, noproto::Oneof)] 5635 &mut self,
394#[cfg_attr(feature = "defmt", derive(defmt::Format))] 5636 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
395pub(crate) enum CtrlMsgPayload { 5637 len: usize,
396 /// * Requests * 5638 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
397 #[noproto(tag = "101")] 5639 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
398 ReqGetMacAddress(CtrlMsgReqGetMacAddress), 5640 let before = decoder.bytes_read();
399 #[noproto(tag = "102")] 5641 while decoder.bytes_read() - before < len {
400 ReqSetMacAddress(CtrlMsgReqSetMacAddress), 5642 let tag = decoder.decode_tag()?;
401 #[noproto(tag = "103")] 5643 match tag.field_num() {
402 ReqGetWifiMode(CtrlMsgReqGetMode), 5644 0 => return Err(::micropb::DecodeError::ZeroField),
403 #[noproto(tag = "104")] 5645 1u32 => {
404 ReqSetWifiMode(CtrlMsgReqSetMode), 5646 let mut_ref = &mut self.r#wifi_curr_tx_power;
405 #[noproto(tag = "105")] 5647 {
406 ReqScanApList(CtrlMsgReqScanResult), 5648 let val = decoder.decode_int32()?;
407 #[noproto(tag = "106")] 5649 let val_ref = &val;
408 ReqGetApConfig(CtrlMsgReqGetApConfig), 5650 if *val_ref != 0 {
409 #[noproto(tag = "107")] 5651 *mut_ref = val as _;
410 ReqConnectAp(CtrlMsgReqConnectAp), 5652 }
411 #[noproto(tag = "108")] 5653 };
412 ReqDisconnectAp(CtrlMsgReqGetStatus), 5654 }
413 #[noproto(tag = "109")] 5655 2u32 => {
414 ReqGetSoftapConfig(CtrlMsgReqGetSoftApConfig), 5656 let mut_ref = &mut self.r#resp;
415 #[noproto(tag = "110")] 5657 {
416 ReqSetSoftapVendorSpecificIe(CtrlMsgReqSetSoftApVendorSpecificIe), 5658 let val = decoder.decode_int32()?;
417 #[noproto(tag = "111")] 5659 let val_ref = &val;
418 ReqStartSoftap(CtrlMsgReqStartSoftAp), 5660 if *val_ref != 0 {
419 #[noproto(tag = "112")] 5661 *mut_ref = val as _;
420 ReqSoftapConnectedStasList(CtrlMsgReqSoftApConnectedSta), 5662 }
421 #[noproto(tag = "113")] 5663 };
422 ReqStopSoftap(CtrlMsgReqGetStatus), 5664 }
423 #[noproto(tag = "114")] 5665 _ => {
424 ReqSetPowerSaveMode(CtrlMsgReqSetMode), 5666 decoder.skip_wire_value(tag.wire_type())?;
425 #[noproto(tag = "115")] 5667 }
426 ReqGetPowerSaveMode(CtrlMsgReqGetMode), 5668 }
427 #[noproto(tag = "116")] 5669 }
428 ReqOtaBegin(CtrlMsgReqOtaBegin), 5670 Ok(())
429 #[noproto(tag = "117")] 5671 }
430 ReqOtaWrite(CtrlMsgReqOtaWrite),
431 #[noproto(tag = "118")]
432 ReqOtaEnd(CtrlMsgReqOtaEnd),
433 #[noproto(tag = "119")]
434 ReqSetWifiMaxTxPower(CtrlMsgReqSetWifiMaxTxPower),
435 #[noproto(tag = "120")]
436 ReqGetWifiCurrTxPower(CtrlMsgReqGetWifiCurrTxPower),
437 #[noproto(tag = "121")]
438 ReqConfigHeartbeat(CtrlMsgReqConfigHeartbeat),
439 /// * Responses *
440 #[noproto(tag = "201")]
441 RespGetMacAddress(CtrlMsgRespGetMacAddress),
442 #[noproto(tag = "202")]
443 RespSetMacAddress(CtrlMsgRespSetMacAddress),
444 #[noproto(tag = "203")]
445 RespGetWifiMode(CtrlMsgRespGetMode),
446 #[noproto(tag = "204")]
447 RespSetWifiMode(CtrlMsgRespSetMode),
448 #[noproto(tag = "205")]
449 RespScanApList(CtrlMsgRespScanResult),
450 #[noproto(tag = "206")]
451 RespGetApConfig(CtrlMsgRespGetApConfig),
452 #[noproto(tag = "207")]
453 RespConnectAp(CtrlMsgRespConnectAp),
454 #[noproto(tag = "208")]
455 RespDisconnectAp(CtrlMsgRespGetStatus),
456 #[noproto(tag = "209")]
457 RespGetSoftapConfig(CtrlMsgRespGetSoftApConfig),
458 #[noproto(tag = "210")]
459 RespSetSoftapVendorSpecificIe(CtrlMsgRespSetSoftApVendorSpecificIe),
460 #[noproto(tag = "211")]
461 RespStartSoftap(CtrlMsgRespStartSoftAp),
462 #[noproto(tag = "212")]
463 RespSoftapConnectedStasList(CtrlMsgRespSoftApConnectedSta),
464 #[noproto(tag = "213")]
465 RespStopSoftap(CtrlMsgRespGetStatus),
466 #[noproto(tag = "214")]
467 RespSetPowerSaveMode(CtrlMsgRespSetMode),
468 #[noproto(tag = "215")]
469 RespGetPowerSaveMode(CtrlMsgRespGetMode),
470 #[noproto(tag = "216")]
471 RespOtaBegin(CtrlMsgRespOtaBegin),
472 #[noproto(tag = "217")]
473 RespOtaWrite(CtrlMsgRespOtaWrite),
474 #[noproto(tag = "218")]
475 RespOtaEnd(CtrlMsgRespOtaEnd),
476 #[noproto(tag = "219")]
477 RespSetWifiMaxTxPower(CtrlMsgRespSetWifiMaxTxPower),
478 #[noproto(tag = "220")]
479 RespGetWifiCurrTxPower(CtrlMsgRespGetWifiCurrTxPower),
480 #[noproto(tag = "221")]
481 RespConfigHeartbeat(CtrlMsgRespConfigHeartbeat),
482 /// * Notifications *
483 #[noproto(tag = "301")]
484 EventEspInit(CtrlMsgEventEspInit),
485 #[noproto(tag = "302")]
486 EventHeartbeat(CtrlMsgEventHeartbeat),
487 #[noproto(tag = "303")]
488 EventStationDisconnectFromAp(CtrlMsgEventStationDisconnectFromAp),
489 #[noproto(tag = "304")]
490 EventStationDisconnectFromEspSoftAp(CtrlMsgEventStationDisconnectFromEspSoftAp),
491} 5672}
492 5673impl ::micropb::MessageEncode for CtrlMsg_Resp_GetWifiCurrTxPower {
493/// Enums similar to ESP IDF 5674 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
494#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] 5675 let mut max_size = 0;
495#[repr(u32)] 5676 if let ::core::option::Option::Some(size) =
496#[cfg_attr(feature = "defmt", derive(defmt::Format))] 5677 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
497pub(crate) enum CtrlVendorIeType { 5678 {
498 #[default] 5679 max_size += size;
499 Beacon = 0, 5680 } else {
500 ProbeReq = 1, 5681 break 'msg (::core::option::Option::<usize>::None);
501 ProbeResp = 2, 5682 };
502 AssocReq = 3, 5683 if let ::core::option::Option::Some(size) =
503 AssocResp = 4, 5684 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
5685 {
5686 max_size += size;
5687 } else {
5688 break 'msg (::core::option::Option::<usize>::None);
5689 };
5690 ::core::option::Option::Some(max_size)
5691 };
5692 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
5693 &self,
5694 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
5695 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
5696 use ::micropb::{FieldEncode, PbMap};
5697 {
5698 let val_ref = &self.r#wifi_curr_tx_power;
5699 if *val_ref != 0 {
5700 encoder.encode_varint32(8u32)?;
5701 encoder.encode_int32(*val_ref as _)?;
5702 }
5703 }
5704 {
5705 let val_ref = &self.r#resp;
5706 if *val_ref != 0 {
5707 encoder.encode_varint32(16u32)?;
5708 encoder.encode_int32(*val_ref as _)?;
5709 }
5710 }
5711 Ok(())
5712 }
5713 fn compute_size(&self) -> usize {
5714 use ::micropb::{FieldEncode, PbMap};
5715 let mut size = 0;
5716 {
5717 let val_ref = &self.r#wifi_curr_tx_power;
5718 if *val_ref != 0 {
5719 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
5720 }
5721 }
5722 {
5723 let val_ref = &self.r#resp;
5724 if *val_ref != 0 {
5725 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
5726 }
5727 }
5728 size
5729 }
504} 5730}
505 5731#[derive(Debug, Default, PartialEq, Clone)]
506#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)]
507#[repr(u32)]
508#[cfg_attr(feature = "defmt", derive(defmt::Format))] 5732#[cfg_attr(feature = "defmt", derive(defmt::Format))]
509pub(crate) enum CtrlVendorIeid { 5733pub struct CtrlMsg_Req_ConfigHeartbeat {
510 #[default] 5734 pub r#enable: bool,
511 Id0 = 0, 5735 pub r#duration: i32,
512 Id1 = 1,
513} 5736}
514 5737impl CtrlMsg_Req_ConfigHeartbeat {
515#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] 5738 ///Return a reference to `enable`
516#[repr(u32)] 5739 #[inline]
5740 pub fn r#enable(&self) -> &bool {
5741 &self.r#enable
5742 }
5743 ///Return a mutable reference to `enable`
5744 #[inline]
5745 pub fn mut_enable(&mut self) -> &mut bool {
5746 &mut self.r#enable
5747 }
5748 ///Set the value of `enable`
5749 #[inline]
5750 pub fn set_enable(&mut self, value: bool) -> &mut Self {
5751 self.r#enable = value.into();
5752 self
5753 }
5754 ///Builder method that sets the value of `enable`. Useful for initializing the message.
5755 #[inline]
5756 pub fn init_enable(mut self, value: bool) -> Self {
5757 self.r#enable = value.into();
5758 self
5759 }
5760 ///Return a reference to `duration`
5761 #[inline]
5762 pub fn r#duration(&self) -> &i32 {
5763 &self.r#duration
5764 }
5765 ///Return a mutable reference to `duration`
5766 #[inline]
5767 pub fn mut_duration(&mut self) -> &mut i32 {
5768 &mut self.r#duration
5769 }
5770 ///Set the value of `duration`
5771 #[inline]
5772 pub fn set_duration(&mut self, value: i32) -> &mut Self {
5773 self.r#duration = value.into();
5774 self
5775 }
5776 ///Builder method that sets the value of `duration`. Useful for initializing the message.
5777 #[inline]
5778 pub fn init_duration(mut self, value: i32) -> Self {
5779 self.r#duration = value.into();
5780 self
5781 }
5782}
5783impl ::micropb::MessageDecode for CtrlMsg_Req_ConfigHeartbeat {
5784 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
5785 &mut self,
5786 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
5787 len: usize,
5788 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
5789 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
5790 let before = decoder.bytes_read();
5791 while decoder.bytes_read() - before < len {
5792 let tag = decoder.decode_tag()?;
5793 match tag.field_num() {
5794 0 => return Err(::micropb::DecodeError::ZeroField),
5795 1u32 => {
5796 let mut_ref = &mut self.r#enable;
5797 {
5798 let val = decoder.decode_bool()?;
5799 let val_ref = &val;
5800 if *val_ref {
5801 *mut_ref = val as _;
5802 }
5803 };
5804 }
5805 2u32 => {
5806 let mut_ref = &mut self.r#duration;
5807 {
5808 let val = decoder.decode_int32()?;
5809 let val_ref = &val;
5810 if *val_ref != 0 {
5811 *mut_ref = val as _;
5812 }
5813 };
5814 }
5815 _ => {
5816 decoder.skip_wire_value(tag.wire_type())?;
5817 }
5818 }
5819 }
5820 Ok(())
5821 }
5822}
5823impl ::micropb::MessageEncode for CtrlMsg_Req_ConfigHeartbeat {
5824 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
5825 let mut max_size = 0;
5826 if let ::core::option::Option::Some(size) =
5827 ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize)
5828 {
5829 max_size += size;
5830 } else {
5831 break 'msg (::core::option::Option::<usize>::None);
5832 };
5833 if let ::core::option::Option::Some(size) =
5834 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
5835 {
5836 max_size += size;
5837 } else {
5838 break 'msg (::core::option::Option::<usize>::None);
5839 };
5840 ::core::option::Option::Some(max_size)
5841 };
5842 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
5843 &self,
5844 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
5845 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
5846 use ::micropb::{FieldEncode, PbMap};
5847 {
5848 let val_ref = &self.r#enable;
5849 if *val_ref {
5850 encoder.encode_varint32(8u32)?;
5851 encoder.encode_bool(*val_ref)?;
5852 }
5853 }
5854 {
5855 let val_ref = &self.r#duration;
5856 if *val_ref != 0 {
5857 encoder.encode_varint32(16u32)?;
5858 encoder.encode_int32(*val_ref as _)?;
5859 }
5860 }
5861 Ok(())
5862 }
5863 fn compute_size(&self) -> usize {
5864 use ::micropb::{FieldEncode, PbMap};
5865 let mut size = 0;
5866 {
5867 let val_ref = &self.r#enable;
5868 if *val_ref {
5869 size += 1usize + 1;
5870 }
5871 }
5872 {
5873 let val_ref = &self.r#duration;
5874 if *val_ref != 0 {
5875 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
5876 }
5877 }
5878 size
5879 }
5880}
5881#[derive(Debug, Default, PartialEq, Clone)]
517#[cfg_attr(feature = "defmt", derive(defmt::Format))] 5882#[cfg_attr(feature = "defmt", derive(defmt::Format))]
518pub(crate) enum CtrlWifiMode { 5883pub struct CtrlMsg_Resp_ConfigHeartbeat {
519 #[default] 5884 pub r#resp: i32,
520 None = 0,
521 Sta = 1,
522 Ap = 2,
523 Apsta = 3,
524} 5885}
525 5886impl CtrlMsg_Resp_ConfigHeartbeat {
526#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] 5887 ///Return a reference to `resp`
527#[repr(u32)] 5888 #[inline]
5889 pub fn r#resp(&self) -> &i32 {
5890 &self.r#resp
5891 }
5892 ///Return a mutable reference to `resp`
5893 #[inline]
5894 pub fn mut_resp(&mut self) -> &mut i32 {
5895 &mut self.r#resp
5896 }
5897 ///Set the value of `resp`
5898 #[inline]
5899 pub fn set_resp(&mut self, value: i32) -> &mut Self {
5900 self.r#resp = value.into();
5901 self
5902 }
5903 ///Builder method that sets the value of `resp`. Useful for initializing the message.
5904 #[inline]
5905 pub fn init_resp(mut self, value: i32) -> Self {
5906 self.r#resp = value.into();
5907 self
5908 }
5909}
5910impl ::micropb::MessageDecode for CtrlMsg_Resp_ConfigHeartbeat {
5911 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
5912 &mut self,
5913 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
5914 len: usize,
5915 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
5916 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
5917 let before = decoder.bytes_read();
5918 while decoder.bytes_read() - before < len {
5919 let tag = decoder.decode_tag()?;
5920 match tag.field_num() {
5921 0 => return Err(::micropb::DecodeError::ZeroField),
5922 1u32 => {
5923 let mut_ref = &mut self.r#resp;
5924 {
5925 let val = decoder.decode_int32()?;
5926 let val_ref = &val;
5927 if *val_ref != 0 {
5928 *mut_ref = val as _;
5929 }
5930 };
5931 }
5932 _ => {
5933 decoder.skip_wire_value(tag.wire_type())?;
5934 }
5935 }
5936 }
5937 Ok(())
5938 }
5939}
5940impl ::micropb::MessageEncode for CtrlMsg_Resp_ConfigHeartbeat {
5941 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
5942 let mut max_size = 0;
5943 if let ::core::option::Option::Some(size) =
5944 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
5945 {
5946 max_size += size;
5947 } else {
5948 break 'msg (::core::option::Option::<usize>::None);
5949 };
5950 ::core::option::Option::Some(max_size)
5951 };
5952 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
5953 &self,
5954 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
5955 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
5956 use ::micropb::{FieldEncode, PbMap};
5957 {
5958 let val_ref = &self.r#resp;
5959 if *val_ref != 0 {
5960 encoder.encode_varint32(8u32)?;
5961 encoder.encode_int32(*val_ref as _)?;
5962 }
5963 }
5964 Ok(())
5965 }
5966 fn compute_size(&self) -> usize {
5967 use ::micropb::{FieldEncode, PbMap};
5968 let mut size = 0;
5969 {
5970 let val_ref = &self.r#resp;
5971 if *val_ref != 0 {
5972 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
5973 }
5974 }
5975 size
5976 }
5977}
5978#[derive(Debug, Default, PartialEq, Clone)]
528#[cfg_attr(feature = "defmt", derive(defmt::Format))] 5979#[cfg_attr(feature = "defmt", derive(defmt::Format))]
529pub(crate) enum CtrlWifiBw { 5980pub struct CtrlMsg_Req_EnableDisable {
530 #[default] 5981 pub r#feature: u32,
531 BwInvalid = 0, 5982 pub r#enable: bool,
532 Ht20 = 1,
533 Ht40 = 2,
534} 5983}
535 5984impl CtrlMsg_Req_EnableDisable {
536#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] 5985 ///Return a reference to `feature`
537#[repr(u32)] 5986 #[inline]
5987 pub fn r#feature(&self) -> &u32 {
5988 &self.r#feature
5989 }
5990 ///Return a mutable reference to `feature`
5991 #[inline]
5992 pub fn mut_feature(&mut self) -> &mut u32 {
5993 &mut self.r#feature
5994 }
5995 ///Set the value of `feature`
5996 #[inline]
5997 pub fn set_feature(&mut self, value: u32) -> &mut Self {
5998 self.r#feature = value.into();
5999 self
6000 }
6001 ///Builder method that sets the value of `feature`. Useful for initializing the message.
6002 #[inline]
6003 pub fn init_feature(mut self, value: u32) -> Self {
6004 self.r#feature = value.into();
6005 self
6006 }
6007 ///Return a reference to `enable`
6008 #[inline]
6009 pub fn r#enable(&self) -> &bool {
6010 &self.r#enable
6011 }
6012 ///Return a mutable reference to `enable`
6013 #[inline]
6014 pub fn mut_enable(&mut self) -> &mut bool {
6015 &mut self.r#enable
6016 }
6017 ///Set the value of `enable`
6018 #[inline]
6019 pub fn set_enable(&mut self, value: bool) -> &mut Self {
6020 self.r#enable = value.into();
6021 self
6022 }
6023 ///Builder method that sets the value of `enable`. Useful for initializing the message.
6024 #[inline]
6025 pub fn init_enable(mut self, value: bool) -> Self {
6026 self.r#enable = value.into();
6027 self
6028 }
6029}
6030impl ::micropb::MessageDecode for CtrlMsg_Req_EnableDisable {
6031 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
6032 &mut self,
6033 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
6034 len: usize,
6035 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
6036 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
6037 let before = decoder.bytes_read();
6038 while decoder.bytes_read() - before < len {
6039 let tag = decoder.decode_tag()?;
6040 match tag.field_num() {
6041 0 => return Err(::micropb::DecodeError::ZeroField),
6042 1u32 => {
6043 let mut_ref = &mut self.r#feature;
6044 {
6045 let val = decoder.decode_varint32()?;
6046 let val_ref = &val;
6047 if *val_ref != 0 {
6048 *mut_ref = val as _;
6049 }
6050 };
6051 }
6052 2u32 => {
6053 let mut_ref = &mut self.r#enable;
6054 {
6055 let val = decoder.decode_bool()?;
6056 let val_ref = &val;
6057 if *val_ref {
6058 *mut_ref = val as _;
6059 }
6060 };
6061 }
6062 _ => {
6063 decoder.skip_wire_value(tag.wire_type())?;
6064 }
6065 }
6066 }
6067 Ok(())
6068 }
6069}
6070impl ::micropb::MessageEncode for CtrlMsg_Req_EnableDisable {
6071 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
6072 let mut max_size = 0;
6073 if let ::core::option::Option::Some(size) =
6074 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
6075 {
6076 max_size += size;
6077 } else {
6078 break 'msg (::core::option::Option::<usize>::None);
6079 };
6080 if let ::core::option::Option::Some(size) =
6081 ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize)
6082 {
6083 max_size += size;
6084 } else {
6085 break 'msg (::core::option::Option::<usize>::None);
6086 };
6087 ::core::option::Option::Some(max_size)
6088 };
6089 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
6090 &self,
6091 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
6092 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
6093 use ::micropb::{FieldEncode, PbMap};
6094 {
6095 let val_ref = &self.r#feature;
6096 if *val_ref != 0 {
6097 encoder.encode_varint32(8u32)?;
6098 encoder.encode_varint32(*val_ref as _)?;
6099 }
6100 }
6101 {
6102 let val_ref = &self.r#enable;
6103 if *val_ref {
6104 encoder.encode_varint32(16u32)?;
6105 encoder.encode_bool(*val_ref)?;
6106 }
6107 }
6108 Ok(())
6109 }
6110 fn compute_size(&self) -> usize {
6111 use ::micropb::{FieldEncode, PbMap};
6112 let mut size = 0;
6113 {
6114 let val_ref = &self.r#feature;
6115 if *val_ref != 0 {
6116 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
6117 }
6118 }
6119 {
6120 let val_ref = &self.r#enable;
6121 if *val_ref {
6122 size += 1usize + 1;
6123 }
6124 }
6125 size
6126 }
6127}
6128#[derive(Debug, Default, PartialEq, Clone)]
538#[cfg_attr(feature = "defmt", derive(defmt::Format))] 6129#[cfg_attr(feature = "defmt", derive(defmt::Format))]
539pub(crate) enum CtrlWifiPowerSave { 6130pub struct CtrlMsg_Resp_EnableDisable {
540 #[default] 6131 pub r#resp: i32,
541 PsInvalid = 0,
542 MinModem = 1,
543 MaxModem = 2,
544} 6132}
545 6133impl CtrlMsg_Resp_EnableDisable {
546/// Wifi Security Settings 6134 ///Return a reference to `resp`
547#[allow(missing_docs)] 6135 #[inline]
548#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] 6136 pub fn r#resp(&self) -> &i32 {
549#[repr(u32)] 6137 &self.r#resp
550#[cfg_attr(feature = "defmt", derive(defmt::Format))] 6138 }
551pub enum CtrlWifiSecProt { 6139 ///Return a mutable reference to `resp`
552 #[default] 6140 #[inline]
553 Open = 0, 6141 pub fn mut_resp(&mut self) -> &mut i32 {
554 Wep = 1, 6142 &mut self.r#resp
555 WpaPsk = 2, 6143 }
556 Wpa2Psk = 3, 6144 ///Set the value of `resp`
557 WpaWpa2Psk = 4, 6145 #[inline]
558 Wpa2Enterprise = 5, 6146 pub fn set_resp(&mut self, value: i32) -> &mut Self {
559 Wpa3Psk = 6, 6147 self.r#resp = value.into();
560 Wpa2Wpa3Psk = 7, 6148 self
6149 }
6150 ///Builder method that sets the value of `resp`. Useful for initializing the message.
6151 #[inline]
6152 pub fn init_resp(mut self, value: i32) -> Self {
6153 self.r#resp = value.into();
6154 self
6155 }
561} 6156}
562 6157impl ::micropb::MessageDecode for CtrlMsg_Resp_EnableDisable {
563/// enums for Control path 6158 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
564#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] 6159 &mut self,
565#[repr(u32)] 6160 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
566#[cfg_attr(feature = "defmt", derive(defmt::Format))] 6161 len: usize,
567pub(crate) enum CtrlStatus { 6162 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
568 #[default] 6163 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
569 Connected = 0, 6164 let before = decoder.bytes_read();
570 NotConnected = 1, 6165 while decoder.bytes_read() - before < len {
571 NoApFound = 2, 6166 let tag = decoder.decode_tag()?;
572 ConnectionFail = 3, 6167 match tag.field_num() {
573 InvalidArgument = 4, 6168 0 => return Err(::micropb::DecodeError::ZeroField),
574 OutOfRange = 5, 6169 1u32 => {
6170 let mut_ref = &mut self.r#resp;
6171 {
6172 let val = decoder.decode_int32()?;
6173 let val_ref = &val;
6174 if *val_ref != 0 {
6175 *mut_ref = val as _;
6176 }
6177 };
6178 }
6179 _ => {
6180 decoder.skip_wire_value(tag.wire_type())?;
6181 }
6182 }
6183 }
6184 Ok(())
6185 }
575} 6186}
576 6187impl ::micropb::MessageEncode for CtrlMsg_Resp_EnableDisable {
577#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] 6188 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
578#[repr(u32)] 6189 let mut max_size = 0;
6190 if let ::core::option::Option::Some(size) =
6191 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
6192 {
6193 max_size += size;
6194 } else {
6195 break 'msg (::core::option::Option::<usize>::None);
6196 };
6197 ::core::option::Option::Some(max_size)
6198 };
6199 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
6200 &self,
6201 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
6202 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
6203 use ::micropb::{FieldEncode, PbMap};
6204 {
6205 let val_ref = &self.r#resp;
6206 if *val_ref != 0 {
6207 encoder.encode_varint32(8u32)?;
6208 encoder.encode_int32(*val_ref as _)?;
6209 }
6210 }
6211 Ok(())
6212 }
6213 fn compute_size(&self) -> usize {
6214 use ::micropb::{FieldEncode, PbMap};
6215 let mut size = 0;
6216 {
6217 let val_ref = &self.r#resp;
6218 if *val_ref != 0 {
6219 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
6220 }
6221 }
6222 size
6223 }
6224}
6225#[derive(Debug, Default, PartialEq, Clone)]
579#[cfg_attr(feature = "defmt", derive(defmt::Format))] 6226#[cfg_attr(feature = "defmt", derive(defmt::Format))]
580pub(crate) enum CtrlMsgType { 6227pub struct CtrlMsg_Req_GetFwVersion {}
581 #[default] 6228impl CtrlMsg_Req_GetFwVersion {}
582 MsgTypeInvalid = 0, 6229impl ::micropb::MessageDecode for CtrlMsg_Req_GetFwVersion {
583 Req = 1, 6230 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
584 Resp = 2, 6231 &mut self,
585 Event = 3, 6232 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
586 MsgTypeMax = 4, 6233 len: usize,
6234 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
6235 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
6236 let before = decoder.bytes_read();
6237 while decoder.bytes_read() - before < len {
6238 let tag = decoder.decode_tag()?;
6239 match tag.field_num() {
6240 0 => return Err(::micropb::DecodeError::ZeroField),
6241 _ => {
6242 decoder.skip_wire_value(tag.wire_type())?;
6243 }
6244 }
6245 }
6246 Ok(())
6247 }
587} 6248}
588 6249impl ::micropb::MessageEncode for CtrlMsg_Req_GetFwVersion {
589#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Hash, PartialOrd, Ord, noproto::Enumeration)] 6250 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
590#[repr(u32)] 6251 let mut max_size = 0;
591#[cfg_attr(feature = "defmt", derive(defmt::Format))] 6252 ::core::option::Option::Some(max_size)
592pub(crate) enum CtrlMsgId { 6253 };
593 #[default] 6254 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
594 MsgIdInvalid = 0, 6255 &self,
595 /// * Request Msgs * 6256 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
596 ReqBase = 100, 6257 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
597 ReqGetMacAddress = 101, 6258 use ::micropb::{FieldEncode, PbMap};
598 ReqSetMacAddress = 102, 6259 Ok(())
599 ReqGetWifiMode = 103, 6260 }
600 ReqSetWifiMode = 104, 6261 fn compute_size(&self) -> usize {
601 ReqGetApScanList = 105, 6262 use ::micropb::{FieldEncode, PbMap};
602 ReqGetApConfig = 106, 6263 let mut size = 0;
603 ReqConnectAp = 107, 6264 size
604 ReqDisconnectAp = 108, 6265 }
605 ReqGetSoftApConfig = 109, 6266}
606 ReqSetSoftApVendorSpecificIe = 110, 6267#[derive(Debug, Default, PartialEq, Clone)]
607 ReqStartSoftAp = 111, 6268#[cfg_attr(feature = "defmt", derive(defmt::Format))]
608 ReqGetSoftApConnectedStaList = 112, 6269pub struct CtrlMsg_Resp_GetFwVersion {
609 ReqStopSoftAp = 113, 6270 pub r#resp: i32,
610 ReqSetPowerSaveMode = 114, 6271 pub r#name: ::micropb::heapless::String<32>,
611 ReqGetPowerSaveMode = 115, 6272 pub r#major1: u32,
612 ReqOtaBegin = 116, 6273 pub r#major2: u32,
613 ReqOtaWrite = 117, 6274 pub r#minor: u32,
614 ReqOtaEnd = 118, 6275 pub r#rev_patch1: u32,
615 ReqSetWifiMaxTxPower = 119, 6276 pub r#rev_patch2: u32,
616 ReqGetWifiCurrTxPower = 120, 6277}
617 ReqConfigHeartbeat = 121, 6278impl CtrlMsg_Resp_GetFwVersion {
618 /// Add new control path command response before Req_Max 6279 ///Return a reference to `resp`
619 /// and update Req_Max 6280 #[inline]
620 ReqMax = 122, 6281 pub fn r#resp(&self) -> &i32 {
621 /// * Response Msgs * 6282 &self.r#resp
622 RespBase = 200, 6283 }
623 RespGetMacAddress = 201, 6284 ///Return a mutable reference to `resp`
624 RespSetMacAddress = 202, 6285 #[inline]
625 RespGetWifiMode = 203, 6286 pub fn mut_resp(&mut self) -> &mut i32 {
626 RespSetWifiMode = 204, 6287 &mut self.r#resp
627 RespGetApScanList = 205, 6288 }
628 RespGetApConfig = 206, 6289 ///Set the value of `resp`
629 RespConnectAp = 207, 6290 #[inline]
630 RespDisconnectAp = 208, 6291 pub fn set_resp(&mut self, value: i32) -> &mut Self {
631 RespGetSoftApConfig = 209, 6292 self.r#resp = value.into();
632 RespSetSoftApVendorSpecificIe = 210, 6293 self
633 RespStartSoftAp = 211, 6294 }
634 RespGetSoftApConnectedStaList = 212, 6295 ///Builder method that sets the value of `resp`. Useful for initializing the message.
635 RespStopSoftAp = 213, 6296 #[inline]
636 RespSetPowerSaveMode = 214, 6297 pub fn init_resp(mut self, value: i32) -> Self {
637 RespGetPowerSaveMode = 215, 6298 self.r#resp = value.into();
638 RespOtaBegin = 216, 6299 self
639 RespOtaWrite = 217, 6300 }
640 RespOtaEnd = 218, 6301 ///Return a reference to `name`
641 RespSetWifiMaxTxPower = 219, 6302 #[inline]
642 RespGetWifiCurrTxPower = 220, 6303 pub fn r#name(&self) -> &::micropb::heapless::String<32> {
643 RespConfigHeartbeat = 221, 6304 &self.r#name
644 /// Add new control path command response before Resp_Max 6305 }
645 /// and update Resp_Max 6306 ///Return a mutable reference to `name`
646 RespMax = 222, 6307 #[inline]
647 /// * Event Msgs * 6308 pub fn mut_name(&mut self) -> &mut ::micropb::heapless::String<32> {
648 EventBase = 300, 6309 &mut self.r#name
649 EventEspInit = 301, 6310 }
650 EventHeartbeat = 302, 6311 ///Set the value of `name`
651 EventStationDisconnectFromAp = 303, 6312 #[inline]
652 EventStationDisconnectFromEspSoftAp = 304, 6313 pub fn set_name(&mut self, value: ::micropb::heapless::String<32>) -> &mut Self {
653 /// Add new control path command notification before Event_Max 6314 self.r#name = value.into();
654 /// and update Event_Max 6315 self
655 EventMax = 305, 6316 }
6317 ///Builder method that sets the value of `name`. Useful for initializing the message.
6318 #[inline]
6319 pub fn init_name(mut self, value: ::micropb::heapless::String<32>) -> Self {
6320 self.r#name = value.into();
6321 self
6322 }
6323 ///Return a reference to `major1`
6324 #[inline]
6325 pub fn r#major1(&self) -> &u32 {
6326 &self.r#major1
6327 }
6328 ///Return a mutable reference to `major1`
6329 #[inline]
6330 pub fn mut_major1(&mut self) -> &mut u32 {
6331 &mut self.r#major1
6332 }
6333 ///Set the value of `major1`
6334 #[inline]
6335 pub fn set_major1(&mut self, value: u32) -> &mut Self {
6336 self.r#major1 = value.into();
6337 self
6338 }
6339 ///Builder method that sets the value of `major1`. Useful for initializing the message.
6340 #[inline]
6341 pub fn init_major1(mut self, value: u32) -> Self {
6342 self.r#major1 = value.into();
6343 self
6344 }
6345 ///Return a reference to `major2`
6346 #[inline]
6347 pub fn r#major2(&self) -> &u32 {
6348 &self.r#major2
6349 }
6350 ///Return a mutable reference to `major2`
6351 #[inline]
6352 pub fn mut_major2(&mut self) -> &mut u32 {
6353 &mut self.r#major2
6354 }
6355 ///Set the value of `major2`
6356 #[inline]
6357 pub fn set_major2(&mut self, value: u32) -> &mut Self {
6358 self.r#major2 = value.into();
6359 self
6360 }
6361 ///Builder method that sets the value of `major2`. Useful for initializing the message.
6362 #[inline]
6363 pub fn init_major2(mut self, value: u32) -> Self {
6364 self.r#major2 = value.into();
6365 self
6366 }
6367 ///Return a reference to `minor`
6368 #[inline]
6369 pub fn r#minor(&self) -> &u32 {
6370 &self.r#minor
6371 }
6372 ///Return a mutable reference to `minor`
6373 #[inline]
6374 pub fn mut_minor(&mut self) -> &mut u32 {
6375 &mut self.r#minor
6376 }
6377 ///Set the value of `minor`
6378 #[inline]
6379 pub fn set_minor(&mut self, value: u32) -> &mut Self {
6380 self.r#minor = value.into();
6381 self
6382 }
6383 ///Builder method that sets the value of `minor`. Useful for initializing the message.
6384 #[inline]
6385 pub fn init_minor(mut self, value: u32) -> Self {
6386 self.r#minor = value.into();
6387 self
6388 }
6389 ///Return a reference to `rev_patch1`
6390 #[inline]
6391 pub fn r#rev_patch1(&self) -> &u32 {
6392 &self.r#rev_patch1
6393 }
6394 ///Return a mutable reference to `rev_patch1`
6395 #[inline]
6396 pub fn mut_rev_patch1(&mut self) -> &mut u32 {
6397 &mut self.r#rev_patch1
6398 }
6399 ///Set the value of `rev_patch1`
6400 #[inline]
6401 pub fn set_rev_patch1(&mut self, value: u32) -> &mut Self {
6402 self.r#rev_patch1 = value.into();
6403 self
6404 }
6405 ///Builder method that sets the value of `rev_patch1`. Useful for initializing the message.
6406 #[inline]
6407 pub fn init_rev_patch1(mut self, value: u32) -> Self {
6408 self.r#rev_patch1 = value.into();
6409 self
6410 }
6411 ///Return a reference to `rev_patch2`
6412 #[inline]
6413 pub fn r#rev_patch2(&self) -> &u32 {
6414 &self.r#rev_patch2
6415 }
6416 ///Return a mutable reference to `rev_patch2`
6417 #[inline]
6418 pub fn mut_rev_patch2(&mut self) -> &mut u32 {
6419 &mut self.r#rev_patch2
6420 }
6421 ///Set the value of `rev_patch2`
6422 #[inline]
6423 pub fn set_rev_patch2(&mut self, value: u32) -> &mut Self {
6424 self.r#rev_patch2 = value.into();
6425 self
6426 }
6427 ///Builder method that sets the value of `rev_patch2`. Useful for initializing the message.
6428 #[inline]
6429 pub fn init_rev_patch2(mut self, value: u32) -> Self {
6430 self.r#rev_patch2 = value.into();
6431 self
6432 }
6433}
6434impl ::micropb::MessageDecode for CtrlMsg_Resp_GetFwVersion {
6435 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
6436 &mut self,
6437 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
6438 len: usize,
6439 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
6440 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
6441 let before = decoder.bytes_read();
6442 while decoder.bytes_read() - before < len {
6443 let tag = decoder.decode_tag()?;
6444 match tag.field_num() {
6445 0 => return Err(::micropb::DecodeError::ZeroField),
6446 1u32 => {
6447 let mut_ref = &mut self.r#resp;
6448 {
6449 let val = decoder.decode_int32()?;
6450 let val_ref = &val;
6451 if *val_ref != 0 {
6452 *mut_ref = val as _;
6453 }
6454 };
6455 }
6456 2u32 => {
6457 let mut_ref = &mut self.r#name;
6458 {
6459 decoder.decode_string(mut_ref, ::micropb::Presence::Implicit)?;
6460 };
6461 }
6462 3u32 => {
6463 let mut_ref = &mut self.r#major1;
6464 {
6465 let val = decoder.decode_varint32()?;
6466 let val_ref = &val;
6467 if *val_ref != 0 {
6468 *mut_ref = val as _;
6469 }
6470 };
6471 }
6472 4u32 => {
6473 let mut_ref = &mut self.r#major2;
6474 {
6475 let val = decoder.decode_varint32()?;
6476 let val_ref = &val;
6477 if *val_ref != 0 {
6478 *mut_ref = val as _;
6479 }
6480 };
6481 }
6482 5u32 => {
6483 let mut_ref = &mut self.r#minor;
6484 {
6485 let val = decoder.decode_varint32()?;
6486 let val_ref = &val;
6487 if *val_ref != 0 {
6488 *mut_ref = val as _;
6489 }
6490 };
6491 }
6492 6u32 => {
6493 let mut_ref = &mut self.r#rev_patch1;
6494 {
6495 let val = decoder.decode_varint32()?;
6496 let val_ref = &val;
6497 if *val_ref != 0 {
6498 *mut_ref = val as _;
6499 }
6500 };
6501 }
6502 7u32 => {
6503 let mut_ref = &mut self.r#rev_patch2;
6504 {
6505 let val = decoder.decode_varint32()?;
6506 let val_ref = &val;
6507 if *val_ref != 0 {
6508 *mut_ref = val as _;
6509 }
6510 };
6511 }
6512 _ => {
6513 decoder.skip_wire_value(tag.wire_type())?;
6514 }
6515 }
6516 }
6517 Ok(())
6518 }
6519}
6520impl ::micropb::MessageEncode for CtrlMsg_Resp_GetFwVersion {
6521 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
6522 let mut max_size = 0;
6523 if let ::core::option::Option::Some(size) =
6524 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
6525 {
6526 max_size += size;
6527 } else {
6528 break 'msg (::core::option::Option::<usize>::None);
6529 };
6530 if let ::core::option::Option::Some(size) =
6531 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
6532 {
6533 max_size += size;
6534 } else {
6535 break 'msg (::core::option::Option::<usize>::None);
6536 };
6537 if let ::core::option::Option::Some(size) =
6538 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
6539 {
6540 max_size += size;
6541 } else {
6542 break 'msg (::core::option::Option::<usize>::None);
6543 };
6544 if let ::core::option::Option::Some(size) =
6545 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
6546 {
6547 max_size += size;
6548 } else {
6549 break 'msg (::core::option::Option::<usize>::None);
6550 };
6551 if let ::core::option::Option::Some(size) =
6552 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
6553 {
6554 max_size += size;
6555 } else {
6556 break 'msg (::core::option::Option::<usize>::None);
6557 };
6558 if let ::core::option::Option::Some(size) =
6559 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
6560 {
6561 max_size += size;
6562 } else {
6563 break 'msg (::core::option::Option::<usize>::None);
6564 };
6565 if let ::core::option::Option::Some(size) =
6566 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
6567 {
6568 max_size += size;
6569 } else {
6570 break 'msg (::core::option::Option::<usize>::None);
6571 };
6572 ::core::option::Option::Some(max_size)
6573 };
6574 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
6575 &self,
6576 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
6577 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
6578 use ::micropb::{FieldEncode, PbMap};
6579 {
6580 let val_ref = &self.r#resp;
6581 if *val_ref != 0 {
6582 encoder.encode_varint32(8u32)?;
6583 encoder.encode_int32(*val_ref as _)?;
6584 }
6585 }
6586 {
6587 let val_ref = &self.r#name;
6588 if !val_ref.is_empty() {
6589 encoder.encode_varint32(18u32)?;
6590 encoder.encode_string(val_ref)?;
6591 }
6592 }
6593 {
6594 let val_ref = &self.r#major1;
6595 if *val_ref != 0 {
6596 encoder.encode_varint32(24u32)?;
6597 encoder.encode_varint32(*val_ref as _)?;
6598 }
6599 }
6600 {
6601 let val_ref = &self.r#major2;
6602 if *val_ref != 0 {
6603 encoder.encode_varint32(32u32)?;
6604 encoder.encode_varint32(*val_ref as _)?;
6605 }
6606 }
6607 {
6608 let val_ref = &self.r#minor;
6609 if *val_ref != 0 {
6610 encoder.encode_varint32(40u32)?;
6611 encoder.encode_varint32(*val_ref as _)?;
6612 }
6613 }
6614 {
6615 let val_ref = &self.r#rev_patch1;
6616 if *val_ref != 0 {
6617 encoder.encode_varint32(48u32)?;
6618 encoder.encode_varint32(*val_ref as _)?;
6619 }
6620 }
6621 {
6622 let val_ref = &self.r#rev_patch2;
6623 if *val_ref != 0 {
6624 encoder.encode_varint32(56u32)?;
6625 encoder.encode_varint32(*val_ref as _)?;
6626 }
6627 }
6628 Ok(())
6629 }
6630 fn compute_size(&self) -> usize {
6631 use ::micropb::{FieldEncode, PbMap};
6632 let mut size = 0;
6633 {
6634 let val_ref = &self.r#resp;
6635 if *val_ref != 0 {
6636 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
6637 }
6638 }
6639 {
6640 let val_ref = &self.r#name;
6641 if !val_ref.is_empty() {
6642 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
6643 }
6644 }
6645 {
6646 let val_ref = &self.r#major1;
6647 if *val_ref != 0 {
6648 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
6649 }
6650 }
6651 {
6652 let val_ref = &self.r#major2;
6653 if *val_ref != 0 {
6654 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
6655 }
6656 }
6657 {
6658 let val_ref = &self.r#minor;
6659 if *val_ref != 0 {
6660 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
6661 }
6662 }
6663 {
6664 let val_ref = &self.r#rev_patch1;
6665 if *val_ref != 0 {
6666 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
6667 }
6668 }
6669 {
6670 let val_ref = &self.r#rev_patch2;
6671 if *val_ref != 0 {
6672 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
6673 }
6674 }
6675 size
6676 }
6677}
6678#[derive(Debug, Default, PartialEq, Clone)]
6679#[cfg_attr(feature = "defmt", derive(defmt::Format))]
6680pub struct CtrlMsg_Req_SetCountryCode {
6681 pub r#country: ::micropb::heapless::Vec<u8, 32>,
6682 pub r#ieee80211d_enabled: bool,
6683}
6684impl CtrlMsg_Req_SetCountryCode {
6685 ///Return a reference to `country`
6686 #[inline]
6687 pub fn r#country(&self) -> &::micropb::heapless::Vec<u8, 32> {
6688 &self.r#country
6689 }
6690 ///Return a mutable reference to `country`
6691 #[inline]
6692 pub fn mut_country(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
6693 &mut self.r#country
6694 }
6695 ///Set the value of `country`
6696 #[inline]
6697 pub fn set_country(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
6698 self.r#country = value.into();
6699 self
6700 }
6701 ///Builder method that sets the value of `country`. Useful for initializing the message.
6702 #[inline]
6703 pub fn init_country(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
6704 self.r#country = value.into();
6705 self
6706 }
6707 ///Return a reference to `ieee80211d_enabled`
6708 #[inline]
6709 pub fn r#ieee80211d_enabled(&self) -> &bool {
6710 &self.r#ieee80211d_enabled
6711 }
6712 ///Return a mutable reference to `ieee80211d_enabled`
6713 #[inline]
6714 pub fn mut_ieee80211d_enabled(&mut self) -> &mut bool {
6715 &mut self.r#ieee80211d_enabled
6716 }
6717 ///Set the value of `ieee80211d_enabled`
6718 #[inline]
6719 pub fn set_ieee80211d_enabled(&mut self, value: bool) -> &mut Self {
6720 self.r#ieee80211d_enabled = value.into();
6721 self
6722 }
6723 ///Builder method that sets the value of `ieee80211d_enabled`. Useful for initializing the message.
6724 #[inline]
6725 pub fn init_ieee80211d_enabled(mut self, value: bool) -> Self {
6726 self.r#ieee80211d_enabled = value.into();
6727 self
6728 }
6729}
6730impl ::micropb::MessageDecode for CtrlMsg_Req_SetCountryCode {
6731 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
6732 &mut self,
6733 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
6734 len: usize,
6735 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
6736 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
6737 let before = decoder.bytes_read();
6738 while decoder.bytes_read() - before < len {
6739 let tag = decoder.decode_tag()?;
6740 match tag.field_num() {
6741 0 => return Err(::micropb::DecodeError::ZeroField),
6742 1u32 => {
6743 let mut_ref = &mut self.r#country;
6744 {
6745 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
6746 };
6747 }
6748 2u32 => {
6749 let mut_ref = &mut self.r#ieee80211d_enabled;
6750 {
6751 let val = decoder.decode_bool()?;
6752 let val_ref = &val;
6753 if *val_ref {
6754 *mut_ref = val as _;
6755 }
6756 };
6757 }
6758 _ => {
6759 decoder.skip_wire_value(tag.wire_type())?;
6760 }
6761 }
6762 }
6763 Ok(())
6764 }
6765}
6766impl ::micropb::MessageEncode for CtrlMsg_Req_SetCountryCode {
6767 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
6768 let mut max_size = 0;
6769 if let ::core::option::Option::Some(size) =
6770 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
6771 {
6772 max_size += size;
6773 } else {
6774 break 'msg (::core::option::Option::<usize>::None);
6775 };
6776 if let ::core::option::Option::Some(size) =
6777 ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize)
6778 {
6779 max_size += size;
6780 } else {
6781 break 'msg (::core::option::Option::<usize>::None);
6782 };
6783 ::core::option::Option::Some(max_size)
6784 };
6785 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
6786 &self,
6787 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
6788 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
6789 use ::micropb::{FieldEncode, PbMap};
6790 {
6791 let val_ref = &self.r#country;
6792 if !val_ref.is_empty() {
6793 encoder.encode_varint32(10u32)?;
6794 encoder.encode_bytes(val_ref)?;
6795 }
6796 }
6797 {
6798 let val_ref = &self.r#ieee80211d_enabled;
6799 if *val_ref {
6800 encoder.encode_varint32(16u32)?;
6801 encoder.encode_bool(*val_ref)?;
6802 }
6803 }
6804 Ok(())
6805 }
6806 fn compute_size(&self) -> usize {
6807 use ::micropb::{FieldEncode, PbMap};
6808 let mut size = 0;
6809 {
6810 let val_ref = &self.r#country;
6811 if !val_ref.is_empty() {
6812 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
6813 }
6814 }
6815 {
6816 let val_ref = &self.r#ieee80211d_enabled;
6817 if *val_ref {
6818 size += 1usize + 1;
6819 }
6820 }
6821 size
6822 }
6823}
6824#[derive(Debug, Default, PartialEq, Clone)]
6825#[cfg_attr(feature = "defmt", derive(defmt::Format))]
6826pub struct CtrlMsg_Resp_SetCountryCode {
6827 pub r#resp: i32,
6828}
6829impl CtrlMsg_Resp_SetCountryCode {
6830 ///Return a reference to `resp`
6831 #[inline]
6832 pub fn r#resp(&self) -> &i32 {
6833 &self.r#resp
6834 }
6835 ///Return a mutable reference to `resp`
6836 #[inline]
6837 pub fn mut_resp(&mut self) -> &mut i32 {
6838 &mut self.r#resp
6839 }
6840 ///Set the value of `resp`
6841 #[inline]
6842 pub fn set_resp(&mut self, value: i32) -> &mut Self {
6843 self.r#resp = value.into();
6844 self
6845 }
6846 ///Builder method that sets the value of `resp`. Useful for initializing the message.
6847 #[inline]
6848 pub fn init_resp(mut self, value: i32) -> Self {
6849 self.r#resp = value.into();
6850 self
6851 }
6852}
6853impl ::micropb::MessageDecode for CtrlMsg_Resp_SetCountryCode {
6854 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
6855 &mut self,
6856 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
6857 len: usize,
6858 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
6859 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
6860 let before = decoder.bytes_read();
6861 while decoder.bytes_read() - before < len {
6862 let tag = decoder.decode_tag()?;
6863 match tag.field_num() {
6864 0 => return Err(::micropb::DecodeError::ZeroField),
6865 1u32 => {
6866 let mut_ref = &mut self.r#resp;
6867 {
6868 let val = decoder.decode_int32()?;
6869 let val_ref = &val;
6870 if *val_ref != 0 {
6871 *mut_ref = val as _;
6872 }
6873 };
6874 }
6875 _ => {
6876 decoder.skip_wire_value(tag.wire_type())?;
6877 }
6878 }
6879 }
6880 Ok(())
6881 }
6882}
6883impl ::micropb::MessageEncode for CtrlMsg_Resp_SetCountryCode {
6884 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
6885 let mut max_size = 0;
6886 if let ::core::option::Option::Some(size) =
6887 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
6888 {
6889 max_size += size;
6890 } else {
6891 break 'msg (::core::option::Option::<usize>::None);
6892 };
6893 ::core::option::Option::Some(max_size)
6894 };
6895 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
6896 &self,
6897 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
6898 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
6899 use ::micropb::{FieldEncode, PbMap};
6900 {
6901 let val_ref = &self.r#resp;
6902 if *val_ref != 0 {
6903 encoder.encode_varint32(8u32)?;
6904 encoder.encode_int32(*val_ref as _)?;
6905 }
6906 }
6907 Ok(())
6908 }
6909 fn compute_size(&self) -> usize {
6910 use ::micropb::{FieldEncode, PbMap};
6911 let mut size = 0;
6912 {
6913 let val_ref = &self.r#resp;
6914 if *val_ref != 0 {
6915 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
6916 }
6917 }
6918 size
6919 }
6920}
6921#[derive(Debug, Default, PartialEq, Clone)]
6922#[cfg_attr(feature = "defmt", derive(defmt::Format))]
6923pub struct CtrlMsg_Req_GetCountryCode {}
6924impl CtrlMsg_Req_GetCountryCode {}
6925impl ::micropb::MessageDecode for CtrlMsg_Req_GetCountryCode {
6926 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
6927 &mut self,
6928 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
6929 len: usize,
6930 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
6931 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
6932 let before = decoder.bytes_read();
6933 while decoder.bytes_read() - before < len {
6934 let tag = decoder.decode_tag()?;
6935 match tag.field_num() {
6936 0 => return Err(::micropb::DecodeError::ZeroField),
6937 _ => {
6938 decoder.skip_wire_value(tag.wire_type())?;
6939 }
6940 }
6941 }
6942 Ok(())
6943 }
6944}
6945impl ::micropb::MessageEncode for CtrlMsg_Req_GetCountryCode {
6946 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
6947 let mut max_size = 0;
6948 ::core::option::Option::Some(max_size)
6949 };
6950 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
6951 &self,
6952 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
6953 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
6954 use ::micropb::{FieldEncode, PbMap};
6955 Ok(())
6956 }
6957 fn compute_size(&self) -> usize {
6958 use ::micropb::{FieldEncode, PbMap};
6959 let mut size = 0;
6960 size
6961 }
6962}
6963#[derive(Debug, Default, PartialEq, Clone)]
6964#[cfg_attr(feature = "defmt", derive(defmt::Format))]
6965pub struct CtrlMsg_Resp_GetCountryCode {
6966 pub r#resp: i32,
6967 pub r#country: ::micropb::heapless::Vec<u8, 32>,
6968}
6969impl CtrlMsg_Resp_GetCountryCode {
6970 ///Return a reference to `resp`
6971 #[inline]
6972 pub fn r#resp(&self) -> &i32 {
6973 &self.r#resp
6974 }
6975 ///Return a mutable reference to `resp`
6976 #[inline]
6977 pub fn mut_resp(&mut self) -> &mut i32 {
6978 &mut self.r#resp
6979 }
6980 ///Set the value of `resp`
6981 #[inline]
6982 pub fn set_resp(&mut self, value: i32) -> &mut Self {
6983 self.r#resp = value.into();
6984 self
6985 }
6986 ///Builder method that sets the value of `resp`. Useful for initializing the message.
6987 #[inline]
6988 pub fn init_resp(mut self, value: i32) -> Self {
6989 self.r#resp = value.into();
6990 self
6991 }
6992 ///Return a reference to `country`
6993 #[inline]
6994 pub fn r#country(&self) -> &::micropb::heapless::Vec<u8, 32> {
6995 &self.r#country
6996 }
6997 ///Return a mutable reference to `country`
6998 #[inline]
6999 pub fn mut_country(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
7000 &mut self.r#country
7001 }
7002 ///Set the value of `country`
7003 #[inline]
7004 pub fn set_country(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
7005 self.r#country = value.into();
7006 self
7007 }
7008 ///Builder method that sets the value of `country`. Useful for initializing the message.
7009 #[inline]
7010 pub fn init_country(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
7011 self.r#country = value.into();
7012 self
7013 }
7014}
7015impl ::micropb::MessageDecode for CtrlMsg_Resp_GetCountryCode {
7016 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
7017 &mut self,
7018 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
7019 len: usize,
7020 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
7021 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
7022 let before = decoder.bytes_read();
7023 while decoder.bytes_read() - before < len {
7024 let tag = decoder.decode_tag()?;
7025 match tag.field_num() {
7026 0 => return Err(::micropb::DecodeError::ZeroField),
7027 1u32 => {
7028 let mut_ref = &mut self.r#resp;
7029 {
7030 let val = decoder.decode_int32()?;
7031 let val_ref = &val;
7032 if *val_ref != 0 {
7033 *mut_ref = val as _;
7034 }
7035 };
7036 }
7037 2u32 => {
7038 let mut_ref = &mut self.r#country;
7039 {
7040 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
7041 };
7042 }
7043 _ => {
7044 decoder.skip_wire_value(tag.wire_type())?;
7045 }
7046 }
7047 }
7048 Ok(())
7049 }
7050}
7051impl ::micropb::MessageEncode for CtrlMsg_Resp_GetCountryCode {
7052 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
7053 let mut max_size = 0;
7054 if let ::core::option::Option::Some(size) =
7055 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
7056 {
7057 max_size += size;
7058 } else {
7059 break 'msg (::core::option::Option::<usize>::None);
7060 };
7061 if let ::core::option::Option::Some(size) =
7062 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
7063 {
7064 max_size += size;
7065 } else {
7066 break 'msg (::core::option::Option::<usize>::None);
7067 };
7068 ::core::option::Option::Some(max_size)
7069 };
7070 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
7071 &self,
7072 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
7073 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
7074 use ::micropb::{FieldEncode, PbMap};
7075 {
7076 let val_ref = &self.r#resp;
7077 if *val_ref != 0 {
7078 encoder.encode_varint32(8u32)?;
7079 encoder.encode_int32(*val_ref as _)?;
7080 }
7081 }
7082 {
7083 let val_ref = &self.r#country;
7084 if !val_ref.is_empty() {
7085 encoder.encode_varint32(18u32)?;
7086 encoder.encode_bytes(val_ref)?;
7087 }
7088 }
7089 Ok(())
7090 }
7091 fn compute_size(&self) -> usize {
7092 use ::micropb::{FieldEncode, PbMap};
7093 let mut size = 0;
7094 {
7095 let val_ref = &self.r#resp;
7096 if *val_ref != 0 {
7097 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
7098 }
7099 }
7100 {
7101 let val_ref = &self.r#country;
7102 if !val_ref.is_empty() {
7103 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
7104 }
7105 }
7106 size
7107 }
7108}
7109#[derive(Debug, Default, PartialEq, Clone)]
7110#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7111pub struct CtrlMsg_Req_SetDhcpDnsStatus {
7112 pub r#iface: i32,
7113 pub r#net_link_up: i32,
7114 pub r#dhcp_up: i32,
7115 pub r#dhcp_ip: ::micropb::heapless::Vec<u8, 32>,
7116 pub r#dhcp_nm: ::micropb::heapless::Vec<u8, 32>,
7117 pub r#dhcp_gw: ::micropb::heapless::Vec<u8, 32>,
7118 pub r#dns_up: i32,
7119 pub r#dns_ip: ::micropb::heapless::Vec<u8, 32>,
7120 pub r#dns_type: i32,
7121}
7122impl CtrlMsg_Req_SetDhcpDnsStatus {
7123 ///Return a reference to `iface`
7124 #[inline]
7125 pub fn r#iface(&self) -> &i32 {
7126 &self.r#iface
7127 }
7128 ///Return a mutable reference to `iface`
7129 #[inline]
7130 pub fn mut_iface(&mut self) -> &mut i32 {
7131 &mut self.r#iface
7132 }
7133 ///Set the value of `iface`
7134 #[inline]
7135 pub fn set_iface(&mut self, value: i32) -> &mut Self {
7136 self.r#iface = value.into();
7137 self
7138 }
7139 ///Builder method that sets the value of `iface`. Useful for initializing the message.
7140 #[inline]
7141 pub fn init_iface(mut self, value: i32) -> Self {
7142 self.r#iface = value.into();
7143 self
7144 }
7145 ///Return a reference to `net_link_up`
7146 #[inline]
7147 pub fn r#net_link_up(&self) -> &i32 {
7148 &self.r#net_link_up
7149 }
7150 ///Return a mutable reference to `net_link_up`
7151 #[inline]
7152 pub fn mut_net_link_up(&mut self) -> &mut i32 {
7153 &mut self.r#net_link_up
7154 }
7155 ///Set the value of `net_link_up`
7156 #[inline]
7157 pub fn set_net_link_up(&mut self, value: i32) -> &mut Self {
7158 self.r#net_link_up = value.into();
7159 self
7160 }
7161 ///Builder method that sets the value of `net_link_up`. Useful for initializing the message.
7162 #[inline]
7163 pub fn init_net_link_up(mut self, value: i32) -> Self {
7164 self.r#net_link_up = value.into();
7165 self
7166 }
7167 ///Return a reference to `dhcp_up`
7168 #[inline]
7169 pub fn r#dhcp_up(&self) -> &i32 {
7170 &self.r#dhcp_up
7171 }
7172 ///Return a mutable reference to `dhcp_up`
7173 #[inline]
7174 pub fn mut_dhcp_up(&mut self) -> &mut i32 {
7175 &mut self.r#dhcp_up
7176 }
7177 ///Set the value of `dhcp_up`
7178 #[inline]
7179 pub fn set_dhcp_up(&mut self, value: i32) -> &mut Self {
7180 self.r#dhcp_up = value.into();
7181 self
7182 }
7183 ///Builder method that sets the value of `dhcp_up`. Useful for initializing the message.
7184 #[inline]
7185 pub fn init_dhcp_up(mut self, value: i32) -> Self {
7186 self.r#dhcp_up = value.into();
7187 self
7188 }
7189 ///Return a reference to `dhcp_ip`
7190 #[inline]
7191 pub fn r#dhcp_ip(&self) -> &::micropb::heapless::Vec<u8, 32> {
7192 &self.r#dhcp_ip
7193 }
7194 ///Return a mutable reference to `dhcp_ip`
7195 #[inline]
7196 pub fn mut_dhcp_ip(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
7197 &mut self.r#dhcp_ip
7198 }
7199 ///Set the value of `dhcp_ip`
7200 #[inline]
7201 pub fn set_dhcp_ip(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
7202 self.r#dhcp_ip = value.into();
7203 self
7204 }
7205 ///Builder method that sets the value of `dhcp_ip`. Useful for initializing the message.
7206 #[inline]
7207 pub fn init_dhcp_ip(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
7208 self.r#dhcp_ip = value.into();
7209 self
7210 }
7211 ///Return a reference to `dhcp_nm`
7212 #[inline]
7213 pub fn r#dhcp_nm(&self) -> &::micropb::heapless::Vec<u8, 32> {
7214 &self.r#dhcp_nm
7215 }
7216 ///Return a mutable reference to `dhcp_nm`
7217 #[inline]
7218 pub fn mut_dhcp_nm(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
7219 &mut self.r#dhcp_nm
7220 }
7221 ///Set the value of `dhcp_nm`
7222 #[inline]
7223 pub fn set_dhcp_nm(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
7224 self.r#dhcp_nm = value.into();
7225 self
7226 }
7227 ///Builder method that sets the value of `dhcp_nm`. Useful for initializing the message.
7228 #[inline]
7229 pub fn init_dhcp_nm(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
7230 self.r#dhcp_nm = value.into();
7231 self
7232 }
7233 ///Return a reference to `dhcp_gw`
7234 #[inline]
7235 pub fn r#dhcp_gw(&self) -> &::micropb::heapless::Vec<u8, 32> {
7236 &self.r#dhcp_gw
7237 }
7238 ///Return a mutable reference to `dhcp_gw`
7239 #[inline]
7240 pub fn mut_dhcp_gw(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
7241 &mut self.r#dhcp_gw
7242 }
7243 ///Set the value of `dhcp_gw`
7244 #[inline]
7245 pub fn set_dhcp_gw(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
7246 self.r#dhcp_gw = value.into();
7247 self
7248 }
7249 ///Builder method that sets the value of `dhcp_gw`. Useful for initializing the message.
7250 #[inline]
7251 pub fn init_dhcp_gw(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
7252 self.r#dhcp_gw = value.into();
7253 self
7254 }
7255 ///Return a reference to `dns_up`
7256 #[inline]
7257 pub fn r#dns_up(&self) -> &i32 {
7258 &self.r#dns_up
7259 }
7260 ///Return a mutable reference to `dns_up`
7261 #[inline]
7262 pub fn mut_dns_up(&mut self) -> &mut i32 {
7263 &mut self.r#dns_up
7264 }
7265 ///Set the value of `dns_up`
7266 #[inline]
7267 pub fn set_dns_up(&mut self, value: i32) -> &mut Self {
7268 self.r#dns_up = value.into();
7269 self
7270 }
7271 ///Builder method that sets the value of `dns_up`. Useful for initializing the message.
7272 #[inline]
7273 pub fn init_dns_up(mut self, value: i32) -> Self {
7274 self.r#dns_up = value.into();
7275 self
7276 }
7277 ///Return a reference to `dns_ip`
7278 #[inline]
7279 pub fn r#dns_ip(&self) -> &::micropb::heapless::Vec<u8, 32> {
7280 &self.r#dns_ip
7281 }
7282 ///Return a mutable reference to `dns_ip`
7283 #[inline]
7284 pub fn mut_dns_ip(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
7285 &mut self.r#dns_ip
7286 }
7287 ///Set the value of `dns_ip`
7288 #[inline]
7289 pub fn set_dns_ip(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
7290 self.r#dns_ip = value.into();
7291 self
7292 }
7293 ///Builder method that sets the value of `dns_ip`. Useful for initializing the message.
7294 #[inline]
7295 pub fn init_dns_ip(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
7296 self.r#dns_ip = value.into();
7297 self
7298 }
7299 ///Return a reference to `dns_type`
7300 #[inline]
7301 pub fn r#dns_type(&self) -> &i32 {
7302 &self.r#dns_type
7303 }
7304 ///Return a mutable reference to `dns_type`
7305 #[inline]
7306 pub fn mut_dns_type(&mut self) -> &mut i32 {
7307 &mut self.r#dns_type
7308 }
7309 ///Set the value of `dns_type`
7310 #[inline]
7311 pub fn set_dns_type(&mut self, value: i32) -> &mut Self {
7312 self.r#dns_type = value.into();
7313 self
7314 }
7315 ///Builder method that sets the value of `dns_type`. Useful for initializing the message.
7316 #[inline]
7317 pub fn init_dns_type(mut self, value: i32) -> Self {
7318 self.r#dns_type = value.into();
7319 self
7320 }
7321}
7322impl ::micropb::MessageDecode for CtrlMsg_Req_SetDhcpDnsStatus {
7323 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
7324 &mut self,
7325 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
7326 len: usize,
7327 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
7328 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
7329 let before = decoder.bytes_read();
7330 while decoder.bytes_read() - before < len {
7331 let tag = decoder.decode_tag()?;
7332 match tag.field_num() {
7333 0 => return Err(::micropb::DecodeError::ZeroField),
7334 1u32 => {
7335 let mut_ref = &mut self.r#iface;
7336 {
7337 let val = decoder.decode_int32()?;
7338 let val_ref = &val;
7339 if *val_ref != 0 {
7340 *mut_ref = val as _;
7341 }
7342 };
7343 }
7344 2u32 => {
7345 let mut_ref = &mut self.r#net_link_up;
7346 {
7347 let val = decoder.decode_int32()?;
7348 let val_ref = &val;
7349 if *val_ref != 0 {
7350 *mut_ref = val as _;
7351 }
7352 };
7353 }
7354 3u32 => {
7355 let mut_ref = &mut self.r#dhcp_up;
7356 {
7357 let val = decoder.decode_int32()?;
7358 let val_ref = &val;
7359 if *val_ref != 0 {
7360 *mut_ref = val as _;
7361 }
7362 };
7363 }
7364 4u32 => {
7365 let mut_ref = &mut self.r#dhcp_ip;
7366 {
7367 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
7368 };
7369 }
7370 5u32 => {
7371 let mut_ref = &mut self.r#dhcp_nm;
7372 {
7373 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
7374 };
7375 }
7376 6u32 => {
7377 let mut_ref = &mut self.r#dhcp_gw;
7378 {
7379 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
7380 };
7381 }
7382 7u32 => {
7383 let mut_ref = &mut self.r#dns_up;
7384 {
7385 let val = decoder.decode_int32()?;
7386 let val_ref = &val;
7387 if *val_ref != 0 {
7388 *mut_ref = val as _;
7389 }
7390 };
7391 }
7392 8u32 => {
7393 let mut_ref = &mut self.r#dns_ip;
7394 {
7395 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
7396 };
7397 }
7398 9u32 => {
7399 let mut_ref = &mut self.r#dns_type;
7400 {
7401 let val = decoder.decode_int32()?;
7402 let val_ref = &val;
7403 if *val_ref != 0 {
7404 *mut_ref = val as _;
7405 }
7406 };
7407 }
7408 _ => {
7409 decoder.skip_wire_value(tag.wire_type())?;
7410 }
7411 }
7412 }
7413 Ok(())
7414 }
7415}
7416impl ::micropb::MessageEncode for CtrlMsg_Req_SetDhcpDnsStatus {
7417 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
7418 let mut max_size = 0;
7419 if let ::core::option::Option::Some(size) =
7420 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
7421 {
7422 max_size += size;
7423 } else {
7424 break 'msg (::core::option::Option::<usize>::None);
7425 };
7426 if let ::core::option::Option::Some(size) =
7427 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
7428 {
7429 max_size += size;
7430 } else {
7431 break 'msg (::core::option::Option::<usize>::None);
7432 };
7433 if let ::core::option::Option::Some(size) =
7434 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
7435 {
7436 max_size += size;
7437 } else {
7438 break 'msg (::core::option::Option::<usize>::None);
7439 };
7440 if let ::core::option::Option::Some(size) =
7441 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
7442 {
7443 max_size += size;
7444 } else {
7445 break 'msg (::core::option::Option::<usize>::None);
7446 };
7447 if let ::core::option::Option::Some(size) =
7448 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
7449 {
7450 max_size += size;
7451 } else {
7452 break 'msg (::core::option::Option::<usize>::None);
7453 };
7454 if let ::core::option::Option::Some(size) =
7455 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
7456 {
7457 max_size += size;
7458 } else {
7459 break 'msg (::core::option::Option::<usize>::None);
7460 };
7461 if let ::core::option::Option::Some(size) =
7462 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
7463 {
7464 max_size += size;
7465 } else {
7466 break 'msg (::core::option::Option::<usize>::None);
7467 };
7468 if let ::core::option::Option::Some(size) =
7469 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
7470 {
7471 max_size += size;
7472 } else {
7473 break 'msg (::core::option::Option::<usize>::None);
7474 };
7475 if let ::core::option::Option::Some(size) =
7476 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
7477 {
7478 max_size += size;
7479 } else {
7480 break 'msg (::core::option::Option::<usize>::None);
7481 };
7482 ::core::option::Option::Some(max_size)
7483 };
7484 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
7485 &self,
7486 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
7487 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
7488 use ::micropb::{FieldEncode, PbMap};
7489 {
7490 let val_ref = &self.r#iface;
7491 if *val_ref != 0 {
7492 encoder.encode_varint32(8u32)?;
7493 encoder.encode_int32(*val_ref as _)?;
7494 }
7495 }
7496 {
7497 let val_ref = &self.r#net_link_up;
7498 if *val_ref != 0 {
7499 encoder.encode_varint32(16u32)?;
7500 encoder.encode_int32(*val_ref as _)?;
7501 }
7502 }
7503 {
7504 let val_ref = &self.r#dhcp_up;
7505 if *val_ref != 0 {
7506 encoder.encode_varint32(24u32)?;
7507 encoder.encode_int32(*val_ref as _)?;
7508 }
7509 }
7510 {
7511 let val_ref = &self.r#dhcp_ip;
7512 if !val_ref.is_empty() {
7513 encoder.encode_varint32(34u32)?;
7514 encoder.encode_bytes(val_ref)?;
7515 }
7516 }
7517 {
7518 let val_ref = &self.r#dhcp_nm;
7519 if !val_ref.is_empty() {
7520 encoder.encode_varint32(42u32)?;
7521 encoder.encode_bytes(val_ref)?;
7522 }
7523 }
7524 {
7525 let val_ref = &self.r#dhcp_gw;
7526 if !val_ref.is_empty() {
7527 encoder.encode_varint32(50u32)?;
7528 encoder.encode_bytes(val_ref)?;
7529 }
7530 }
7531 {
7532 let val_ref = &self.r#dns_up;
7533 if *val_ref != 0 {
7534 encoder.encode_varint32(56u32)?;
7535 encoder.encode_int32(*val_ref as _)?;
7536 }
7537 }
7538 {
7539 let val_ref = &self.r#dns_ip;
7540 if !val_ref.is_empty() {
7541 encoder.encode_varint32(66u32)?;
7542 encoder.encode_bytes(val_ref)?;
7543 }
7544 }
7545 {
7546 let val_ref = &self.r#dns_type;
7547 if *val_ref != 0 {
7548 encoder.encode_varint32(72u32)?;
7549 encoder.encode_int32(*val_ref as _)?;
7550 }
7551 }
7552 Ok(())
7553 }
7554 fn compute_size(&self) -> usize {
7555 use ::micropb::{FieldEncode, PbMap};
7556 let mut size = 0;
7557 {
7558 let val_ref = &self.r#iface;
7559 if *val_ref != 0 {
7560 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
7561 }
7562 }
7563 {
7564 let val_ref = &self.r#net_link_up;
7565 if *val_ref != 0 {
7566 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
7567 }
7568 }
7569 {
7570 let val_ref = &self.r#dhcp_up;
7571 if *val_ref != 0 {
7572 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
7573 }
7574 }
7575 {
7576 let val_ref = &self.r#dhcp_ip;
7577 if !val_ref.is_empty() {
7578 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
7579 }
7580 }
7581 {
7582 let val_ref = &self.r#dhcp_nm;
7583 if !val_ref.is_empty() {
7584 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
7585 }
7586 }
7587 {
7588 let val_ref = &self.r#dhcp_gw;
7589 if !val_ref.is_empty() {
7590 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
7591 }
7592 }
7593 {
7594 let val_ref = &self.r#dns_up;
7595 if *val_ref != 0 {
7596 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
7597 }
7598 }
7599 {
7600 let val_ref = &self.r#dns_ip;
7601 if !val_ref.is_empty() {
7602 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
7603 }
7604 }
7605 {
7606 let val_ref = &self.r#dns_type;
7607 if *val_ref != 0 {
7608 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
7609 }
7610 }
7611 size
7612 }
7613}
7614#[derive(Debug, Default, PartialEq, Clone)]
7615#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7616pub struct CtrlMsg_Resp_SetDhcpDnsStatus {
7617 pub r#resp: i32,
7618}
7619impl CtrlMsg_Resp_SetDhcpDnsStatus {
7620 ///Return a reference to `resp`
7621 #[inline]
7622 pub fn r#resp(&self) -> &i32 {
7623 &self.r#resp
7624 }
7625 ///Return a mutable reference to `resp`
7626 #[inline]
7627 pub fn mut_resp(&mut self) -> &mut i32 {
7628 &mut self.r#resp
7629 }
7630 ///Set the value of `resp`
7631 #[inline]
7632 pub fn set_resp(&mut self, value: i32) -> &mut Self {
7633 self.r#resp = value.into();
7634 self
7635 }
7636 ///Builder method that sets the value of `resp`. Useful for initializing the message.
7637 #[inline]
7638 pub fn init_resp(mut self, value: i32) -> Self {
7639 self.r#resp = value.into();
7640 self
7641 }
7642}
7643impl ::micropb::MessageDecode for CtrlMsg_Resp_SetDhcpDnsStatus {
7644 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
7645 &mut self,
7646 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
7647 len: usize,
7648 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
7649 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
7650 let before = decoder.bytes_read();
7651 while decoder.bytes_read() - before < len {
7652 let tag = decoder.decode_tag()?;
7653 match tag.field_num() {
7654 0 => return Err(::micropb::DecodeError::ZeroField),
7655 1u32 => {
7656 let mut_ref = &mut self.r#resp;
7657 {
7658 let val = decoder.decode_int32()?;
7659 let val_ref = &val;
7660 if *val_ref != 0 {
7661 *mut_ref = val as _;
7662 }
7663 };
7664 }
7665 _ => {
7666 decoder.skip_wire_value(tag.wire_type())?;
7667 }
7668 }
7669 }
7670 Ok(())
7671 }
7672}
7673impl ::micropb::MessageEncode for CtrlMsg_Resp_SetDhcpDnsStatus {
7674 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
7675 let mut max_size = 0;
7676 if let ::core::option::Option::Some(size) =
7677 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
7678 {
7679 max_size += size;
7680 } else {
7681 break 'msg (::core::option::Option::<usize>::None);
7682 };
7683 ::core::option::Option::Some(max_size)
7684 };
7685 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
7686 &self,
7687 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
7688 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
7689 use ::micropb::{FieldEncode, PbMap};
7690 {
7691 let val_ref = &self.r#resp;
7692 if *val_ref != 0 {
7693 encoder.encode_varint32(8u32)?;
7694 encoder.encode_int32(*val_ref as _)?;
7695 }
7696 }
7697 Ok(())
7698 }
7699 fn compute_size(&self) -> usize {
7700 use ::micropb::{FieldEncode, PbMap};
7701 let mut size = 0;
7702 {
7703 let val_ref = &self.r#resp;
7704 if *val_ref != 0 {
7705 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
7706 }
7707 }
7708 size
7709 }
7710}
7711#[derive(Debug, Default, PartialEq, Clone)]
7712#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7713pub struct CtrlMsg_Req_GetDhcpDnsStatus {}
7714impl CtrlMsg_Req_GetDhcpDnsStatus {}
7715impl ::micropb::MessageDecode for CtrlMsg_Req_GetDhcpDnsStatus {
7716 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
7717 &mut self,
7718 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
7719 len: usize,
7720 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
7721 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
7722 let before = decoder.bytes_read();
7723 while decoder.bytes_read() - before < len {
7724 let tag = decoder.decode_tag()?;
7725 match tag.field_num() {
7726 0 => return Err(::micropb::DecodeError::ZeroField),
7727 _ => {
7728 decoder.skip_wire_value(tag.wire_type())?;
7729 }
7730 }
7731 }
7732 Ok(())
7733 }
7734}
7735impl ::micropb::MessageEncode for CtrlMsg_Req_GetDhcpDnsStatus {
7736 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
7737 let mut max_size = 0;
7738 ::core::option::Option::Some(max_size)
7739 };
7740 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
7741 &self,
7742 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
7743 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
7744 use ::micropb::{FieldEncode, PbMap};
7745 Ok(())
7746 }
7747 fn compute_size(&self) -> usize {
7748 use ::micropb::{FieldEncode, PbMap};
7749 let mut size = 0;
7750 size
7751 }
7752}
7753#[derive(Debug, Default, PartialEq, Clone)]
7754#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7755pub struct CtrlMsg_Resp_GetDhcpDnsStatus {
7756 pub r#resp: i32,
7757 pub r#iface: i32,
7758 pub r#net_link_up: i32,
7759 pub r#dhcp_up: i32,
7760 pub r#dhcp_ip: ::micropb::heapless::Vec<u8, 32>,
7761 pub r#dhcp_nm: ::micropb::heapless::Vec<u8, 32>,
7762 pub r#dhcp_gw: ::micropb::heapless::Vec<u8, 32>,
7763 pub r#dns_up: i32,
7764 pub r#dns_ip: ::micropb::heapless::Vec<u8, 32>,
7765 pub r#dns_type: i32,
7766}
7767impl CtrlMsg_Resp_GetDhcpDnsStatus {
7768 ///Return a reference to `resp`
7769 #[inline]
7770 pub fn r#resp(&self) -> &i32 {
7771 &self.r#resp
7772 }
7773 ///Return a mutable reference to `resp`
7774 #[inline]
7775 pub fn mut_resp(&mut self) -> &mut i32 {
7776 &mut self.r#resp
7777 }
7778 ///Set the value of `resp`
7779 #[inline]
7780 pub fn set_resp(&mut self, value: i32) -> &mut Self {
7781 self.r#resp = value.into();
7782 self
7783 }
7784 ///Builder method that sets the value of `resp`. Useful for initializing the message.
7785 #[inline]
7786 pub fn init_resp(mut self, value: i32) -> Self {
7787 self.r#resp = value.into();
7788 self
7789 }
7790 ///Return a reference to `iface`
7791 #[inline]
7792 pub fn r#iface(&self) -> &i32 {
7793 &self.r#iface
7794 }
7795 ///Return a mutable reference to `iface`
7796 #[inline]
7797 pub fn mut_iface(&mut self) -> &mut i32 {
7798 &mut self.r#iface
7799 }
7800 ///Set the value of `iface`
7801 #[inline]
7802 pub fn set_iface(&mut self, value: i32) -> &mut Self {
7803 self.r#iface = value.into();
7804 self
7805 }
7806 ///Builder method that sets the value of `iface`. Useful for initializing the message.
7807 #[inline]
7808 pub fn init_iface(mut self, value: i32) -> Self {
7809 self.r#iface = value.into();
7810 self
7811 }
7812 ///Return a reference to `net_link_up`
7813 #[inline]
7814 pub fn r#net_link_up(&self) -> &i32 {
7815 &self.r#net_link_up
7816 }
7817 ///Return a mutable reference to `net_link_up`
7818 #[inline]
7819 pub fn mut_net_link_up(&mut self) -> &mut i32 {
7820 &mut self.r#net_link_up
7821 }
7822 ///Set the value of `net_link_up`
7823 #[inline]
7824 pub fn set_net_link_up(&mut self, value: i32) -> &mut Self {
7825 self.r#net_link_up = value.into();
7826 self
7827 }
7828 ///Builder method that sets the value of `net_link_up`. Useful for initializing the message.
7829 #[inline]
7830 pub fn init_net_link_up(mut self, value: i32) -> Self {
7831 self.r#net_link_up = value.into();
7832 self
7833 }
7834 ///Return a reference to `dhcp_up`
7835 #[inline]
7836 pub fn r#dhcp_up(&self) -> &i32 {
7837 &self.r#dhcp_up
7838 }
7839 ///Return a mutable reference to `dhcp_up`
7840 #[inline]
7841 pub fn mut_dhcp_up(&mut self) -> &mut i32 {
7842 &mut self.r#dhcp_up
7843 }
7844 ///Set the value of `dhcp_up`
7845 #[inline]
7846 pub fn set_dhcp_up(&mut self, value: i32) -> &mut Self {
7847 self.r#dhcp_up = value.into();
7848 self
7849 }
7850 ///Builder method that sets the value of `dhcp_up`. Useful for initializing the message.
7851 #[inline]
7852 pub fn init_dhcp_up(mut self, value: i32) -> Self {
7853 self.r#dhcp_up = value.into();
7854 self
7855 }
7856 ///Return a reference to `dhcp_ip`
7857 #[inline]
7858 pub fn r#dhcp_ip(&self) -> &::micropb::heapless::Vec<u8, 32> {
7859 &self.r#dhcp_ip
7860 }
7861 ///Return a mutable reference to `dhcp_ip`
7862 #[inline]
7863 pub fn mut_dhcp_ip(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
7864 &mut self.r#dhcp_ip
7865 }
7866 ///Set the value of `dhcp_ip`
7867 #[inline]
7868 pub fn set_dhcp_ip(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
7869 self.r#dhcp_ip = value.into();
7870 self
7871 }
7872 ///Builder method that sets the value of `dhcp_ip`. Useful for initializing the message.
7873 #[inline]
7874 pub fn init_dhcp_ip(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
7875 self.r#dhcp_ip = value.into();
7876 self
7877 }
7878 ///Return a reference to `dhcp_nm`
7879 #[inline]
7880 pub fn r#dhcp_nm(&self) -> &::micropb::heapless::Vec<u8, 32> {
7881 &self.r#dhcp_nm
7882 }
7883 ///Return a mutable reference to `dhcp_nm`
7884 #[inline]
7885 pub fn mut_dhcp_nm(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
7886 &mut self.r#dhcp_nm
7887 }
7888 ///Set the value of `dhcp_nm`
7889 #[inline]
7890 pub fn set_dhcp_nm(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
7891 self.r#dhcp_nm = value.into();
7892 self
7893 }
7894 ///Builder method that sets the value of `dhcp_nm`. Useful for initializing the message.
7895 #[inline]
7896 pub fn init_dhcp_nm(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
7897 self.r#dhcp_nm = value.into();
7898 self
7899 }
7900 ///Return a reference to `dhcp_gw`
7901 #[inline]
7902 pub fn r#dhcp_gw(&self) -> &::micropb::heapless::Vec<u8, 32> {
7903 &self.r#dhcp_gw
7904 }
7905 ///Return a mutable reference to `dhcp_gw`
7906 #[inline]
7907 pub fn mut_dhcp_gw(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
7908 &mut self.r#dhcp_gw
7909 }
7910 ///Set the value of `dhcp_gw`
7911 #[inline]
7912 pub fn set_dhcp_gw(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
7913 self.r#dhcp_gw = value.into();
7914 self
7915 }
7916 ///Builder method that sets the value of `dhcp_gw`. Useful for initializing the message.
7917 #[inline]
7918 pub fn init_dhcp_gw(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
7919 self.r#dhcp_gw = value.into();
7920 self
7921 }
7922 ///Return a reference to `dns_up`
7923 #[inline]
7924 pub fn r#dns_up(&self) -> &i32 {
7925 &self.r#dns_up
7926 }
7927 ///Return a mutable reference to `dns_up`
7928 #[inline]
7929 pub fn mut_dns_up(&mut self) -> &mut i32 {
7930 &mut self.r#dns_up
7931 }
7932 ///Set the value of `dns_up`
7933 #[inline]
7934 pub fn set_dns_up(&mut self, value: i32) -> &mut Self {
7935 self.r#dns_up = value.into();
7936 self
7937 }
7938 ///Builder method that sets the value of `dns_up`. Useful for initializing the message.
7939 #[inline]
7940 pub fn init_dns_up(mut self, value: i32) -> Self {
7941 self.r#dns_up = value.into();
7942 self
7943 }
7944 ///Return a reference to `dns_ip`
7945 #[inline]
7946 pub fn r#dns_ip(&self) -> &::micropb::heapless::Vec<u8, 32> {
7947 &self.r#dns_ip
7948 }
7949 ///Return a mutable reference to `dns_ip`
7950 #[inline]
7951 pub fn mut_dns_ip(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
7952 &mut self.r#dns_ip
7953 }
7954 ///Set the value of `dns_ip`
7955 #[inline]
7956 pub fn set_dns_ip(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
7957 self.r#dns_ip = value.into();
7958 self
7959 }
7960 ///Builder method that sets the value of `dns_ip`. Useful for initializing the message.
7961 #[inline]
7962 pub fn init_dns_ip(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
7963 self.r#dns_ip = value.into();
7964 self
7965 }
7966 ///Return a reference to `dns_type`
7967 #[inline]
7968 pub fn r#dns_type(&self) -> &i32 {
7969 &self.r#dns_type
7970 }
7971 ///Return a mutable reference to `dns_type`
7972 #[inline]
7973 pub fn mut_dns_type(&mut self) -> &mut i32 {
7974 &mut self.r#dns_type
7975 }
7976 ///Set the value of `dns_type`
7977 #[inline]
7978 pub fn set_dns_type(&mut self, value: i32) -> &mut Self {
7979 self.r#dns_type = value.into();
7980 self
7981 }
7982 ///Builder method that sets the value of `dns_type`. Useful for initializing the message.
7983 #[inline]
7984 pub fn init_dns_type(mut self, value: i32) -> Self {
7985 self.r#dns_type = value.into();
7986 self
7987 }
7988}
7989impl ::micropb::MessageDecode for CtrlMsg_Resp_GetDhcpDnsStatus {
7990 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
7991 &mut self,
7992 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
7993 len: usize,
7994 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
7995 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
7996 let before = decoder.bytes_read();
7997 while decoder.bytes_read() - before < len {
7998 let tag = decoder.decode_tag()?;
7999 match tag.field_num() {
8000 0 => return Err(::micropb::DecodeError::ZeroField),
8001 1u32 => {
8002 let mut_ref = &mut self.r#resp;
8003 {
8004 let val = decoder.decode_int32()?;
8005 let val_ref = &val;
8006 if *val_ref != 0 {
8007 *mut_ref = val as _;
8008 }
8009 };
8010 }
8011 2u32 => {
8012 let mut_ref = &mut self.r#iface;
8013 {
8014 let val = decoder.decode_int32()?;
8015 let val_ref = &val;
8016 if *val_ref != 0 {
8017 *mut_ref = val as _;
8018 }
8019 };
8020 }
8021 3u32 => {
8022 let mut_ref = &mut self.r#net_link_up;
8023 {
8024 let val = decoder.decode_int32()?;
8025 let val_ref = &val;
8026 if *val_ref != 0 {
8027 *mut_ref = val as _;
8028 }
8029 };
8030 }
8031 4u32 => {
8032 let mut_ref = &mut self.r#dhcp_up;
8033 {
8034 let val = decoder.decode_int32()?;
8035 let val_ref = &val;
8036 if *val_ref != 0 {
8037 *mut_ref = val as _;
8038 }
8039 };
8040 }
8041 5u32 => {
8042 let mut_ref = &mut self.r#dhcp_ip;
8043 {
8044 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
8045 };
8046 }
8047 6u32 => {
8048 let mut_ref = &mut self.r#dhcp_nm;
8049 {
8050 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
8051 };
8052 }
8053 7u32 => {
8054 let mut_ref = &mut self.r#dhcp_gw;
8055 {
8056 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
8057 };
8058 }
8059 8u32 => {
8060 let mut_ref = &mut self.r#dns_up;
8061 {
8062 let val = decoder.decode_int32()?;
8063 let val_ref = &val;
8064 if *val_ref != 0 {
8065 *mut_ref = val as _;
8066 }
8067 };
8068 }
8069 9u32 => {
8070 let mut_ref = &mut self.r#dns_ip;
8071 {
8072 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
8073 };
8074 }
8075 10u32 => {
8076 let mut_ref = &mut self.r#dns_type;
8077 {
8078 let val = decoder.decode_int32()?;
8079 let val_ref = &val;
8080 if *val_ref != 0 {
8081 *mut_ref = val as _;
8082 }
8083 };
8084 }
8085 _ => {
8086 decoder.skip_wire_value(tag.wire_type())?;
8087 }
8088 }
8089 }
8090 Ok(())
8091 }
8092}
8093impl ::micropb::MessageEncode for CtrlMsg_Resp_GetDhcpDnsStatus {
8094 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
8095 let mut max_size = 0;
8096 if let ::core::option::Option::Some(size) =
8097 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
8098 {
8099 max_size += size;
8100 } else {
8101 break 'msg (::core::option::Option::<usize>::None);
8102 };
8103 if let ::core::option::Option::Some(size) =
8104 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
8105 {
8106 max_size += size;
8107 } else {
8108 break 'msg (::core::option::Option::<usize>::None);
8109 };
8110 if let ::core::option::Option::Some(size) =
8111 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
8112 {
8113 max_size += size;
8114 } else {
8115 break 'msg (::core::option::Option::<usize>::None);
8116 };
8117 if let ::core::option::Option::Some(size) =
8118 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
8119 {
8120 max_size += size;
8121 } else {
8122 break 'msg (::core::option::Option::<usize>::None);
8123 };
8124 if let ::core::option::Option::Some(size) =
8125 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
8126 {
8127 max_size += size;
8128 } else {
8129 break 'msg (::core::option::Option::<usize>::None);
8130 };
8131 if let ::core::option::Option::Some(size) =
8132 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
8133 {
8134 max_size += size;
8135 } else {
8136 break 'msg (::core::option::Option::<usize>::None);
8137 };
8138 if let ::core::option::Option::Some(size) =
8139 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
8140 {
8141 max_size += size;
8142 } else {
8143 break 'msg (::core::option::Option::<usize>::None);
8144 };
8145 if let ::core::option::Option::Some(size) =
8146 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
8147 {
8148 max_size += size;
8149 } else {
8150 break 'msg (::core::option::Option::<usize>::None);
8151 };
8152 if let ::core::option::Option::Some(size) =
8153 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
8154 {
8155 max_size += size;
8156 } else {
8157 break 'msg (::core::option::Option::<usize>::None);
8158 };
8159 if let ::core::option::Option::Some(size) =
8160 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
8161 {
8162 max_size += size;
8163 } else {
8164 break 'msg (::core::option::Option::<usize>::None);
8165 };
8166 ::core::option::Option::Some(max_size)
8167 };
8168 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
8169 &self,
8170 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
8171 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
8172 use ::micropb::{FieldEncode, PbMap};
8173 {
8174 let val_ref = &self.r#resp;
8175 if *val_ref != 0 {
8176 encoder.encode_varint32(8u32)?;
8177 encoder.encode_int32(*val_ref as _)?;
8178 }
8179 }
8180 {
8181 let val_ref = &self.r#iface;
8182 if *val_ref != 0 {
8183 encoder.encode_varint32(16u32)?;
8184 encoder.encode_int32(*val_ref as _)?;
8185 }
8186 }
8187 {
8188 let val_ref = &self.r#net_link_up;
8189 if *val_ref != 0 {
8190 encoder.encode_varint32(24u32)?;
8191 encoder.encode_int32(*val_ref as _)?;
8192 }
8193 }
8194 {
8195 let val_ref = &self.r#dhcp_up;
8196 if *val_ref != 0 {
8197 encoder.encode_varint32(32u32)?;
8198 encoder.encode_int32(*val_ref as _)?;
8199 }
8200 }
8201 {
8202 let val_ref = &self.r#dhcp_ip;
8203 if !val_ref.is_empty() {
8204 encoder.encode_varint32(42u32)?;
8205 encoder.encode_bytes(val_ref)?;
8206 }
8207 }
8208 {
8209 let val_ref = &self.r#dhcp_nm;
8210 if !val_ref.is_empty() {
8211 encoder.encode_varint32(50u32)?;
8212 encoder.encode_bytes(val_ref)?;
8213 }
8214 }
8215 {
8216 let val_ref = &self.r#dhcp_gw;
8217 if !val_ref.is_empty() {
8218 encoder.encode_varint32(58u32)?;
8219 encoder.encode_bytes(val_ref)?;
8220 }
8221 }
8222 {
8223 let val_ref = &self.r#dns_up;
8224 if *val_ref != 0 {
8225 encoder.encode_varint32(64u32)?;
8226 encoder.encode_int32(*val_ref as _)?;
8227 }
8228 }
8229 {
8230 let val_ref = &self.r#dns_ip;
8231 if !val_ref.is_empty() {
8232 encoder.encode_varint32(74u32)?;
8233 encoder.encode_bytes(val_ref)?;
8234 }
8235 }
8236 {
8237 let val_ref = &self.r#dns_type;
8238 if *val_ref != 0 {
8239 encoder.encode_varint32(80u32)?;
8240 encoder.encode_int32(*val_ref as _)?;
8241 }
8242 }
8243 Ok(())
8244 }
8245 fn compute_size(&self) -> usize {
8246 use ::micropb::{FieldEncode, PbMap};
8247 let mut size = 0;
8248 {
8249 let val_ref = &self.r#resp;
8250 if *val_ref != 0 {
8251 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
8252 }
8253 }
8254 {
8255 let val_ref = &self.r#iface;
8256 if *val_ref != 0 {
8257 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
8258 }
8259 }
8260 {
8261 let val_ref = &self.r#net_link_up;
8262 if *val_ref != 0 {
8263 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
8264 }
8265 }
8266 {
8267 let val_ref = &self.r#dhcp_up;
8268 if *val_ref != 0 {
8269 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
8270 }
8271 }
8272 {
8273 let val_ref = &self.r#dhcp_ip;
8274 if !val_ref.is_empty() {
8275 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
8276 }
8277 }
8278 {
8279 let val_ref = &self.r#dhcp_nm;
8280 if !val_ref.is_empty() {
8281 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
8282 }
8283 }
8284 {
8285 let val_ref = &self.r#dhcp_gw;
8286 if !val_ref.is_empty() {
8287 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
8288 }
8289 }
8290 {
8291 let val_ref = &self.r#dns_up;
8292 if *val_ref != 0 {
8293 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
8294 }
8295 }
8296 {
8297 let val_ref = &self.r#dns_ip;
8298 if !val_ref.is_empty() {
8299 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
8300 }
8301 }
8302 {
8303 let val_ref = &self.r#dns_type;
8304 if *val_ref != 0 {
8305 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
8306 }
8307 }
8308 size
8309 }
8310}
8311#[derive(Debug, Default, PartialEq, Clone)]
8312#[cfg_attr(feature = "defmt", derive(defmt::Format))]
8313pub struct CtrlMsg_Event_ESPInit {
8314 pub r#init_data: ::micropb::heapless::Vec<u8, 64>,
8315}
8316impl CtrlMsg_Event_ESPInit {
8317 ///Return a reference to `init_data`
8318 #[inline]
8319 pub fn r#init_data(&self) -> &::micropb::heapless::Vec<u8, 64> {
8320 &self.r#init_data
8321 }
8322 ///Return a mutable reference to `init_data`
8323 #[inline]
8324 pub fn mut_init_data(&mut self) -> &mut ::micropb::heapless::Vec<u8, 64> {
8325 &mut self.r#init_data
8326 }
8327 ///Set the value of `init_data`
8328 #[inline]
8329 pub fn set_init_data(&mut self, value: ::micropb::heapless::Vec<u8, 64>) -> &mut Self {
8330 self.r#init_data = value.into();
8331 self
8332 }
8333 ///Builder method that sets the value of `init_data`. Useful for initializing the message.
8334 #[inline]
8335 pub fn init_init_data(mut self, value: ::micropb::heapless::Vec<u8, 64>) -> Self {
8336 self.r#init_data = value.into();
8337 self
8338 }
8339}
8340impl ::micropb::MessageDecode for CtrlMsg_Event_ESPInit {
8341 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
8342 &mut self,
8343 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
8344 len: usize,
8345 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
8346 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
8347 let before = decoder.bytes_read();
8348 while decoder.bytes_read() - before < len {
8349 let tag = decoder.decode_tag()?;
8350 match tag.field_num() {
8351 0 => return Err(::micropb::DecodeError::ZeroField),
8352 1u32 => {
8353 let mut_ref = &mut self.r#init_data;
8354 {
8355 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
8356 };
8357 }
8358 _ => {
8359 decoder.skip_wire_value(tag.wire_type())?;
8360 }
8361 }
8362 }
8363 Ok(())
8364 }
8365}
8366impl ::micropb::MessageEncode for CtrlMsg_Event_ESPInit {
8367 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
8368 let mut max_size = 0;
8369 if let ::core::option::Option::Some(size) =
8370 ::micropb::const_map!(::core::option::Option::Some(65usize), |size| size + 1usize)
8371 {
8372 max_size += size;
8373 } else {
8374 break 'msg (::core::option::Option::<usize>::None);
8375 };
8376 ::core::option::Option::Some(max_size)
8377 };
8378 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
8379 &self,
8380 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
8381 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
8382 use ::micropb::{FieldEncode, PbMap};
8383 {
8384 let val_ref = &self.r#init_data;
8385 if !val_ref.is_empty() {
8386 encoder.encode_varint32(10u32)?;
8387 encoder.encode_bytes(val_ref)?;
8388 }
8389 }
8390 Ok(())
8391 }
8392 fn compute_size(&self) -> usize {
8393 use ::micropb::{FieldEncode, PbMap};
8394 let mut size = 0;
8395 {
8396 let val_ref = &self.r#init_data;
8397 if !val_ref.is_empty() {
8398 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
8399 }
8400 }
8401 size
8402 }
8403}
8404#[derive(Debug, Default, PartialEq, Clone)]
8405#[cfg_attr(feature = "defmt", derive(defmt::Format))]
8406pub struct CtrlMsg_Event_Heartbeat {
8407 pub r#hb_num: i32,
8408}
8409impl CtrlMsg_Event_Heartbeat {
8410 ///Return a reference to `hb_num`
8411 #[inline]
8412 pub fn r#hb_num(&self) -> &i32 {
8413 &self.r#hb_num
8414 }
8415 ///Return a mutable reference to `hb_num`
8416 #[inline]
8417 pub fn mut_hb_num(&mut self) -> &mut i32 {
8418 &mut self.r#hb_num
8419 }
8420 ///Set the value of `hb_num`
8421 #[inline]
8422 pub fn set_hb_num(&mut self, value: i32) -> &mut Self {
8423 self.r#hb_num = value.into();
8424 self
8425 }
8426 ///Builder method that sets the value of `hb_num`. Useful for initializing the message.
8427 #[inline]
8428 pub fn init_hb_num(mut self, value: i32) -> Self {
8429 self.r#hb_num = value.into();
8430 self
8431 }
8432}
8433impl ::micropb::MessageDecode for CtrlMsg_Event_Heartbeat {
8434 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
8435 &mut self,
8436 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
8437 len: usize,
8438 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
8439 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
8440 let before = decoder.bytes_read();
8441 while decoder.bytes_read() - before < len {
8442 let tag = decoder.decode_tag()?;
8443 match tag.field_num() {
8444 0 => return Err(::micropb::DecodeError::ZeroField),
8445 1u32 => {
8446 let mut_ref = &mut self.r#hb_num;
8447 {
8448 let val = decoder.decode_int32()?;
8449 let val_ref = &val;
8450 if *val_ref != 0 {
8451 *mut_ref = val as _;
8452 }
8453 };
8454 }
8455 _ => {
8456 decoder.skip_wire_value(tag.wire_type())?;
8457 }
8458 }
8459 }
8460 Ok(())
8461 }
8462}
8463impl ::micropb::MessageEncode for CtrlMsg_Event_Heartbeat {
8464 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
8465 let mut max_size = 0;
8466 if let ::core::option::Option::Some(size) =
8467 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
8468 {
8469 max_size += size;
8470 } else {
8471 break 'msg (::core::option::Option::<usize>::None);
8472 };
8473 ::core::option::Option::Some(max_size)
8474 };
8475 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
8476 &self,
8477 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
8478 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
8479 use ::micropb::{FieldEncode, PbMap};
8480 {
8481 let val_ref = &self.r#hb_num;
8482 if *val_ref != 0 {
8483 encoder.encode_varint32(8u32)?;
8484 encoder.encode_int32(*val_ref as _)?;
8485 }
8486 }
8487 Ok(())
8488 }
8489 fn compute_size(&self) -> usize {
8490 use ::micropb::{FieldEncode, PbMap};
8491 let mut size = 0;
8492 {
8493 let val_ref = &self.r#hb_num;
8494 if *val_ref != 0 {
8495 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
8496 }
8497 }
8498 size
8499 }
8500}
8501#[derive(Debug, Default, PartialEq, Clone)]
8502#[cfg_attr(feature = "defmt", derive(defmt::Format))]
8503pub struct CtrlMsg_Event_StationDisconnectFromAP {
8504 pub r#resp: i32,
8505 pub r#ssid: ::micropb::heapless::Vec<u8, 32>,
8506 pub r#ssid_len: u32,
8507 pub r#bssid: ::micropb::heapless::Vec<u8, 32>,
8508 pub r#reason: u32,
8509 pub r#rssi: i32,
8510}
8511impl CtrlMsg_Event_StationDisconnectFromAP {
8512 ///Return a reference to `resp`
8513 #[inline]
8514 pub fn r#resp(&self) -> &i32 {
8515 &self.r#resp
8516 }
8517 ///Return a mutable reference to `resp`
8518 #[inline]
8519 pub fn mut_resp(&mut self) -> &mut i32 {
8520 &mut self.r#resp
8521 }
8522 ///Set the value of `resp`
8523 #[inline]
8524 pub fn set_resp(&mut self, value: i32) -> &mut Self {
8525 self.r#resp = value.into();
8526 self
8527 }
8528 ///Builder method that sets the value of `resp`. Useful for initializing the message.
8529 #[inline]
8530 pub fn init_resp(mut self, value: i32) -> Self {
8531 self.r#resp = value.into();
8532 self
8533 }
8534 ///Return a reference to `ssid`
8535 #[inline]
8536 pub fn r#ssid(&self) -> &::micropb::heapless::Vec<u8, 32> {
8537 &self.r#ssid
8538 }
8539 ///Return a mutable reference to `ssid`
8540 #[inline]
8541 pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
8542 &mut self.r#ssid
8543 }
8544 ///Set the value of `ssid`
8545 #[inline]
8546 pub fn set_ssid(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
8547 self.r#ssid = value.into();
8548 self
8549 }
8550 ///Builder method that sets the value of `ssid`. Useful for initializing the message.
8551 #[inline]
8552 pub fn init_ssid(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
8553 self.r#ssid = value.into();
8554 self
8555 }
8556 ///Return a reference to `ssid_len`
8557 #[inline]
8558 pub fn r#ssid_len(&self) -> &u32 {
8559 &self.r#ssid_len
8560 }
8561 ///Return a mutable reference to `ssid_len`
8562 #[inline]
8563 pub fn mut_ssid_len(&mut self) -> &mut u32 {
8564 &mut self.r#ssid_len
8565 }
8566 ///Set the value of `ssid_len`
8567 #[inline]
8568 pub fn set_ssid_len(&mut self, value: u32) -> &mut Self {
8569 self.r#ssid_len = value.into();
8570 self
8571 }
8572 ///Builder method that sets the value of `ssid_len`. Useful for initializing the message.
8573 #[inline]
8574 pub fn init_ssid_len(mut self, value: u32) -> Self {
8575 self.r#ssid_len = value.into();
8576 self
8577 }
8578 ///Return a reference to `bssid`
8579 #[inline]
8580 pub fn r#bssid(&self) -> &::micropb::heapless::Vec<u8, 32> {
8581 &self.r#bssid
8582 }
8583 ///Return a mutable reference to `bssid`
8584 #[inline]
8585 pub fn mut_bssid(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
8586 &mut self.r#bssid
8587 }
8588 ///Set the value of `bssid`
8589 #[inline]
8590 pub fn set_bssid(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
8591 self.r#bssid = value.into();
8592 self
8593 }
8594 ///Builder method that sets the value of `bssid`. Useful for initializing the message.
8595 #[inline]
8596 pub fn init_bssid(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
8597 self.r#bssid = value.into();
8598 self
8599 }
8600 ///Return a reference to `reason`
8601 #[inline]
8602 pub fn r#reason(&self) -> &u32 {
8603 &self.r#reason
8604 }
8605 ///Return a mutable reference to `reason`
8606 #[inline]
8607 pub fn mut_reason(&mut self) -> &mut u32 {
8608 &mut self.r#reason
8609 }
8610 ///Set the value of `reason`
8611 #[inline]
8612 pub fn set_reason(&mut self, value: u32) -> &mut Self {
8613 self.r#reason = value.into();
8614 self
8615 }
8616 ///Builder method that sets the value of `reason`. Useful for initializing the message.
8617 #[inline]
8618 pub fn init_reason(mut self, value: u32) -> Self {
8619 self.r#reason = value.into();
8620 self
8621 }
8622 ///Return a reference to `rssi`
8623 #[inline]
8624 pub fn r#rssi(&self) -> &i32 {
8625 &self.r#rssi
8626 }
8627 ///Return a mutable reference to `rssi`
8628 #[inline]
8629 pub fn mut_rssi(&mut self) -> &mut i32 {
8630 &mut self.r#rssi
8631 }
8632 ///Set the value of `rssi`
8633 #[inline]
8634 pub fn set_rssi(&mut self, value: i32) -> &mut Self {
8635 self.r#rssi = value.into();
8636 self
8637 }
8638 ///Builder method that sets the value of `rssi`. Useful for initializing the message.
8639 #[inline]
8640 pub fn init_rssi(mut self, value: i32) -> Self {
8641 self.r#rssi = value.into();
8642 self
8643 }
8644}
8645impl ::micropb::MessageDecode for CtrlMsg_Event_StationDisconnectFromAP {
8646 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
8647 &mut self,
8648 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
8649 len: usize,
8650 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
8651 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
8652 let before = decoder.bytes_read();
8653 while decoder.bytes_read() - before < len {
8654 let tag = decoder.decode_tag()?;
8655 match tag.field_num() {
8656 0 => return Err(::micropb::DecodeError::ZeroField),
8657 1u32 => {
8658 let mut_ref = &mut self.r#resp;
8659 {
8660 let val = decoder.decode_int32()?;
8661 let val_ref = &val;
8662 if *val_ref != 0 {
8663 *mut_ref = val as _;
8664 }
8665 };
8666 }
8667 2u32 => {
8668 let mut_ref = &mut self.r#ssid;
8669 {
8670 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
8671 };
8672 }
8673 3u32 => {
8674 let mut_ref = &mut self.r#ssid_len;
8675 {
8676 let val = decoder.decode_varint32()?;
8677 let val_ref = &val;
8678 if *val_ref != 0 {
8679 *mut_ref = val as _;
8680 }
8681 };
8682 }
8683 4u32 => {
8684 let mut_ref = &mut self.r#bssid;
8685 {
8686 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
8687 };
8688 }
8689 5u32 => {
8690 let mut_ref = &mut self.r#reason;
8691 {
8692 let val = decoder.decode_varint32()?;
8693 let val_ref = &val;
8694 if *val_ref != 0 {
8695 *mut_ref = val as _;
8696 }
8697 };
8698 }
8699 6u32 => {
8700 let mut_ref = &mut self.r#rssi;
8701 {
8702 let val = decoder.decode_int32()?;
8703 let val_ref = &val;
8704 if *val_ref != 0 {
8705 *mut_ref = val as _;
8706 }
8707 };
8708 }
8709 _ => {
8710 decoder.skip_wire_value(tag.wire_type())?;
8711 }
8712 }
8713 }
8714 Ok(())
8715 }
8716}
8717impl ::micropb::MessageEncode for CtrlMsg_Event_StationDisconnectFromAP {
8718 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
8719 let mut max_size = 0;
8720 if let ::core::option::Option::Some(size) =
8721 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
8722 {
8723 max_size += size;
8724 } else {
8725 break 'msg (::core::option::Option::<usize>::None);
8726 };
8727 if let ::core::option::Option::Some(size) =
8728 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
8729 {
8730 max_size += size;
8731 } else {
8732 break 'msg (::core::option::Option::<usize>::None);
8733 };
8734 if let ::core::option::Option::Some(size) =
8735 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
8736 {
8737 max_size += size;
8738 } else {
8739 break 'msg (::core::option::Option::<usize>::None);
8740 };
8741 if let ::core::option::Option::Some(size) =
8742 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
8743 {
8744 max_size += size;
8745 } else {
8746 break 'msg (::core::option::Option::<usize>::None);
8747 };
8748 if let ::core::option::Option::Some(size) =
8749 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
8750 {
8751 max_size += size;
8752 } else {
8753 break 'msg (::core::option::Option::<usize>::None);
8754 };
8755 if let ::core::option::Option::Some(size) =
8756 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
8757 {
8758 max_size += size;
8759 } else {
8760 break 'msg (::core::option::Option::<usize>::None);
8761 };
8762 ::core::option::Option::Some(max_size)
8763 };
8764 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
8765 &self,
8766 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
8767 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
8768 use ::micropb::{FieldEncode, PbMap};
8769 {
8770 let val_ref = &self.r#resp;
8771 if *val_ref != 0 {
8772 encoder.encode_varint32(8u32)?;
8773 encoder.encode_int32(*val_ref as _)?;
8774 }
8775 }
8776 {
8777 let val_ref = &self.r#ssid;
8778 if !val_ref.is_empty() {
8779 encoder.encode_varint32(18u32)?;
8780 encoder.encode_bytes(val_ref)?;
8781 }
8782 }
8783 {
8784 let val_ref = &self.r#ssid_len;
8785 if *val_ref != 0 {
8786 encoder.encode_varint32(24u32)?;
8787 encoder.encode_varint32(*val_ref as _)?;
8788 }
8789 }
8790 {
8791 let val_ref = &self.r#bssid;
8792 if !val_ref.is_empty() {
8793 encoder.encode_varint32(34u32)?;
8794 encoder.encode_bytes(val_ref)?;
8795 }
8796 }
8797 {
8798 let val_ref = &self.r#reason;
8799 if *val_ref != 0 {
8800 encoder.encode_varint32(40u32)?;
8801 encoder.encode_varint32(*val_ref as _)?;
8802 }
8803 }
8804 {
8805 let val_ref = &self.r#rssi;
8806 if *val_ref != 0 {
8807 encoder.encode_varint32(48u32)?;
8808 encoder.encode_int32(*val_ref as _)?;
8809 }
8810 }
8811 Ok(())
8812 }
8813 fn compute_size(&self) -> usize {
8814 use ::micropb::{FieldEncode, PbMap};
8815 let mut size = 0;
8816 {
8817 let val_ref = &self.r#resp;
8818 if *val_ref != 0 {
8819 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
8820 }
8821 }
8822 {
8823 let val_ref = &self.r#ssid;
8824 if !val_ref.is_empty() {
8825 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
8826 }
8827 }
8828 {
8829 let val_ref = &self.r#ssid_len;
8830 if *val_ref != 0 {
8831 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
8832 }
8833 }
8834 {
8835 let val_ref = &self.r#bssid;
8836 if !val_ref.is_empty() {
8837 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
8838 }
8839 }
8840 {
8841 let val_ref = &self.r#reason;
8842 if *val_ref != 0 {
8843 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
8844 }
8845 }
8846 {
8847 let val_ref = &self.r#rssi;
8848 if *val_ref != 0 {
8849 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
8850 }
8851 }
8852 size
8853 }
8854}
8855#[derive(Debug, Default, PartialEq, Clone)]
8856#[cfg_attr(feature = "defmt", derive(defmt::Format))]
8857pub struct CtrlMsg_Event_StationConnectedToAP {
8858 pub r#resp: i32,
8859 pub r#ssid: ::micropb::heapless::Vec<u8, 32>,
8860 pub r#ssid_len: u32,
8861 pub r#bssid: ::micropb::heapless::Vec<u8, 32>,
8862 pub r#channel: u32,
8863 pub r#authmode: i32,
8864 pub r#aid: i32,
8865}
8866impl CtrlMsg_Event_StationConnectedToAP {
8867 ///Return a reference to `resp`
8868 #[inline]
8869 pub fn r#resp(&self) -> &i32 {
8870 &self.r#resp
8871 }
8872 ///Return a mutable reference to `resp`
8873 #[inline]
8874 pub fn mut_resp(&mut self) -> &mut i32 {
8875 &mut self.r#resp
8876 }
8877 ///Set the value of `resp`
8878 #[inline]
8879 pub fn set_resp(&mut self, value: i32) -> &mut Self {
8880 self.r#resp = value.into();
8881 self
8882 }
8883 ///Builder method that sets the value of `resp`. Useful for initializing the message.
8884 #[inline]
8885 pub fn init_resp(mut self, value: i32) -> Self {
8886 self.r#resp = value.into();
8887 self
8888 }
8889 ///Return a reference to `ssid`
8890 #[inline]
8891 pub fn r#ssid(&self) -> &::micropb::heapless::Vec<u8, 32> {
8892 &self.r#ssid
8893 }
8894 ///Return a mutable reference to `ssid`
8895 #[inline]
8896 pub fn mut_ssid(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
8897 &mut self.r#ssid
8898 }
8899 ///Set the value of `ssid`
8900 #[inline]
8901 pub fn set_ssid(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
8902 self.r#ssid = value.into();
8903 self
8904 }
8905 ///Builder method that sets the value of `ssid`. Useful for initializing the message.
8906 #[inline]
8907 pub fn init_ssid(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
8908 self.r#ssid = value.into();
8909 self
8910 }
8911 ///Return a reference to `ssid_len`
8912 #[inline]
8913 pub fn r#ssid_len(&self) -> &u32 {
8914 &self.r#ssid_len
8915 }
8916 ///Return a mutable reference to `ssid_len`
8917 #[inline]
8918 pub fn mut_ssid_len(&mut self) -> &mut u32 {
8919 &mut self.r#ssid_len
8920 }
8921 ///Set the value of `ssid_len`
8922 #[inline]
8923 pub fn set_ssid_len(&mut self, value: u32) -> &mut Self {
8924 self.r#ssid_len = value.into();
8925 self
8926 }
8927 ///Builder method that sets the value of `ssid_len`. Useful for initializing the message.
8928 #[inline]
8929 pub fn init_ssid_len(mut self, value: u32) -> Self {
8930 self.r#ssid_len = value.into();
8931 self
8932 }
8933 ///Return a reference to `bssid`
8934 #[inline]
8935 pub fn r#bssid(&self) -> &::micropb::heapless::Vec<u8, 32> {
8936 &self.r#bssid
8937 }
8938 ///Return a mutable reference to `bssid`
8939 #[inline]
8940 pub fn mut_bssid(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
8941 &mut self.r#bssid
8942 }
8943 ///Set the value of `bssid`
8944 #[inline]
8945 pub fn set_bssid(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
8946 self.r#bssid = value.into();
8947 self
8948 }
8949 ///Builder method that sets the value of `bssid`. Useful for initializing the message.
8950 #[inline]
8951 pub fn init_bssid(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
8952 self.r#bssid = value.into();
8953 self
8954 }
8955 ///Return a reference to `channel`
8956 #[inline]
8957 pub fn r#channel(&self) -> &u32 {
8958 &self.r#channel
8959 }
8960 ///Return a mutable reference to `channel`
8961 #[inline]
8962 pub fn mut_channel(&mut self) -> &mut u32 {
8963 &mut self.r#channel
8964 }
8965 ///Set the value of `channel`
8966 #[inline]
8967 pub fn set_channel(&mut self, value: u32) -> &mut Self {
8968 self.r#channel = value.into();
8969 self
8970 }
8971 ///Builder method that sets the value of `channel`. Useful for initializing the message.
8972 #[inline]
8973 pub fn init_channel(mut self, value: u32) -> Self {
8974 self.r#channel = value.into();
8975 self
8976 }
8977 ///Return a reference to `authmode`
8978 #[inline]
8979 pub fn r#authmode(&self) -> &i32 {
8980 &self.r#authmode
8981 }
8982 ///Return a mutable reference to `authmode`
8983 #[inline]
8984 pub fn mut_authmode(&mut self) -> &mut i32 {
8985 &mut self.r#authmode
8986 }
8987 ///Set the value of `authmode`
8988 #[inline]
8989 pub fn set_authmode(&mut self, value: i32) -> &mut Self {
8990 self.r#authmode = value.into();
8991 self
8992 }
8993 ///Builder method that sets the value of `authmode`. Useful for initializing the message.
8994 #[inline]
8995 pub fn init_authmode(mut self, value: i32) -> Self {
8996 self.r#authmode = value.into();
8997 self
8998 }
8999 ///Return a reference to `aid`
9000 #[inline]
9001 pub fn r#aid(&self) -> &i32 {
9002 &self.r#aid
9003 }
9004 ///Return a mutable reference to `aid`
9005 #[inline]
9006 pub fn mut_aid(&mut self) -> &mut i32 {
9007 &mut self.r#aid
9008 }
9009 ///Set the value of `aid`
9010 #[inline]
9011 pub fn set_aid(&mut self, value: i32) -> &mut Self {
9012 self.r#aid = value.into();
9013 self
9014 }
9015 ///Builder method that sets the value of `aid`. Useful for initializing the message.
9016 #[inline]
9017 pub fn init_aid(mut self, value: i32) -> Self {
9018 self.r#aid = value.into();
9019 self
9020 }
9021}
9022impl ::micropb::MessageDecode for CtrlMsg_Event_StationConnectedToAP {
9023 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
9024 &mut self,
9025 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
9026 len: usize,
9027 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
9028 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
9029 let before = decoder.bytes_read();
9030 while decoder.bytes_read() - before < len {
9031 let tag = decoder.decode_tag()?;
9032 match tag.field_num() {
9033 0 => return Err(::micropb::DecodeError::ZeroField),
9034 1u32 => {
9035 let mut_ref = &mut self.r#resp;
9036 {
9037 let val = decoder.decode_int32()?;
9038 let val_ref = &val;
9039 if *val_ref != 0 {
9040 *mut_ref = val as _;
9041 }
9042 };
9043 }
9044 2u32 => {
9045 let mut_ref = &mut self.r#ssid;
9046 {
9047 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
9048 };
9049 }
9050 3u32 => {
9051 let mut_ref = &mut self.r#ssid_len;
9052 {
9053 let val = decoder.decode_varint32()?;
9054 let val_ref = &val;
9055 if *val_ref != 0 {
9056 *mut_ref = val as _;
9057 }
9058 };
9059 }
9060 4u32 => {
9061 let mut_ref = &mut self.r#bssid;
9062 {
9063 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
9064 };
9065 }
9066 5u32 => {
9067 let mut_ref = &mut self.r#channel;
9068 {
9069 let val = decoder.decode_varint32()?;
9070 let val_ref = &val;
9071 if *val_ref != 0 {
9072 *mut_ref = val as _;
9073 }
9074 };
9075 }
9076 6u32 => {
9077 let mut_ref = &mut self.r#authmode;
9078 {
9079 let val = decoder.decode_int32()?;
9080 let val_ref = &val;
9081 if *val_ref != 0 {
9082 *mut_ref = val as _;
9083 }
9084 };
9085 }
9086 7u32 => {
9087 let mut_ref = &mut self.r#aid;
9088 {
9089 let val = decoder.decode_int32()?;
9090 let val_ref = &val;
9091 if *val_ref != 0 {
9092 *mut_ref = val as _;
9093 }
9094 };
9095 }
9096 _ => {
9097 decoder.skip_wire_value(tag.wire_type())?;
9098 }
9099 }
9100 }
9101 Ok(())
9102 }
9103}
9104impl ::micropb::MessageEncode for CtrlMsg_Event_StationConnectedToAP {
9105 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
9106 let mut max_size = 0;
9107 if let ::core::option::Option::Some(size) =
9108 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
9109 {
9110 max_size += size;
9111 } else {
9112 break 'msg (::core::option::Option::<usize>::None);
9113 };
9114 if let ::core::option::Option::Some(size) =
9115 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
9116 {
9117 max_size += size;
9118 } else {
9119 break 'msg (::core::option::Option::<usize>::None);
9120 };
9121 if let ::core::option::Option::Some(size) =
9122 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
9123 {
9124 max_size += size;
9125 } else {
9126 break 'msg (::core::option::Option::<usize>::None);
9127 };
9128 if let ::core::option::Option::Some(size) =
9129 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
9130 {
9131 max_size += size;
9132 } else {
9133 break 'msg (::core::option::Option::<usize>::None);
9134 };
9135 if let ::core::option::Option::Some(size) =
9136 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
9137 {
9138 max_size += size;
9139 } else {
9140 break 'msg (::core::option::Option::<usize>::None);
9141 };
9142 if let ::core::option::Option::Some(size) =
9143 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
9144 {
9145 max_size += size;
9146 } else {
9147 break 'msg (::core::option::Option::<usize>::None);
9148 };
9149 if let ::core::option::Option::Some(size) =
9150 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
9151 {
9152 max_size += size;
9153 } else {
9154 break 'msg (::core::option::Option::<usize>::None);
9155 };
9156 ::core::option::Option::Some(max_size)
9157 };
9158 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
9159 &self,
9160 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
9161 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
9162 use ::micropb::{FieldEncode, PbMap};
9163 {
9164 let val_ref = &self.r#resp;
9165 if *val_ref != 0 {
9166 encoder.encode_varint32(8u32)?;
9167 encoder.encode_int32(*val_ref as _)?;
9168 }
9169 }
9170 {
9171 let val_ref = &self.r#ssid;
9172 if !val_ref.is_empty() {
9173 encoder.encode_varint32(18u32)?;
9174 encoder.encode_bytes(val_ref)?;
9175 }
9176 }
9177 {
9178 let val_ref = &self.r#ssid_len;
9179 if *val_ref != 0 {
9180 encoder.encode_varint32(24u32)?;
9181 encoder.encode_varint32(*val_ref as _)?;
9182 }
9183 }
9184 {
9185 let val_ref = &self.r#bssid;
9186 if !val_ref.is_empty() {
9187 encoder.encode_varint32(34u32)?;
9188 encoder.encode_bytes(val_ref)?;
9189 }
9190 }
9191 {
9192 let val_ref = &self.r#channel;
9193 if *val_ref != 0 {
9194 encoder.encode_varint32(40u32)?;
9195 encoder.encode_varint32(*val_ref as _)?;
9196 }
9197 }
9198 {
9199 let val_ref = &self.r#authmode;
9200 if *val_ref != 0 {
9201 encoder.encode_varint32(48u32)?;
9202 encoder.encode_int32(*val_ref as _)?;
9203 }
9204 }
9205 {
9206 let val_ref = &self.r#aid;
9207 if *val_ref != 0 {
9208 encoder.encode_varint32(56u32)?;
9209 encoder.encode_int32(*val_ref as _)?;
9210 }
9211 }
9212 Ok(())
9213 }
9214 fn compute_size(&self) -> usize {
9215 use ::micropb::{FieldEncode, PbMap};
9216 let mut size = 0;
9217 {
9218 let val_ref = &self.r#resp;
9219 if *val_ref != 0 {
9220 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
9221 }
9222 }
9223 {
9224 let val_ref = &self.r#ssid;
9225 if !val_ref.is_empty() {
9226 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
9227 }
9228 }
9229 {
9230 let val_ref = &self.r#ssid_len;
9231 if *val_ref != 0 {
9232 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
9233 }
9234 }
9235 {
9236 let val_ref = &self.r#bssid;
9237 if !val_ref.is_empty() {
9238 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
9239 }
9240 }
9241 {
9242 let val_ref = &self.r#channel;
9243 if *val_ref != 0 {
9244 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
9245 }
9246 }
9247 {
9248 let val_ref = &self.r#authmode;
9249 if *val_ref != 0 {
9250 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
9251 }
9252 }
9253 {
9254 let val_ref = &self.r#aid;
9255 if *val_ref != 0 {
9256 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
9257 }
9258 }
9259 size
9260 }
9261}
9262#[derive(Debug, Default, PartialEq, Clone)]
9263#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9264pub struct CtrlMsg_Event_StationDisconnectFromESPSoftAP {
9265 pub r#resp: i32,
9266 pub r#mac: ::micropb::heapless::Vec<u8, 32>,
9267 pub r#aid: u32,
9268 pub r#is_mesh_child: bool,
9269 pub r#reason: u32,
9270}
9271impl CtrlMsg_Event_StationDisconnectFromESPSoftAP {
9272 ///Return a reference to `resp`
9273 #[inline]
9274 pub fn r#resp(&self) -> &i32 {
9275 &self.r#resp
9276 }
9277 ///Return a mutable reference to `resp`
9278 #[inline]
9279 pub fn mut_resp(&mut self) -> &mut i32 {
9280 &mut self.r#resp
9281 }
9282 ///Set the value of `resp`
9283 #[inline]
9284 pub fn set_resp(&mut self, value: i32) -> &mut Self {
9285 self.r#resp = value.into();
9286 self
9287 }
9288 ///Builder method that sets the value of `resp`. Useful for initializing the message.
9289 #[inline]
9290 pub fn init_resp(mut self, value: i32) -> Self {
9291 self.r#resp = value.into();
9292 self
9293 }
9294 ///Return a reference to `mac`
9295 #[inline]
9296 pub fn r#mac(&self) -> &::micropb::heapless::Vec<u8, 32> {
9297 &self.r#mac
9298 }
9299 ///Return a mutable reference to `mac`
9300 #[inline]
9301 pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
9302 &mut self.r#mac
9303 }
9304 ///Set the value of `mac`
9305 #[inline]
9306 pub fn set_mac(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
9307 self.r#mac = value.into();
9308 self
9309 }
9310 ///Builder method that sets the value of `mac`. Useful for initializing the message.
9311 #[inline]
9312 pub fn init_mac(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
9313 self.r#mac = value.into();
9314 self
9315 }
9316 ///Return a reference to `aid`
9317 #[inline]
9318 pub fn r#aid(&self) -> &u32 {
9319 &self.r#aid
9320 }
9321 ///Return a mutable reference to `aid`
9322 #[inline]
9323 pub fn mut_aid(&mut self) -> &mut u32 {
9324 &mut self.r#aid
9325 }
9326 ///Set the value of `aid`
9327 #[inline]
9328 pub fn set_aid(&mut self, value: u32) -> &mut Self {
9329 self.r#aid = value.into();
9330 self
9331 }
9332 ///Builder method that sets the value of `aid`. Useful for initializing the message.
9333 #[inline]
9334 pub fn init_aid(mut self, value: u32) -> Self {
9335 self.r#aid = value.into();
9336 self
9337 }
9338 ///Return a reference to `is_mesh_child`
9339 #[inline]
9340 pub fn r#is_mesh_child(&self) -> &bool {
9341 &self.r#is_mesh_child
9342 }
9343 ///Return a mutable reference to `is_mesh_child`
9344 #[inline]
9345 pub fn mut_is_mesh_child(&mut self) -> &mut bool {
9346 &mut self.r#is_mesh_child
9347 }
9348 ///Set the value of `is_mesh_child`
9349 #[inline]
9350 pub fn set_is_mesh_child(&mut self, value: bool) -> &mut Self {
9351 self.r#is_mesh_child = value.into();
9352 self
9353 }
9354 ///Builder method that sets the value of `is_mesh_child`. Useful for initializing the message.
9355 #[inline]
9356 pub fn init_is_mesh_child(mut self, value: bool) -> Self {
9357 self.r#is_mesh_child = value.into();
9358 self
9359 }
9360 ///Return a reference to `reason`
9361 #[inline]
9362 pub fn r#reason(&self) -> &u32 {
9363 &self.r#reason
9364 }
9365 ///Return a mutable reference to `reason`
9366 #[inline]
9367 pub fn mut_reason(&mut self) -> &mut u32 {
9368 &mut self.r#reason
9369 }
9370 ///Set the value of `reason`
9371 #[inline]
9372 pub fn set_reason(&mut self, value: u32) -> &mut Self {
9373 self.r#reason = value.into();
9374 self
9375 }
9376 ///Builder method that sets the value of `reason`. Useful for initializing the message.
9377 #[inline]
9378 pub fn init_reason(mut self, value: u32) -> Self {
9379 self.r#reason = value.into();
9380 self
9381 }
9382}
9383impl ::micropb::MessageDecode for CtrlMsg_Event_StationDisconnectFromESPSoftAP {
9384 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
9385 &mut self,
9386 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
9387 len: usize,
9388 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
9389 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
9390 let before = decoder.bytes_read();
9391 while decoder.bytes_read() - before < len {
9392 let tag = decoder.decode_tag()?;
9393 match tag.field_num() {
9394 0 => return Err(::micropb::DecodeError::ZeroField),
9395 1u32 => {
9396 let mut_ref = &mut self.r#resp;
9397 {
9398 let val = decoder.decode_int32()?;
9399 let val_ref = &val;
9400 if *val_ref != 0 {
9401 *mut_ref = val as _;
9402 }
9403 };
9404 }
9405 2u32 => {
9406 let mut_ref = &mut self.r#mac;
9407 {
9408 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
9409 };
9410 }
9411 3u32 => {
9412 let mut_ref = &mut self.r#aid;
9413 {
9414 let val = decoder.decode_varint32()?;
9415 let val_ref = &val;
9416 if *val_ref != 0 {
9417 *mut_ref = val as _;
9418 }
9419 };
9420 }
9421 4u32 => {
9422 let mut_ref = &mut self.r#is_mesh_child;
9423 {
9424 let val = decoder.decode_bool()?;
9425 let val_ref = &val;
9426 if *val_ref {
9427 *mut_ref = val as _;
9428 }
9429 };
9430 }
9431 5u32 => {
9432 let mut_ref = &mut self.r#reason;
9433 {
9434 let val = decoder.decode_varint32()?;
9435 let val_ref = &val;
9436 if *val_ref != 0 {
9437 *mut_ref = val as _;
9438 }
9439 };
9440 }
9441 _ => {
9442 decoder.skip_wire_value(tag.wire_type())?;
9443 }
9444 }
9445 }
9446 Ok(())
9447 }
9448}
9449impl ::micropb::MessageEncode for CtrlMsg_Event_StationDisconnectFromESPSoftAP {
9450 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
9451 let mut max_size = 0;
9452 if let ::core::option::Option::Some(size) =
9453 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
9454 {
9455 max_size += size;
9456 } else {
9457 break 'msg (::core::option::Option::<usize>::None);
9458 };
9459 if let ::core::option::Option::Some(size) =
9460 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
9461 {
9462 max_size += size;
9463 } else {
9464 break 'msg (::core::option::Option::<usize>::None);
9465 };
9466 if let ::core::option::Option::Some(size) =
9467 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
9468 {
9469 max_size += size;
9470 } else {
9471 break 'msg (::core::option::Option::<usize>::None);
9472 };
9473 if let ::core::option::Option::Some(size) =
9474 ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize)
9475 {
9476 max_size += size;
9477 } else {
9478 break 'msg (::core::option::Option::<usize>::None);
9479 };
9480 if let ::core::option::Option::Some(size) =
9481 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
9482 {
9483 max_size += size;
9484 } else {
9485 break 'msg (::core::option::Option::<usize>::None);
9486 };
9487 ::core::option::Option::Some(max_size)
9488 };
9489 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
9490 &self,
9491 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
9492 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
9493 use ::micropb::{FieldEncode, PbMap};
9494 {
9495 let val_ref = &self.r#resp;
9496 if *val_ref != 0 {
9497 encoder.encode_varint32(8u32)?;
9498 encoder.encode_int32(*val_ref as _)?;
9499 }
9500 }
9501 {
9502 let val_ref = &self.r#mac;
9503 if !val_ref.is_empty() {
9504 encoder.encode_varint32(18u32)?;
9505 encoder.encode_bytes(val_ref)?;
9506 }
9507 }
9508 {
9509 let val_ref = &self.r#aid;
9510 if *val_ref != 0 {
9511 encoder.encode_varint32(24u32)?;
9512 encoder.encode_varint32(*val_ref as _)?;
9513 }
9514 }
9515 {
9516 let val_ref = &self.r#is_mesh_child;
9517 if *val_ref {
9518 encoder.encode_varint32(32u32)?;
9519 encoder.encode_bool(*val_ref)?;
9520 }
9521 }
9522 {
9523 let val_ref = &self.r#reason;
9524 if *val_ref != 0 {
9525 encoder.encode_varint32(40u32)?;
9526 encoder.encode_varint32(*val_ref as _)?;
9527 }
9528 }
9529 Ok(())
9530 }
9531 fn compute_size(&self) -> usize {
9532 use ::micropb::{FieldEncode, PbMap};
9533 let mut size = 0;
9534 {
9535 let val_ref = &self.r#resp;
9536 if *val_ref != 0 {
9537 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
9538 }
9539 }
9540 {
9541 let val_ref = &self.r#mac;
9542 if !val_ref.is_empty() {
9543 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
9544 }
9545 }
9546 {
9547 let val_ref = &self.r#aid;
9548 if *val_ref != 0 {
9549 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
9550 }
9551 }
9552 {
9553 let val_ref = &self.r#is_mesh_child;
9554 if *val_ref {
9555 size += 1usize + 1;
9556 }
9557 }
9558 {
9559 let val_ref = &self.r#reason;
9560 if *val_ref != 0 {
9561 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
9562 }
9563 }
9564 size
9565 }
9566}
9567#[derive(Debug, Default, PartialEq, Clone)]
9568#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9569pub struct CtrlMsg_Event_StationConnectedToESPSoftAP {
9570 pub r#resp: i32,
9571 pub r#mac: ::micropb::heapless::Vec<u8, 32>,
9572 pub r#aid: u32,
9573 pub r#is_mesh_child: bool,
9574}
9575impl CtrlMsg_Event_StationConnectedToESPSoftAP {
9576 ///Return a reference to `resp`
9577 #[inline]
9578 pub fn r#resp(&self) -> &i32 {
9579 &self.r#resp
9580 }
9581 ///Return a mutable reference to `resp`
9582 #[inline]
9583 pub fn mut_resp(&mut self) -> &mut i32 {
9584 &mut self.r#resp
9585 }
9586 ///Set the value of `resp`
9587 #[inline]
9588 pub fn set_resp(&mut self, value: i32) -> &mut Self {
9589 self.r#resp = value.into();
9590 self
9591 }
9592 ///Builder method that sets the value of `resp`. Useful for initializing the message.
9593 #[inline]
9594 pub fn init_resp(mut self, value: i32) -> Self {
9595 self.r#resp = value.into();
9596 self
9597 }
9598 ///Return a reference to `mac`
9599 #[inline]
9600 pub fn r#mac(&self) -> &::micropb::heapless::Vec<u8, 32> {
9601 &self.r#mac
9602 }
9603 ///Return a mutable reference to `mac`
9604 #[inline]
9605 pub fn mut_mac(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
9606 &mut self.r#mac
9607 }
9608 ///Set the value of `mac`
9609 #[inline]
9610 pub fn set_mac(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
9611 self.r#mac = value.into();
9612 self
9613 }
9614 ///Builder method that sets the value of `mac`. Useful for initializing the message.
9615 #[inline]
9616 pub fn init_mac(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
9617 self.r#mac = value.into();
9618 self
9619 }
9620 ///Return a reference to `aid`
9621 #[inline]
9622 pub fn r#aid(&self) -> &u32 {
9623 &self.r#aid
9624 }
9625 ///Return a mutable reference to `aid`
9626 #[inline]
9627 pub fn mut_aid(&mut self) -> &mut u32 {
9628 &mut self.r#aid
9629 }
9630 ///Set the value of `aid`
9631 #[inline]
9632 pub fn set_aid(&mut self, value: u32) -> &mut Self {
9633 self.r#aid = value.into();
9634 self
9635 }
9636 ///Builder method that sets the value of `aid`. Useful for initializing the message.
9637 #[inline]
9638 pub fn init_aid(mut self, value: u32) -> Self {
9639 self.r#aid = value.into();
9640 self
9641 }
9642 ///Return a reference to `is_mesh_child`
9643 #[inline]
9644 pub fn r#is_mesh_child(&self) -> &bool {
9645 &self.r#is_mesh_child
9646 }
9647 ///Return a mutable reference to `is_mesh_child`
9648 #[inline]
9649 pub fn mut_is_mesh_child(&mut self) -> &mut bool {
9650 &mut self.r#is_mesh_child
9651 }
9652 ///Set the value of `is_mesh_child`
9653 #[inline]
9654 pub fn set_is_mesh_child(&mut self, value: bool) -> &mut Self {
9655 self.r#is_mesh_child = value.into();
9656 self
9657 }
9658 ///Builder method that sets the value of `is_mesh_child`. Useful for initializing the message.
9659 #[inline]
9660 pub fn init_is_mesh_child(mut self, value: bool) -> Self {
9661 self.r#is_mesh_child = value.into();
9662 self
9663 }
9664}
9665impl ::micropb::MessageDecode for CtrlMsg_Event_StationConnectedToESPSoftAP {
9666 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
9667 &mut self,
9668 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
9669 len: usize,
9670 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
9671 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
9672 let before = decoder.bytes_read();
9673 while decoder.bytes_read() - before < len {
9674 let tag = decoder.decode_tag()?;
9675 match tag.field_num() {
9676 0 => return Err(::micropb::DecodeError::ZeroField),
9677 1u32 => {
9678 let mut_ref = &mut self.r#resp;
9679 {
9680 let val = decoder.decode_int32()?;
9681 let val_ref = &val;
9682 if *val_ref != 0 {
9683 *mut_ref = val as _;
9684 }
9685 };
9686 }
9687 2u32 => {
9688 let mut_ref = &mut self.r#mac;
9689 {
9690 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
9691 };
9692 }
9693 3u32 => {
9694 let mut_ref = &mut self.r#aid;
9695 {
9696 let val = decoder.decode_varint32()?;
9697 let val_ref = &val;
9698 if *val_ref != 0 {
9699 *mut_ref = val as _;
9700 }
9701 };
9702 }
9703 4u32 => {
9704 let mut_ref = &mut self.r#is_mesh_child;
9705 {
9706 let val = decoder.decode_bool()?;
9707 let val_ref = &val;
9708 if *val_ref {
9709 *mut_ref = val as _;
9710 }
9711 };
9712 }
9713 _ => {
9714 decoder.skip_wire_value(tag.wire_type())?;
9715 }
9716 }
9717 }
9718 Ok(())
9719 }
9720}
9721impl ::micropb::MessageEncode for CtrlMsg_Event_StationConnectedToESPSoftAP {
9722 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
9723 let mut max_size = 0;
9724 if let ::core::option::Option::Some(size) =
9725 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
9726 {
9727 max_size += size;
9728 } else {
9729 break 'msg (::core::option::Option::<usize>::None);
9730 };
9731 if let ::core::option::Option::Some(size) =
9732 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
9733 {
9734 max_size += size;
9735 } else {
9736 break 'msg (::core::option::Option::<usize>::None);
9737 };
9738 if let ::core::option::Option::Some(size) =
9739 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
9740 {
9741 max_size += size;
9742 } else {
9743 break 'msg (::core::option::Option::<usize>::None);
9744 };
9745 if let ::core::option::Option::Some(size) =
9746 ::micropb::const_map!(::core::option::Option::Some(1usize), |size| size + 1usize)
9747 {
9748 max_size += size;
9749 } else {
9750 break 'msg (::core::option::Option::<usize>::None);
9751 };
9752 ::core::option::Option::Some(max_size)
9753 };
9754 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
9755 &self,
9756 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
9757 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
9758 use ::micropb::{FieldEncode, PbMap};
9759 {
9760 let val_ref = &self.r#resp;
9761 if *val_ref != 0 {
9762 encoder.encode_varint32(8u32)?;
9763 encoder.encode_int32(*val_ref as _)?;
9764 }
9765 }
9766 {
9767 let val_ref = &self.r#mac;
9768 if !val_ref.is_empty() {
9769 encoder.encode_varint32(18u32)?;
9770 encoder.encode_bytes(val_ref)?;
9771 }
9772 }
9773 {
9774 let val_ref = &self.r#aid;
9775 if *val_ref != 0 {
9776 encoder.encode_varint32(24u32)?;
9777 encoder.encode_varint32(*val_ref as _)?;
9778 }
9779 }
9780 {
9781 let val_ref = &self.r#is_mesh_child;
9782 if *val_ref {
9783 encoder.encode_varint32(32u32)?;
9784 encoder.encode_bool(*val_ref)?;
9785 }
9786 }
9787 Ok(())
9788 }
9789 fn compute_size(&self) -> usize {
9790 use ::micropb::{FieldEncode, PbMap};
9791 let mut size = 0;
9792 {
9793 let val_ref = &self.r#resp;
9794 if *val_ref != 0 {
9795 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
9796 }
9797 }
9798 {
9799 let val_ref = &self.r#mac;
9800 if !val_ref.is_empty() {
9801 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
9802 }
9803 }
9804 {
9805 let val_ref = &self.r#aid;
9806 if *val_ref != 0 {
9807 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
9808 }
9809 }
9810 {
9811 let val_ref = &self.r#is_mesh_child;
9812 if *val_ref {
9813 size += 1usize + 1;
9814 }
9815 }
9816 size
9817 }
9818}
9819#[derive(Debug, Default, PartialEq, Clone)]
9820#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9821pub struct CtrlMsg_Event_SetDhcpDnsStatus {
9822 pub r#iface: i32,
9823 pub r#net_link_up: i32,
9824 pub r#dhcp_up: i32,
9825 pub r#dhcp_ip: ::micropb::heapless::Vec<u8, 32>,
9826 pub r#dhcp_nm: ::micropb::heapless::Vec<u8, 32>,
9827 pub r#dhcp_gw: ::micropb::heapless::Vec<u8, 32>,
9828 pub r#dns_up: i32,
9829 pub r#dns_ip: ::micropb::heapless::Vec<u8, 32>,
9830 pub r#dns_type: i32,
9831 pub r#resp: i32,
9832}
9833impl CtrlMsg_Event_SetDhcpDnsStatus {
9834 ///Return a reference to `iface`
9835 #[inline]
9836 pub fn r#iface(&self) -> &i32 {
9837 &self.r#iface
9838 }
9839 ///Return a mutable reference to `iface`
9840 #[inline]
9841 pub fn mut_iface(&mut self) -> &mut i32 {
9842 &mut self.r#iface
9843 }
9844 ///Set the value of `iface`
9845 #[inline]
9846 pub fn set_iface(&mut self, value: i32) -> &mut Self {
9847 self.r#iface = value.into();
9848 self
9849 }
9850 ///Builder method that sets the value of `iface`. Useful for initializing the message.
9851 #[inline]
9852 pub fn init_iface(mut self, value: i32) -> Self {
9853 self.r#iface = value.into();
9854 self
9855 }
9856 ///Return a reference to `net_link_up`
9857 #[inline]
9858 pub fn r#net_link_up(&self) -> &i32 {
9859 &self.r#net_link_up
9860 }
9861 ///Return a mutable reference to `net_link_up`
9862 #[inline]
9863 pub fn mut_net_link_up(&mut self) -> &mut i32 {
9864 &mut self.r#net_link_up
9865 }
9866 ///Set the value of `net_link_up`
9867 #[inline]
9868 pub fn set_net_link_up(&mut self, value: i32) -> &mut Self {
9869 self.r#net_link_up = value.into();
9870 self
9871 }
9872 ///Builder method that sets the value of `net_link_up`. Useful for initializing the message.
9873 #[inline]
9874 pub fn init_net_link_up(mut self, value: i32) -> Self {
9875 self.r#net_link_up = value.into();
9876 self
9877 }
9878 ///Return a reference to `dhcp_up`
9879 #[inline]
9880 pub fn r#dhcp_up(&self) -> &i32 {
9881 &self.r#dhcp_up
9882 }
9883 ///Return a mutable reference to `dhcp_up`
9884 #[inline]
9885 pub fn mut_dhcp_up(&mut self) -> &mut i32 {
9886 &mut self.r#dhcp_up
9887 }
9888 ///Set the value of `dhcp_up`
9889 #[inline]
9890 pub fn set_dhcp_up(&mut self, value: i32) -> &mut Self {
9891 self.r#dhcp_up = value.into();
9892 self
9893 }
9894 ///Builder method that sets the value of `dhcp_up`. Useful for initializing the message.
9895 #[inline]
9896 pub fn init_dhcp_up(mut self, value: i32) -> Self {
9897 self.r#dhcp_up = value.into();
9898 self
9899 }
9900 ///Return a reference to `dhcp_ip`
9901 #[inline]
9902 pub fn r#dhcp_ip(&self) -> &::micropb::heapless::Vec<u8, 32> {
9903 &self.r#dhcp_ip
9904 }
9905 ///Return a mutable reference to `dhcp_ip`
9906 #[inline]
9907 pub fn mut_dhcp_ip(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
9908 &mut self.r#dhcp_ip
9909 }
9910 ///Set the value of `dhcp_ip`
9911 #[inline]
9912 pub fn set_dhcp_ip(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
9913 self.r#dhcp_ip = value.into();
9914 self
9915 }
9916 ///Builder method that sets the value of `dhcp_ip`. Useful for initializing the message.
9917 #[inline]
9918 pub fn init_dhcp_ip(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
9919 self.r#dhcp_ip = value.into();
9920 self
9921 }
9922 ///Return a reference to `dhcp_nm`
9923 #[inline]
9924 pub fn r#dhcp_nm(&self) -> &::micropb::heapless::Vec<u8, 32> {
9925 &self.r#dhcp_nm
9926 }
9927 ///Return a mutable reference to `dhcp_nm`
9928 #[inline]
9929 pub fn mut_dhcp_nm(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
9930 &mut self.r#dhcp_nm
9931 }
9932 ///Set the value of `dhcp_nm`
9933 #[inline]
9934 pub fn set_dhcp_nm(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
9935 self.r#dhcp_nm = value.into();
9936 self
9937 }
9938 ///Builder method that sets the value of `dhcp_nm`. Useful for initializing the message.
9939 #[inline]
9940 pub fn init_dhcp_nm(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
9941 self.r#dhcp_nm = value.into();
9942 self
9943 }
9944 ///Return a reference to `dhcp_gw`
9945 #[inline]
9946 pub fn r#dhcp_gw(&self) -> &::micropb::heapless::Vec<u8, 32> {
9947 &self.r#dhcp_gw
9948 }
9949 ///Return a mutable reference to `dhcp_gw`
9950 #[inline]
9951 pub fn mut_dhcp_gw(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
9952 &mut self.r#dhcp_gw
9953 }
9954 ///Set the value of `dhcp_gw`
9955 #[inline]
9956 pub fn set_dhcp_gw(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
9957 self.r#dhcp_gw = value.into();
9958 self
9959 }
9960 ///Builder method that sets the value of `dhcp_gw`. Useful for initializing the message.
9961 #[inline]
9962 pub fn init_dhcp_gw(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
9963 self.r#dhcp_gw = value.into();
9964 self
9965 }
9966 ///Return a reference to `dns_up`
9967 #[inline]
9968 pub fn r#dns_up(&self) -> &i32 {
9969 &self.r#dns_up
9970 }
9971 ///Return a mutable reference to `dns_up`
9972 #[inline]
9973 pub fn mut_dns_up(&mut self) -> &mut i32 {
9974 &mut self.r#dns_up
9975 }
9976 ///Set the value of `dns_up`
9977 #[inline]
9978 pub fn set_dns_up(&mut self, value: i32) -> &mut Self {
9979 self.r#dns_up = value.into();
9980 self
9981 }
9982 ///Builder method that sets the value of `dns_up`. Useful for initializing the message.
9983 #[inline]
9984 pub fn init_dns_up(mut self, value: i32) -> Self {
9985 self.r#dns_up = value.into();
9986 self
9987 }
9988 ///Return a reference to `dns_ip`
9989 #[inline]
9990 pub fn r#dns_ip(&self) -> &::micropb::heapless::Vec<u8, 32> {
9991 &self.r#dns_ip
9992 }
9993 ///Return a mutable reference to `dns_ip`
9994 #[inline]
9995 pub fn mut_dns_ip(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
9996 &mut self.r#dns_ip
9997 }
9998 ///Set the value of `dns_ip`
9999 #[inline]
10000 pub fn set_dns_ip(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
10001 self.r#dns_ip = value.into();
10002 self
10003 }
10004 ///Builder method that sets the value of `dns_ip`. Useful for initializing the message.
10005 #[inline]
10006 pub fn init_dns_ip(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
10007 self.r#dns_ip = value.into();
10008 self
10009 }
10010 ///Return a reference to `dns_type`
10011 #[inline]
10012 pub fn r#dns_type(&self) -> &i32 {
10013 &self.r#dns_type
10014 }
10015 ///Return a mutable reference to `dns_type`
10016 #[inline]
10017 pub fn mut_dns_type(&mut self) -> &mut i32 {
10018 &mut self.r#dns_type
10019 }
10020 ///Set the value of `dns_type`
10021 #[inline]
10022 pub fn set_dns_type(&mut self, value: i32) -> &mut Self {
10023 self.r#dns_type = value.into();
10024 self
10025 }
10026 ///Builder method that sets the value of `dns_type`. Useful for initializing the message.
10027 #[inline]
10028 pub fn init_dns_type(mut self, value: i32) -> Self {
10029 self.r#dns_type = value.into();
10030 self
10031 }
10032 ///Return a reference to `resp`
10033 #[inline]
10034 pub fn r#resp(&self) -> &i32 {
10035 &self.r#resp
10036 }
10037 ///Return a mutable reference to `resp`
10038 #[inline]
10039 pub fn mut_resp(&mut self) -> &mut i32 {
10040 &mut self.r#resp
10041 }
10042 ///Set the value of `resp`
10043 #[inline]
10044 pub fn set_resp(&mut self, value: i32) -> &mut Self {
10045 self.r#resp = value.into();
10046 self
10047 }
10048 ///Builder method that sets the value of `resp`. Useful for initializing the message.
10049 #[inline]
10050 pub fn init_resp(mut self, value: i32) -> Self {
10051 self.r#resp = value.into();
10052 self
10053 }
10054}
10055impl ::micropb::MessageDecode for CtrlMsg_Event_SetDhcpDnsStatus {
10056 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
10057 &mut self,
10058 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
10059 len: usize,
10060 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
10061 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
10062 let before = decoder.bytes_read();
10063 while decoder.bytes_read() - before < len {
10064 let tag = decoder.decode_tag()?;
10065 match tag.field_num() {
10066 0 => return Err(::micropb::DecodeError::ZeroField),
10067 1u32 => {
10068 let mut_ref = &mut self.r#iface;
10069 {
10070 let val = decoder.decode_int32()?;
10071 let val_ref = &val;
10072 if *val_ref != 0 {
10073 *mut_ref = val as _;
10074 }
10075 };
10076 }
10077 2u32 => {
10078 let mut_ref = &mut self.r#net_link_up;
10079 {
10080 let val = decoder.decode_int32()?;
10081 let val_ref = &val;
10082 if *val_ref != 0 {
10083 *mut_ref = val as _;
10084 }
10085 };
10086 }
10087 3u32 => {
10088 let mut_ref = &mut self.r#dhcp_up;
10089 {
10090 let val = decoder.decode_int32()?;
10091 let val_ref = &val;
10092 if *val_ref != 0 {
10093 *mut_ref = val as _;
10094 }
10095 };
10096 }
10097 4u32 => {
10098 let mut_ref = &mut self.r#dhcp_ip;
10099 {
10100 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
10101 };
10102 }
10103 5u32 => {
10104 let mut_ref = &mut self.r#dhcp_nm;
10105 {
10106 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
10107 };
10108 }
10109 6u32 => {
10110 let mut_ref = &mut self.r#dhcp_gw;
10111 {
10112 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
10113 };
10114 }
10115 7u32 => {
10116 let mut_ref = &mut self.r#dns_up;
10117 {
10118 let val = decoder.decode_int32()?;
10119 let val_ref = &val;
10120 if *val_ref != 0 {
10121 *mut_ref = val as _;
10122 }
10123 };
10124 }
10125 8u32 => {
10126 let mut_ref = &mut self.r#dns_ip;
10127 {
10128 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
10129 };
10130 }
10131 9u32 => {
10132 let mut_ref = &mut self.r#dns_type;
10133 {
10134 let val = decoder.decode_int32()?;
10135 let val_ref = &val;
10136 if *val_ref != 0 {
10137 *mut_ref = val as _;
10138 }
10139 };
10140 }
10141 10u32 => {
10142 let mut_ref = &mut self.r#resp;
10143 {
10144 let val = decoder.decode_int32()?;
10145 let val_ref = &val;
10146 if *val_ref != 0 {
10147 *mut_ref = val as _;
10148 }
10149 };
10150 }
10151 _ => {
10152 decoder.skip_wire_value(tag.wire_type())?;
10153 }
10154 }
10155 }
10156 Ok(())
10157 }
10158}
10159impl ::micropb::MessageEncode for CtrlMsg_Event_SetDhcpDnsStatus {
10160 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
10161 let mut max_size = 0;
10162 if let ::core::option::Option::Some(size) =
10163 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
10164 {
10165 max_size += size;
10166 } else {
10167 break 'msg (::core::option::Option::<usize>::None);
10168 };
10169 if let ::core::option::Option::Some(size) =
10170 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
10171 {
10172 max_size += size;
10173 } else {
10174 break 'msg (::core::option::Option::<usize>::None);
10175 };
10176 if let ::core::option::Option::Some(size) =
10177 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
10178 {
10179 max_size += size;
10180 } else {
10181 break 'msg (::core::option::Option::<usize>::None);
10182 };
10183 if let ::core::option::Option::Some(size) =
10184 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
10185 {
10186 max_size += size;
10187 } else {
10188 break 'msg (::core::option::Option::<usize>::None);
10189 };
10190 if let ::core::option::Option::Some(size) =
10191 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
10192 {
10193 max_size += size;
10194 } else {
10195 break 'msg (::core::option::Option::<usize>::None);
10196 };
10197 if let ::core::option::Option::Some(size) =
10198 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
10199 {
10200 max_size += size;
10201 } else {
10202 break 'msg (::core::option::Option::<usize>::None);
10203 };
10204 if let ::core::option::Option::Some(size) =
10205 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
10206 {
10207 max_size += size;
10208 } else {
10209 break 'msg (::core::option::Option::<usize>::None);
10210 };
10211 if let ::core::option::Option::Some(size) =
10212 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
10213 {
10214 max_size += size;
10215 } else {
10216 break 'msg (::core::option::Option::<usize>::None);
10217 };
10218 if let ::core::option::Option::Some(size) =
10219 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
10220 {
10221 max_size += size;
10222 } else {
10223 break 'msg (::core::option::Option::<usize>::None);
10224 };
10225 if let ::core::option::Option::Some(size) =
10226 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
10227 {
10228 max_size += size;
10229 } else {
10230 break 'msg (::core::option::Option::<usize>::None);
10231 };
10232 ::core::option::Option::Some(max_size)
10233 };
10234 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
10235 &self,
10236 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
10237 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
10238 use ::micropb::{FieldEncode, PbMap};
10239 {
10240 let val_ref = &self.r#iface;
10241 if *val_ref != 0 {
10242 encoder.encode_varint32(8u32)?;
10243 encoder.encode_int32(*val_ref as _)?;
10244 }
10245 }
10246 {
10247 let val_ref = &self.r#net_link_up;
10248 if *val_ref != 0 {
10249 encoder.encode_varint32(16u32)?;
10250 encoder.encode_int32(*val_ref as _)?;
10251 }
10252 }
10253 {
10254 let val_ref = &self.r#dhcp_up;
10255 if *val_ref != 0 {
10256 encoder.encode_varint32(24u32)?;
10257 encoder.encode_int32(*val_ref as _)?;
10258 }
10259 }
10260 {
10261 let val_ref = &self.r#dhcp_ip;
10262 if !val_ref.is_empty() {
10263 encoder.encode_varint32(34u32)?;
10264 encoder.encode_bytes(val_ref)?;
10265 }
10266 }
10267 {
10268 let val_ref = &self.r#dhcp_nm;
10269 if !val_ref.is_empty() {
10270 encoder.encode_varint32(42u32)?;
10271 encoder.encode_bytes(val_ref)?;
10272 }
10273 }
10274 {
10275 let val_ref = &self.r#dhcp_gw;
10276 if !val_ref.is_empty() {
10277 encoder.encode_varint32(50u32)?;
10278 encoder.encode_bytes(val_ref)?;
10279 }
10280 }
10281 {
10282 let val_ref = &self.r#dns_up;
10283 if *val_ref != 0 {
10284 encoder.encode_varint32(56u32)?;
10285 encoder.encode_int32(*val_ref as _)?;
10286 }
10287 }
10288 {
10289 let val_ref = &self.r#dns_ip;
10290 if !val_ref.is_empty() {
10291 encoder.encode_varint32(66u32)?;
10292 encoder.encode_bytes(val_ref)?;
10293 }
10294 }
10295 {
10296 let val_ref = &self.r#dns_type;
10297 if *val_ref != 0 {
10298 encoder.encode_varint32(72u32)?;
10299 encoder.encode_int32(*val_ref as _)?;
10300 }
10301 }
10302 {
10303 let val_ref = &self.r#resp;
10304 if *val_ref != 0 {
10305 encoder.encode_varint32(80u32)?;
10306 encoder.encode_int32(*val_ref as _)?;
10307 }
10308 }
10309 Ok(())
10310 }
10311 fn compute_size(&self) -> usize {
10312 use ::micropb::{FieldEncode, PbMap};
10313 let mut size = 0;
10314 {
10315 let val_ref = &self.r#iface;
10316 if *val_ref != 0 {
10317 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
10318 }
10319 }
10320 {
10321 let val_ref = &self.r#net_link_up;
10322 if *val_ref != 0 {
10323 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
10324 }
10325 }
10326 {
10327 let val_ref = &self.r#dhcp_up;
10328 if *val_ref != 0 {
10329 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
10330 }
10331 }
10332 {
10333 let val_ref = &self.r#dhcp_ip;
10334 if !val_ref.is_empty() {
10335 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
10336 }
10337 }
10338 {
10339 let val_ref = &self.r#dhcp_nm;
10340 if !val_ref.is_empty() {
10341 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
10342 }
10343 }
10344 {
10345 let val_ref = &self.r#dhcp_gw;
10346 if !val_ref.is_empty() {
10347 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
10348 }
10349 }
10350 {
10351 let val_ref = &self.r#dns_up;
10352 if *val_ref != 0 {
10353 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
10354 }
10355 }
10356 {
10357 let val_ref = &self.r#dns_ip;
10358 if !val_ref.is_empty() {
10359 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
10360 }
10361 }
10362 {
10363 let val_ref = &self.r#dns_type;
10364 if *val_ref != 0 {
10365 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
10366 }
10367 }
10368 {
10369 let val_ref = &self.r#resp;
10370 if *val_ref != 0 {
10371 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
10372 }
10373 }
10374 size
10375 }
10376}
10377#[derive(Debug, Default, PartialEq, Clone)]
10378#[cfg_attr(feature = "defmt", derive(defmt::Format))]
10379pub struct CtrlMsg_Req_CustomRpcUnserialisedMsg {
10380 pub r#custom_msg_id: u32,
10381 pub r#data: ::micropb::heapless::Vec<u8, 32>,
10382}
10383impl CtrlMsg_Req_CustomRpcUnserialisedMsg {
10384 ///Return a reference to `custom_msg_id`
10385 #[inline]
10386 pub fn r#custom_msg_id(&self) -> &u32 {
10387 &self.r#custom_msg_id
10388 }
10389 ///Return a mutable reference to `custom_msg_id`
10390 #[inline]
10391 pub fn mut_custom_msg_id(&mut self) -> &mut u32 {
10392 &mut self.r#custom_msg_id
10393 }
10394 ///Set the value of `custom_msg_id`
10395 #[inline]
10396 pub fn set_custom_msg_id(&mut self, value: u32) -> &mut Self {
10397 self.r#custom_msg_id = value.into();
10398 self
10399 }
10400 ///Builder method that sets the value of `custom_msg_id`. Useful for initializing the message.
10401 #[inline]
10402 pub fn init_custom_msg_id(mut self, value: u32) -> Self {
10403 self.r#custom_msg_id = value.into();
10404 self
10405 }
10406 ///Return a reference to `data`
10407 #[inline]
10408 pub fn r#data(&self) -> &::micropb::heapless::Vec<u8, 32> {
10409 &self.r#data
10410 }
10411 ///Return a mutable reference to `data`
10412 #[inline]
10413 pub fn mut_data(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
10414 &mut self.r#data
10415 }
10416 ///Set the value of `data`
10417 #[inline]
10418 pub fn set_data(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
10419 self.r#data = value.into();
10420 self
10421 }
10422 ///Builder method that sets the value of `data`. Useful for initializing the message.
10423 #[inline]
10424 pub fn init_data(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
10425 self.r#data = value.into();
10426 self
10427 }
10428}
10429impl ::micropb::MessageDecode for CtrlMsg_Req_CustomRpcUnserialisedMsg {
10430 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
10431 &mut self,
10432 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
10433 len: usize,
10434 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
10435 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
10436 let before = decoder.bytes_read();
10437 while decoder.bytes_read() - before < len {
10438 let tag = decoder.decode_tag()?;
10439 match tag.field_num() {
10440 0 => return Err(::micropb::DecodeError::ZeroField),
10441 1u32 => {
10442 let mut_ref = &mut self.r#custom_msg_id;
10443 {
10444 let val = decoder.decode_varint32()?;
10445 let val_ref = &val;
10446 if *val_ref != 0 {
10447 *mut_ref = val as _;
10448 }
10449 };
10450 }
10451 2u32 => {
10452 let mut_ref = &mut self.r#data;
10453 {
10454 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
10455 };
10456 }
10457 _ => {
10458 decoder.skip_wire_value(tag.wire_type())?;
10459 }
10460 }
10461 }
10462 Ok(())
10463 }
10464}
10465impl ::micropb::MessageEncode for CtrlMsg_Req_CustomRpcUnserialisedMsg {
10466 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
10467 let mut max_size = 0;
10468 if let ::core::option::Option::Some(size) =
10469 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
10470 {
10471 max_size += size;
10472 } else {
10473 break 'msg (::core::option::Option::<usize>::None);
10474 };
10475 if let ::core::option::Option::Some(size) =
10476 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
10477 {
10478 max_size += size;
10479 } else {
10480 break 'msg (::core::option::Option::<usize>::None);
10481 };
10482 ::core::option::Option::Some(max_size)
10483 };
10484 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
10485 &self,
10486 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
10487 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
10488 use ::micropb::{FieldEncode, PbMap};
10489 {
10490 let val_ref = &self.r#custom_msg_id;
10491 if *val_ref != 0 {
10492 encoder.encode_varint32(8u32)?;
10493 encoder.encode_varint32(*val_ref as _)?;
10494 }
10495 }
10496 {
10497 let val_ref = &self.r#data;
10498 if !val_ref.is_empty() {
10499 encoder.encode_varint32(18u32)?;
10500 encoder.encode_bytes(val_ref)?;
10501 }
10502 }
10503 Ok(())
10504 }
10505 fn compute_size(&self) -> usize {
10506 use ::micropb::{FieldEncode, PbMap};
10507 let mut size = 0;
10508 {
10509 let val_ref = &self.r#custom_msg_id;
10510 if *val_ref != 0 {
10511 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
10512 }
10513 }
10514 {
10515 let val_ref = &self.r#data;
10516 if !val_ref.is_empty() {
10517 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
10518 }
10519 }
10520 size
10521 }
10522}
10523#[derive(Debug, Default, PartialEq, Clone)]
10524#[cfg_attr(feature = "defmt", derive(defmt::Format))]
10525pub struct CtrlMsg_Resp_CustomRpcUnserialisedMsg {
10526 pub r#resp: i32,
10527 pub r#custom_msg_id: u32,
10528 pub r#data: ::micropb::heapless::Vec<u8, 32>,
10529}
10530impl CtrlMsg_Resp_CustomRpcUnserialisedMsg {
10531 ///Return a reference to `resp`
10532 #[inline]
10533 pub fn r#resp(&self) -> &i32 {
10534 &self.r#resp
10535 }
10536 ///Return a mutable reference to `resp`
10537 #[inline]
10538 pub fn mut_resp(&mut self) -> &mut i32 {
10539 &mut self.r#resp
10540 }
10541 ///Set the value of `resp`
10542 #[inline]
10543 pub fn set_resp(&mut self, value: i32) -> &mut Self {
10544 self.r#resp = value.into();
10545 self
10546 }
10547 ///Builder method that sets the value of `resp`. Useful for initializing the message.
10548 #[inline]
10549 pub fn init_resp(mut self, value: i32) -> Self {
10550 self.r#resp = value.into();
10551 self
10552 }
10553 ///Return a reference to `custom_msg_id`
10554 #[inline]
10555 pub fn r#custom_msg_id(&self) -> &u32 {
10556 &self.r#custom_msg_id
10557 }
10558 ///Return a mutable reference to `custom_msg_id`
10559 #[inline]
10560 pub fn mut_custom_msg_id(&mut self) -> &mut u32 {
10561 &mut self.r#custom_msg_id
10562 }
10563 ///Set the value of `custom_msg_id`
10564 #[inline]
10565 pub fn set_custom_msg_id(&mut self, value: u32) -> &mut Self {
10566 self.r#custom_msg_id = value.into();
10567 self
10568 }
10569 ///Builder method that sets the value of `custom_msg_id`. Useful for initializing the message.
10570 #[inline]
10571 pub fn init_custom_msg_id(mut self, value: u32) -> Self {
10572 self.r#custom_msg_id = value.into();
10573 self
10574 }
10575 ///Return a reference to `data`
10576 #[inline]
10577 pub fn r#data(&self) -> &::micropb::heapless::Vec<u8, 32> {
10578 &self.r#data
10579 }
10580 ///Return a mutable reference to `data`
10581 #[inline]
10582 pub fn mut_data(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
10583 &mut self.r#data
10584 }
10585 ///Set the value of `data`
10586 #[inline]
10587 pub fn set_data(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
10588 self.r#data = value.into();
10589 self
10590 }
10591 ///Builder method that sets the value of `data`. Useful for initializing the message.
10592 #[inline]
10593 pub fn init_data(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
10594 self.r#data = value.into();
10595 self
10596 }
10597}
10598impl ::micropb::MessageDecode for CtrlMsg_Resp_CustomRpcUnserialisedMsg {
10599 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
10600 &mut self,
10601 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
10602 len: usize,
10603 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
10604 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
10605 let before = decoder.bytes_read();
10606 while decoder.bytes_read() - before < len {
10607 let tag = decoder.decode_tag()?;
10608 match tag.field_num() {
10609 0 => return Err(::micropb::DecodeError::ZeroField),
10610 1u32 => {
10611 let mut_ref = &mut self.r#resp;
10612 {
10613 let val = decoder.decode_int32()?;
10614 let val_ref = &val;
10615 if *val_ref != 0 {
10616 *mut_ref = val as _;
10617 }
10618 };
10619 }
10620 2u32 => {
10621 let mut_ref = &mut self.r#custom_msg_id;
10622 {
10623 let val = decoder.decode_varint32()?;
10624 let val_ref = &val;
10625 if *val_ref != 0 {
10626 *mut_ref = val as _;
10627 }
10628 };
10629 }
10630 3u32 => {
10631 let mut_ref = &mut self.r#data;
10632 {
10633 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
10634 };
10635 }
10636 _ => {
10637 decoder.skip_wire_value(tag.wire_type())?;
10638 }
10639 }
10640 }
10641 Ok(())
10642 }
10643}
10644impl ::micropb::MessageEncode for CtrlMsg_Resp_CustomRpcUnserialisedMsg {
10645 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
10646 let mut max_size = 0;
10647 if let ::core::option::Option::Some(size) =
10648 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
10649 {
10650 max_size += size;
10651 } else {
10652 break 'msg (::core::option::Option::<usize>::None);
10653 };
10654 if let ::core::option::Option::Some(size) =
10655 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
10656 {
10657 max_size += size;
10658 } else {
10659 break 'msg (::core::option::Option::<usize>::None);
10660 };
10661 if let ::core::option::Option::Some(size) =
10662 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
10663 {
10664 max_size += size;
10665 } else {
10666 break 'msg (::core::option::Option::<usize>::None);
10667 };
10668 ::core::option::Option::Some(max_size)
10669 };
10670 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
10671 &self,
10672 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
10673 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
10674 use ::micropb::{FieldEncode, PbMap};
10675 {
10676 let val_ref = &self.r#resp;
10677 if *val_ref != 0 {
10678 encoder.encode_varint32(8u32)?;
10679 encoder.encode_int32(*val_ref as _)?;
10680 }
10681 }
10682 {
10683 let val_ref = &self.r#custom_msg_id;
10684 if *val_ref != 0 {
10685 encoder.encode_varint32(16u32)?;
10686 encoder.encode_varint32(*val_ref as _)?;
10687 }
10688 }
10689 {
10690 let val_ref = &self.r#data;
10691 if !val_ref.is_empty() {
10692 encoder.encode_varint32(26u32)?;
10693 encoder.encode_bytes(val_ref)?;
10694 }
10695 }
10696 Ok(())
10697 }
10698 fn compute_size(&self) -> usize {
10699 use ::micropb::{FieldEncode, PbMap};
10700 let mut size = 0;
10701 {
10702 let val_ref = &self.r#resp;
10703 if *val_ref != 0 {
10704 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
10705 }
10706 }
10707 {
10708 let val_ref = &self.r#custom_msg_id;
10709 if *val_ref != 0 {
10710 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
10711 }
10712 }
10713 {
10714 let val_ref = &self.r#data;
10715 if !val_ref.is_empty() {
10716 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
10717 }
10718 }
10719 size
10720 }
10721}
10722#[derive(Debug, Default, PartialEq, Clone)]
10723#[cfg_attr(feature = "defmt", derive(defmt::Format))]
10724pub struct CtrlMsg_Event_CustomRpcUnserialisedMsg {
10725 pub r#resp: i32,
10726 pub r#custom_evt_id: u32,
10727 pub r#data: ::micropb::heapless::Vec<u8, 32>,
10728}
10729impl CtrlMsg_Event_CustomRpcUnserialisedMsg {
10730 ///Return a reference to `resp`
10731 #[inline]
10732 pub fn r#resp(&self) -> &i32 {
10733 &self.r#resp
10734 }
10735 ///Return a mutable reference to `resp`
10736 #[inline]
10737 pub fn mut_resp(&mut self) -> &mut i32 {
10738 &mut self.r#resp
10739 }
10740 ///Set the value of `resp`
10741 #[inline]
10742 pub fn set_resp(&mut self, value: i32) -> &mut Self {
10743 self.r#resp = value.into();
10744 self
10745 }
10746 ///Builder method that sets the value of `resp`. Useful for initializing the message.
10747 #[inline]
10748 pub fn init_resp(mut self, value: i32) -> Self {
10749 self.r#resp = value.into();
10750 self
10751 }
10752 ///Return a reference to `custom_evt_id`
10753 #[inline]
10754 pub fn r#custom_evt_id(&self) -> &u32 {
10755 &self.r#custom_evt_id
10756 }
10757 ///Return a mutable reference to `custom_evt_id`
10758 #[inline]
10759 pub fn mut_custom_evt_id(&mut self) -> &mut u32 {
10760 &mut self.r#custom_evt_id
10761 }
10762 ///Set the value of `custom_evt_id`
10763 #[inline]
10764 pub fn set_custom_evt_id(&mut self, value: u32) -> &mut Self {
10765 self.r#custom_evt_id = value.into();
10766 self
10767 }
10768 ///Builder method that sets the value of `custom_evt_id`. Useful for initializing the message.
10769 #[inline]
10770 pub fn init_custom_evt_id(mut self, value: u32) -> Self {
10771 self.r#custom_evt_id = value.into();
10772 self
10773 }
10774 ///Return a reference to `data`
10775 #[inline]
10776 pub fn r#data(&self) -> &::micropb::heapless::Vec<u8, 32> {
10777 &self.r#data
10778 }
10779 ///Return a mutable reference to `data`
10780 #[inline]
10781 pub fn mut_data(&mut self) -> &mut ::micropb::heapless::Vec<u8, 32> {
10782 &mut self.r#data
10783 }
10784 ///Set the value of `data`
10785 #[inline]
10786 pub fn set_data(&mut self, value: ::micropb::heapless::Vec<u8, 32>) -> &mut Self {
10787 self.r#data = value.into();
10788 self
10789 }
10790 ///Builder method that sets the value of `data`. Useful for initializing the message.
10791 #[inline]
10792 pub fn init_data(mut self, value: ::micropb::heapless::Vec<u8, 32>) -> Self {
10793 self.r#data = value.into();
10794 self
10795 }
10796}
10797impl ::micropb::MessageDecode for CtrlMsg_Event_CustomRpcUnserialisedMsg {
10798 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
10799 &mut self,
10800 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
10801 len: usize,
10802 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
10803 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
10804 let before = decoder.bytes_read();
10805 while decoder.bytes_read() - before < len {
10806 let tag = decoder.decode_tag()?;
10807 match tag.field_num() {
10808 0 => return Err(::micropb::DecodeError::ZeroField),
10809 1u32 => {
10810 let mut_ref = &mut self.r#resp;
10811 {
10812 let val = decoder.decode_int32()?;
10813 let val_ref = &val;
10814 if *val_ref != 0 {
10815 *mut_ref = val as _;
10816 }
10817 };
10818 }
10819 2u32 => {
10820 let mut_ref = &mut self.r#custom_evt_id;
10821 {
10822 let val = decoder.decode_varint32()?;
10823 let val_ref = &val;
10824 if *val_ref != 0 {
10825 *mut_ref = val as _;
10826 }
10827 };
10828 }
10829 3u32 => {
10830 let mut_ref = &mut self.r#data;
10831 {
10832 decoder.decode_bytes(mut_ref, ::micropb::Presence::Implicit)?;
10833 };
10834 }
10835 _ => {
10836 decoder.skip_wire_value(tag.wire_type())?;
10837 }
10838 }
10839 }
10840 Ok(())
10841 }
10842}
10843impl ::micropb::MessageEncode for CtrlMsg_Event_CustomRpcUnserialisedMsg {
10844 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
10845 let mut max_size = 0;
10846 if let ::core::option::Option::Some(size) =
10847 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
10848 {
10849 max_size += size;
10850 } else {
10851 break 'msg (::core::option::Option::<usize>::None);
10852 };
10853 if let ::core::option::Option::Some(size) =
10854 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
10855 {
10856 max_size += size;
10857 } else {
10858 break 'msg (::core::option::Option::<usize>::None);
10859 };
10860 if let ::core::option::Option::Some(size) =
10861 ::micropb::const_map!(::core::option::Option::Some(33usize), |size| size + 1usize)
10862 {
10863 max_size += size;
10864 } else {
10865 break 'msg (::core::option::Option::<usize>::None);
10866 };
10867 ::core::option::Option::Some(max_size)
10868 };
10869 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
10870 &self,
10871 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
10872 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
10873 use ::micropb::{FieldEncode, PbMap};
10874 {
10875 let val_ref = &self.r#resp;
10876 if *val_ref != 0 {
10877 encoder.encode_varint32(8u32)?;
10878 encoder.encode_int32(*val_ref as _)?;
10879 }
10880 }
10881 {
10882 let val_ref = &self.r#custom_evt_id;
10883 if *val_ref != 0 {
10884 encoder.encode_varint32(16u32)?;
10885 encoder.encode_varint32(*val_ref as _)?;
10886 }
10887 }
10888 {
10889 let val_ref = &self.r#data;
10890 if !val_ref.is_empty() {
10891 encoder.encode_varint32(26u32)?;
10892 encoder.encode_bytes(val_ref)?;
10893 }
10894 }
10895 Ok(())
10896 }
10897 fn compute_size(&self) -> usize {
10898 use ::micropb::{FieldEncode, PbMap};
10899 let mut size = 0;
10900 {
10901 let val_ref = &self.r#resp;
10902 if *val_ref != 0 {
10903 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
10904 }
10905 }
10906 {
10907 let val_ref = &self.r#custom_evt_id;
10908 if *val_ref != 0 {
10909 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
10910 }
10911 }
10912 {
10913 let val_ref = &self.r#data;
10914 if !val_ref.is_empty() {
10915 size += 1usize + ::micropb::size::sizeof_len_record(val_ref.len());
10916 }
10917 }
10918 size
10919 }
10920}
10921pub mod CtrlMsg_ {
10922 #[derive(Debug, PartialEq, Clone)]
10923 #[cfg_attr(feature = "defmt", derive(defmt::Format))]
10924 pub enum Payload {
10925 ReqGetMacAddress(super::CtrlMsg_Req_GetMacAddress),
10926 ReqSetMacAddress(super::CtrlMsg_Req_SetMacAddress),
10927 ReqGetWifiMode(super::CtrlMsg_Req_GetMode),
10928 ReqSetWifiMode(super::CtrlMsg_Req_SetMode),
10929 ReqScanApList(super::CtrlMsg_Req_ScanResult),
10930 ReqGetApConfig(super::CtrlMsg_Req_GetAPConfig),
10931 ReqConnectAp(super::CtrlMsg_Req_ConnectAP),
10932 ReqDisconnectAp(super::CtrlMsg_Req_GetStatus),
10933 ReqGetSoftapConfig(super::CtrlMsg_Req_GetSoftAPConfig),
10934 ReqSetSoftapVendorSpecificIe(super::CtrlMsg_Req_SetSoftAPVendorSpecificIE),
10935 ReqStartSoftap(super::CtrlMsg_Req_StartSoftAP),
10936 ReqSoftapConnectedStasList(super::CtrlMsg_Req_SoftAPConnectedSTA),
10937 ReqStopSoftap(super::CtrlMsg_Req_GetStatus),
10938 ReqSetPowerSaveMode(super::CtrlMsg_Req_SetMode),
10939 ReqGetPowerSaveMode(super::CtrlMsg_Req_GetMode),
10940 ReqOtaBegin(super::CtrlMsg_Req_OTABegin),
10941 ReqOtaWrite(super::CtrlMsg_Req_OTAWrite),
10942 ReqOtaEnd(super::CtrlMsg_Req_OTAEnd),
10943 ReqSetWifiMaxTxPower(super::CtrlMsg_Req_SetWifiMaxTxPower),
10944 ReqGetWifiCurrTxPower(super::CtrlMsg_Req_GetWifiCurrTxPower),
10945 ReqConfigHeartbeat(super::CtrlMsg_Req_ConfigHeartbeat),
10946 ReqEnableDisableFeat(super::CtrlMsg_Req_EnableDisable),
10947 ReqGetFwVersion(super::CtrlMsg_Req_GetFwVersion),
10948 ReqSetCountryCode(super::CtrlMsg_Req_SetCountryCode),
10949 ReqGetCountryCode(super::CtrlMsg_Req_GetCountryCode),
10950 ReqSetDhcpDnsStatus(super::CtrlMsg_Req_SetDhcpDnsStatus),
10951 ReqGetDhcpDnsStatus(super::CtrlMsg_Req_GetDhcpDnsStatus),
10952 ReqCustomRpcUnserialisedMsg(super::CtrlMsg_Req_CustomRpcUnserialisedMsg),
10953 RespGetMacAddress(super::CtrlMsg_Resp_GetMacAddress),
10954 RespSetMacAddress(super::CtrlMsg_Resp_SetMacAddress),
10955 RespGetWifiMode(super::CtrlMsg_Resp_GetMode),
10956 RespSetWifiMode(super::CtrlMsg_Resp_SetMode),
10957 RespScanApList(super::CtrlMsg_Resp_ScanResult),
10958 RespGetApConfig(super::CtrlMsg_Resp_GetAPConfig),
10959 RespConnectAp(super::CtrlMsg_Resp_ConnectAP),
10960 RespDisconnectAp(super::CtrlMsg_Resp_GetStatus),
10961 RespGetSoftapConfig(super::CtrlMsg_Resp_GetSoftAPConfig),
10962 RespSetSoftapVendorSpecificIe(super::CtrlMsg_Resp_SetSoftAPVendorSpecificIE),
10963 RespStartSoftap(super::CtrlMsg_Resp_StartSoftAP),
10964 RespSoftapConnectedStasList(super::CtrlMsg_Resp_SoftAPConnectedSTA),
10965 RespStopSoftap(super::CtrlMsg_Resp_GetStatus),
10966 RespSetPowerSaveMode(super::CtrlMsg_Resp_SetMode),
10967 RespGetPowerSaveMode(super::CtrlMsg_Resp_GetMode),
10968 RespOtaBegin(super::CtrlMsg_Resp_OTABegin),
10969 RespOtaWrite(super::CtrlMsg_Resp_OTAWrite),
10970 RespOtaEnd(super::CtrlMsg_Resp_OTAEnd),
10971 RespSetWifiMaxTxPower(super::CtrlMsg_Resp_SetWifiMaxTxPower),
10972 RespGetWifiCurrTxPower(super::CtrlMsg_Resp_GetWifiCurrTxPower),
10973 RespConfigHeartbeat(super::CtrlMsg_Resp_ConfigHeartbeat),
10974 RespEnableDisableFeat(super::CtrlMsg_Resp_EnableDisable),
10975 RespGetFwVersion(super::CtrlMsg_Resp_GetFwVersion),
10976 RespSetCountryCode(super::CtrlMsg_Resp_SetCountryCode),
10977 RespGetCountryCode(super::CtrlMsg_Resp_GetCountryCode),
10978 RespSetDhcpDnsStatus(super::CtrlMsg_Resp_SetDhcpDnsStatus),
10979 RespGetDhcpDnsStatus(super::CtrlMsg_Resp_GetDhcpDnsStatus),
10980 RespCustomRpcUnserialisedMsg(super::CtrlMsg_Resp_CustomRpcUnserialisedMsg),
10981 EventEspInit(super::CtrlMsg_Event_ESPInit),
10982 EventHeartbeat(super::CtrlMsg_Event_Heartbeat),
10983 EventStationDisconnectFromAp(super::CtrlMsg_Event_StationDisconnectFromAP),
10984 EventStationDisconnectFromEspSoftAp(super::CtrlMsg_Event_StationDisconnectFromESPSoftAP),
10985 EventStationConnectedToAp(super::CtrlMsg_Event_StationConnectedToAP),
10986 EventStationConnectedToEspSoftAp(super::CtrlMsg_Event_StationConnectedToESPSoftAP),
10987 EventSetDhcpDnsStatus(super::CtrlMsg_Event_SetDhcpDnsStatus),
10988 EventCustomRpcUnserialisedMsg(super::CtrlMsg_Event_CustomRpcUnserialisedMsg),
10989 }
10990}
10991#[derive(Debug, Default, PartialEq, Clone)]
10992#[cfg_attr(feature = "defmt", derive(defmt::Format))]
10993pub struct CtrlMsg {
10994 pub r#msg_type: CtrlMsgType,
10995 pub r#msg_id: CtrlMsgId,
10996 pub r#uid: i32,
10997 pub r#req_resp_type: u32,
10998 pub r#payload: ::core::option::Option<CtrlMsg_::Payload>,
10999}
11000impl CtrlMsg {
11001 ///Return a reference to `msg_type`
11002 #[inline]
11003 pub fn r#msg_type(&self) -> &CtrlMsgType {
11004 &self.r#msg_type
11005 }
11006 ///Return a mutable reference to `msg_type`
11007 #[inline]
11008 pub fn mut_msg_type(&mut self) -> &mut CtrlMsgType {
11009 &mut self.r#msg_type
11010 }
11011 ///Set the value of `msg_type`
11012 #[inline]
11013 pub fn set_msg_type(&mut self, value: CtrlMsgType) -> &mut Self {
11014 self.r#msg_type = value.into();
11015 self
11016 }
11017 ///Builder method that sets the value of `msg_type`. Useful for initializing the message.
11018 #[inline]
11019 pub fn init_msg_type(mut self, value: CtrlMsgType) -> Self {
11020 self.r#msg_type = value.into();
11021 self
11022 }
11023 ///Return a reference to `msg_id`
11024 #[inline]
11025 pub fn r#msg_id(&self) -> &CtrlMsgId {
11026 &self.r#msg_id
11027 }
11028 ///Return a mutable reference to `msg_id`
11029 #[inline]
11030 pub fn mut_msg_id(&mut self) -> &mut CtrlMsgId {
11031 &mut self.r#msg_id
11032 }
11033 ///Set the value of `msg_id`
11034 #[inline]
11035 pub fn set_msg_id(&mut self, value: CtrlMsgId) -> &mut Self {
11036 self.r#msg_id = value.into();
11037 self
11038 }
11039 ///Builder method that sets the value of `msg_id`. Useful for initializing the message.
11040 #[inline]
11041 pub fn init_msg_id(mut self, value: CtrlMsgId) -> Self {
11042 self.r#msg_id = value.into();
11043 self
11044 }
11045 ///Return a reference to `uid`
11046 #[inline]
11047 pub fn r#uid(&self) -> &i32 {
11048 &self.r#uid
11049 }
11050 ///Return a mutable reference to `uid`
11051 #[inline]
11052 pub fn mut_uid(&mut self) -> &mut i32 {
11053 &mut self.r#uid
11054 }
11055 ///Set the value of `uid`
11056 #[inline]
11057 pub fn set_uid(&mut self, value: i32) -> &mut Self {
11058 self.r#uid = value.into();
11059 self
11060 }
11061 ///Builder method that sets the value of `uid`. Useful for initializing the message.
11062 #[inline]
11063 pub fn init_uid(mut self, value: i32) -> Self {
11064 self.r#uid = value.into();
11065 self
11066 }
11067 ///Return a reference to `req_resp_type`
11068 #[inline]
11069 pub fn r#req_resp_type(&self) -> &u32 {
11070 &self.r#req_resp_type
11071 }
11072 ///Return a mutable reference to `req_resp_type`
11073 #[inline]
11074 pub fn mut_req_resp_type(&mut self) -> &mut u32 {
11075 &mut self.r#req_resp_type
11076 }
11077 ///Set the value of `req_resp_type`
11078 #[inline]
11079 pub fn set_req_resp_type(&mut self, value: u32) -> &mut Self {
11080 self.r#req_resp_type = value.into();
11081 self
11082 }
11083 ///Builder method that sets the value of `req_resp_type`. Useful for initializing the message.
11084 #[inline]
11085 pub fn init_req_resp_type(mut self, value: u32) -> Self {
11086 self.r#req_resp_type = value.into();
11087 self
11088 }
11089}
11090impl ::micropb::MessageDecode for CtrlMsg {
11091 fn decode<IMPL_MICROPB_READ: ::micropb::PbRead>(
11092 &mut self,
11093 decoder: &mut ::micropb::PbDecoder<IMPL_MICROPB_READ>,
11094 len: usize,
11095 ) -> Result<(), ::micropb::DecodeError<IMPL_MICROPB_READ::Error>> {
11096 use ::micropb::{FieldDecode, PbBytes, PbMap, PbString, PbVec};
11097 let before = decoder.bytes_read();
11098 while decoder.bytes_read() - before < len {
11099 let tag = decoder.decode_tag()?;
11100 match tag.field_num() {
11101 0 => return Err(::micropb::DecodeError::ZeroField),
11102 1u32 => {
11103 let mut_ref = &mut self.r#msg_type;
11104 {
11105 let val = decoder.decode_int32().map(|n| CtrlMsgType(n as _))?;
11106 let val_ref = &val;
11107 if val_ref.0 != 0 {
11108 *mut_ref = val as _;
11109 }
11110 };
11111 }
11112 2u32 => {
11113 let mut_ref = &mut self.r#msg_id;
11114 {
11115 let val = decoder.decode_int32().map(|n| CtrlMsgId(n as _))?;
11116 let val_ref = &val;
11117 if val_ref.0 != 0 {
11118 *mut_ref = val as _;
11119 }
11120 };
11121 }
11122 3u32 => {
11123 let mut_ref = &mut self.r#uid;
11124 {
11125 let val = decoder.decode_int32()?;
11126 let val_ref = &val;
11127 if *val_ref != 0 {
11128 *mut_ref = val as _;
11129 }
11130 };
11131 }
11132 4u32 => {
11133 let mut_ref = &mut self.r#req_resp_type;
11134 {
11135 let val = decoder.decode_varint32()?;
11136 let val_ref = &val;
11137 if *val_ref != 0 {
11138 *mut_ref = val as _;
11139 }
11140 };
11141 }
11142 101u32 => {
11143 let mut_ref = loop {
11144 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11145 if let CtrlMsg_::Payload::ReqGetMacAddress(variant) = &mut *variant {
11146 break &mut *variant;
11147 }
11148 }
11149 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetMacAddress(
11150 ::core::default::Default::default(),
11151 ));
11152 };
11153 mut_ref.decode_len_delimited(decoder)?;
11154 }
11155 102u32 => {
11156 let mut_ref = loop {
11157 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11158 if let CtrlMsg_::Payload::ReqSetMacAddress(variant) = &mut *variant {
11159 break &mut *variant;
11160 }
11161 }
11162 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetMacAddress(
11163 ::core::default::Default::default(),
11164 ));
11165 };
11166 mut_ref.decode_len_delimited(decoder)?;
11167 }
11168 103u32 => {
11169 let mut_ref = loop {
11170 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11171 if let CtrlMsg_::Payload::ReqGetWifiMode(variant) = &mut *variant {
11172 break &mut *variant;
11173 }
11174 }
11175 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetWifiMode(
11176 ::core::default::Default::default(),
11177 ));
11178 };
11179 mut_ref.decode_len_delimited(decoder)?;
11180 }
11181 104u32 => {
11182 let mut_ref = loop {
11183 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11184 if let CtrlMsg_::Payload::ReqSetWifiMode(variant) = &mut *variant {
11185 break &mut *variant;
11186 }
11187 }
11188 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetWifiMode(
11189 ::core::default::Default::default(),
11190 ));
11191 };
11192 mut_ref.decode_len_delimited(decoder)?;
11193 }
11194 105u32 => {
11195 let mut_ref = loop {
11196 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11197 if let CtrlMsg_::Payload::ReqScanApList(variant) = &mut *variant {
11198 break &mut *variant;
11199 }
11200 }
11201 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqScanApList(
11202 ::core::default::Default::default(),
11203 ));
11204 };
11205 mut_ref.decode_len_delimited(decoder)?;
11206 }
11207 106u32 => {
11208 let mut_ref = loop {
11209 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11210 if let CtrlMsg_::Payload::ReqGetApConfig(variant) = &mut *variant {
11211 break &mut *variant;
11212 }
11213 }
11214 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetApConfig(
11215 ::core::default::Default::default(),
11216 ));
11217 };
11218 mut_ref.decode_len_delimited(decoder)?;
11219 }
11220 107u32 => {
11221 let mut_ref = loop {
11222 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11223 if let CtrlMsg_::Payload::ReqConnectAp(variant) = &mut *variant {
11224 break &mut *variant;
11225 }
11226 }
11227 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqConnectAp(
11228 ::core::default::Default::default(),
11229 ));
11230 };
11231 mut_ref.decode_len_delimited(decoder)?;
11232 }
11233 108u32 => {
11234 let mut_ref = loop {
11235 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11236 if let CtrlMsg_::Payload::ReqDisconnectAp(variant) = &mut *variant {
11237 break &mut *variant;
11238 }
11239 }
11240 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqDisconnectAp(
11241 ::core::default::Default::default(),
11242 ));
11243 };
11244 mut_ref.decode_len_delimited(decoder)?;
11245 }
11246 109u32 => {
11247 let mut_ref = loop {
11248 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11249 if let CtrlMsg_::Payload::ReqGetSoftapConfig(variant) = &mut *variant {
11250 break &mut *variant;
11251 }
11252 }
11253 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetSoftapConfig(
11254 ::core::default::Default::default(),
11255 ));
11256 };
11257 mut_ref.decode_len_delimited(decoder)?;
11258 }
11259 110u32 => {
11260 let mut_ref = loop {
11261 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11262 if let CtrlMsg_::Payload::ReqSetSoftapVendorSpecificIe(variant) = &mut *variant {
11263 break &mut *variant;
11264 }
11265 }
11266 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetSoftapVendorSpecificIe(
11267 ::core::default::Default::default(),
11268 ));
11269 };
11270 mut_ref.decode_len_delimited(decoder)?;
11271 }
11272 111u32 => {
11273 let mut_ref = loop {
11274 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11275 if let CtrlMsg_::Payload::ReqStartSoftap(variant) = &mut *variant {
11276 break &mut *variant;
11277 }
11278 }
11279 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqStartSoftap(
11280 ::core::default::Default::default(),
11281 ));
11282 };
11283 mut_ref.decode_len_delimited(decoder)?;
11284 }
11285 112u32 => {
11286 let mut_ref = loop {
11287 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11288 if let CtrlMsg_::Payload::ReqSoftapConnectedStasList(variant) = &mut *variant {
11289 break &mut *variant;
11290 }
11291 }
11292 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSoftapConnectedStasList(
11293 ::core::default::Default::default(),
11294 ));
11295 };
11296 mut_ref.decode_len_delimited(decoder)?;
11297 }
11298 113u32 => {
11299 let mut_ref = loop {
11300 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11301 if let CtrlMsg_::Payload::ReqStopSoftap(variant) = &mut *variant {
11302 break &mut *variant;
11303 }
11304 }
11305 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqStopSoftap(
11306 ::core::default::Default::default(),
11307 ));
11308 };
11309 mut_ref.decode_len_delimited(decoder)?;
11310 }
11311 114u32 => {
11312 let mut_ref = loop {
11313 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11314 if let CtrlMsg_::Payload::ReqSetPowerSaveMode(variant) = &mut *variant {
11315 break &mut *variant;
11316 }
11317 }
11318 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetPowerSaveMode(
11319 ::core::default::Default::default(),
11320 ));
11321 };
11322 mut_ref.decode_len_delimited(decoder)?;
11323 }
11324 115u32 => {
11325 let mut_ref = loop {
11326 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11327 if let CtrlMsg_::Payload::ReqGetPowerSaveMode(variant) = &mut *variant {
11328 break &mut *variant;
11329 }
11330 }
11331 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetPowerSaveMode(
11332 ::core::default::Default::default(),
11333 ));
11334 };
11335 mut_ref.decode_len_delimited(decoder)?;
11336 }
11337 116u32 => {
11338 let mut_ref = loop {
11339 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11340 if let CtrlMsg_::Payload::ReqOtaBegin(variant) = &mut *variant {
11341 break &mut *variant;
11342 }
11343 }
11344 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqOtaBegin(
11345 ::core::default::Default::default(),
11346 ));
11347 };
11348 mut_ref.decode_len_delimited(decoder)?;
11349 }
11350 117u32 => {
11351 let mut_ref = loop {
11352 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11353 if let CtrlMsg_::Payload::ReqOtaWrite(variant) = &mut *variant {
11354 break &mut *variant;
11355 }
11356 }
11357 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqOtaWrite(
11358 ::core::default::Default::default(),
11359 ));
11360 };
11361 mut_ref.decode_len_delimited(decoder)?;
11362 }
11363 118u32 => {
11364 let mut_ref = loop {
11365 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11366 if let CtrlMsg_::Payload::ReqOtaEnd(variant) = &mut *variant {
11367 break &mut *variant;
11368 }
11369 }
11370 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqOtaEnd(
11371 ::core::default::Default::default(),
11372 ));
11373 };
11374 mut_ref.decode_len_delimited(decoder)?;
11375 }
11376 119u32 => {
11377 let mut_ref = loop {
11378 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11379 if let CtrlMsg_::Payload::ReqSetWifiMaxTxPower(variant) = &mut *variant {
11380 break &mut *variant;
11381 }
11382 }
11383 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetWifiMaxTxPower(
11384 ::core::default::Default::default(),
11385 ));
11386 };
11387 mut_ref.decode_len_delimited(decoder)?;
11388 }
11389 120u32 => {
11390 let mut_ref = loop {
11391 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11392 if let CtrlMsg_::Payload::ReqGetWifiCurrTxPower(variant) = &mut *variant {
11393 break &mut *variant;
11394 }
11395 }
11396 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetWifiCurrTxPower(
11397 ::core::default::Default::default(),
11398 ));
11399 };
11400 mut_ref.decode_len_delimited(decoder)?;
11401 }
11402 121u32 => {
11403 let mut_ref = loop {
11404 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11405 if let CtrlMsg_::Payload::ReqConfigHeartbeat(variant) = &mut *variant {
11406 break &mut *variant;
11407 }
11408 }
11409 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqConfigHeartbeat(
11410 ::core::default::Default::default(),
11411 ));
11412 };
11413 mut_ref.decode_len_delimited(decoder)?;
11414 }
11415 122u32 => {
11416 let mut_ref = loop {
11417 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11418 if let CtrlMsg_::Payload::ReqEnableDisableFeat(variant) = &mut *variant {
11419 break &mut *variant;
11420 }
11421 }
11422 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqEnableDisableFeat(
11423 ::core::default::Default::default(),
11424 ));
11425 };
11426 mut_ref.decode_len_delimited(decoder)?;
11427 }
11428 123u32 => {
11429 let mut_ref = loop {
11430 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11431 if let CtrlMsg_::Payload::ReqGetFwVersion(variant) = &mut *variant {
11432 break &mut *variant;
11433 }
11434 }
11435 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetFwVersion(
11436 ::core::default::Default::default(),
11437 ));
11438 };
11439 mut_ref.decode_len_delimited(decoder)?;
11440 }
11441 124u32 => {
11442 let mut_ref = loop {
11443 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11444 if let CtrlMsg_::Payload::ReqSetCountryCode(variant) = &mut *variant {
11445 break &mut *variant;
11446 }
11447 }
11448 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetCountryCode(
11449 ::core::default::Default::default(),
11450 ));
11451 };
11452 mut_ref.decode_len_delimited(decoder)?;
11453 }
11454 125u32 => {
11455 let mut_ref = loop {
11456 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11457 if let CtrlMsg_::Payload::ReqGetCountryCode(variant) = &mut *variant {
11458 break &mut *variant;
11459 }
11460 }
11461 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetCountryCode(
11462 ::core::default::Default::default(),
11463 ));
11464 };
11465 mut_ref.decode_len_delimited(decoder)?;
11466 }
11467 126u32 => {
11468 let mut_ref = loop {
11469 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11470 if let CtrlMsg_::Payload::ReqSetDhcpDnsStatus(variant) = &mut *variant {
11471 break &mut *variant;
11472 }
11473 }
11474 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqSetDhcpDnsStatus(
11475 ::core::default::Default::default(),
11476 ));
11477 };
11478 mut_ref.decode_len_delimited(decoder)?;
11479 }
11480 127u32 => {
11481 let mut_ref = loop {
11482 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11483 if let CtrlMsg_::Payload::ReqGetDhcpDnsStatus(variant) = &mut *variant {
11484 break &mut *variant;
11485 }
11486 }
11487 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqGetDhcpDnsStatus(
11488 ::core::default::Default::default(),
11489 ));
11490 };
11491 mut_ref.decode_len_delimited(decoder)?;
11492 }
11493 128u32 => {
11494 let mut_ref = loop {
11495 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11496 if let CtrlMsg_::Payload::ReqCustomRpcUnserialisedMsg(variant) = &mut *variant {
11497 break &mut *variant;
11498 }
11499 }
11500 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::ReqCustomRpcUnserialisedMsg(
11501 ::core::default::Default::default(),
11502 ));
11503 };
11504 mut_ref.decode_len_delimited(decoder)?;
11505 }
11506 201u32 => {
11507 let mut_ref = loop {
11508 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11509 if let CtrlMsg_::Payload::RespGetMacAddress(variant) = &mut *variant {
11510 break &mut *variant;
11511 }
11512 }
11513 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetMacAddress(
11514 ::core::default::Default::default(),
11515 ));
11516 };
11517 mut_ref.decode_len_delimited(decoder)?;
11518 }
11519 202u32 => {
11520 let mut_ref = loop {
11521 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11522 if let CtrlMsg_::Payload::RespSetMacAddress(variant) = &mut *variant {
11523 break &mut *variant;
11524 }
11525 }
11526 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSetMacAddress(
11527 ::core::default::Default::default(),
11528 ));
11529 };
11530 mut_ref.decode_len_delimited(decoder)?;
11531 }
11532 203u32 => {
11533 let mut_ref = loop {
11534 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11535 if let CtrlMsg_::Payload::RespGetWifiMode(variant) = &mut *variant {
11536 break &mut *variant;
11537 }
11538 }
11539 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetWifiMode(
11540 ::core::default::Default::default(),
11541 ));
11542 };
11543 mut_ref.decode_len_delimited(decoder)?;
11544 }
11545 204u32 => {
11546 let mut_ref = loop {
11547 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11548 if let CtrlMsg_::Payload::RespSetWifiMode(variant) = &mut *variant {
11549 break &mut *variant;
11550 }
11551 }
11552 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSetWifiMode(
11553 ::core::default::Default::default(),
11554 ));
11555 };
11556 mut_ref.decode_len_delimited(decoder)?;
11557 }
11558 205u32 => {
11559 let mut_ref = loop {
11560 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11561 if let CtrlMsg_::Payload::RespScanApList(variant) = &mut *variant {
11562 break &mut *variant;
11563 }
11564 }
11565 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespScanApList(
11566 ::core::default::Default::default(),
11567 ));
11568 };
11569 mut_ref.decode_len_delimited(decoder)?;
11570 }
11571 206u32 => {
11572 let mut_ref = loop {
11573 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11574 if let CtrlMsg_::Payload::RespGetApConfig(variant) = &mut *variant {
11575 break &mut *variant;
11576 }
11577 }
11578 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetApConfig(
11579 ::core::default::Default::default(),
11580 ));
11581 };
11582 mut_ref.decode_len_delimited(decoder)?;
11583 }
11584 207u32 => {
11585 let mut_ref = loop {
11586 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11587 if let CtrlMsg_::Payload::RespConnectAp(variant) = &mut *variant {
11588 break &mut *variant;
11589 }
11590 }
11591 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespConnectAp(
11592 ::core::default::Default::default(),
11593 ));
11594 };
11595 mut_ref.decode_len_delimited(decoder)?;
11596 }
11597 208u32 => {
11598 let mut_ref = loop {
11599 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11600 if let CtrlMsg_::Payload::RespDisconnectAp(variant) = &mut *variant {
11601 break &mut *variant;
11602 }
11603 }
11604 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespDisconnectAp(
11605 ::core::default::Default::default(),
11606 ));
11607 };
11608 mut_ref.decode_len_delimited(decoder)?;
11609 }
11610 209u32 => {
11611 let mut_ref = loop {
11612 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11613 if let CtrlMsg_::Payload::RespGetSoftapConfig(variant) = &mut *variant {
11614 break &mut *variant;
11615 }
11616 }
11617 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetSoftapConfig(
11618 ::core::default::Default::default(),
11619 ));
11620 };
11621 mut_ref.decode_len_delimited(decoder)?;
11622 }
11623 210u32 => {
11624 let mut_ref = loop {
11625 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11626 if let CtrlMsg_::Payload::RespSetSoftapVendorSpecificIe(variant) = &mut *variant {
11627 break &mut *variant;
11628 }
11629 }
11630 self.r#payload = ::core::option::Option::Some(
11631 CtrlMsg_::Payload::RespSetSoftapVendorSpecificIe(::core::default::Default::default()),
11632 );
11633 };
11634 mut_ref.decode_len_delimited(decoder)?;
11635 }
11636 211u32 => {
11637 let mut_ref = loop {
11638 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11639 if let CtrlMsg_::Payload::RespStartSoftap(variant) = &mut *variant {
11640 break &mut *variant;
11641 }
11642 }
11643 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespStartSoftap(
11644 ::core::default::Default::default(),
11645 ));
11646 };
11647 mut_ref.decode_len_delimited(decoder)?;
11648 }
11649 212u32 => {
11650 let mut_ref = loop {
11651 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11652 if let CtrlMsg_::Payload::RespSoftapConnectedStasList(variant) = &mut *variant {
11653 break &mut *variant;
11654 }
11655 }
11656 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSoftapConnectedStasList(
11657 ::core::default::Default::default(),
11658 ));
11659 };
11660 mut_ref.decode_len_delimited(decoder)?;
11661 }
11662 213u32 => {
11663 let mut_ref = loop {
11664 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11665 if let CtrlMsg_::Payload::RespStopSoftap(variant) = &mut *variant {
11666 break &mut *variant;
11667 }
11668 }
11669 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespStopSoftap(
11670 ::core::default::Default::default(),
11671 ));
11672 };
11673 mut_ref.decode_len_delimited(decoder)?;
11674 }
11675 214u32 => {
11676 let mut_ref = loop {
11677 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11678 if let CtrlMsg_::Payload::RespSetPowerSaveMode(variant) = &mut *variant {
11679 break &mut *variant;
11680 }
11681 }
11682 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSetPowerSaveMode(
11683 ::core::default::Default::default(),
11684 ));
11685 };
11686 mut_ref.decode_len_delimited(decoder)?;
11687 }
11688 215u32 => {
11689 let mut_ref = loop {
11690 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11691 if let CtrlMsg_::Payload::RespGetPowerSaveMode(variant) = &mut *variant {
11692 break &mut *variant;
11693 }
11694 }
11695 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetPowerSaveMode(
11696 ::core::default::Default::default(),
11697 ));
11698 };
11699 mut_ref.decode_len_delimited(decoder)?;
11700 }
11701 216u32 => {
11702 let mut_ref = loop {
11703 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11704 if let CtrlMsg_::Payload::RespOtaBegin(variant) = &mut *variant {
11705 break &mut *variant;
11706 }
11707 }
11708 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespOtaBegin(
11709 ::core::default::Default::default(),
11710 ));
11711 };
11712 mut_ref.decode_len_delimited(decoder)?;
11713 }
11714 217u32 => {
11715 let mut_ref = loop {
11716 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11717 if let CtrlMsg_::Payload::RespOtaWrite(variant) = &mut *variant {
11718 break &mut *variant;
11719 }
11720 }
11721 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespOtaWrite(
11722 ::core::default::Default::default(),
11723 ));
11724 };
11725 mut_ref.decode_len_delimited(decoder)?;
11726 }
11727 218u32 => {
11728 let mut_ref = loop {
11729 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11730 if let CtrlMsg_::Payload::RespOtaEnd(variant) = &mut *variant {
11731 break &mut *variant;
11732 }
11733 }
11734 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespOtaEnd(
11735 ::core::default::Default::default(),
11736 ));
11737 };
11738 mut_ref.decode_len_delimited(decoder)?;
11739 }
11740 219u32 => {
11741 let mut_ref = loop {
11742 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11743 if let CtrlMsg_::Payload::RespSetWifiMaxTxPower(variant) = &mut *variant {
11744 break &mut *variant;
11745 }
11746 }
11747 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSetWifiMaxTxPower(
11748 ::core::default::Default::default(),
11749 ));
11750 };
11751 mut_ref.decode_len_delimited(decoder)?;
11752 }
11753 220u32 => {
11754 let mut_ref = loop {
11755 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11756 if let CtrlMsg_::Payload::RespGetWifiCurrTxPower(variant) = &mut *variant {
11757 break &mut *variant;
11758 }
11759 }
11760 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetWifiCurrTxPower(
11761 ::core::default::Default::default(),
11762 ));
11763 };
11764 mut_ref.decode_len_delimited(decoder)?;
11765 }
11766 221u32 => {
11767 let mut_ref = loop {
11768 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11769 if let CtrlMsg_::Payload::RespConfigHeartbeat(variant) = &mut *variant {
11770 break &mut *variant;
11771 }
11772 }
11773 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespConfigHeartbeat(
11774 ::core::default::Default::default(),
11775 ));
11776 };
11777 mut_ref.decode_len_delimited(decoder)?;
11778 }
11779 222u32 => {
11780 let mut_ref = loop {
11781 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11782 if let CtrlMsg_::Payload::RespEnableDisableFeat(variant) = &mut *variant {
11783 break &mut *variant;
11784 }
11785 }
11786 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespEnableDisableFeat(
11787 ::core::default::Default::default(),
11788 ));
11789 };
11790 mut_ref.decode_len_delimited(decoder)?;
11791 }
11792 223u32 => {
11793 let mut_ref = loop {
11794 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11795 if let CtrlMsg_::Payload::RespGetFwVersion(variant) = &mut *variant {
11796 break &mut *variant;
11797 }
11798 }
11799 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetFwVersion(
11800 ::core::default::Default::default(),
11801 ));
11802 };
11803 mut_ref.decode_len_delimited(decoder)?;
11804 }
11805 224u32 => {
11806 let mut_ref = loop {
11807 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11808 if let CtrlMsg_::Payload::RespSetCountryCode(variant) = &mut *variant {
11809 break &mut *variant;
11810 }
11811 }
11812 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSetCountryCode(
11813 ::core::default::Default::default(),
11814 ));
11815 };
11816 mut_ref.decode_len_delimited(decoder)?;
11817 }
11818 225u32 => {
11819 let mut_ref = loop {
11820 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11821 if let CtrlMsg_::Payload::RespGetCountryCode(variant) = &mut *variant {
11822 break &mut *variant;
11823 }
11824 }
11825 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetCountryCode(
11826 ::core::default::Default::default(),
11827 ));
11828 };
11829 mut_ref.decode_len_delimited(decoder)?;
11830 }
11831 226u32 => {
11832 let mut_ref = loop {
11833 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11834 if let CtrlMsg_::Payload::RespSetDhcpDnsStatus(variant) = &mut *variant {
11835 break &mut *variant;
11836 }
11837 }
11838 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespSetDhcpDnsStatus(
11839 ::core::default::Default::default(),
11840 ));
11841 };
11842 mut_ref.decode_len_delimited(decoder)?;
11843 }
11844 227u32 => {
11845 let mut_ref = loop {
11846 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11847 if let CtrlMsg_::Payload::RespGetDhcpDnsStatus(variant) = &mut *variant {
11848 break &mut *variant;
11849 }
11850 }
11851 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespGetDhcpDnsStatus(
11852 ::core::default::Default::default(),
11853 ));
11854 };
11855 mut_ref.decode_len_delimited(decoder)?;
11856 }
11857 228u32 => {
11858 let mut_ref = loop {
11859 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11860 if let CtrlMsg_::Payload::RespCustomRpcUnserialisedMsg(variant) = &mut *variant {
11861 break &mut *variant;
11862 }
11863 }
11864 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::RespCustomRpcUnserialisedMsg(
11865 ::core::default::Default::default(),
11866 ));
11867 };
11868 mut_ref.decode_len_delimited(decoder)?;
11869 }
11870 301u32 => {
11871 let mut_ref = loop {
11872 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11873 if let CtrlMsg_::Payload::EventEspInit(variant) = &mut *variant {
11874 break &mut *variant;
11875 }
11876 }
11877 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::EventEspInit(
11878 ::core::default::Default::default(),
11879 ));
11880 };
11881 mut_ref.decode_len_delimited(decoder)?;
11882 }
11883 302u32 => {
11884 let mut_ref = loop {
11885 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11886 if let CtrlMsg_::Payload::EventHeartbeat(variant) = &mut *variant {
11887 break &mut *variant;
11888 }
11889 }
11890 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::EventHeartbeat(
11891 ::core::default::Default::default(),
11892 ));
11893 };
11894 mut_ref.decode_len_delimited(decoder)?;
11895 }
11896 303u32 => {
11897 let mut_ref = loop {
11898 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11899 if let CtrlMsg_::Payload::EventStationDisconnectFromAp(variant) = &mut *variant {
11900 break &mut *variant;
11901 }
11902 }
11903 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::EventStationDisconnectFromAp(
11904 ::core::default::Default::default(),
11905 ));
11906 };
11907 mut_ref.decode_len_delimited(decoder)?;
11908 }
11909 304u32 => {
11910 let mut_ref = loop {
11911 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11912 if let CtrlMsg_::Payload::EventStationDisconnectFromEspSoftAp(variant) = &mut *variant {
11913 break &mut *variant;
11914 }
11915 }
11916 self.r#payload = ::core::option::Option::Some(
11917 CtrlMsg_::Payload::EventStationDisconnectFromEspSoftAp(::core::default::Default::default()),
11918 );
11919 };
11920 mut_ref.decode_len_delimited(decoder)?;
11921 }
11922 305u32 => {
11923 let mut_ref = loop {
11924 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11925 if let CtrlMsg_::Payload::EventStationConnectedToAp(variant) = &mut *variant {
11926 break &mut *variant;
11927 }
11928 }
11929 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::EventStationConnectedToAp(
11930 ::core::default::Default::default(),
11931 ));
11932 };
11933 mut_ref.decode_len_delimited(decoder)?;
11934 }
11935 306u32 => {
11936 let mut_ref = loop {
11937 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11938 if let CtrlMsg_::Payload::EventStationConnectedToEspSoftAp(variant) = &mut *variant {
11939 break &mut *variant;
11940 }
11941 }
11942 self.r#payload = ::core::option::Option::Some(
11943 CtrlMsg_::Payload::EventStationConnectedToEspSoftAp(::core::default::Default::default()),
11944 );
11945 };
11946 mut_ref.decode_len_delimited(decoder)?;
11947 }
11948 307u32 => {
11949 let mut_ref = loop {
11950 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11951 if let CtrlMsg_::Payload::EventSetDhcpDnsStatus(variant) = &mut *variant {
11952 break &mut *variant;
11953 }
11954 }
11955 self.r#payload = ::core::option::Option::Some(CtrlMsg_::Payload::EventSetDhcpDnsStatus(
11956 ::core::default::Default::default(),
11957 ));
11958 };
11959 mut_ref.decode_len_delimited(decoder)?;
11960 }
11961 308u32 => {
11962 let mut_ref = loop {
11963 if let ::core::option::Option::Some(variant) = &mut self.r#payload {
11964 if let CtrlMsg_::Payload::EventCustomRpcUnserialisedMsg(variant) = &mut *variant {
11965 break &mut *variant;
11966 }
11967 }
11968 self.r#payload = ::core::option::Option::Some(
11969 CtrlMsg_::Payload::EventCustomRpcUnserialisedMsg(::core::default::Default::default()),
11970 );
11971 };
11972 mut_ref.decode_len_delimited(decoder)?;
11973 }
11974 _ => {
11975 decoder.skip_wire_value(tag.wire_type())?;
11976 }
11977 }
11978 }
11979 Ok(())
11980 }
11981}
11982impl ::micropb::MessageEncode for CtrlMsg {
11983 const MAX_SIZE: ::core::option::Option<usize> = 'msg: {
11984 let mut max_size = 0;
11985 if let ::core::option::Option::Some(size) =
11986 ::micropb::const_map!(::core::option::Option::Some(CtrlMsgType::_MAX_SIZE), |size| size
11987 + 1usize)
11988 {
11989 max_size += size;
11990 } else {
11991 break 'msg (::core::option::Option::<usize>::None);
11992 };
11993 if let ::core::option::Option::Some(size) =
11994 ::micropb::const_map!(::core::option::Option::Some(CtrlMsgId::_MAX_SIZE), |size| size + 1usize)
11995 {
11996 max_size += size;
11997 } else {
11998 break 'msg (::core::option::Option::<usize>::None);
11999 };
12000 if let ::core::option::Option::Some(size) =
12001 ::micropb::const_map!(::core::option::Option::Some(10usize), |size| size + 1usize)
12002 {
12003 max_size += size;
12004 } else {
12005 break 'msg (::core::option::Option::<usize>::None);
12006 };
12007 if let ::core::option::Option::Some(size) =
12008 ::micropb::const_map!(::core::option::Option::Some(5usize), |size| size + 1usize)
12009 {
12010 max_size += size;
12011 } else {
12012 break 'msg (::core::option::Option::<usize>::None);
12013 };
12014 if let ::core::option::Option::Some(size) = 'oneof: {
12015 let mut max_size = 0;
12016 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12017 ::micropb::const_map!(
12018 <CtrlMsg_Req_GetMacAddress as ::micropb::MessageEncode>::MAX_SIZE,
12019 |size| ::micropb::size::sizeof_len_record(size)
12020 ),
12021 |size| size + 2usize
12022 ) {
12023 if size > max_size {
12024 max_size = size;
12025 }
12026 } else {
12027 break 'oneof (::core::option::Option::<usize>::None);
12028 }
12029 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12030 ::micropb::const_map!(
12031 <CtrlMsg_Req_SetMacAddress as ::micropb::MessageEncode>::MAX_SIZE,
12032 |size| ::micropb::size::sizeof_len_record(size)
12033 ),
12034 |size| size + 2usize
12035 ) {
12036 if size > max_size {
12037 max_size = size;
12038 }
12039 } else {
12040 break 'oneof (::core::option::Option::<usize>::None);
12041 }
12042 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12043 ::micropb::const_map!(<CtrlMsg_Req_GetMode as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12044 ::micropb::size::sizeof_len_record(size)
12045 }),
12046 |size| size + 2usize
12047 ) {
12048 if size > max_size {
12049 max_size = size;
12050 }
12051 } else {
12052 break 'oneof (::core::option::Option::<usize>::None);
12053 }
12054 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12055 ::micropb::const_map!(<CtrlMsg_Req_SetMode as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12056 ::micropb::size::sizeof_len_record(size)
12057 }),
12058 |size| size + 2usize
12059 ) {
12060 if size > max_size {
12061 max_size = size;
12062 }
12063 } else {
12064 break 'oneof (::core::option::Option::<usize>::None);
12065 }
12066 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12067 ::micropb::const_map!(<CtrlMsg_Req_ScanResult as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12068 ::micropb::size::sizeof_len_record(size)
12069 }),
12070 |size| size + 2usize
12071 ) {
12072 if size > max_size {
12073 max_size = size;
12074 }
12075 } else {
12076 break 'oneof (::core::option::Option::<usize>::None);
12077 }
12078 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12079 ::micropb::const_map!(
12080 <CtrlMsg_Req_GetAPConfig as ::micropb::MessageEncode>::MAX_SIZE,
12081 |size| ::micropb::size::sizeof_len_record(size)
12082 ),
12083 |size| size + 2usize
12084 ) {
12085 if size > max_size {
12086 max_size = size;
12087 }
12088 } else {
12089 break 'oneof (::core::option::Option::<usize>::None);
12090 }
12091 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12092 ::micropb::const_map!(<CtrlMsg_Req_ConnectAP as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12093 ::micropb::size::sizeof_len_record(size)
12094 }),
12095 |size| size + 2usize
12096 ) {
12097 if size > max_size {
12098 max_size = size;
12099 }
12100 } else {
12101 break 'oneof (::core::option::Option::<usize>::None);
12102 }
12103 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12104 ::micropb::const_map!(<CtrlMsg_Req_GetStatus as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12105 ::micropb::size::sizeof_len_record(size)
12106 }),
12107 |size| size + 2usize
12108 ) {
12109 if size > max_size {
12110 max_size = size;
12111 }
12112 } else {
12113 break 'oneof (::core::option::Option::<usize>::None);
12114 }
12115 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12116 ::micropb::const_map!(
12117 <CtrlMsg_Req_GetSoftAPConfig as ::micropb::MessageEncode>::MAX_SIZE,
12118 |size| ::micropb::size::sizeof_len_record(size)
12119 ),
12120 |size| size + 2usize
12121 ) {
12122 if size > max_size {
12123 max_size = size;
12124 }
12125 } else {
12126 break 'oneof (::core::option::Option::<usize>::None);
12127 }
12128 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12129 ::micropb::const_map!(
12130 <CtrlMsg_Req_SetSoftAPVendorSpecificIE as ::micropb::MessageEncode>::MAX_SIZE,
12131 |size| ::micropb::size::sizeof_len_record(size)
12132 ),
12133 |size| size + 2usize
12134 ) {
12135 if size > max_size {
12136 max_size = size;
12137 }
12138 } else {
12139 break 'oneof (::core::option::Option::<usize>::None);
12140 }
12141 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12142 ::micropb::const_map!(
12143 <CtrlMsg_Req_StartSoftAP as ::micropb::MessageEncode>::MAX_SIZE,
12144 |size| ::micropb::size::sizeof_len_record(size)
12145 ),
12146 |size| size + 2usize
12147 ) {
12148 if size > max_size {
12149 max_size = size;
12150 }
12151 } else {
12152 break 'oneof (::core::option::Option::<usize>::None);
12153 }
12154 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12155 ::micropb::const_map!(
12156 <CtrlMsg_Req_SoftAPConnectedSTA as ::micropb::MessageEncode>::MAX_SIZE,
12157 |size| ::micropb::size::sizeof_len_record(size)
12158 ),
12159 |size| size + 2usize
12160 ) {
12161 if size > max_size {
12162 max_size = size;
12163 }
12164 } else {
12165 break 'oneof (::core::option::Option::<usize>::None);
12166 }
12167 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12168 ::micropb::const_map!(<CtrlMsg_Req_GetStatus as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12169 ::micropb::size::sizeof_len_record(size)
12170 }),
12171 |size| size + 2usize
12172 ) {
12173 if size > max_size {
12174 max_size = size;
12175 }
12176 } else {
12177 break 'oneof (::core::option::Option::<usize>::None);
12178 }
12179 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12180 ::micropb::const_map!(<CtrlMsg_Req_SetMode as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12181 ::micropb::size::sizeof_len_record(size)
12182 }),
12183 |size| size + 2usize
12184 ) {
12185 if size > max_size {
12186 max_size = size;
12187 }
12188 } else {
12189 break 'oneof (::core::option::Option::<usize>::None);
12190 }
12191 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12192 ::micropb::const_map!(<CtrlMsg_Req_GetMode as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12193 ::micropb::size::sizeof_len_record(size)
12194 }),
12195 |size| size + 2usize
12196 ) {
12197 if size > max_size {
12198 max_size = size;
12199 }
12200 } else {
12201 break 'oneof (::core::option::Option::<usize>::None);
12202 }
12203 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12204 ::micropb::const_map!(<CtrlMsg_Req_OTABegin as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12205 ::micropb::size::sizeof_len_record(size)
12206 }),
12207 |size| size + 2usize
12208 ) {
12209 if size > max_size {
12210 max_size = size;
12211 }
12212 } else {
12213 break 'oneof (::core::option::Option::<usize>::None);
12214 }
12215 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12216 ::micropb::const_map!(<CtrlMsg_Req_OTAWrite as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12217 ::micropb::size::sizeof_len_record(size)
12218 }),
12219 |size| size + 2usize
12220 ) {
12221 if size > max_size {
12222 max_size = size;
12223 }
12224 } else {
12225 break 'oneof (::core::option::Option::<usize>::None);
12226 }
12227 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12228 ::micropb::const_map!(<CtrlMsg_Req_OTAEnd as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12229 ::micropb::size::sizeof_len_record(size)
12230 }),
12231 |size| size + 2usize
12232 ) {
12233 if size > max_size {
12234 max_size = size;
12235 }
12236 } else {
12237 break 'oneof (::core::option::Option::<usize>::None);
12238 }
12239 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12240 ::micropb::const_map!(
12241 <CtrlMsg_Req_SetWifiMaxTxPower as ::micropb::MessageEncode>::MAX_SIZE,
12242 |size| ::micropb::size::sizeof_len_record(size)
12243 ),
12244 |size| size + 2usize
12245 ) {
12246 if size > max_size {
12247 max_size = size;
12248 }
12249 } else {
12250 break 'oneof (::core::option::Option::<usize>::None);
12251 }
12252 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12253 ::micropb::const_map!(
12254 <CtrlMsg_Req_GetWifiCurrTxPower as ::micropb::MessageEncode>::MAX_SIZE,
12255 |size| ::micropb::size::sizeof_len_record(size)
12256 ),
12257 |size| size + 2usize
12258 ) {
12259 if size > max_size {
12260 max_size = size;
12261 }
12262 } else {
12263 break 'oneof (::core::option::Option::<usize>::None);
12264 }
12265 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12266 ::micropb::const_map!(
12267 <CtrlMsg_Req_ConfigHeartbeat as ::micropb::MessageEncode>::MAX_SIZE,
12268 |size| ::micropb::size::sizeof_len_record(size)
12269 ),
12270 |size| size + 2usize
12271 ) {
12272 if size > max_size {
12273 max_size = size;
12274 }
12275 } else {
12276 break 'oneof (::core::option::Option::<usize>::None);
12277 }
12278 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12279 ::micropb::const_map!(
12280 <CtrlMsg_Req_EnableDisable as ::micropb::MessageEncode>::MAX_SIZE,
12281 |size| ::micropb::size::sizeof_len_record(size)
12282 ),
12283 |size| size + 2usize
12284 ) {
12285 if size > max_size {
12286 max_size = size;
12287 }
12288 } else {
12289 break 'oneof (::core::option::Option::<usize>::None);
12290 }
12291 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12292 ::micropb::const_map!(
12293 <CtrlMsg_Req_GetFwVersion as ::micropb::MessageEncode>::MAX_SIZE,
12294 |size| ::micropb::size::sizeof_len_record(size)
12295 ),
12296 |size| size + 2usize
12297 ) {
12298 if size > max_size {
12299 max_size = size;
12300 }
12301 } else {
12302 break 'oneof (::core::option::Option::<usize>::None);
12303 }
12304 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12305 ::micropb::const_map!(
12306 <CtrlMsg_Req_SetCountryCode as ::micropb::MessageEncode>::MAX_SIZE,
12307 |size| ::micropb::size::sizeof_len_record(size)
12308 ),
12309 |size| size + 2usize
12310 ) {
12311 if size > max_size {
12312 max_size = size;
12313 }
12314 } else {
12315 break 'oneof (::core::option::Option::<usize>::None);
12316 }
12317 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12318 ::micropb::const_map!(
12319 <CtrlMsg_Req_GetCountryCode as ::micropb::MessageEncode>::MAX_SIZE,
12320 |size| ::micropb::size::sizeof_len_record(size)
12321 ),
12322 |size| size + 2usize
12323 ) {
12324 if size > max_size {
12325 max_size = size;
12326 }
12327 } else {
12328 break 'oneof (::core::option::Option::<usize>::None);
12329 }
12330 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12331 ::micropb::const_map!(
12332 <CtrlMsg_Req_SetDhcpDnsStatus as ::micropb::MessageEncode>::MAX_SIZE,
12333 |size| ::micropb::size::sizeof_len_record(size)
12334 ),
12335 |size| size + 2usize
12336 ) {
12337 if size > max_size {
12338 max_size = size;
12339 }
12340 } else {
12341 break 'oneof (::core::option::Option::<usize>::None);
12342 }
12343 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12344 ::micropb::const_map!(
12345 <CtrlMsg_Req_GetDhcpDnsStatus as ::micropb::MessageEncode>::MAX_SIZE,
12346 |size| ::micropb::size::sizeof_len_record(size)
12347 ),
12348 |size| size + 2usize
12349 ) {
12350 if size > max_size {
12351 max_size = size;
12352 }
12353 } else {
12354 break 'oneof (::core::option::Option::<usize>::None);
12355 }
12356 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12357 ::micropb::const_map!(
12358 <CtrlMsg_Req_CustomRpcUnserialisedMsg as ::micropb::MessageEncode>::MAX_SIZE,
12359 |size| ::micropb::size::sizeof_len_record(size)
12360 ),
12361 |size| size + 2usize
12362 ) {
12363 if size > max_size {
12364 max_size = size;
12365 }
12366 } else {
12367 break 'oneof (::core::option::Option::<usize>::None);
12368 }
12369 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12370 ::micropb::const_map!(
12371 <CtrlMsg_Resp_GetMacAddress as ::micropb::MessageEncode>::MAX_SIZE,
12372 |size| ::micropb::size::sizeof_len_record(size)
12373 ),
12374 |size| size + 2usize
12375 ) {
12376 if size > max_size {
12377 max_size = size;
12378 }
12379 } else {
12380 break 'oneof (::core::option::Option::<usize>::None);
12381 }
12382 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12383 ::micropb::const_map!(
12384 <CtrlMsg_Resp_SetMacAddress as ::micropb::MessageEncode>::MAX_SIZE,
12385 |size| ::micropb::size::sizeof_len_record(size)
12386 ),
12387 |size| size + 2usize
12388 ) {
12389 if size > max_size {
12390 max_size = size;
12391 }
12392 } else {
12393 break 'oneof (::core::option::Option::<usize>::None);
12394 }
12395 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12396 ::micropb::const_map!(<CtrlMsg_Resp_GetMode as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12397 ::micropb::size::sizeof_len_record(size)
12398 }),
12399 |size| size + 2usize
12400 ) {
12401 if size > max_size {
12402 max_size = size;
12403 }
12404 } else {
12405 break 'oneof (::core::option::Option::<usize>::None);
12406 }
12407 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12408 ::micropb::const_map!(<CtrlMsg_Resp_SetMode as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12409 ::micropb::size::sizeof_len_record(size)
12410 }),
12411 |size| size + 2usize
12412 ) {
12413 if size > max_size {
12414 max_size = size;
12415 }
12416 } else {
12417 break 'oneof (::core::option::Option::<usize>::None);
12418 }
12419 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12420 ::micropb::const_map!(
12421 <CtrlMsg_Resp_ScanResult as ::micropb::MessageEncode>::MAX_SIZE,
12422 |size| ::micropb::size::sizeof_len_record(size)
12423 ),
12424 |size| size + 2usize
12425 ) {
12426 if size > max_size {
12427 max_size = size;
12428 }
12429 } else {
12430 break 'oneof (::core::option::Option::<usize>::None);
12431 }
12432 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12433 ::micropb::const_map!(
12434 <CtrlMsg_Resp_GetAPConfig as ::micropb::MessageEncode>::MAX_SIZE,
12435 |size| ::micropb::size::sizeof_len_record(size)
12436 ),
12437 |size| size + 2usize
12438 ) {
12439 if size > max_size {
12440 max_size = size;
12441 }
12442 } else {
12443 break 'oneof (::core::option::Option::<usize>::None);
12444 }
12445 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12446 ::micropb::const_map!(<CtrlMsg_Resp_ConnectAP as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12447 ::micropb::size::sizeof_len_record(size)
12448 }),
12449 |size| size + 2usize
12450 ) {
12451 if size > max_size {
12452 max_size = size;
12453 }
12454 } else {
12455 break 'oneof (::core::option::Option::<usize>::None);
12456 }
12457 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12458 ::micropb::const_map!(<CtrlMsg_Resp_GetStatus as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12459 ::micropb::size::sizeof_len_record(size)
12460 }),
12461 |size| size + 2usize
12462 ) {
12463 if size > max_size {
12464 max_size = size;
12465 }
12466 } else {
12467 break 'oneof (::core::option::Option::<usize>::None);
12468 }
12469 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12470 ::micropb::const_map!(
12471 <CtrlMsg_Resp_GetSoftAPConfig as ::micropb::MessageEncode>::MAX_SIZE,
12472 |size| ::micropb::size::sizeof_len_record(size)
12473 ),
12474 |size| size + 2usize
12475 ) {
12476 if size > max_size {
12477 max_size = size;
12478 }
12479 } else {
12480 break 'oneof (::core::option::Option::<usize>::None);
12481 }
12482 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12483 ::micropb::const_map!(
12484 <CtrlMsg_Resp_SetSoftAPVendorSpecificIE as ::micropb::MessageEncode>::MAX_SIZE,
12485 |size| ::micropb::size::sizeof_len_record(size)
12486 ),
12487 |size| size + 2usize
12488 ) {
12489 if size > max_size {
12490 max_size = size;
12491 }
12492 } else {
12493 break 'oneof (::core::option::Option::<usize>::None);
12494 }
12495 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12496 ::micropb::const_map!(
12497 <CtrlMsg_Resp_StartSoftAP as ::micropb::MessageEncode>::MAX_SIZE,
12498 |size| ::micropb::size::sizeof_len_record(size)
12499 ),
12500 |size| size + 2usize
12501 ) {
12502 if size > max_size {
12503 max_size = size;
12504 }
12505 } else {
12506 break 'oneof (::core::option::Option::<usize>::None);
12507 }
12508 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12509 ::micropb::const_map!(
12510 <CtrlMsg_Resp_SoftAPConnectedSTA as ::micropb::MessageEncode>::MAX_SIZE,
12511 |size| ::micropb::size::sizeof_len_record(size)
12512 ),
12513 |size| size + 2usize
12514 ) {
12515 if size > max_size {
12516 max_size = size;
12517 }
12518 } else {
12519 break 'oneof (::core::option::Option::<usize>::None);
12520 }
12521 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12522 ::micropb::const_map!(<CtrlMsg_Resp_GetStatus as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12523 ::micropb::size::sizeof_len_record(size)
12524 }),
12525 |size| size + 2usize
12526 ) {
12527 if size > max_size {
12528 max_size = size;
12529 }
12530 } else {
12531 break 'oneof (::core::option::Option::<usize>::None);
12532 }
12533 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12534 ::micropb::const_map!(<CtrlMsg_Resp_SetMode as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12535 ::micropb::size::sizeof_len_record(size)
12536 }),
12537 |size| size + 2usize
12538 ) {
12539 if size > max_size {
12540 max_size = size;
12541 }
12542 } else {
12543 break 'oneof (::core::option::Option::<usize>::None);
12544 }
12545 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12546 ::micropb::const_map!(<CtrlMsg_Resp_GetMode as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12547 ::micropb::size::sizeof_len_record(size)
12548 }),
12549 |size| size + 2usize
12550 ) {
12551 if size > max_size {
12552 max_size = size;
12553 }
12554 } else {
12555 break 'oneof (::core::option::Option::<usize>::None);
12556 }
12557 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12558 ::micropb::const_map!(<CtrlMsg_Resp_OTABegin as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12559 ::micropb::size::sizeof_len_record(size)
12560 }),
12561 |size| size + 2usize
12562 ) {
12563 if size > max_size {
12564 max_size = size;
12565 }
12566 } else {
12567 break 'oneof (::core::option::Option::<usize>::None);
12568 }
12569 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12570 ::micropb::const_map!(<CtrlMsg_Resp_OTAWrite as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12571 ::micropb::size::sizeof_len_record(size)
12572 }),
12573 |size| size + 2usize
12574 ) {
12575 if size > max_size {
12576 max_size = size;
12577 }
12578 } else {
12579 break 'oneof (::core::option::Option::<usize>::None);
12580 }
12581 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12582 ::micropb::const_map!(<CtrlMsg_Resp_OTAEnd as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12583 ::micropb::size::sizeof_len_record(size)
12584 }),
12585 |size| size + 2usize
12586 ) {
12587 if size > max_size {
12588 max_size = size;
12589 }
12590 } else {
12591 break 'oneof (::core::option::Option::<usize>::None);
12592 }
12593 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12594 ::micropb::const_map!(
12595 <CtrlMsg_Resp_SetWifiMaxTxPower as ::micropb::MessageEncode>::MAX_SIZE,
12596 |size| ::micropb::size::sizeof_len_record(size)
12597 ),
12598 |size| size + 2usize
12599 ) {
12600 if size > max_size {
12601 max_size = size;
12602 }
12603 } else {
12604 break 'oneof (::core::option::Option::<usize>::None);
12605 }
12606 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12607 ::micropb::const_map!(
12608 <CtrlMsg_Resp_GetWifiCurrTxPower as ::micropb::MessageEncode>::MAX_SIZE,
12609 |size| ::micropb::size::sizeof_len_record(size)
12610 ),
12611 |size| size + 2usize
12612 ) {
12613 if size > max_size {
12614 max_size = size;
12615 }
12616 } else {
12617 break 'oneof (::core::option::Option::<usize>::None);
12618 }
12619 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12620 ::micropb::const_map!(
12621 <CtrlMsg_Resp_ConfigHeartbeat as ::micropb::MessageEncode>::MAX_SIZE,
12622 |size| ::micropb::size::sizeof_len_record(size)
12623 ),
12624 |size| size + 2usize
12625 ) {
12626 if size > max_size {
12627 max_size = size;
12628 }
12629 } else {
12630 break 'oneof (::core::option::Option::<usize>::None);
12631 }
12632 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12633 ::micropb::const_map!(
12634 <CtrlMsg_Resp_EnableDisable as ::micropb::MessageEncode>::MAX_SIZE,
12635 |size| ::micropb::size::sizeof_len_record(size)
12636 ),
12637 |size| size + 2usize
12638 ) {
12639 if size > max_size {
12640 max_size = size;
12641 }
12642 } else {
12643 break 'oneof (::core::option::Option::<usize>::None);
12644 }
12645 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12646 ::micropb::const_map!(
12647 <CtrlMsg_Resp_GetFwVersion as ::micropb::MessageEncode>::MAX_SIZE,
12648 |size| ::micropb::size::sizeof_len_record(size)
12649 ),
12650 |size| size + 2usize
12651 ) {
12652 if size > max_size {
12653 max_size = size;
12654 }
12655 } else {
12656 break 'oneof (::core::option::Option::<usize>::None);
12657 }
12658 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12659 ::micropb::const_map!(
12660 <CtrlMsg_Resp_SetCountryCode as ::micropb::MessageEncode>::MAX_SIZE,
12661 |size| ::micropb::size::sizeof_len_record(size)
12662 ),
12663 |size| size + 2usize
12664 ) {
12665 if size > max_size {
12666 max_size = size;
12667 }
12668 } else {
12669 break 'oneof (::core::option::Option::<usize>::None);
12670 }
12671 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12672 ::micropb::const_map!(
12673 <CtrlMsg_Resp_GetCountryCode as ::micropb::MessageEncode>::MAX_SIZE,
12674 |size| ::micropb::size::sizeof_len_record(size)
12675 ),
12676 |size| size + 2usize
12677 ) {
12678 if size > max_size {
12679 max_size = size;
12680 }
12681 } else {
12682 break 'oneof (::core::option::Option::<usize>::None);
12683 }
12684 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12685 ::micropb::const_map!(
12686 <CtrlMsg_Resp_SetDhcpDnsStatus as ::micropb::MessageEncode>::MAX_SIZE,
12687 |size| ::micropb::size::sizeof_len_record(size)
12688 ),
12689 |size| size + 2usize
12690 ) {
12691 if size > max_size {
12692 max_size = size;
12693 }
12694 } else {
12695 break 'oneof (::core::option::Option::<usize>::None);
12696 }
12697 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12698 ::micropb::const_map!(
12699 <CtrlMsg_Resp_GetDhcpDnsStatus as ::micropb::MessageEncode>::MAX_SIZE,
12700 |size| ::micropb::size::sizeof_len_record(size)
12701 ),
12702 |size| size + 2usize
12703 ) {
12704 if size > max_size {
12705 max_size = size;
12706 }
12707 } else {
12708 break 'oneof (::core::option::Option::<usize>::None);
12709 }
12710 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12711 ::micropb::const_map!(
12712 <CtrlMsg_Resp_CustomRpcUnserialisedMsg as ::micropb::MessageEncode>::MAX_SIZE,
12713 |size| ::micropb::size::sizeof_len_record(size)
12714 ),
12715 |size| size + 2usize
12716 ) {
12717 if size > max_size {
12718 max_size = size;
12719 }
12720 } else {
12721 break 'oneof (::core::option::Option::<usize>::None);
12722 }
12723 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12724 ::micropb::const_map!(<CtrlMsg_Event_ESPInit as ::micropb::MessageEncode>::MAX_SIZE, |size| {
12725 ::micropb::size::sizeof_len_record(size)
12726 }),
12727 |size| size + 2usize
12728 ) {
12729 if size > max_size {
12730 max_size = size;
12731 }
12732 } else {
12733 break 'oneof (::core::option::Option::<usize>::None);
12734 }
12735 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12736 ::micropb::const_map!(
12737 <CtrlMsg_Event_Heartbeat as ::micropb::MessageEncode>::MAX_SIZE,
12738 |size| ::micropb::size::sizeof_len_record(size)
12739 ),
12740 |size| size + 2usize
12741 ) {
12742 if size > max_size {
12743 max_size = size;
12744 }
12745 } else {
12746 break 'oneof (::core::option::Option::<usize>::None);
12747 }
12748 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12749 ::micropb::const_map!(
12750 <CtrlMsg_Event_StationDisconnectFromAP as ::micropb::MessageEncode>::MAX_SIZE,
12751 |size| ::micropb::size::sizeof_len_record(size)
12752 ),
12753 |size| size + 2usize
12754 ) {
12755 if size > max_size {
12756 max_size = size;
12757 }
12758 } else {
12759 break 'oneof (::core::option::Option::<usize>::None);
12760 }
12761 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12762 ::micropb::const_map!(
12763 <CtrlMsg_Event_StationDisconnectFromESPSoftAP as ::micropb::MessageEncode>::MAX_SIZE,
12764 |size| ::micropb::size::sizeof_len_record(size)
12765 ),
12766 |size| size + 2usize
12767 ) {
12768 if size > max_size {
12769 max_size = size;
12770 }
12771 } else {
12772 break 'oneof (::core::option::Option::<usize>::None);
12773 }
12774 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12775 ::micropb::const_map!(
12776 <CtrlMsg_Event_StationConnectedToAP as ::micropb::MessageEncode>::MAX_SIZE,
12777 |size| ::micropb::size::sizeof_len_record(size)
12778 ),
12779 |size| size + 2usize
12780 ) {
12781 if size > max_size {
12782 max_size = size;
12783 }
12784 } else {
12785 break 'oneof (::core::option::Option::<usize>::None);
12786 }
12787 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12788 ::micropb::const_map!(
12789 <CtrlMsg_Event_StationConnectedToESPSoftAP as ::micropb::MessageEncode>::MAX_SIZE,
12790 |size| ::micropb::size::sizeof_len_record(size)
12791 ),
12792 |size| size + 2usize
12793 ) {
12794 if size > max_size {
12795 max_size = size;
12796 }
12797 } else {
12798 break 'oneof (::core::option::Option::<usize>::None);
12799 }
12800 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12801 ::micropb::const_map!(
12802 <CtrlMsg_Event_SetDhcpDnsStatus as ::micropb::MessageEncode>::MAX_SIZE,
12803 |size| ::micropb::size::sizeof_len_record(size)
12804 ),
12805 |size| size + 2usize
12806 ) {
12807 if size > max_size {
12808 max_size = size;
12809 }
12810 } else {
12811 break 'oneof (::core::option::Option::<usize>::None);
12812 }
12813 if let ::core::option::Option::Some(size) = ::micropb::const_map!(
12814 ::micropb::const_map!(
12815 <CtrlMsg_Event_CustomRpcUnserialisedMsg as ::micropb::MessageEncode>::MAX_SIZE,
12816 |size| ::micropb::size::sizeof_len_record(size)
12817 ),
12818 |size| size + 2usize
12819 ) {
12820 if size > max_size {
12821 max_size = size;
12822 }
12823 } else {
12824 break 'oneof (::core::option::Option::<usize>::None);
12825 }
12826 ::core::option::Option::Some(max_size)
12827 } {
12828 max_size += size;
12829 } else {
12830 break 'msg (::core::option::Option::<usize>::None);
12831 };
12832 ::core::option::Option::Some(max_size)
12833 };
12834 fn encode<IMPL_MICROPB_WRITE: ::micropb::PbWrite>(
12835 &self,
12836 encoder: &mut ::micropb::PbEncoder<IMPL_MICROPB_WRITE>,
12837 ) -> Result<(), IMPL_MICROPB_WRITE::Error> {
12838 use ::micropb::{FieldEncode, PbMap};
12839 {
12840 let val_ref = &self.r#msg_type;
12841 if val_ref.0 != 0 {
12842 encoder.encode_varint32(8u32)?;
12843 encoder.encode_int32(val_ref.0 as _)?;
12844 }
12845 }
12846 {
12847 let val_ref = &self.r#msg_id;
12848 if val_ref.0 != 0 {
12849 encoder.encode_varint32(16u32)?;
12850 encoder.encode_int32(val_ref.0 as _)?;
12851 }
12852 }
12853 {
12854 let val_ref = &self.r#uid;
12855 if *val_ref != 0 {
12856 encoder.encode_varint32(24u32)?;
12857 encoder.encode_int32(*val_ref as _)?;
12858 }
12859 }
12860 {
12861 let val_ref = &self.r#req_resp_type;
12862 if *val_ref != 0 {
12863 encoder.encode_varint32(32u32)?;
12864 encoder.encode_varint32(*val_ref as _)?;
12865 }
12866 }
12867 if let Some(oneof) = &self.r#payload {
12868 match &*oneof {
12869 CtrlMsg_::Payload::ReqGetMacAddress(val_ref) => {
12870 let val_ref = &*val_ref;
12871 encoder.encode_varint32(810u32)?;
12872 val_ref.encode_len_delimited(encoder)?;
12873 }
12874 CtrlMsg_::Payload::ReqSetMacAddress(val_ref) => {
12875 let val_ref = &*val_ref;
12876 encoder.encode_varint32(818u32)?;
12877 val_ref.encode_len_delimited(encoder)?;
12878 }
12879 CtrlMsg_::Payload::ReqGetWifiMode(val_ref) => {
12880 let val_ref = &*val_ref;
12881 encoder.encode_varint32(826u32)?;
12882 val_ref.encode_len_delimited(encoder)?;
12883 }
12884 CtrlMsg_::Payload::ReqSetWifiMode(val_ref) => {
12885 let val_ref = &*val_ref;
12886 encoder.encode_varint32(834u32)?;
12887 val_ref.encode_len_delimited(encoder)?;
12888 }
12889 CtrlMsg_::Payload::ReqScanApList(val_ref) => {
12890 let val_ref = &*val_ref;
12891 encoder.encode_varint32(842u32)?;
12892 val_ref.encode_len_delimited(encoder)?;
12893 }
12894 CtrlMsg_::Payload::ReqGetApConfig(val_ref) => {
12895 let val_ref = &*val_ref;
12896 encoder.encode_varint32(850u32)?;
12897 val_ref.encode_len_delimited(encoder)?;
12898 }
12899 CtrlMsg_::Payload::ReqConnectAp(val_ref) => {
12900 let val_ref = &*val_ref;
12901 encoder.encode_varint32(858u32)?;
12902 val_ref.encode_len_delimited(encoder)?;
12903 }
12904 CtrlMsg_::Payload::ReqDisconnectAp(val_ref) => {
12905 let val_ref = &*val_ref;
12906 encoder.encode_varint32(866u32)?;
12907 val_ref.encode_len_delimited(encoder)?;
12908 }
12909 CtrlMsg_::Payload::ReqGetSoftapConfig(val_ref) => {
12910 let val_ref = &*val_ref;
12911 encoder.encode_varint32(874u32)?;
12912 val_ref.encode_len_delimited(encoder)?;
12913 }
12914 CtrlMsg_::Payload::ReqSetSoftapVendorSpecificIe(val_ref) => {
12915 let val_ref = &*val_ref;
12916 encoder.encode_varint32(882u32)?;
12917 val_ref.encode_len_delimited(encoder)?;
12918 }
12919 CtrlMsg_::Payload::ReqStartSoftap(val_ref) => {
12920 let val_ref = &*val_ref;
12921 encoder.encode_varint32(890u32)?;
12922 val_ref.encode_len_delimited(encoder)?;
12923 }
12924 CtrlMsg_::Payload::ReqSoftapConnectedStasList(val_ref) => {
12925 let val_ref = &*val_ref;
12926 encoder.encode_varint32(898u32)?;
12927 val_ref.encode_len_delimited(encoder)?;
12928 }
12929 CtrlMsg_::Payload::ReqStopSoftap(val_ref) => {
12930 let val_ref = &*val_ref;
12931 encoder.encode_varint32(906u32)?;
12932 val_ref.encode_len_delimited(encoder)?;
12933 }
12934 CtrlMsg_::Payload::ReqSetPowerSaveMode(val_ref) => {
12935 let val_ref = &*val_ref;
12936 encoder.encode_varint32(914u32)?;
12937 val_ref.encode_len_delimited(encoder)?;
12938 }
12939 CtrlMsg_::Payload::ReqGetPowerSaveMode(val_ref) => {
12940 let val_ref = &*val_ref;
12941 encoder.encode_varint32(922u32)?;
12942 val_ref.encode_len_delimited(encoder)?;
12943 }
12944 CtrlMsg_::Payload::ReqOtaBegin(val_ref) => {
12945 let val_ref = &*val_ref;
12946 encoder.encode_varint32(930u32)?;
12947 val_ref.encode_len_delimited(encoder)?;
12948 }
12949 CtrlMsg_::Payload::ReqOtaWrite(val_ref) => {
12950 let val_ref = &*val_ref;
12951 encoder.encode_varint32(938u32)?;
12952 val_ref.encode_len_delimited(encoder)?;
12953 }
12954 CtrlMsg_::Payload::ReqOtaEnd(val_ref) => {
12955 let val_ref = &*val_ref;
12956 encoder.encode_varint32(946u32)?;
12957 val_ref.encode_len_delimited(encoder)?;
12958 }
12959 CtrlMsg_::Payload::ReqSetWifiMaxTxPower(val_ref) => {
12960 let val_ref = &*val_ref;
12961 encoder.encode_varint32(954u32)?;
12962 val_ref.encode_len_delimited(encoder)?;
12963 }
12964 CtrlMsg_::Payload::ReqGetWifiCurrTxPower(val_ref) => {
12965 let val_ref = &*val_ref;
12966 encoder.encode_varint32(962u32)?;
12967 val_ref.encode_len_delimited(encoder)?;
12968 }
12969 CtrlMsg_::Payload::ReqConfigHeartbeat(val_ref) => {
12970 let val_ref = &*val_ref;
12971 encoder.encode_varint32(970u32)?;
12972 val_ref.encode_len_delimited(encoder)?;
12973 }
12974 CtrlMsg_::Payload::ReqEnableDisableFeat(val_ref) => {
12975 let val_ref = &*val_ref;
12976 encoder.encode_varint32(978u32)?;
12977 val_ref.encode_len_delimited(encoder)?;
12978 }
12979 CtrlMsg_::Payload::ReqGetFwVersion(val_ref) => {
12980 let val_ref = &*val_ref;
12981 encoder.encode_varint32(986u32)?;
12982 val_ref.encode_len_delimited(encoder)?;
12983 }
12984 CtrlMsg_::Payload::ReqSetCountryCode(val_ref) => {
12985 let val_ref = &*val_ref;
12986 encoder.encode_varint32(994u32)?;
12987 val_ref.encode_len_delimited(encoder)?;
12988 }
12989 CtrlMsg_::Payload::ReqGetCountryCode(val_ref) => {
12990 let val_ref = &*val_ref;
12991 encoder.encode_varint32(1002u32)?;
12992 val_ref.encode_len_delimited(encoder)?;
12993 }
12994 CtrlMsg_::Payload::ReqSetDhcpDnsStatus(val_ref) => {
12995 let val_ref = &*val_ref;
12996 encoder.encode_varint32(1010u32)?;
12997 val_ref.encode_len_delimited(encoder)?;
12998 }
12999 CtrlMsg_::Payload::ReqGetDhcpDnsStatus(val_ref) => {
13000 let val_ref = &*val_ref;
13001 encoder.encode_varint32(1018u32)?;
13002 val_ref.encode_len_delimited(encoder)?;
13003 }
13004 CtrlMsg_::Payload::ReqCustomRpcUnserialisedMsg(val_ref) => {
13005 let val_ref = &*val_ref;
13006 encoder.encode_varint32(1026u32)?;
13007 val_ref.encode_len_delimited(encoder)?;
13008 }
13009 CtrlMsg_::Payload::RespGetMacAddress(val_ref) => {
13010 let val_ref = &*val_ref;
13011 encoder.encode_varint32(1610u32)?;
13012 val_ref.encode_len_delimited(encoder)?;
13013 }
13014 CtrlMsg_::Payload::RespSetMacAddress(val_ref) => {
13015 let val_ref = &*val_ref;
13016 encoder.encode_varint32(1618u32)?;
13017 val_ref.encode_len_delimited(encoder)?;
13018 }
13019 CtrlMsg_::Payload::RespGetWifiMode(val_ref) => {
13020 let val_ref = &*val_ref;
13021 encoder.encode_varint32(1626u32)?;
13022 val_ref.encode_len_delimited(encoder)?;
13023 }
13024 CtrlMsg_::Payload::RespSetWifiMode(val_ref) => {
13025 let val_ref = &*val_ref;
13026 encoder.encode_varint32(1634u32)?;
13027 val_ref.encode_len_delimited(encoder)?;
13028 }
13029 CtrlMsg_::Payload::RespScanApList(val_ref) => {
13030 let val_ref = &*val_ref;
13031 encoder.encode_varint32(1642u32)?;
13032 val_ref.encode_len_delimited(encoder)?;
13033 }
13034 CtrlMsg_::Payload::RespGetApConfig(val_ref) => {
13035 let val_ref = &*val_ref;
13036 encoder.encode_varint32(1650u32)?;
13037 val_ref.encode_len_delimited(encoder)?;
13038 }
13039 CtrlMsg_::Payload::RespConnectAp(val_ref) => {
13040 let val_ref = &*val_ref;
13041 encoder.encode_varint32(1658u32)?;
13042 val_ref.encode_len_delimited(encoder)?;
13043 }
13044 CtrlMsg_::Payload::RespDisconnectAp(val_ref) => {
13045 let val_ref = &*val_ref;
13046 encoder.encode_varint32(1666u32)?;
13047 val_ref.encode_len_delimited(encoder)?;
13048 }
13049 CtrlMsg_::Payload::RespGetSoftapConfig(val_ref) => {
13050 let val_ref = &*val_ref;
13051 encoder.encode_varint32(1674u32)?;
13052 val_ref.encode_len_delimited(encoder)?;
13053 }
13054 CtrlMsg_::Payload::RespSetSoftapVendorSpecificIe(val_ref) => {
13055 let val_ref = &*val_ref;
13056 encoder.encode_varint32(1682u32)?;
13057 val_ref.encode_len_delimited(encoder)?;
13058 }
13059 CtrlMsg_::Payload::RespStartSoftap(val_ref) => {
13060 let val_ref = &*val_ref;
13061 encoder.encode_varint32(1690u32)?;
13062 val_ref.encode_len_delimited(encoder)?;
13063 }
13064 CtrlMsg_::Payload::RespSoftapConnectedStasList(val_ref) => {
13065 let val_ref = &*val_ref;
13066 encoder.encode_varint32(1698u32)?;
13067 val_ref.encode_len_delimited(encoder)?;
13068 }
13069 CtrlMsg_::Payload::RespStopSoftap(val_ref) => {
13070 let val_ref = &*val_ref;
13071 encoder.encode_varint32(1706u32)?;
13072 val_ref.encode_len_delimited(encoder)?;
13073 }
13074 CtrlMsg_::Payload::RespSetPowerSaveMode(val_ref) => {
13075 let val_ref = &*val_ref;
13076 encoder.encode_varint32(1714u32)?;
13077 val_ref.encode_len_delimited(encoder)?;
13078 }
13079 CtrlMsg_::Payload::RespGetPowerSaveMode(val_ref) => {
13080 let val_ref = &*val_ref;
13081 encoder.encode_varint32(1722u32)?;
13082 val_ref.encode_len_delimited(encoder)?;
13083 }
13084 CtrlMsg_::Payload::RespOtaBegin(val_ref) => {
13085 let val_ref = &*val_ref;
13086 encoder.encode_varint32(1730u32)?;
13087 val_ref.encode_len_delimited(encoder)?;
13088 }
13089 CtrlMsg_::Payload::RespOtaWrite(val_ref) => {
13090 let val_ref = &*val_ref;
13091 encoder.encode_varint32(1738u32)?;
13092 val_ref.encode_len_delimited(encoder)?;
13093 }
13094 CtrlMsg_::Payload::RespOtaEnd(val_ref) => {
13095 let val_ref = &*val_ref;
13096 encoder.encode_varint32(1746u32)?;
13097 val_ref.encode_len_delimited(encoder)?;
13098 }
13099 CtrlMsg_::Payload::RespSetWifiMaxTxPower(val_ref) => {
13100 let val_ref = &*val_ref;
13101 encoder.encode_varint32(1754u32)?;
13102 val_ref.encode_len_delimited(encoder)?;
13103 }
13104 CtrlMsg_::Payload::RespGetWifiCurrTxPower(val_ref) => {
13105 let val_ref = &*val_ref;
13106 encoder.encode_varint32(1762u32)?;
13107 val_ref.encode_len_delimited(encoder)?;
13108 }
13109 CtrlMsg_::Payload::RespConfigHeartbeat(val_ref) => {
13110 let val_ref = &*val_ref;
13111 encoder.encode_varint32(1770u32)?;
13112 val_ref.encode_len_delimited(encoder)?;
13113 }
13114 CtrlMsg_::Payload::RespEnableDisableFeat(val_ref) => {
13115 let val_ref = &*val_ref;
13116 encoder.encode_varint32(1778u32)?;
13117 val_ref.encode_len_delimited(encoder)?;
13118 }
13119 CtrlMsg_::Payload::RespGetFwVersion(val_ref) => {
13120 let val_ref = &*val_ref;
13121 encoder.encode_varint32(1786u32)?;
13122 val_ref.encode_len_delimited(encoder)?;
13123 }
13124 CtrlMsg_::Payload::RespSetCountryCode(val_ref) => {
13125 let val_ref = &*val_ref;
13126 encoder.encode_varint32(1794u32)?;
13127 val_ref.encode_len_delimited(encoder)?;
13128 }
13129 CtrlMsg_::Payload::RespGetCountryCode(val_ref) => {
13130 let val_ref = &*val_ref;
13131 encoder.encode_varint32(1802u32)?;
13132 val_ref.encode_len_delimited(encoder)?;
13133 }
13134 CtrlMsg_::Payload::RespSetDhcpDnsStatus(val_ref) => {
13135 let val_ref = &*val_ref;
13136 encoder.encode_varint32(1810u32)?;
13137 val_ref.encode_len_delimited(encoder)?;
13138 }
13139 CtrlMsg_::Payload::RespGetDhcpDnsStatus(val_ref) => {
13140 let val_ref = &*val_ref;
13141 encoder.encode_varint32(1818u32)?;
13142 val_ref.encode_len_delimited(encoder)?;
13143 }
13144 CtrlMsg_::Payload::RespCustomRpcUnserialisedMsg(val_ref) => {
13145 let val_ref = &*val_ref;
13146 encoder.encode_varint32(1826u32)?;
13147 val_ref.encode_len_delimited(encoder)?;
13148 }
13149 CtrlMsg_::Payload::EventEspInit(val_ref) => {
13150 let val_ref = &*val_ref;
13151 encoder.encode_varint32(2410u32)?;
13152 val_ref.encode_len_delimited(encoder)?;
13153 }
13154 CtrlMsg_::Payload::EventHeartbeat(val_ref) => {
13155 let val_ref = &*val_ref;
13156 encoder.encode_varint32(2418u32)?;
13157 val_ref.encode_len_delimited(encoder)?;
13158 }
13159 CtrlMsg_::Payload::EventStationDisconnectFromAp(val_ref) => {
13160 let val_ref = &*val_ref;
13161 encoder.encode_varint32(2426u32)?;
13162 val_ref.encode_len_delimited(encoder)?;
13163 }
13164 CtrlMsg_::Payload::EventStationDisconnectFromEspSoftAp(val_ref) => {
13165 let val_ref = &*val_ref;
13166 encoder.encode_varint32(2434u32)?;
13167 val_ref.encode_len_delimited(encoder)?;
13168 }
13169 CtrlMsg_::Payload::EventStationConnectedToAp(val_ref) => {
13170 let val_ref = &*val_ref;
13171 encoder.encode_varint32(2442u32)?;
13172 val_ref.encode_len_delimited(encoder)?;
13173 }
13174 CtrlMsg_::Payload::EventStationConnectedToEspSoftAp(val_ref) => {
13175 let val_ref = &*val_ref;
13176 encoder.encode_varint32(2450u32)?;
13177 val_ref.encode_len_delimited(encoder)?;
13178 }
13179 CtrlMsg_::Payload::EventSetDhcpDnsStatus(val_ref) => {
13180 let val_ref = &*val_ref;
13181 encoder.encode_varint32(2458u32)?;
13182 val_ref.encode_len_delimited(encoder)?;
13183 }
13184 CtrlMsg_::Payload::EventCustomRpcUnserialisedMsg(val_ref) => {
13185 let val_ref = &*val_ref;
13186 encoder.encode_varint32(2466u32)?;
13187 val_ref.encode_len_delimited(encoder)?;
13188 }
13189 }
13190 }
13191 Ok(())
13192 }
13193 fn compute_size(&self) -> usize {
13194 use ::micropb::{FieldEncode, PbMap};
13195 let mut size = 0;
13196 {
13197 let val_ref = &self.r#msg_type;
13198 if val_ref.0 != 0 {
13199 size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _);
13200 }
13201 }
13202 {
13203 let val_ref = &self.r#msg_id;
13204 if val_ref.0 != 0 {
13205 size += 1usize + ::micropb::size::sizeof_int32(val_ref.0 as _);
13206 }
13207 }
13208 {
13209 let val_ref = &self.r#uid;
13210 if *val_ref != 0 {
13211 size += 1usize + ::micropb::size::sizeof_int32(*val_ref as _);
13212 }
13213 }
13214 {
13215 let val_ref = &self.r#req_resp_type;
13216 if *val_ref != 0 {
13217 size += 1usize + ::micropb::size::sizeof_varint32(*val_ref as _);
13218 }
13219 }
13220 if let Some(oneof) = &self.r#payload {
13221 match &*oneof {
13222 CtrlMsg_::Payload::ReqGetMacAddress(val_ref) => {
13223 let val_ref = &*val_ref;
13224 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13225 }
13226 CtrlMsg_::Payload::ReqSetMacAddress(val_ref) => {
13227 let val_ref = &*val_ref;
13228 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13229 }
13230 CtrlMsg_::Payload::ReqGetWifiMode(val_ref) => {
13231 let val_ref = &*val_ref;
13232 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13233 }
13234 CtrlMsg_::Payload::ReqSetWifiMode(val_ref) => {
13235 let val_ref = &*val_ref;
13236 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13237 }
13238 CtrlMsg_::Payload::ReqScanApList(val_ref) => {
13239 let val_ref = &*val_ref;
13240 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13241 }
13242 CtrlMsg_::Payload::ReqGetApConfig(val_ref) => {
13243 let val_ref = &*val_ref;
13244 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13245 }
13246 CtrlMsg_::Payload::ReqConnectAp(val_ref) => {
13247 let val_ref = &*val_ref;
13248 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13249 }
13250 CtrlMsg_::Payload::ReqDisconnectAp(val_ref) => {
13251 let val_ref = &*val_ref;
13252 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13253 }
13254 CtrlMsg_::Payload::ReqGetSoftapConfig(val_ref) => {
13255 let val_ref = &*val_ref;
13256 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13257 }
13258 CtrlMsg_::Payload::ReqSetSoftapVendorSpecificIe(val_ref) => {
13259 let val_ref = &*val_ref;
13260 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13261 }
13262 CtrlMsg_::Payload::ReqStartSoftap(val_ref) => {
13263 let val_ref = &*val_ref;
13264 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13265 }
13266 CtrlMsg_::Payload::ReqSoftapConnectedStasList(val_ref) => {
13267 let val_ref = &*val_ref;
13268 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13269 }
13270 CtrlMsg_::Payload::ReqStopSoftap(val_ref) => {
13271 let val_ref = &*val_ref;
13272 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13273 }
13274 CtrlMsg_::Payload::ReqSetPowerSaveMode(val_ref) => {
13275 let val_ref = &*val_ref;
13276 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13277 }
13278 CtrlMsg_::Payload::ReqGetPowerSaveMode(val_ref) => {
13279 let val_ref = &*val_ref;
13280 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13281 }
13282 CtrlMsg_::Payload::ReqOtaBegin(val_ref) => {
13283 let val_ref = &*val_ref;
13284 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13285 }
13286 CtrlMsg_::Payload::ReqOtaWrite(val_ref) => {
13287 let val_ref = &*val_ref;
13288 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13289 }
13290 CtrlMsg_::Payload::ReqOtaEnd(val_ref) => {
13291 let val_ref = &*val_ref;
13292 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13293 }
13294 CtrlMsg_::Payload::ReqSetWifiMaxTxPower(val_ref) => {
13295 let val_ref = &*val_ref;
13296 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13297 }
13298 CtrlMsg_::Payload::ReqGetWifiCurrTxPower(val_ref) => {
13299 let val_ref = &*val_ref;
13300 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13301 }
13302 CtrlMsg_::Payload::ReqConfigHeartbeat(val_ref) => {
13303 let val_ref = &*val_ref;
13304 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13305 }
13306 CtrlMsg_::Payload::ReqEnableDisableFeat(val_ref) => {
13307 let val_ref = &*val_ref;
13308 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13309 }
13310 CtrlMsg_::Payload::ReqGetFwVersion(val_ref) => {
13311 let val_ref = &*val_ref;
13312 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13313 }
13314 CtrlMsg_::Payload::ReqSetCountryCode(val_ref) => {
13315 let val_ref = &*val_ref;
13316 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13317 }
13318 CtrlMsg_::Payload::ReqGetCountryCode(val_ref) => {
13319 let val_ref = &*val_ref;
13320 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13321 }
13322 CtrlMsg_::Payload::ReqSetDhcpDnsStatus(val_ref) => {
13323 let val_ref = &*val_ref;
13324 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13325 }
13326 CtrlMsg_::Payload::ReqGetDhcpDnsStatus(val_ref) => {
13327 let val_ref = &*val_ref;
13328 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13329 }
13330 CtrlMsg_::Payload::ReqCustomRpcUnserialisedMsg(val_ref) => {
13331 let val_ref = &*val_ref;
13332 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13333 }
13334 CtrlMsg_::Payload::RespGetMacAddress(val_ref) => {
13335 let val_ref = &*val_ref;
13336 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13337 }
13338 CtrlMsg_::Payload::RespSetMacAddress(val_ref) => {
13339 let val_ref = &*val_ref;
13340 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13341 }
13342 CtrlMsg_::Payload::RespGetWifiMode(val_ref) => {
13343 let val_ref = &*val_ref;
13344 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13345 }
13346 CtrlMsg_::Payload::RespSetWifiMode(val_ref) => {
13347 let val_ref = &*val_ref;
13348 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13349 }
13350 CtrlMsg_::Payload::RespScanApList(val_ref) => {
13351 let val_ref = &*val_ref;
13352 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13353 }
13354 CtrlMsg_::Payload::RespGetApConfig(val_ref) => {
13355 let val_ref = &*val_ref;
13356 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13357 }
13358 CtrlMsg_::Payload::RespConnectAp(val_ref) => {
13359 let val_ref = &*val_ref;
13360 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13361 }
13362 CtrlMsg_::Payload::RespDisconnectAp(val_ref) => {
13363 let val_ref = &*val_ref;
13364 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13365 }
13366 CtrlMsg_::Payload::RespGetSoftapConfig(val_ref) => {
13367 let val_ref = &*val_ref;
13368 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13369 }
13370 CtrlMsg_::Payload::RespSetSoftapVendorSpecificIe(val_ref) => {
13371 let val_ref = &*val_ref;
13372 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13373 }
13374 CtrlMsg_::Payload::RespStartSoftap(val_ref) => {
13375 let val_ref = &*val_ref;
13376 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13377 }
13378 CtrlMsg_::Payload::RespSoftapConnectedStasList(val_ref) => {
13379 let val_ref = &*val_ref;
13380 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13381 }
13382 CtrlMsg_::Payload::RespStopSoftap(val_ref) => {
13383 let val_ref = &*val_ref;
13384 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13385 }
13386 CtrlMsg_::Payload::RespSetPowerSaveMode(val_ref) => {
13387 let val_ref = &*val_ref;
13388 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13389 }
13390 CtrlMsg_::Payload::RespGetPowerSaveMode(val_ref) => {
13391 let val_ref = &*val_ref;
13392 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13393 }
13394 CtrlMsg_::Payload::RespOtaBegin(val_ref) => {
13395 let val_ref = &*val_ref;
13396 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13397 }
13398 CtrlMsg_::Payload::RespOtaWrite(val_ref) => {
13399 let val_ref = &*val_ref;
13400 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13401 }
13402 CtrlMsg_::Payload::RespOtaEnd(val_ref) => {
13403 let val_ref = &*val_ref;
13404 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13405 }
13406 CtrlMsg_::Payload::RespSetWifiMaxTxPower(val_ref) => {
13407 let val_ref = &*val_ref;
13408 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13409 }
13410 CtrlMsg_::Payload::RespGetWifiCurrTxPower(val_ref) => {
13411 let val_ref = &*val_ref;
13412 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13413 }
13414 CtrlMsg_::Payload::RespConfigHeartbeat(val_ref) => {
13415 let val_ref = &*val_ref;
13416 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13417 }
13418 CtrlMsg_::Payload::RespEnableDisableFeat(val_ref) => {
13419 let val_ref = &*val_ref;
13420 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13421 }
13422 CtrlMsg_::Payload::RespGetFwVersion(val_ref) => {
13423 let val_ref = &*val_ref;
13424 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13425 }
13426 CtrlMsg_::Payload::RespSetCountryCode(val_ref) => {
13427 let val_ref = &*val_ref;
13428 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13429 }
13430 CtrlMsg_::Payload::RespGetCountryCode(val_ref) => {
13431 let val_ref = &*val_ref;
13432 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13433 }
13434 CtrlMsg_::Payload::RespSetDhcpDnsStatus(val_ref) => {
13435 let val_ref = &*val_ref;
13436 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13437 }
13438 CtrlMsg_::Payload::RespGetDhcpDnsStatus(val_ref) => {
13439 let val_ref = &*val_ref;
13440 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13441 }
13442 CtrlMsg_::Payload::RespCustomRpcUnserialisedMsg(val_ref) => {
13443 let val_ref = &*val_ref;
13444 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13445 }
13446 CtrlMsg_::Payload::EventEspInit(val_ref) => {
13447 let val_ref = &*val_ref;
13448 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13449 }
13450 CtrlMsg_::Payload::EventHeartbeat(val_ref) => {
13451 let val_ref = &*val_ref;
13452 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13453 }
13454 CtrlMsg_::Payload::EventStationDisconnectFromAp(val_ref) => {
13455 let val_ref = &*val_ref;
13456 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13457 }
13458 CtrlMsg_::Payload::EventStationDisconnectFromEspSoftAp(val_ref) => {
13459 let val_ref = &*val_ref;
13460 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13461 }
13462 CtrlMsg_::Payload::EventStationConnectedToAp(val_ref) => {
13463 let val_ref = &*val_ref;
13464 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13465 }
13466 CtrlMsg_::Payload::EventStationConnectedToEspSoftAp(val_ref) => {
13467 let val_ref = &*val_ref;
13468 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13469 }
13470 CtrlMsg_::Payload::EventSetDhcpDnsStatus(val_ref) => {
13471 let val_ref = &*val_ref;
13472 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13473 }
13474 CtrlMsg_::Payload::EventCustomRpcUnserialisedMsg(val_ref) => {
13475 let val_ref = &*val_ref;
13476 size += 2usize + ::micropb::size::sizeof_len_record(val_ref.compute_size());
13477 }
13478 }
13479 }
13480 size
13481 }
13482}
13483#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
13484#[repr(transparent)]
13485#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13486pub struct Ctrl_VendorIEType(pub i32);
13487impl Ctrl_VendorIEType {
13488 pub const _MAX_SIZE: usize = 10usize;
13489 pub const Beacon: Self = Self(0);
13490 pub const ProbeReq: Self = Self(1);
13491 pub const ProbeResp: Self = Self(2);
13492 pub const AssocReq: Self = Self(3);
13493 pub const AssocResp: Self = Self(4);
13494}
13495impl core::default::Default for Ctrl_VendorIEType {
13496 fn default() -> Self {
13497 Self(0)
13498 }
13499}
13500impl core::convert::From<i32> for Ctrl_VendorIEType {
13501 fn from(val: i32) -> Self {
13502 Self(val)
13503 }
13504}
13505#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
13506#[repr(transparent)]
13507#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13508pub struct Ctrl_VendorIEID(pub i32);
13509impl Ctrl_VendorIEID {
13510 pub const _MAX_SIZE: usize = 10usize;
13511 pub const Id0: Self = Self(0);
13512 pub const Id1: Self = Self(1);
13513}
13514impl core::default::Default for Ctrl_VendorIEID {
13515 fn default() -> Self {
13516 Self(0)
13517 }
13518}
13519impl core::convert::From<i32> for Ctrl_VendorIEID {
13520 fn from(val: i32) -> Self {
13521 Self(val)
13522 }
13523}
13524#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
13525#[repr(transparent)]
13526#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13527pub struct Ctrl_WifiMode(pub i32);
13528impl Ctrl_WifiMode {
13529 pub const _MAX_SIZE: usize = 10usize;
13530 pub const None: Self = Self(0);
13531 pub const Sta: Self = Self(1);
13532 pub const Ap: Self = Self(2);
13533 pub const Apsta: Self = Self(3);
13534}
13535impl core::default::Default for Ctrl_WifiMode {
13536 fn default() -> Self {
13537 Self(0)
13538 }
13539}
13540impl core::convert::From<i32> for Ctrl_WifiMode {
13541 fn from(val: i32) -> Self {
13542 Self(val)
13543 }
13544}
13545#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
13546#[repr(transparent)]
13547#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13548pub struct Ctrl_WifiBw(pub i32);
13549impl Ctrl_WifiBw {
13550 pub const _MAX_SIZE: usize = 10usize;
13551 pub const BwInvalid: Self = Self(0);
13552 pub const Ht20: Self = Self(1);
13553 pub const Ht40: Self = Self(2);
13554}
13555impl core::default::Default for Ctrl_WifiBw {
13556 fn default() -> Self {
13557 Self(0)
13558 }
13559}
13560impl core::convert::From<i32> for Ctrl_WifiBw {
13561 fn from(val: i32) -> Self {
13562 Self(val)
13563 }
13564}
13565#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
13566#[repr(transparent)]
13567#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13568pub struct Ctrl_WifiPowerSave(pub i32);
13569impl Ctrl_WifiPowerSave {
13570 pub const _MAX_SIZE: usize = 10usize;
13571 pub const NoPs: Self = Self(0);
13572 pub const MinModem: Self = Self(1);
13573 pub const MaxModem: Self = Self(2);
13574 pub const PsInvalid: Self = Self(3);
13575}
13576impl core::default::Default for Ctrl_WifiPowerSave {
13577 fn default() -> Self {
13578 Self(0)
13579 }
13580}
13581impl core::convert::From<i32> for Ctrl_WifiPowerSave {
13582 fn from(val: i32) -> Self {
13583 Self(val)
13584 }
13585}
13586#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
13587#[repr(transparent)]
13588#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13589pub struct Ctrl_WifiSecProt(pub i32);
13590impl Ctrl_WifiSecProt {
13591 pub const _MAX_SIZE: usize = 10usize;
13592 pub const Open: Self = Self(0);
13593 pub const Wep: Self = Self(1);
13594 pub const WpaPsk: Self = Self(2);
13595 pub const Wpa2Psk: Self = Self(3);
13596 pub const WpaWpa2Psk: Self = Self(4);
13597 pub const Wpa2Enterprise: Self = Self(5);
13598 pub const Wpa3Psk: Self = Self(6);
13599 pub const Wpa2Wpa3Psk: Self = Self(7);
13600}
13601impl core::default::Default for Ctrl_WifiSecProt {
13602 fn default() -> Self {
13603 Self(0)
13604 }
13605}
13606impl core::convert::From<i32> for Ctrl_WifiSecProt {
13607 fn from(val: i32) -> Self {
13608 Self(val)
13609 }
13610}
13611#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
13612#[repr(transparent)]
13613#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13614pub struct Ctrl_Status(pub i32);
13615impl Ctrl_Status {
13616 pub const _MAX_SIZE: usize = 10usize;
13617 pub const Connected: Self = Self(0);
13618 pub const NotConnected: Self = Self(1);
13619 pub const NoApFound: Self = Self(2);
13620 pub const ConnectionFail: Self = Self(3);
13621 pub const InvalidArgument: Self = Self(4);
13622 pub const OutOfRange: Self = Self(5);
13623}
13624impl core::default::Default for Ctrl_Status {
13625 fn default() -> Self {
13626 Self(0)
13627 }
13628}
13629impl core::convert::From<i32> for Ctrl_Status {
13630 fn from(val: i32) -> Self {
13631 Self(val)
13632 }
13633}
13634#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
13635#[repr(transparent)]
13636#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13637pub struct CtrlMsgType(pub i32);
13638impl CtrlMsgType {
13639 pub const _MAX_SIZE: usize = 10usize;
13640 pub const MsgTypeInvalid: Self = Self(0);
13641 pub const Req: Self = Self(1);
13642 pub const Resp: Self = Self(2);
13643 pub const Event: Self = Self(3);
13644 pub const MsgTypeMax: Self = Self(4);
13645}
13646impl core::default::Default for CtrlMsgType {
13647 fn default() -> Self {
13648 Self(0)
13649 }
13650}
13651impl core::convert::From<i32> for CtrlMsgType {
13652 fn from(val: i32) -> Self {
13653 Self(val)
13654 }
13655}
13656#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
13657#[repr(transparent)]
13658#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13659pub struct CtrlMsgId(pub i32);
13660impl CtrlMsgId {
13661 pub const _MAX_SIZE: usize = 10usize;
13662 pub const MsgIdInvalid: Self = Self(0);
13663 pub const ReqBase: Self = Self(100);
13664 pub const ReqGetMacAddress: Self = Self(101);
13665 pub const ReqSetMacAddress: Self = Self(102);
13666 pub const ReqGetWifiMode: Self = Self(103);
13667 pub const ReqSetWifiMode: Self = Self(104);
13668 pub const ReqGetApScanList: Self = Self(105);
13669 pub const ReqGetApConfig: Self = Self(106);
13670 pub const ReqConnectAp: Self = Self(107);
13671 pub const ReqDisconnectAp: Self = Self(108);
13672 pub const ReqGetSoftApConfig: Self = Self(109);
13673 pub const ReqSetSoftApVendorSpecificIe: Self = Self(110);
13674 pub const ReqStartSoftAp: Self = Self(111);
13675 pub const ReqGetSoftApConnectedStaList: Self = Self(112);
13676 pub const ReqStopSoftAp: Self = Self(113);
13677 pub const ReqSetPowerSaveMode: Self = Self(114);
13678 pub const ReqGetPowerSaveMode: Self = Self(115);
13679 pub const ReqOtaBegin: Self = Self(116);
13680 pub const ReqOtaWrite: Self = Self(117);
13681 pub const ReqOtaEnd: Self = Self(118);
13682 pub const ReqSetWifiMaxTxPower: Self = Self(119);
13683 pub const ReqGetWifiCurrTxPower: Self = Self(120);
13684 pub const ReqConfigHeartbeat: Self = Self(121);
13685 pub const ReqEnableDisable: Self = Self(122);
13686 pub const ReqGetFwVersion: Self = Self(123);
13687 pub const ReqSetCountryCode: Self = Self(124);
13688 pub const ReqGetCountryCode: Self = Self(125);
13689 pub const ReqSetDhcpDnsStatus: Self = Self(126);
13690 pub const ReqGetDhcpDnsStatus: Self = Self(127);
13691 pub const ReqCustomRpcUnserialisedMsg: Self = Self(128);
13692 pub const ReqMax: Self = Self(129);
13693 pub const RespBase: Self = Self(200);
13694 pub const RespGetMacAddress: Self = Self(201);
13695 pub const RespSetMacAddress: Self = Self(202);
13696 pub const RespGetWifiMode: Self = Self(203);
13697 pub const RespSetWifiMode: Self = Self(204);
13698 pub const RespGetApScanList: Self = Self(205);
13699 pub const RespGetApConfig: Self = Self(206);
13700 pub const RespConnectAp: Self = Self(207);
13701 pub const RespDisconnectAp: Self = Self(208);
13702 pub const RespGetSoftApConfig: Self = Self(209);
13703 pub const RespSetSoftApVendorSpecificIe: Self = Self(210);
13704 pub const RespStartSoftAp: Self = Self(211);
13705 pub const RespGetSoftApConnectedStaList: Self = Self(212);
13706 pub const RespStopSoftAp: Self = Self(213);
13707 pub const RespSetPowerSaveMode: Self = Self(214);
13708 pub const RespGetPowerSaveMode: Self = Self(215);
13709 pub const RespOtaBegin: Self = Self(216);
13710 pub const RespOtaWrite: Self = Self(217);
13711 pub const RespOtaEnd: Self = Self(218);
13712 pub const RespSetWifiMaxTxPower: Self = Self(219);
13713 pub const RespGetWifiCurrTxPower: Self = Self(220);
13714 pub const RespConfigHeartbeat: Self = Self(221);
13715 pub const RespEnableDisable: Self = Self(222);
13716 pub const RespGetFwVersion: Self = Self(223);
13717 pub const RespSetCountryCode: Self = Self(224);
13718 pub const RespGetCountryCode: Self = Self(225);
13719 pub const RespSetDhcpDnsStatus: Self = Self(226);
13720 pub const RespGetDhcpDnsStatus: Self = Self(227);
13721 pub const RespCustomRpcUnserialisedMsg: Self = Self(228);
13722 pub const RespMax: Self = Self(229);
13723 pub const EventBase: Self = Self(300);
13724 pub const EventEspInit: Self = Self(301);
13725 pub const EventHeartbeat: Self = Self(302);
13726 pub const EventStationDisconnectFromAp: Self = Self(303);
13727 pub const EventStationDisconnectFromEspSoftAp: Self = Self(304);
13728 pub const EventStationConnectedToAp: Self = Self(305);
13729 pub const EventStationConnectedToEspSoftAp: Self = Self(306);
13730 pub const EventSetDhcpDnsStatus: Self = Self(307);
13731 pub const EventCustomRpcUnserialisedMsg: Self = Self(308);
13732 pub const EventMax: Self = Self(309);
13733}
13734impl core::default::Default for CtrlMsgId {
13735 fn default() -> Self {
13736 Self(0)
13737 }
13738}
13739impl core::convert::From<i32> for CtrlMsgId {
13740 fn from(val: i32) -> Self {
13741 Self(val)
13742 }
13743}
13744#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
13745#[repr(transparent)]
13746#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13747pub struct HostedFeature(pub i32);
13748impl HostedFeature {
13749 pub const _MAX_SIZE: usize = 10usize;
13750 pub const HostedInvalidFeature: Self = Self(0);
13751 pub const HostedWifi: Self = Self(1);
13752 pub const HostedBluetooth: Self = Self(2);
13753 pub const HostedIsNetworkSplitOn: Self = Self(3);
13754}
13755impl core::default::Default for HostedFeature {
13756 fn default() -> Self {
13757 Self(0)
13758 }
13759}
13760impl core::convert::From<i32> for HostedFeature {
13761 fn from(val: i32) -> Self {
13762 Self(val)
13763 }
656} 13764}