1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const WLAN_MAC_MAX_RATES: u32 = 263;
12
13bitflags! {
14 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
15 pub struct WlanRxInfoFlags: u32 {
16 const FCS_INVALID = 1;
18 const FRAME_BODY_PADDING_4 = 2;
20 }
21}
22
23impl WlanRxInfoFlags {
24 #[inline(always)]
25 pub fn from_bits_allow_unknown(bits: u32) -> Self {
26 Self::from_bits_retain(bits)
27 }
28
29 #[inline(always)]
30 pub fn has_unknown_bits(&self) -> bool {
31 self.get_unknown_bits() != 0
32 }
33
34 #[inline(always)]
35 pub fn get_unknown_bits(&self) -> u32 {
36 self.bits() & !Self::all().bits()
37 }
38}
39
40bitflags! {
41 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
42 pub struct WlanRxInfoValid: u32 {
43 const PHY = 1;
44 const DATA_RATE = 2;
45 const CHAN_WIDTH = 4;
46 const MCS = 8;
47 const RSSI = 16;
48 const SNR = 32;
49 }
50}
51
52impl WlanRxInfoValid {
53 #[inline(always)]
54 pub fn from_bits_allow_unknown(bits: u32) -> Self {
55 Self::from_bits_retain(bits)
56 }
57
58 #[inline(always)]
59 pub fn has_unknown_bits(&self) -> bool {
60 self.get_unknown_bits() != 0
61 }
62
63 #[inline(always)]
64 pub fn get_unknown_bits(&self) -> u32 {
65 self.bits() & !Self::all().bits()
66 }
67}
68
69bitflags! {
70 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
71 pub struct WlanTxInfoFlags: u32 {
72 const PROTECTED = 1;
74 const FAVOR_RELIABILITY = 2;
77 const QOS = 4;
79 }
80}
81
82impl WlanTxInfoFlags {
83 #[inline(always)]
84 pub fn from_bits_allow_unknown(bits: u32) -> Self {
85 Self::from_bits_retain(bits)
86 }
87
88 #[inline(always)]
89 pub fn has_unknown_bits(&self) -> bool {
90 self.get_unknown_bits() != 0
91 }
92
93 #[inline(always)]
94 pub fn get_unknown_bits(&self) -> u32 {
95 self.bits() & !Self::all().bits()
96 }
97}
98
99bitflags! {
100 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
101 pub struct WlanTxInfoValid: u32 {
102 const DATA_RATE = 1;
103 const TX_VECTOR_IDX = 2;
104 const PHY = 4;
105 const CHANNEL_BANDWIDTH = 8;
106 const MCS = 16;
107 }
108}
109
110impl WlanTxInfoValid {
111 #[inline(always)]
112 pub fn from_bits_allow_unknown(bits: u32) -> Self {
113 Self::from_bits_retain(bits)
114 }
115
116 #[inline(always)]
117 pub fn has_unknown_bits(&self) -> bool {
118 self.get_unknown_bits() != 0
119 }
120
121 #[inline(always)]
122 pub fn get_unknown_bits(&self) -> u32 {
123 self.bits() & !Self::all().bits()
124 }
125}
126
127#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
128#[repr(u8)]
129pub enum WlanProtection {
130 None = 0,
131 Rx = 1,
132 Tx = 2,
133 RxTx = 3,
134}
135
136impl WlanProtection {
137 #[inline]
138 pub fn from_primitive(prim: u8) -> Option<Self> {
139 match prim {
140 0 => Some(Self::None),
141 1 => Some(Self::Rx),
142 2 => Some(Self::Tx),
143 3 => Some(Self::RxTx),
144 _ => None,
145 }
146 }
147
148 #[inline]
149 pub const fn into_primitive(self) -> u8 {
150 self as u8
151 }
152}
153
154#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
157pub struct DiscoverySupport {
158 pub scan_offload: ScanOffloadExtension,
159 pub probe_response_offload: ProbeResponseOffloadExtension,
160}
161
162impl fidl::Persistable for DiscoverySupport {}
163
164#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
168pub struct ProbeResponseOffloadExtension {
169 pub supported: bool,
171}
172
173impl fidl::Persistable for ProbeResponseOffloadExtension {}
174
175#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
179pub struct ScanOffloadExtension {
180 pub supported: bool,
182 pub scan_cancel_supported: bool,
183}
184
185impl fidl::Persistable for ScanOffloadExtension {}
186
187#[derive(Clone, Debug, PartialEq)]
188pub struct WlanRxInfo {
189 pub rx_flags: WlanRxInfoFlags,
192 pub valid_fields: WlanRxInfoValid,
195 pub phy: fidl_fuchsia_wlan_common__common::WlanPhyType,
197 pub data_rate: u32,
199 pub channel: fidl_fuchsia_wlan_ieee80211__common::WlanChannel,
200 pub mcs: u8,
203 pub rssi_dbm: i8,
205 pub snr_dbh: i16,
207}
208
209impl fidl::Persistable for WlanRxInfo {}
210
211#[derive(Clone, Debug, PartialEq)]
212pub struct WlanRxPacket {
213 pub mac_frame: Vec<u8>,
214 pub info: WlanRxInfo,
215}
216
217impl fidl::Persistable for WlanRxPacket {}
218
219#[derive(Clone, Debug, PartialEq)]
220pub struct WlanSoftmacBaseJoinBssRequest {
221 pub join_request: fidl_fuchsia_wlan_common__common::JoinBssRequest,
222}
223
224impl fidl::Persistable for WlanSoftmacBaseJoinBssRequest {}
225
226#[derive(Clone, Debug, PartialEq)]
227pub struct WlanSoftmacBaseNotifyAssociationCompleteRequest {
228 pub assoc_cfg: WlanAssociationConfig,
229}
230
231impl fidl::Persistable for WlanSoftmacBaseNotifyAssociationCompleteRequest {}
232
233#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
234pub struct WlanSoftmacBaseQueryDiscoverySupportResponse {
235 pub resp: DiscoverySupport,
236}
237
238impl fidl::Persistable for WlanSoftmacBaseQueryDiscoverySupportResponse {}
239
240#[derive(Clone, Debug, PartialEq)]
241pub struct WlanSoftmacBaseQueryMacSublayerSupportResponse {
242 pub resp: fidl_fuchsia_wlan_common__common::MacSublayerSupport,
243}
244
245impl fidl::Persistable for WlanSoftmacBaseQueryMacSublayerSupportResponse {}
246
247#[derive(Clone, Debug, PartialEq)]
248pub struct WlanSoftmacBaseQuerySecuritySupportResponse {
249 pub resp: fidl_fuchsia_wlan_common__common::SecuritySupport,
250}
251
252impl fidl::Persistable for WlanSoftmacBaseQuerySecuritySupportResponse {}
253
254#[derive(Clone, Debug, PartialEq)]
255pub struct WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
256 pub resp: fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
257}
258
259impl fidl::Persistable for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {}
260
261#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
262#[repr(C)]
263pub struct WlanSoftmacBridgeSetEthernetStatusRequest {
264 pub status: u32,
265}
266
267impl fidl::Persistable for WlanSoftmacBridgeSetEthernetStatusRequest {}
268
269#[derive(Clone, Debug, PartialEq)]
270pub struct WlanSoftmacIfcBaseReportTxResultRequest {
271 pub tx_result: fidl_fuchsia_wlan_common__common::WlanTxResult,
272}
273
274impl fidl::Persistable for WlanSoftmacIfcBaseReportTxResultRequest {}
275
276#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
277pub struct WlanTxInfo {
278 pub tx_flags: u32,
281 pub valid_fields: u32,
285 pub tx_vector_idx: u16,
286 pub phy: fidl_fuchsia_wlan_common__common::WlanPhyType,
287 pub channel_bandwidth: fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth,
288 pub mcs: u8,
291}
292
293impl fidl::Persistable for WlanTxInfo {}
294
295#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
296pub struct WlanTxPacket {
297 pub mac_frame: Vec<u8>,
298 pub info: WlanTxInfo,
301}
302
303impl fidl::Persistable for WlanTxPacket {}
304
305#[derive(Clone, Debug, Default, PartialEq)]
306pub struct EthernetRxTransferRequest {
307 pub packet_address: Option<u64>,
308 pub packet_size: Option<u64>,
309 #[doc(hidden)]
310 pub __source_breaking: fidl::marker::SourceBreaking,
311}
312
313impl fidl::Persistable for EthernetRxTransferRequest {}
314
315#[derive(Clone, Debug, Default, PartialEq)]
316pub struct EthernetTxTransferRequest {
317 pub packet_address: Option<u64>,
318 pub packet_size: Option<u64>,
319 pub async_id: Option<u64>,
320 pub borrowed_operation: Option<u64>,
321 pub complete_borrowed_operation: Option<u64>,
322 #[doc(hidden)]
323 pub __source_breaking: fidl::marker::SourceBreaking,
324}
325
326impl fidl::Persistable for EthernetTxTransferRequest {}
327
328#[derive(Clone, Debug, Default, PartialEq)]
334pub struct WlanAssociationConfig {
335 pub bssid: Option<[u8; 6]>,
337 pub aid: Option<u16>,
340 pub listen_interval: Option<u16>,
341 pub channel: Option<fidl_fuchsia_wlan_ieee80211__common::WlanChannel>,
342 pub qos: Option<bool>,
344 pub wmm_params: Option<fidl_fuchsia_wlan_common__common::WlanWmmParameters>,
346 pub rates: Option<Vec<u8>>,
349 pub capability_info: Option<u16>,
351 pub ht_cap: Option<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>,
355 pub ht_op: Option<fidl_fuchsia_wlan_ieee80211__common::HtOperation>,
356 pub vht_cap: Option<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>,
358 pub vht_op: Option<fidl_fuchsia_wlan_ieee80211__common::VhtOperation>,
359 #[doc(hidden)]
360 pub __source_breaking: fidl::marker::SourceBreaking,
361}
362
363impl fidl::Persistable for WlanAssociationConfig {}
364
365#[derive(Clone, Debug, Default, PartialEq)]
366pub struct WlanKeyConfiguration {
367 pub protection: Option<WlanProtection>,
369 pub cipher_oui: Option<[u8; 3]>,
372 pub cipher_type: Option<u8>,
373 pub key_type: Option<fidl_fuchsia_wlan_ieee80211__common::KeyType>,
374 pub peer_addr: Option<[u8; 6]>,
377 pub key_idx: Option<u8>,
380 pub key: Option<Vec<u8>>,
381 pub rsc: Option<u64>,
384 #[doc(hidden)]
385 pub __source_breaking: fidl::marker::SourceBreaking,
386}
387
388impl fidl::Persistable for WlanKeyConfiguration {}
389
390#[derive(Clone, Debug, Default, PartialEq)]
391pub struct WlanRxTransferRequest {
392 pub packet_address: Option<u64>,
393 pub packet_size: Option<u64>,
394 pub packet_info: Option<WlanRxInfo>,
395 pub async_id: Option<u64>,
396 pub arena: Option<u64>,
397 #[doc(hidden)]
398 pub __source_breaking: fidl::marker::SourceBreaking,
399}
400
401impl fidl::Persistable for WlanRxTransferRequest {}
402
403#[derive(Clone, Debug, Default, PartialEq)]
405pub struct WlanSoftmacBandCapability {
406 pub band: Option<fidl_fuchsia_wlan_ieee80211__common::WlanBand>,
407 pub basic_rate_count: Option<u8>,
418 pub basic_rate_list: Option<[u8; 12]>,
433 pub ht_supported: Option<bool>,
448 pub ht_caps: Option<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>,
449 pub vht_supported: Option<bool>,
464 pub vht_caps: Option<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>,
465 pub operating_channel_count: Option<u16>,
477 pub operating_channel_list: Option<[u8; 256]>,
492 pub basic_rates: Option<Vec<u8>>,
497 pub operating_channels: Option<Vec<u8>>,
505 #[doc(hidden)]
506 pub __source_breaking: fidl::marker::SourceBreaking,
507}
508
509impl fidl::Persistable for WlanSoftmacBandCapability {}
510
511#[derive(Clone, Debug, Default, PartialEq)]
512pub struct WlanSoftmacBaseCancelScanRequest {
513 pub scan_id: Option<u64>,
514 #[doc(hidden)]
515 pub __source_breaking: fidl::marker::SourceBreaking,
516}
517
518impl fidl::Persistable for WlanSoftmacBaseCancelScanRequest {}
519
520#[derive(Clone, Debug, Default, PartialEq)]
521pub struct WlanSoftmacBaseClearAssociationRequest {
522 pub peer_addr: Option<[u8; 6]>,
523 #[doc(hidden)]
524 pub __source_breaking: fidl::marker::SourceBreaking,
525}
526
527impl fidl::Persistable for WlanSoftmacBaseClearAssociationRequest {}
528
529#[derive(Clone, Debug, Default, PartialEq)]
530pub struct WlanSoftmacBaseEnableBeaconingRequest {
531 pub packet_template: Option<WlanTxPacket>,
535 pub tim_ele_offset: Option<u64>,
538 pub beacon_interval: Option<u16>,
540 #[doc(hidden)]
541 pub __source_breaking: fidl::marker::SourceBreaking,
542}
543
544impl fidl::Persistable for WlanSoftmacBaseEnableBeaconingRequest {}
545
546#[derive(Clone, Debug, Default, PartialEq)]
547pub struct WlanSoftmacBaseSetChannelRequest {
548 pub channel: Option<fidl_fuchsia_wlan_ieee80211__common::WlanChannel>,
549 #[doc(hidden)]
550 pub __source_breaking: fidl::marker::SourceBreaking,
551}
552
553impl fidl::Persistable for WlanSoftmacBaseSetChannelRequest {}
554
555#[derive(Clone, Debug, Default, PartialEq)]
556pub struct WlanSoftmacBaseStartPassiveScanRequest {
557 pub channels: Option<Vec<u8>>,
567 pub min_channel_time: Option<i64>,
569 pub max_channel_time: Option<i64>,
571 pub min_home_time: Option<i64>,
575 #[doc(hidden)]
576 pub __source_breaking: fidl::marker::SourceBreaking,
577}
578
579impl fidl::Persistable for WlanSoftmacBaseStartPassiveScanRequest {}
580
581#[derive(Clone, Debug, Default, PartialEq)]
582pub struct WlanSoftmacBaseUpdateWmmParametersRequest {
583 pub ac: Option<fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory>,
584 pub params: Option<fidl_fuchsia_wlan_common__common::WlanWmmParameters>,
585 #[doc(hidden)]
586 pub __source_breaking: fidl::marker::SourceBreaking,
587}
588
589impl fidl::Persistable for WlanSoftmacBaseUpdateWmmParametersRequest {}
590
591#[derive(Clone, Debug, Default, PartialEq)]
592pub struct WlanSoftmacBaseStartActiveScanResponse {
593 pub scan_id: Option<u64>,
594 #[doc(hidden)]
595 pub __source_breaking: fidl::marker::SourceBreaking,
596}
597
598impl fidl::Persistable for WlanSoftmacBaseStartActiveScanResponse {}
599
600#[derive(Clone, Debug, Default, PartialEq)]
601pub struct WlanSoftmacBaseStartPassiveScanResponse {
602 pub scan_id: Option<u64>,
603 #[doc(hidden)]
604 pub __source_breaking: fidl::marker::SourceBreaking,
605}
606
607impl fidl::Persistable for WlanSoftmacBaseStartPassiveScanResponse {}
608
609#[derive(Clone, Debug, Default, PartialEq)]
610pub struct WlanSoftmacIfcBaseNotifyScanCompleteRequest {
611 pub status: Option<i32>,
612 pub scan_id: Option<u64>,
613 #[doc(hidden)]
614 pub __source_breaking: fidl::marker::SourceBreaking,
615}
616
617impl fidl::Persistable for WlanSoftmacIfcBaseNotifyScanCompleteRequest {}
618
619#[derive(Clone, Debug, Default, PartialEq)]
622pub struct WlanSoftmacQueryResponse {
623 pub sta_addr: Option<[u8; 6]>,
625 pub mac_role: Option<fidl_fuchsia_wlan_common__common::WlanMacRole>,
627 pub supported_phys: Option<Vec<fidl_fuchsia_wlan_common__common::WlanPhyType>>,
629 pub hardware_capability: Option<u32>,
631 pub band_caps: Option<Vec<WlanSoftmacBandCapability>>,
633 pub factory_addr: Option<[u8; 6]>,
635 #[doc(hidden)]
636 pub __source_breaking: fidl::marker::SourceBreaking,
637}
638
639impl fidl::Persistable for WlanSoftmacQueryResponse {}
640
641#[derive(Clone, Debug, Default, PartialEq)]
643pub struct WlanSoftmacStartActiveScanRequest {
644 pub channels: Option<Vec<u8>>,
652 pub ssids: Option<Vec<fidl_fuchsia_wlan_ieee80211__common::CSsid>>,
658 pub mac_header: Option<Vec<u8>>,
661 pub ies: Option<Vec<u8>>,
669 pub min_channel_time: Option<i64>,
671 pub max_channel_time: Option<i64>,
673 pub min_home_time: Option<i64>,
677 pub min_probes_per_channel: Option<u8>,
684 pub max_probes_per_channel: Option<u8>,
692 #[doc(hidden)]
693 pub __source_breaking: fidl::marker::SourceBreaking,
694}
695
696impl fidl::Persistable for WlanSoftmacStartActiveScanRequest {}
697
698#[derive(Clone, Debug, Default, PartialEq)]
699pub struct WlanTxTransferRequest {
700 pub packet_address: Option<u64>,
701 pub packet_size: Option<u64>,
702 pub packet_info: Option<WlanTxInfo>,
703 pub async_id: Option<u64>,
704 pub arena: Option<u64>,
705 #[doc(hidden)]
706 pub __source_breaking: fidl::marker::SourceBreaking,
707}
708
709impl fidl::Persistable for WlanTxTransferRequest {}
710
711pub mod ethernet_rx_ordinals {
712 pub const TRANSFER: u64 = 0x199ff3498ef8a22a;
713}
714
715pub mod ethernet_tx_ordinals {
716 pub const TRANSFER: u64 = 0x616dafedf07d00e7;
717}
718
719pub mod wlan_rx_ordinals {
720 pub const TRANSFER: u64 = 0x2c73b18cbfca6055;
721}
722
723pub mod wlan_softmac_base_ordinals {
724 pub const QUERY: u64 = 0x18231a638e508f9d;
725 pub const QUERY_DISCOVERY_SUPPORT: u64 = 0x16797affc0cb58ae;
726 pub const QUERY_MAC_SUBLAYER_SUPPORT: u64 = 0x7302c3f8c131f075;
727 pub const QUERY_SECURITY_SUPPORT: u64 = 0x3691bb75abf6354;
728 pub const QUERY_SPECTRUM_MANAGEMENT_SUPPORT: u64 = 0x347d78dc1d4d27bf;
729 pub const SET_CHANNEL: u64 = 0x12836b533cd63ece;
730 pub const JOIN_BSS: u64 = 0x1336fb5455b77a6e;
731 pub const ENABLE_BEACONING: u64 = 0x6c35807632c64576;
732 pub const DISABLE_BEACONING: u64 = 0x3303b30f99dbb406;
733 pub const INSTALL_KEY: u64 = 0x7decf9b4200b9131;
734 pub const NOTIFY_ASSOCIATION_COMPLETE: u64 = 0x436ffe3ba461d6cd;
735 pub const CLEAR_ASSOCIATION: u64 = 0x581d76c39190a7dd;
736 pub const START_PASSIVE_SCAN: u64 = 0x5662f989cb4083bb;
737 pub const START_ACTIVE_SCAN: u64 = 0x4896eafa9937751e;
738 pub const CANCEL_SCAN: u64 = 0xf7d859369764556;
739 pub const UPDATE_WMM_PARAMETERS: u64 = 0x68522c7122d5f78c;
740}
741
742pub mod wlan_softmac_bridge_ordinals {
743 pub const QUERY: u64 = 0x18231a638e508f9d;
744 pub const QUERY_DISCOVERY_SUPPORT: u64 = 0x16797affc0cb58ae;
745 pub const QUERY_MAC_SUBLAYER_SUPPORT: u64 = 0x7302c3f8c131f075;
746 pub const QUERY_SECURITY_SUPPORT: u64 = 0x3691bb75abf6354;
747 pub const QUERY_SPECTRUM_MANAGEMENT_SUPPORT: u64 = 0x347d78dc1d4d27bf;
748 pub const SET_CHANNEL: u64 = 0x12836b533cd63ece;
749 pub const JOIN_BSS: u64 = 0x1336fb5455b77a6e;
750 pub const ENABLE_BEACONING: u64 = 0x6c35807632c64576;
751 pub const DISABLE_BEACONING: u64 = 0x3303b30f99dbb406;
752 pub const INSTALL_KEY: u64 = 0x7decf9b4200b9131;
753 pub const NOTIFY_ASSOCIATION_COMPLETE: u64 = 0x436ffe3ba461d6cd;
754 pub const CLEAR_ASSOCIATION: u64 = 0x581d76c39190a7dd;
755 pub const START_PASSIVE_SCAN: u64 = 0x5662f989cb4083bb;
756 pub const START_ACTIVE_SCAN: u64 = 0x4896eafa9937751e;
757 pub const CANCEL_SCAN: u64 = 0xf7d859369764556;
758 pub const UPDATE_WMM_PARAMETERS: u64 = 0x68522c7122d5f78c;
759 pub const START: u64 = 0x7b2c15a507020d4d;
760 pub const SET_ETHERNET_STATUS: u64 = 0x412503cb3aaa350b;
761}
762
763pub mod wlan_softmac_ifc_base_ordinals {
764 pub const REPORT_TX_RESULT: u64 = 0x5835c2f13d94e09a;
765 pub const NOTIFY_SCAN_COMPLETE: u64 = 0x7045e3cd460dc42c;
766}
767
768pub mod wlan_softmac_ifc_bridge_ordinals {
769 pub const REPORT_TX_RESULT: u64 = 0x5835c2f13d94e09a;
770 pub const NOTIFY_SCAN_COMPLETE: u64 = 0x7045e3cd460dc42c;
771 pub const STOP_BRIDGED_DRIVER: u64 = 0x112dbd0cc2251151;
772}
773
774pub mod wlan_tx_ordinals {
775 pub const TRANSFER: u64 = 0x19f8ff7a8b910ab3;
776}
777
778mod internal {
779 use super::*;
780 unsafe impl fidl::encoding::TypeMarker for WlanRxInfoFlags {
781 type Owned = Self;
782
783 #[inline(always)]
784 fn inline_align(_context: fidl::encoding::Context) -> usize {
785 4
786 }
787
788 #[inline(always)]
789 fn inline_size(_context: fidl::encoding::Context) -> usize {
790 4
791 }
792 }
793
794 impl fidl::encoding::ValueTypeMarker for WlanRxInfoFlags {
795 type Borrowed<'a> = Self;
796 #[inline(always)]
797 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
798 *value
799 }
800 }
801
802 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
803 for WlanRxInfoFlags
804 {
805 #[inline]
806 unsafe fn encode(
807 self,
808 encoder: &mut fidl::encoding::Encoder<'_, D>,
809 offset: usize,
810 _depth: fidl::encoding::Depth,
811 ) -> fidl::Result<()> {
812 encoder.debug_check_bounds::<Self>(offset);
813 encoder.write_num(self.bits(), offset);
814 Ok(())
815 }
816 }
817
818 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfoFlags {
819 #[inline(always)]
820 fn new_empty() -> Self {
821 Self::empty()
822 }
823
824 #[inline]
825 unsafe fn decode(
826 &mut self,
827 decoder: &mut fidl::encoding::Decoder<'_, D>,
828 offset: usize,
829 _depth: fidl::encoding::Depth,
830 ) -> fidl::Result<()> {
831 decoder.debug_check_bounds::<Self>(offset);
832 let prim = decoder.read_num::<u32>(offset);
833 *self = Self::from_bits_allow_unknown(prim);
834 Ok(())
835 }
836 }
837 unsafe impl fidl::encoding::TypeMarker for WlanRxInfoValid {
838 type Owned = Self;
839
840 #[inline(always)]
841 fn inline_align(_context: fidl::encoding::Context) -> usize {
842 4
843 }
844
845 #[inline(always)]
846 fn inline_size(_context: fidl::encoding::Context) -> usize {
847 4
848 }
849 }
850
851 impl fidl::encoding::ValueTypeMarker for WlanRxInfoValid {
852 type Borrowed<'a> = Self;
853 #[inline(always)]
854 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
855 *value
856 }
857 }
858
859 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
860 for WlanRxInfoValid
861 {
862 #[inline]
863 unsafe fn encode(
864 self,
865 encoder: &mut fidl::encoding::Encoder<'_, D>,
866 offset: usize,
867 _depth: fidl::encoding::Depth,
868 ) -> fidl::Result<()> {
869 encoder.debug_check_bounds::<Self>(offset);
870 encoder.write_num(self.bits(), offset);
871 Ok(())
872 }
873 }
874
875 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfoValid {
876 #[inline(always)]
877 fn new_empty() -> Self {
878 Self::empty()
879 }
880
881 #[inline]
882 unsafe fn decode(
883 &mut self,
884 decoder: &mut fidl::encoding::Decoder<'_, D>,
885 offset: usize,
886 _depth: fidl::encoding::Depth,
887 ) -> fidl::Result<()> {
888 decoder.debug_check_bounds::<Self>(offset);
889 let prim = decoder.read_num::<u32>(offset);
890 *self = Self::from_bits_allow_unknown(prim);
891 Ok(())
892 }
893 }
894 unsafe impl fidl::encoding::TypeMarker for WlanTxInfoFlags {
895 type Owned = Self;
896
897 #[inline(always)]
898 fn inline_align(_context: fidl::encoding::Context) -> usize {
899 4
900 }
901
902 #[inline(always)]
903 fn inline_size(_context: fidl::encoding::Context) -> usize {
904 4
905 }
906 }
907
908 impl fidl::encoding::ValueTypeMarker for WlanTxInfoFlags {
909 type Borrowed<'a> = Self;
910 #[inline(always)]
911 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
912 *value
913 }
914 }
915
916 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
917 for WlanTxInfoFlags
918 {
919 #[inline]
920 unsafe fn encode(
921 self,
922 encoder: &mut fidl::encoding::Encoder<'_, D>,
923 offset: usize,
924 _depth: fidl::encoding::Depth,
925 ) -> fidl::Result<()> {
926 encoder.debug_check_bounds::<Self>(offset);
927 encoder.write_num(self.bits(), offset);
928 Ok(())
929 }
930 }
931
932 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfoFlags {
933 #[inline(always)]
934 fn new_empty() -> Self {
935 Self::empty()
936 }
937
938 #[inline]
939 unsafe fn decode(
940 &mut self,
941 decoder: &mut fidl::encoding::Decoder<'_, D>,
942 offset: usize,
943 _depth: fidl::encoding::Depth,
944 ) -> fidl::Result<()> {
945 decoder.debug_check_bounds::<Self>(offset);
946 let prim = decoder.read_num::<u32>(offset);
947 *self = Self::from_bits_allow_unknown(prim);
948 Ok(())
949 }
950 }
951 unsafe impl fidl::encoding::TypeMarker for WlanTxInfoValid {
952 type Owned = Self;
953
954 #[inline(always)]
955 fn inline_align(_context: fidl::encoding::Context) -> usize {
956 4
957 }
958
959 #[inline(always)]
960 fn inline_size(_context: fidl::encoding::Context) -> usize {
961 4
962 }
963 }
964
965 impl fidl::encoding::ValueTypeMarker for WlanTxInfoValid {
966 type Borrowed<'a> = Self;
967 #[inline(always)]
968 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
969 *value
970 }
971 }
972
973 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
974 for WlanTxInfoValid
975 {
976 #[inline]
977 unsafe fn encode(
978 self,
979 encoder: &mut fidl::encoding::Encoder<'_, D>,
980 offset: usize,
981 _depth: fidl::encoding::Depth,
982 ) -> fidl::Result<()> {
983 encoder.debug_check_bounds::<Self>(offset);
984 encoder.write_num(self.bits(), offset);
985 Ok(())
986 }
987 }
988
989 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfoValid {
990 #[inline(always)]
991 fn new_empty() -> Self {
992 Self::empty()
993 }
994
995 #[inline]
996 unsafe fn decode(
997 &mut self,
998 decoder: &mut fidl::encoding::Decoder<'_, D>,
999 offset: usize,
1000 _depth: fidl::encoding::Depth,
1001 ) -> fidl::Result<()> {
1002 decoder.debug_check_bounds::<Self>(offset);
1003 let prim = decoder.read_num::<u32>(offset);
1004 *self = Self::from_bits_allow_unknown(prim);
1005 Ok(())
1006 }
1007 }
1008 unsafe impl fidl::encoding::TypeMarker for WlanProtection {
1009 type Owned = Self;
1010
1011 #[inline(always)]
1012 fn inline_align(_context: fidl::encoding::Context) -> usize {
1013 std::mem::align_of::<u8>()
1014 }
1015
1016 #[inline(always)]
1017 fn inline_size(_context: fidl::encoding::Context) -> usize {
1018 std::mem::size_of::<u8>()
1019 }
1020
1021 #[inline(always)]
1022 fn encode_is_copy() -> bool {
1023 true
1024 }
1025
1026 #[inline(always)]
1027 fn decode_is_copy() -> bool {
1028 false
1029 }
1030 }
1031
1032 impl fidl::encoding::ValueTypeMarker for WlanProtection {
1033 type Borrowed<'a> = Self;
1034 #[inline(always)]
1035 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1036 *value
1037 }
1038 }
1039
1040 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanProtection {
1041 #[inline]
1042 unsafe fn encode(
1043 self,
1044 encoder: &mut fidl::encoding::Encoder<'_, D>,
1045 offset: usize,
1046 _depth: fidl::encoding::Depth,
1047 ) -> fidl::Result<()> {
1048 encoder.debug_check_bounds::<Self>(offset);
1049 encoder.write_num(self.into_primitive(), offset);
1050 Ok(())
1051 }
1052 }
1053
1054 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanProtection {
1055 #[inline(always)]
1056 fn new_empty() -> Self {
1057 Self::None
1058 }
1059
1060 #[inline]
1061 unsafe fn decode(
1062 &mut self,
1063 decoder: &mut fidl::encoding::Decoder<'_, D>,
1064 offset: usize,
1065 _depth: fidl::encoding::Depth,
1066 ) -> fidl::Result<()> {
1067 decoder.debug_check_bounds::<Self>(offset);
1068 let prim = decoder.read_num::<u8>(offset);
1069
1070 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1071 Ok(())
1072 }
1073 }
1074
1075 impl fidl::encoding::ValueTypeMarker for DiscoverySupport {
1076 type Borrowed<'a> = &'a Self;
1077 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1078 value
1079 }
1080 }
1081
1082 unsafe impl fidl::encoding::TypeMarker for DiscoverySupport {
1083 type Owned = Self;
1084
1085 #[inline(always)]
1086 fn inline_align(_context: fidl::encoding::Context) -> usize {
1087 1
1088 }
1089
1090 #[inline(always)]
1091 fn inline_size(_context: fidl::encoding::Context) -> usize {
1092 3
1093 }
1094 }
1095
1096 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DiscoverySupport, D>
1097 for &DiscoverySupport
1098 {
1099 #[inline]
1100 unsafe fn encode(
1101 self,
1102 encoder: &mut fidl::encoding::Encoder<'_, D>,
1103 offset: usize,
1104 _depth: fidl::encoding::Depth,
1105 ) -> fidl::Result<()> {
1106 encoder.debug_check_bounds::<DiscoverySupport>(offset);
1107 fidl::encoding::Encode::<DiscoverySupport, D>::encode(
1109 (
1110 <ScanOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
1111 &self.scan_offload,
1112 ),
1113 <ProbeResponseOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
1114 &self.probe_response_offload,
1115 ),
1116 ),
1117 encoder,
1118 offset,
1119 _depth,
1120 )
1121 }
1122 }
1123 unsafe impl<
1124 D: fidl::encoding::ResourceDialect,
1125 T0: fidl::encoding::Encode<ScanOffloadExtension, D>,
1126 T1: fidl::encoding::Encode<ProbeResponseOffloadExtension, D>,
1127 > fidl::encoding::Encode<DiscoverySupport, D> for (T0, T1)
1128 {
1129 #[inline]
1130 unsafe fn encode(
1131 self,
1132 encoder: &mut fidl::encoding::Encoder<'_, D>,
1133 offset: usize,
1134 depth: fidl::encoding::Depth,
1135 ) -> fidl::Result<()> {
1136 encoder.debug_check_bounds::<DiscoverySupport>(offset);
1137 self.0.encode(encoder, offset + 0, depth)?;
1141 self.1.encode(encoder, offset + 2, depth)?;
1142 Ok(())
1143 }
1144 }
1145
1146 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DiscoverySupport {
1147 #[inline(always)]
1148 fn new_empty() -> Self {
1149 Self {
1150 scan_offload: fidl::new_empty!(ScanOffloadExtension, D),
1151 probe_response_offload: fidl::new_empty!(ProbeResponseOffloadExtension, D),
1152 }
1153 }
1154
1155 #[inline]
1156 unsafe fn decode(
1157 &mut self,
1158 decoder: &mut fidl::encoding::Decoder<'_, D>,
1159 offset: usize,
1160 _depth: fidl::encoding::Depth,
1161 ) -> fidl::Result<()> {
1162 decoder.debug_check_bounds::<Self>(offset);
1163 fidl::decode!(
1165 ScanOffloadExtension,
1166 D,
1167 &mut self.scan_offload,
1168 decoder,
1169 offset + 0,
1170 _depth
1171 )?;
1172 fidl::decode!(
1173 ProbeResponseOffloadExtension,
1174 D,
1175 &mut self.probe_response_offload,
1176 decoder,
1177 offset + 2,
1178 _depth
1179 )?;
1180 Ok(())
1181 }
1182 }
1183
1184 impl fidl::encoding::ValueTypeMarker for ProbeResponseOffloadExtension {
1185 type Borrowed<'a> = &'a Self;
1186 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1187 value
1188 }
1189 }
1190
1191 unsafe impl fidl::encoding::TypeMarker for ProbeResponseOffloadExtension {
1192 type Owned = Self;
1193
1194 #[inline(always)]
1195 fn inline_align(_context: fidl::encoding::Context) -> usize {
1196 1
1197 }
1198
1199 #[inline(always)]
1200 fn inline_size(_context: fidl::encoding::Context) -> usize {
1201 1
1202 }
1203 }
1204
1205 unsafe impl<D: fidl::encoding::ResourceDialect>
1206 fidl::encoding::Encode<ProbeResponseOffloadExtension, D>
1207 for &ProbeResponseOffloadExtension
1208 {
1209 #[inline]
1210 unsafe fn encode(
1211 self,
1212 encoder: &mut fidl::encoding::Encoder<'_, D>,
1213 offset: usize,
1214 _depth: fidl::encoding::Depth,
1215 ) -> fidl::Result<()> {
1216 encoder.debug_check_bounds::<ProbeResponseOffloadExtension>(offset);
1217 fidl::encoding::Encode::<ProbeResponseOffloadExtension, D>::encode(
1219 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
1220 encoder,
1221 offset,
1222 _depth,
1223 )
1224 }
1225 }
1226 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1227 fidl::encoding::Encode<ProbeResponseOffloadExtension, D> for (T0,)
1228 {
1229 #[inline]
1230 unsafe fn encode(
1231 self,
1232 encoder: &mut fidl::encoding::Encoder<'_, D>,
1233 offset: usize,
1234 depth: fidl::encoding::Depth,
1235 ) -> fidl::Result<()> {
1236 encoder.debug_check_bounds::<ProbeResponseOffloadExtension>(offset);
1237 self.0.encode(encoder, offset + 0, depth)?;
1241 Ok(())
1242 }
1243 }
1244
1245 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1246 for ProbeResponseOffloadExtension
1247 {
1248 #[inline(always)]
1249 fn new_empty() -> Self {
1250 Self { supported: fidl::new_empty!(bool, D) }
1251 }
1252
1253 #[inline]
1254 unsafe fn decode(
1255 &mut self,
1256 decoder: &mut fidl::encoding::Decoder<'_, D>,
1257 offset: usize,
1258 _depth: fidl::encoding::Depth,
1259 ) -> fidl::Result<()> {
1260 decoder.debug_check_bounds::<Self>(offset);
1261 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
1263 Ok(())
1264 }
1265 }
1266
1267 impl fidl::encoding::ValueTypeMarker for ScanOffloadExtension {
1268 type Borrowed<'a> = &'a Self;
1269 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1270 value
1271 }
1272 }
1273
1274 unsafe impl fidl::encoding::TypeMarker for ScanOffloadExtension {
1275 type Owned = Self;
1276
1277 #[inline(always)]
1278 fn inline_align(_context: fidl::encoding::Context) -> usize {
1279 1
1280 }
1281
1282 #[inline(always)]
1283 fn inline_size(_context: fidl::encoding::Context) -> usize {
1284 2
1285 }
1286 }
1287
1288 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ScanOffloadExtension, D>
1289 for &ScanOffloadExtension
1290 {
1291 #[inline]
1292 unsafe fn encode(
1293 self,
1294 encoder: &mut fidl::encoding::Encoder<'_, D>,
1295 offset: usize,
1296 _depth: fidl::encoding::Depth,
1297 ) -> fidl::Result<()> {
1298 encoder.debug_check_bounds::<ScanOffloadExtension>(offset);
1299 fidl::encoding::Encode::<ScanOffloadExtension, D>::encode(
1301 (
1302 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),
1303 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.scan_cancel_supported),
1304 ),
1305 encoder,
1306 offset,
1307 _depth,
1308 )
1309 }
1310 }
1311 unsafe impl<
1312 D: fidl::encoding::ResourceDialect,
1313 T0: fidl::encoding::Encode<bool, D>,
1314 T1: fidl::encoding::Encode<bool, D>,
1315 > fidl::encoding::Encode<ScanOffloadExtension, D> for (T0, T1)
1316 {
1317 #[inline]
1318 unsafe fn encode(
1319 self,
1320 encoder: &mut fidl::encoding::Encoder<'_, D>,
1321 offset: usize,
1322 depth: fidl::encoding::Depth,
1323 ) -> fidl::Result<()> {
1324 encoder.debug_check_bounds::<ScanOffloadExtension>(offset);
1325 self.0.encode(encoder, offset + 0, depth)?;
1329 self.1.encode(encoder, offset + 1, depth)?;
1330 Ok(())
1331 }
1332 }
1333
1334 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanOffloadExtension {
1335 #[inline(always)]
1336 fn new_empty() -> Self {
1337 Self {
1338 supported: fidl::new_empty!(bool, D),
1339 scan_cancel_supported: fidl::new_empty!(bool, D),
1340 }
1341 }
1342
1343 #[inline]
1344 unsafe fn decode(
1345 &mut self,
1346 decoder: &mut fidl::encoding::Decoder<'_, D>,
1347 offset: usize,
1348 _depth: fidl::encoding::Depth,
1349 ) -> fidl::Result<()> {
1350 decoder.debug_check_bounds::<Self>(offset);
1351 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
1353 fidl::decode!(bool, D, &mut self.scan_cancel_supported, decoder, offset + 1, _depth)?;
1354 Ok(())
1355 }
1356 }
1357
1358 impl fidl::encoding::ValueTypeMarker for WlanRxInfo {
1359 type Borrowed<'a> = &'a Self;
1360 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1361 value
1362 }
1363 }
1364
1365 unsafe impl fidl::encoding::TypeMarker for WlanRxInfo {
1366 type Owned = Self;
1367
1368 #[inline(always)]
1369 fn inline_align(_context: fidl::encoding::Context) -> usize {
1370 4
1371 }
1372
1373 #[inline(always)]
1374 fn inline_size(_context: fidl::encoding::Context) -> usize {
1375 32
1376 }
1377 }
1378
1379 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxInfo, D>
1380 for &WlanRxInfo
1381 {
1382 #[inline]
1383 unsafe fn encode(
1384 self,
1385 encoder: &mut fidl::encoding::Encoder<'_, D>,
1386 offset: usize,
1387 _depth: fidl::encoding::Depth,
1388 ) -> fidl::Result<()> {
1389 encoder.debug_check_bounds::<WlanRxInfo>(offset);
1390 fidl::encoding::Encode::<WlanRxInfo, D>::encode(
1392 (
1393 <WlanRxInfoFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.rx_flags),
1394 <WlanRxInfoValid as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
1395 <fidl_fuchsia_wlan_common__common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
1396 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_rate),
1397 <fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
1398 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
1399 <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.rssi_dbm),
1400 <i16 as fidl::encoding::ValueTypeMarker>::borrow(&self.snr_dbh),
1401 ),
1402 encoder, offset, _depth
1403 )
1404 }
1405 }
1406 unsafe impl<
1407 D: fidl::encoding::ResourceDialect,
1408 T0: fidl::encoding::Encode<WlanRxInfoFlags, D>,
1409 T1: fidl::encoding::Encode<WlanRxInfoValid, D>,
1410 T2: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanPhyType, D>,
1411 T3: fidl::encoding::Encode<u32, D>,
1412 T4: fidl::encoding::Encode<fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D>,
1413 T5: fidl::encoding::Encode<u8, D>,
1414 T6: fidl::encoding::Encode<i8, D>,
1415 T7: fidl::encoding::Encode<i16, D>,
1416 > fidl::encoding::Encode<WlanRxInfo, D> for (T0, T1, T2, T3, T4, T5, T6, T7)
1417 {
1418 #[inline]
1419 unsafe fn encode(
1420 self,
1421 encoder: &mut fidl::encoding::Encoder<'_, D>,
1422 offset: usize,
1423 depth: fidl::encoding::Depth,
1424 ) -> fidl::Result<()> {
1425 encoder.debug_check_bounds::<WlanRxInfo>(offset);
1426 self.0.encode(encoder, offset + 0, depth)?;
1430 self.1.encode(encoder, offset + 4, depth)?;
1431 self.2.encode(encoder, offset + 8, depth)?;
1432 self.3.encode(encoder, offset + 12, depth)?;
1433 self.4.encode(encoder, offset + 16, depth)?;
1434 self.5.encode(encoder, offset + 28, depth)?;
1435 self.6.encode(encoder, offset + 29, depth)?;
1436 self.7.encode(encoder, offset + 30, depth)?;
1437 Ok(())
1438 }
1439 }
1440
1441 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfo {
1442 #[inline(always)]
1443 fn new_empty() -> Self {
1444 Self {
1445 rx_flags: fidl::new_empty!(WlanRxInfoFlags, D),
1446 valid_fields: fidl::new_empty!(WlanRxInfoValid, D),
1447 phy: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanPhyType, D),
1448 data_rate: fidl::new_empty!(u32, D),
1449 channel: fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D),
1450 mcs: fidl::new_empty!(u8, D),
1451 rssi_dbm: fidl::new_empty!(i8, D),
1452 snr_dbh: fidl::new_empty!(i16, D),
1453 }
1454 }
1455
1456 #[inline]
1457 unsafe fn decode(
1458 &mut self,
1459 decoder: &mut fidl::encoding::Decoder<'_, D>,
1460 offset: usize,
1461 _depth: fidl::encoding::Depth,
1462 ) -> fidl::Result<()> {
1463 decoder.debug_check_bounds::<Self>(offset);
1464 fidl::decode!(WlanRxInfoFlags, D, &mut self.rx_flags, decoder, offset + 0, _depth)?;
1466 fidl::decode!(WlanRxInfoValid, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
1467 fidl::decode!(
1468 fidl_fuchsia_wlan_common__common::WlanPhyType,
1469 D,
1470 &mut self.phy,
1471 decoder,
1472 offset + 8,
1473 _depth
1474 )?;
1475 fidl::decode!(u32, D, &mut self.data_rate, decoder, offset + 12, _depth)?;
1476 fidl::decode!(
1477 fidl_fuchsia_wlan_ieee80211__common::WlanChannel,
1478 D,
1479 &mut self.channel,
1480 decoder,
1481 offset + 16,
1482 _depth
1483 )?;
1484 fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 28, _depth)?;
1485 fidl::decode!(i8, D, &mut self.rssi_dbm, decoder, offset + 29, _depth)?;
1486 fidl::decode!(i16, D, &mut self.snr_dbh, decoder, offset + 30, _depth)?;
1487 Ok(())
1488 }
1489 }
1490
1491 impl fidl::encoding::ValueTypeMarker for WlanRxPacket {
1492 type Borrowed<'a> = &'a Self;
1493 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1494 value
1495 }
1496 }
1497
1498 unsafe impl fidl::encoding::TypeMarker for WlanRxPacket {
1499 type Owned = Self;
1500
1501 #[inline(always)]
1502 fn inline_align(_context: fidl::encoding::Context) -> usize {
1503 8
1504 }
1505
1506 #[inline(always)]
1507 fn inline_size(_context: fidl::encoding::Context) -> usize {
1508 48
1509 }
1510 }
1511
1512 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxPacket, D>
1513 for &WlanRxPacket
1514 {
1515 #[inline]
1516 unsafe fn encode(
1517 self,
1518 encoder: &mut fidl::encoding::Encoder<'_, D>,
1519 offset: usize,
1520 _depth: fidl::encoding::Depth,
1521 ) -> fidl::Result<()> {
1522 encoder.debug_check_bounds::<WlanRxPacket>(offset);
1523 fidl::encoding::Encode::<WlanRxPacket, D>::encode(
1525 (
1526 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_frame),
1527 <WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1528 ),
1529 encoder, offset, _depth
1530 )
1531 }
1532 }
1533 unsafe impl<
1534 D: fidl::encoding::ResourceDialect,
1535 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
1536 T1: fidl::encoding::Encode<WlanRxInfo, D>,
1537 > fidl::encoding::Encode<WlanRxPacket, D> for (T0, T1)
1538 {
1539 #[inline]
1540 unsafe fn encode(
1541 self,
1542 encoder: &mut fidl::encoding::Encoder<'_, D>,
1543 offset: usize,
1544 depth: fidl::encoding::Depth,
1545 ) -> fidl::Result<()> {
1546 encoder.debug_check_bounds::<WlanRxPacket>(offset);
1547 self.0.encode(encoder, offset + 0, depth)?;
1551 self.1.encode(encoder, offset + 16, depth)?;
1552 Ok(())
1553 }
1554 }
1555
1556 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxPacket {
1557 #[inline(always)]
1558 fn new_empty() -> Self {
1559 Self {
1560 mac_frame: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
1561 info: fidl::new_empty!(WlanRxInfo, D),
1562 }
1563 }
1564
1565 #[inline]
1566 unsafe fn decode(
1567 &mut self,
1568 decoder: &mut fidl::encoding::Decoder<'_, D>,
1569 offset: usize,
1570 _depth: fidl::encoding::Depth,
1571 ) -> fidl::Result<()> {
1572 decoder.debug_check_bounds::<Self>(offset);
1573 fidl::decode!(
1575 fidl::encoding::UnboundedVector<u8>,
1576 D,
1577 &mut self.mac_frame,
1578 decoder,
1579 offset + 0,
1580 _depth
1581 )?;
1582 fidl::decode!(WlanRxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
1583 Ok(())
1584 }
1585 }
1586
1587 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseJoinBssRequest {
1588 type Borrowed<'a> = &'a Self;
1589 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1590 value
1591 }
1592 }
1593
1594 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseJoinBssRequest {
1595 type Owned = Self;
1596
1597 #[inline(always)]
1598 fn inline_align(_context: fidl::encoding::Context) -> usize {
1599 8
1600 }
1601
1602 #[inline(always)]
1603 fn inline_size(_context: fidl::encoding::Context) -> usize {
1604 16
1605 }
1606 }
1607
1608 unsafe impl<D: fidl::encoding::ResourceDialect>
1609 fidl::encoding::Encode<WlanSoftmacBaseJoinBssRequest, D>
1610 for &WlanSoftmacBaseJoinBssRequest
1611 {
1612 #[inline]
1613 unsafe fn encode(
1614 self,
1615 encoder: &mut fidl::encoding::Encoder<'_, D>,
1616 offset: usize,
1617 _depth: fidl::encoding::Depth,
1618 ) -> fidl::Result<()> {
1619 encoder.debug_check_bounds::<WlanSoftmacBaseJoinBssRequest>(offset);
1620 fidl::encoding::Encode::<WlanSoftmacBaseJoinBssRequest, D>::encode(
1622 (
1623 <fidl_fuchsia_wlan_common__common::JoinBssRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.join_request),
1624 ),
1625 encoder, offset, _depth
1626 )
1627 }
1628 }
1629 unsafe impl<
1630 D: fidl::encoding::ResourceDialect,
1631 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::JoinBssRequest, D>,
1632 > fidl::encoding::Encode<WlanSoftmacBaseJoinBssRequest, D> for (T0,)
1633 {
1634 #[inline]
1635 unsafe fn encode(
1636 self,
1637 encoder: &mut fidl::encoding::Encoder<'_, D>,
1638 offset: usize,
1639 depth: fidl::encoding::Depth,
1640 ) -> fidl::Result<()> {
1641 encoder.debug_check_bounds::<WlanSoftmacBaseJoinBssRequest>(offset);
1642 self.0.encode(encoder, offset + 0, depth)?;
1646 Ok(())
1647 }
1648 }
1649
1650 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1651 for WlanSoftmacBaseJoinBssRequest
1652 {
1653 #[inline(always)]
1654 fn new_empty() -> Self {
1655 Self {
1656 join_request: fidl::new_empty!(fidl_fuchsia_wlan_common__common::JoinBssRequest, D),
1657 }
1658 }
1659
1660 #[inline]
1661 unsafe fn decode(
1662 &mut self,
1663 decoder: &mut fidl::encoding::Decoder<'_, D>,
1664 offset: usize,
1665 _depth: fidl::encoding::Depth,
1666 ) -> fidl::Result<()> {
1667 decoder.debug_check_bounds::<Self>(offset);
1668 fidl::decode!(
1670 fidl_fuchsia_wlan_common__common::JoinBssRequest,
1671 D,
1672 &mut self.join_request,
1673 decoder,
1674 offset + 0,
1675 _depth
1676 )?;
1677 Ok(())
1678 }
1679 }
1680
1681 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseNotifyAssociationCompleteRequest {
1682 type Borrowed<'a> = &'a Self;
1683 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1684 value
1685 }
1686 }
1687
1688 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseNotifyAssociationCompleteRequest {
1689 type Owned = Self;
1690
1691 #[inline(always)]
1692 fn inline_align(_context: fidl::encoding::Context) -> usize {
1693 8
1694 }
1695
1696 #[inline(always)]
1697 fn inline_size(_context: fidl::encoding::Context) -> usize {
1698 16
1699 }
1700 }
1701
1702 unsafe impl<D: fidl::encoding::ResourceDialect>
1703 fidl::encoding::Encode<WlanSoftmacBaseNotifyAssociationCompleteRequest, D>
1704 for &WlanSoftmacBaseNotifyAssociationCompleteRequest
1705 {
1706 #[inline]
1707 unsafe fn encode(
1708 self,
1709 encoder: &mut fidl::encoding::Encoder<'_, D>,
1710 offset: usize,
1711 _depth: fidl::encoding::Depth,
1712 ) -> fidl::Result<()> {
1713 encoder.debug_check_bounds::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(offset);
1714 fidl::encoding::Encode::<WlanSoftmacBaseNotifyAssociationCompleteRequest, D>::encode(
1716 (<WlanAssociationConfig as fidl::encoding::ValueTypeMarker>::borrow(
1717 &self.assoc_cfg,
1718 ),),
1719 encoder,
1720 offset,
1721 _depth,
1722 )
1723 }
1724 }
1725 unsafe impl<
1726 D: fidl::encoding::ResourceDialect,
1727 T0: fidl::encoding::Encode<WlanAssociationConfig, D>,
1728 > fidl::encoding::Encode<WlanSoftmacBaseNotifyAssociationCompleteRequest, D> for (T0,)
1729 {
1730 #[inline]
1731 unsafe fn encode(
1732 self,
1733 encoder: &mut fidl::encoding::Encoder<'_, D>,
1734 offset: usize,
1735 depth: fidl::encoding::Depth,
1736 ) -> fidl::Result<()> {
1737 encoder.debug_check_bounds::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(offset);
1738 self.0.encode(encoder, offset + 0, depth)?;
1742 Ok(())
1743 }
1744 }
1745
1746 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1747 for WlanSoftmacBaseNotifyAssociationCompleteRequest
1748 {
1749 #[inline(always)]
1750 fn new_empty() -> Self {
1751 Self { assoc_cfg: fidl::new_empty!(WlanAssociationConfig, D) }
1752 }
1753
1754 #[inline]
1755 unsafe fn decode(
1756 &mut self,
1757 decoder: &mut fidl::encoding::Decoder<'_, D>,
1758 offset: usize,
1759 _depth: fidl::encoding::Depth,
1760 ) -> fidl::Result<()> {
1761 decoder.debug_check_bounds::<Self>(offset);
1762 fidl::decode!(
1764 WlanAssociationConfig,
1765 D,
1766 &mut self.assoc_cfg,
1767 decoder,
1768 offset + 0,
1769 _depth
1770 )?;
1771 Ok(())
1772 }
1773 }
1774
1775 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQueryDiscoverySupportResponse {
1776 type Borrowed<'a> = &'a Self;
1777 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1778 value
1779 }
1780 }
1781
1782 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQueryDiscoverySupportResponse {
1783 type Owned = Self;
1784
1785 #[inline(always)]
1786 fn inline_align(_context: fidl::encoding::Context) -> usize {
1787 1
1788 }
1789
1790 #[inline(always)]
1791 fn inline_size(_context: fidl::encoding::Context) -> usize {
1792 3
1793 }
1794 }
1795
1796 unsafe impl<D: fidl::encoding::ResourceDialect>
1797 fidl::encoding::Encode<WlanSoftmacBaseQueryDiscoverySupportResponse, D>
1798 for &WlanSoftmacBaseQueryDiscoverySupportResponse
1799 {
1800 #[inline]
1801 unsafe fn encode(
1802 self,
1803 encoder: &mut fidl::encoding::Encoder<'_, D>,
1804 offset: usize,
1805 _depth: fidl::encoding::Depth,
1806 ) -> fidl::Result<()> {
1807 encoder.debug_check_bounds::<WlanSoftmacBaseQueryDiscoverySupportResponse>(offset);
1808 fidl::encoding::Encode::<WlanSoftmacBaseQueryDiscoverySupportResponse, D>::encode(
1810 (<DiscoverySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
1811 encoder,
1812 offset,
1813 _depth,
1814 )
1815 }
1816 }
1817 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DiscoverySupport, D>>
1818 fidl::encoding::Encode<WlanSoftmacBaseQueryDiscoverySupportResponse, D> for (T0,)
1819 {
1820 #[inline]
1821 unsafe fn encode(
1822 self,
1823 encoder: &mut fidl::encoding::Encoder<'_, D>,
1824 offset: usize,
1825 depth: fidl::encoding::Depth,
1826 ) -> fidl::Result<()> {
1827 encoder.debug_check_bounds::<WlanSoftmacBaseQueryDiscoverySupportResponse>(offset);
1828 self.0.encode(encoder, offset + 0, depth)?;
1832 Ok(())
1833 }
1834 }
1835
1836 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1837 for WlanSoftmacBaseQueryDiscoverySupportResponse
1838 {
1839 #[inline(always)]
1840 fn new_empty() -> Self {
1841 Self { resp: fidl::new_empty!(DiscoverySupport, D) }
1842 }
1843
1844 #[inline]
1845 unsafe fn decode(
1846 &mut self,
1847 decoder: &mut fidl::encoding::Decoder<'_, D>,
1848 offset: usize,
1849 _depth: fidl::encoding::Depth,
1850 ) -> fidl::Result<()> {
1851 decoder.debug_check_bounds::<Self>(offset);
1852 fidl::decode!(DiscoverySupport, D, &mut self.resp, decoder, offset + 0, _depth)?;
1854 Ok(())
1855 }
1856 }
1857
1858 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQueryMacSublayerSupportResponse {
1859 type Borrowed<'a> = &'a Self;
1860 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1861 value
1862 }
1863 }
1864
1865 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQueryMacSublayerSupportResponse {
1866 type Owned = Self;
1867
1868 #[inline(always)]
1869 fn inline_align(_context: fidl::encoding::Context) -> usize {
1870 1
1871 }
1872
1873 #[inline(always)]
1874 fn inline_size(_context: fidl::encoding::Context) -> usize {
1875 5
1876 }
1877 }
1878
1879 unsafe impl<D: fidl::encoding::ResourceDialect>
1880 fidl::encoding::Encode<WlanSoftmacBaseQueryMacSublayerSupportResponse, D>
1881 for &WlanSoftmacBaseQueryMacSublayerSupportResponse
1882 {
1883 #[inline]
1884 unsafe fn encode(
1885 self,
1886 encoder: &mut fidl::encoding::Encoder<'_, D>,
1887 offset: usize,
1888 _depth: fidl::encoding::Depth,
1889 ) -> fidl::Result<()> {
1890 encoder.debug_check_bounds::<WlanSoftmacBaseQueryMacSublayerSupportResponse>(offset);
1891 fidl::encoding::Encode::<WlanSoftmacBaseQueryMacSublayerSupportResponse, D>::encode(
1893 (
1894 <fidl_fuchsia_wlan_common__common::MacSublayerSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
1895 ),
1896 encoder, offset, _depth
1897 )
1898 }
1899 }
1900 unsafe impl<
1901 D: fidl::encoding::ResourceDialect,
1902 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::MacSublayerSupport, D>,
1903 > fidl::encoding::Encode<WlanSoftmacBaseQueryMacSublayerSupportResponse, D> for (T0,)
1904 {
1905 #[inline]
1906 unsafe fn encode(
1907 self,
1908 encoder: &mut fidl::encoding::Encoder<'_, D>,
1909 offset: usize,
1910 depth: fidl::encoding::Depth,
1911 ) -> fidl::Result<()> {
1912 encoder.debug_check_bounds::<WlanSoftmacBaseQueryMacSublayerSupportResponse>(offset);
1913 self.0.encode(encoder, offset + 0, depth)?;
1917 Ok(())
1918 }
1919 }
1920
1921 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1922 for WlanSoftmacBaseQueryMacSublayerSupportResponse
1923 {
1924 #[inline(always)]
1925 fn new_empty() -> Self {
1926 Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common__common::MacSublayerSupport, D) }
1927 }
1928
1929 #[inline]
1930 unsafe fn decode(
1931 &mut self,
1932 decoder: &mut fidl::encoding::Decoder<'_, D>,
1933 offset: usize,
1934 _depth: fidl::encoding::Depth,
1935 ) -> fidl::Result<()> {
1936 decoder.debug_check_bounds::<Self>(offset);
1937 fidl::decode!(
1939 fidl_fuchsia_wlan_common__common::MacSublayerSupport,
1940 D,
1941 &mut self.resp,
1942 decoder,
1943 offset + 0,
1944 _depth
1945 )?;
1946 Ok(())
1947 }
1948 }
1949
1950 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQuerySecuritySupportResponse {
1951 type Borrowed<'a> = &'a Self;
1952 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1953 value
1954 }
1955 }
1956
1957 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQuerySecuritySupportResponse {
1958 type Owned = Self;
1959
1960 #[inline(always)]
1961 fn inline_align(_context: fidl::encoding::Context) -> usize {
1962 1
1963 }
1964
1965 #[inline(always)]
1966 fn inline_size(_context: fidl::encoding::Context) -> usize {
1967 3
1968 }
1969 }
1970
1971 unsafe impl<D: fidl::encoding::ResourceDialect>
1972 fidl::encoding::Encode<WlanSoftmacBaseQuerySecuritySupportResponse, D>
1973 for &WlanSoftmacBaseQuerySecuritySupportResponse
1974 {
1975 #[inline]
1976 unsafe fn encode(
1977 self,
1978 encoder: &mut fidl::encoding::Encoder<'_, D>,
1979 offset: usize,
1980 _depth: fidl::encoding::Depth,
1981 ) -> fidl::Result<()> {
1982 encoder.debug_check_bounds::<WlanSoftmacBaseQuerySecuritySupportResponse>(offset);
1983 fidl::encoding::Encode::<WlanSoftmacBaseQuerySecuritySupportResponse, D>::encode(
1985 (
1986 <fidl_fuchsia_wlan_common__common::SecuritySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
1987 ),
1988 encoder, offset, _depth
1989 )
1990 }
1991 }
1992 unsafe impl<
1993 D: fidl::encoding::ResourceDialect,
1994 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::SecuritySupport, D>,
1995 > fidl::encoding::Encode<WlanSoftmacBaseQuerySecuritySupportResponse, D> for (T0,)
1996 {
1997 #[inline]
1998 unsafe fn encode(
1999 self,
2000 encoder: &mut fidl::encoding::Encoder<'_, D>,
2001 offset: usize,
2002 depth: fidl::encoding::Depth,
2003 ) -> fidl::Result<()> {
2004 encoder.debug_check_bounds::<WlanSoftmacBaseQuerySecuritySupportResponse>(offset);
2005 self.0.encode(encoder, offset + 0, depth)?;
2009 Ok(())
2010 }
2011 }
2012
2013 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2014 for WlanSoftmacBaseQuerySecuritySupportResponse
2015 {
2016 #[inline(always)]
2017 fn new_empty() -> Self {
2018 Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common__common::SecuritySupport, D) }
2019 }
2020
2021 #[inline]
2022 unsafe fn decode(
2023 &mut self,
2024 decoder: &mut fidl::encoding::Decoder<'_, D>,
2025 offset: usize,
2026 _depth: fidl::encoding::Depth,
2027 ) -> fidl::Result<()> {
2028 decoder.debug_check_bounds::<Self>(offset);
2029 fidl::decode!(
2031 fidl_fuchsia_wlan_common__common::SecuritySupport,
2032 D,
2033 &mut self.resp,
2034 decoder,
2035 offset + 0,
2036 _depth
2037 )?;
2038 Ok(())
2039 }
2040 }
2041
2042 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
2043 type Borrowed<'a> = &'a Self;
2044 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2045 value
2046 }
2047 }
2048
2049 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
2050 type Owned = Self;
2051
2052 #[inline(always)]
2053 fn inline_align(_context: fidl::encoding::Context) -> usize {
2054 1
2055 }
2056
2057 #[inline(always)]
2058 fn inline_size(_context: fidl::encoding::Context) -> usize {
2059 1
2060 }
2061 }
2062
2063 unsafe impl<D: fidl::encoding::ResourceDialect>
2064 fidl::encoding::Encode<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D>
2065 for &WlanSoftmacBaseQuerySpectrumManagementSupportResponse
2066 {
2067 #[inline]
2068 unsafe fn encode(
2069 self,
2070 encoder: &mut fidl::encoding::Encoder<'_, D>,
2071 offset: usize,
2072 _depth: fidl::encoding::Depth,
2073 ) -> fidl::Result<()> {
2074 encoder.debug_check_bounds::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse>(
2075 offset,
2076 );
2077 fidl::encoding::Encode::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D>::encode(
2079 (
2080 <fidl_fuchsia_wlan_common__common::SpectrumManagementSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
2081 ),
2082 encoder, offset, _depth
2083 )
2084 }
2085 }
2086 unsafe impl<
2087 D: fidl::encoding::ResourceDialect,
2088 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::SpectrumManagementSupport, D>,
2089 > fidl::encoding::Encode<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D> for (T0,)
2090 {
2091 #[inline]
2092 unsafe fn encode(
2093 self,
2094 encoder: &mut fidl::encoding::Encoder<'_, D>,
2095 offset: usize,
2096 depth: fidl::encoding::Depth,
2097 ) -> fidl::Result<()> {
2098 encoder.debug_check_bounds::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse>(
2099 offset,
2100 );
2101 self.0.encode(encoder, offset + 0, depth)?;
2105 Ok(())
2106 }
2107 }
2108
2109 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2110 for WlanSoftmacBaseQuerySpectrumManagementSupportResponse
2111 {
2112 #[inline(always)]
2113 fn new_empty() -> Self {
2114 Self {
2115 resp: fidl::new_empty!(
2116 fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
2117 D
2118 ),
2119 }
2120 }
2121
2122 #[inline]
2123 unsafe fn decode(
2124 &mut self,
2125 decoder: &mut fidl::encoding::Decoder<'_, D>,
2126 offset: usize,
2127 _depth: fidl::encoding::Depth,
2128 ) -> fidl::Result<()> {
2129 decoder.debug_check_bounds::<Self>(offset);
2130 fidl::decode!(
2132 fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
2133 D,
2134 &mut self.resp,
2135 decoder,
2136 offset + 0,
2137 _depth
2138 )?;
2139 Ok(())
2140 }
2141 }
2142
2143 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBridgeSetEthernetStatusRequest {
2144 type Borrowed<'a> = &'a Self;
2145 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2146 value
2147 }
2148 }
2149
2150 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBridgeSetEthernetStatusRequest {
2151 type Owned = Self;
2152
2153 #[inline(always)]
2154 fn inline_align(_context: fidl::encoding::Context) -> usize {
2155 4
2156 }
2157
2158 #[inline(always)]
2159 fn inline_size(_context: fidl::encoding::Context) -> usize {
2160 4
2161 }
2162 #[inline(always)]
2163 fn encode_is_copy() -> bool {
2164 true
2165 }
2166
2167 #[inline(always)]
2168 fn decode_is_copy() -> bool {
2169 true
2170 }
2171 }
2172
2173 unsafe impl<D: fidl::encoding::ResourceDialect>
2174 fidl::encoding::Encode<WlanSoftmacBridgeSetEthernetStatusRequest, D>
2175 for &WlanSoftmacBridgeSetEthernetStatusRequest
2176 {
2177 #[inline]
2178 unsafe fn encode(
2179 self,
2180 encoder: &mut fidl::encoding::Encoder<'_, D>,
2181 offset: usize,
2182 _depth: fidl::encoding::Depth,
2183 ) -> fidl::Result<()> {
2184 encoder.debug_check_bounds::<WlanSoftmacBridgeSetEthernetStatusRequest>(offset);
2185 unsafe {
2186 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2188 (buf_ptr as *mut WlanSoftmacBridgeSetEthernetStatusRequest).write_unaligned(
2189 (self as *const WlanSoftmacBridgeSetEthernetStatusRequest).read(),
2190 );
2191 }
2194 Ok(())
2195 }
2196 }
2197 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2198 fidl::encoding::Encode<WlanSoftmacBridgeSetEthernetStatusRequest, D> for (T0,)
2199 {
2200 #[inline]
2201 unsafe fn encode(
2202 self,
2203 encoder: &mut fidl::encoding::Encoder<'_, D>,
2204 offset: usize,
2205 depth: fidl::encoding::Depth,
2206 ) -> fidl::Result<()> {
2207 encoder.debug_check_bounds::<WlanSoftmacBridgeSetEthernetStatusRequest>(offset);
2208 self.0.encode(encoder, offset + 0, depth)?;
2212 Ok(())
2213 }
2214 }
2215
2216 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2217 for WlanSoftmacBridgeSetEthernetStatusRequest
2218 {
2219 #[inline(always)]
2220 fn new_empty() -> Self {
2221 Self { status: fidl::new_empty!(u32, D) }
2222 }
2223
2224 #[inline]
2225 unsafe fn decode(
2226 &mut self,
2227 decoder: &mut fidl::encoding::Decoder<'_, D>,
2228 offset: usize,
2229 _depth: fidl::encoding::Depth,
2230 ) -> fidl::Result<()> {
2231 decoder.debug_check_bounds::<Self>(offset);
2232 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2233 unsafe {
2236 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2237 }
2238 Ok(())
2239 }
2240 }
2241
2242 impl fidl::encoding::ValueTypeMarker for WlanSoftmacIfcBaseReportTxResultRequest {
2243 type Borrowed<'a> = &'a Self;
2244 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2245 value
2246 }
2247 }
2248
2249 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacIfcBaseReportTxResultRequest {
2250 type Owned = Self;
2251
2252 #[inline(always)]
2253 fn inline_align(_context: fidl::encoding::Context) -> usize {
2254 2
2255 }
2256
2257 #[inline(always)]
2258 fn inline_size(_context: fidl::encoding::Context) -> usize {
2259 40
2260 }
2261 }
2262
2263 unsafe impl<D: fidl::encoding::ResourceDialect>
2264 fidl::encoding::Encode<WlanSoftmacIfcBaseReportTxResultRequest, D>
2265 for &WlanSoftmacIfcBaseReportTxResultRequest
2266 {
2267 #[inline]
2268 unsafe fn encode(
2269 self,
2270 encoder: &mut fidl::encoding::Encoder<'_, D>,
2271 offset: usize,
2272 _depth: fidl::encoding::Depth,
2273 ) -> fidl::Result<()> {
2274 encoder.debug_check_bounds::<WlanSoftmacIfcBaseReportTxResultRequest>(offset);
2275 fidl::encoding::Encode::<WlanSoftmacIfcBaseReportTxResultRequest, D>::encode(
2277 (
2278 <fidl_fuchsia_wlan_common__common::WlanTxResult as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_result),
2279 ),
2280 encoder, offset, _depth
2281 )
2282 }
2283 }
2284 unsafe impl<
2285 D: fidl::encoding::ResourceDialect,
2286 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanTxResult, D>,
2287 > fidl::encoding::Encode<WlanSoftmacIfcBaseReportTxResultRequest, D> for (T0,)
2288 {
2289 #[inline]
2290 unsafe fn encode(
2291 self,
2292 encoder: &mut fidl::encoding::Encoder<'_, D>,
2293 offset: usize,
2294 depth: fidl::encoding::Depth,
2295 ) -> fidl::Result<()> {
2296 encoder.debug_check_bounds::<WlanSoftmacIfcBaseReportTxResultRequest>(offset);
2297 self.0.encode(encoder, offset + 0, depth)?;
2301 Ok(())
2302 }
2303 }
2304
2305 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2306 for WlanSoftmacIfcBaseReportTxResultRequest
2307 {
2308 #[inline(always)]
2309 fn new_empty() -> Self {
2310 Self { tx_result: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanTxResult, D) }
2311 }
2312
2313 #[inline]
2314 unsafe fn decode(
2315 &mut self,
2316 decoder: &mut fidl::encoding::Decoder<'_, D>,
2317 offset: usize,
2318 _depth: fidl::encoding::Depth,
2319 ) -> fidl::Result<()> {
2320 decoder.debug_check_bounds::<Self>(offset);
2321 fidl::decode!(
2323 fidl_fuchsia_wlan_common__common::WlanTxResult,
2324 D,
2325 &mut self.tx_result,
2326 decoder,
2327 offset + 0,
2328 _depth
2329 )?;
2330 Ok(())
2331 }
2332 }
2333
2334 impl fidl::encoding::ValueTypeMarker for WlanTxInfo {
2335 type Borrowed<'a> = &'a Self;
2336 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2337 value
2338 }
2339 }
2340
2341 unsafe impl fidl::encoding::TypeMarker for WlanTxInfo {
2342 type Owned = Self;
2343
2344 #[inline(always)]
2345 fn inline_align(_context: fidl::encoding::Context) -> usize {
2346 4
2347 }
2348
2349 #[inline(always)]
2350 fn inline_size(_context: fidl::encoding::Context) -> usize {
2351 24
2352 }
2353 }
2354
2355 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxInfo, D>
2356 for &WlanTxInfo
2357 {
2358 #[inline]
2359 unsafe fn encode(
2360 self,
2361 encoder: &mut fidl::encoding::Encoder<'_, D>,
2362 offset: usize,
2363 _depth: fidl::encoding::Depth,
2364 ) -> fidl::Result<()> {
2365 encoder.debug_check_bounds::<WlanTxInfo>(offset);
2366 fidl::encoding::Encode::<WlanTxInfo, D>::encode(
2368 (
2369 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_flags),
2370 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
2371 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_vector_idx),
2372 <fidl_fuchsia_wlan_common__common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
2373 <fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_bandwidth),
2374 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
2375 ),
2376 encoder, offset, _depth
2377 )
2378 }
2379 }
2380 unsafe impl<
2381 D: fidl::encoding::ResourceDialect,
2382 T0: fidl::encoding::Encode<u32, D>,
2383 T1: fidl::encoding::Encode<u32, D>,
2384 T2: fidl::encoding::Encode<u16, D>,
2385 T3: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanPhyType, D>,
2386 T4: fidl::encoding::Encode<fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth, D>,
2387 T5: fidl::encoding::Encode<u8, D>,
2388 > fidl::encoding::Encode<WlanTxInfo, D> for (T0, T1, T2, T3, T4, T5)
2389 {
2390 #[inline]
2391 unsafe fn encode(
2392 self,
2393 encoder: &mut fidl::encoding::Encoder<'_, D>,
2394 offset: usize,
2395 depth: fidl::encoding::Depth,
2396 ) -> fidl::Result<()> {
2397 encoder.debug_check_bounds::<WlanTxInfo>(offset);
2398 unsafe {
2401 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2402 (ptr as *mut u32).write_unaligned(0);
2403 }
2404 unsafe {
2405 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(20);
2406 (ptr as *mut u32).write_unaligned(0);
2407 }
2408 self.0.encode(encoder, offset + 0, depth)?;
2410 self.1.encode(encoder, offset + 4, depth)?;
2411 self.2.encode(encoder, offset + 8, depth)?;
2412 self.3.encode(encoder, offset + 12, depth)?;
2413 self.4.encode(encoder, offset + 16, depth)?;
2414 self.5.encode(encoder, offset + 20, depth)?;
2415 Ok(())
2416 }
2417 }
2418
2419 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfo {
2420 #[inline(always)]
2421 fn new_empty() -> Self {
2422 Self {
2423 tx_flags: fidl::new_empty!(u32, D),
2424 valid_fields: fidl::new_empty!(u32, D),
2425 tx_vector_idx: fidl::new_empty!(u16, D),
2426 phy: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanPhyType, D),
2427 channel_bandwidth: fidl::new_empty!(
2428 fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth,
2429 D
2430 ),
2431 mcs: fidl::new_empty!(u8, D),
2432 }
2433 }
2434
2435 #[inline]
2436 unsafe fn decode(
2437 &mut self,
2438 decoder: &mut fidl::encoding::Decoder<'_, D>,
2439 offset: usize,
2440 _depth: fidl::encoding::Depth,
2441 ) -> fidl::Result<()> {
2442 decoder.debug_check_bounds::<Self>(offset);
2443 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2445 let padval = unsafe { (ptr as *const u32).read_unaligned() };
2446 let mask = 0xffff0000u32;
2447 let maskedval = padval & mask;
2448 if maskedval != 0 {
2449 return Err(fidl::Error::NonZeroPadding {
2450 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2451 });
2452 }
2453 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(20) };
2454 let padval = unsafe { (ptr as *const u32).read_unaligned() };
2455 let mask = 0xffffff00u32;
2456 let maskedval = padval & mask;
2457 if maskedval != 0 {
2458 return Err(fidl::Error::NonZeroPadding {
2459 padding_start: offset + 20 + ((mask as u64).trailing_zeros() / 8) as usize,
2460 });
2461 }
2462 fidl::decode!(u32, D, &mut self.tx_flags, decoder, offset + 0, _depth)?;
2463 fidl::decode!(u32, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
2464 fidl::decode!(u16, D, &mut self.tx_vector_idx, decoder, offset + 8, _depth)?;
2465 fidl::decode!(
2466 fidl_fuchsia_wlan_common__common::WlanPhyType,
2467 D,
2468 &mut self.phy,
2469 decoder,
2470 offset + 12,
2471 _depth
2472 )?;
2473 fidl::decode!(
2474 fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth,
2475 D,
2476 &mut self.channel_bandwidth,
2477 decoder,
2478 offset + 16,
2479 _depth
2480 )?;
2481 fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 20, _depth)?;
2482 Ok(())
2483 }
2484 }
2485
2486 impl fidl::encoding::ValueTypeMarker for WlanTxPacket {
2487 type Borrowed<'a> = &'a Self;
2488 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2489 value
2490 }
2491 }
2492
2493 unsafe impl fidl::encoding::TypeMarker for WlanTxPacket {
2494 type Owned = Self;
2495
2496 #[inline(always)]
2497 fn inline_align(_context: fidl::encoding::Context) -> usize {
2498 8
2499 }
2500
2501 #[inline(always)]
2502 fn inline_size(_context: fidl::encoding::Context) -> usize {
2503 40
2504 }
2505 }
2506
2507 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxPacket, D>
2508 for &WlanTxPacket
2509 {
2510 #[inline]
2511 unsafe fn encode(
2512 self,
2513 encoder: &mut fidl::encoding::Encoder<'_, D>,
2514 offset: usize,
2515 _depth: fidl::encoding::Depth,
2516 ) -> fidl::Result<()> {
2517 encoder.debug_check_bounds::<WlanTxPacket>(offset);
2518 fidl::encoding::Encode::<WlanTxPacket, D>::encode(
2520 (
2521 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_frame),
2522 <WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
2523 ),
2524 encoder, offset, _depth
2525 )
2526 }
2527 }
2528 unsafe impl<
2529 D: fidl::encoding::ResourceDialect,
2530 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
2531 T1: fidl::encoding::Encode<WlanTxInfo, D>,
2532 > fidl::encoding::Encode<WlanTxPacket, D> for (T0, T1)
2533 {
2534 #[inline]
2535 unsafe fn encode(
2536 self,
2537 encoder: &mut fidl::encoding::Encoder<'_, D>,
2538 offset: usize,
2539 depth: fidl::encoding::Depth,
2540 ) -> fidl::Result<()> {
2541 encoder.debug_check_bounds::<WlanTxPacket>(offset);
2542 self.0.encode(encoder, offset + 0, depth)?;
2546 self.1.encode(encoder, offset + 16, depth)?;
2547 Ok(())
2548 }
2549 }
2550
2551 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxPacket {
2552 #[inline(always)]
2553 fn new_empty() -> Self {
2554 Self {
2555 mac_frame: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
2556 info: fidl::new_empty!(WlanTxInfo, D),
2557 }
2558 }
2559
2560 #[inline]
2561 unsafe fn decode(
2562 &mut self,
2563 decoder: &mut fidl::encoding::Decoder<'_, D>,
2564 offset: usize,
2565 _depth: fidl::encoding::Depth,
2566 ) -> fidl::Result<()> {
2567 decoder.debug_check_bounds::<Self>(offset);
2568 fidl::decode!(
2570 fidl::encoding::UnboundedVector<u8>,
2571 D,
2572 &mut self.mac_frame,
2573 decoder,
2574 offset + 0,
2575 _depth
2576 )?;
2577 fidl::decode!(WlanTxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
2578 Ok(())
2579 }
2580 }
2581
2582 impl EthernetRxTransferRequest {
2583 #[inline(always)]
2584 fn max_ordinal_present(&self) -> u64 {
2585 if let Some(_) = self.packet_size {
2586 return 2;
2587 }
2588 if let Some(_) = self.packet_address {
2589 return 1;
2590 }
2591 0
2592 }
2593 }
2594
2595 impl fidl::encoding::ValueTypeMarker for EthernetRxTransferRequest {
2596 type Borrowed<'a> = &'a Self;
2597 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2598 value
2599 }
2600 }
2601
2602 unsafe impl fidl::encoding::TypeMarker for EthernetRxTransferRequest {
2603 type Owned = Self;
2604
2605 #[inline(always)]
2606 fn inline_align(_context: fidl::encoding::Context) -> usize {
2607 8
2608 }
2609
2610 #[inline(always)]
2611 fn inline_size(_context: fidl::encoding::Context) -> usize {
2612 16
2613 }
2614 }
2615
2616 unsafe impl<D: fidl::encoding::ResourceDialect>
2617 fidl::encoding::Encode<EthernetRxTransferRequest, D> for &EthernetRxTransferRequest
2618 {
2619 unsafe fn encode(
2620 self,
2621 encoder: &mut fidl::encoding::Encoder<'_, D>,
2622 offset: usize,
2623 mut depth: fidl::encoding::Depth,
2624 ) -> fidl::Result<()> {
2625 encoder.debug_check_bounds::<EthernetRxTransferRequest>(offset);
2626 let max_ordinal: u64 = self.max_ordinal_present();
2628 encoder.write_num(max_ordinal, offset);
2629 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2630 if max_ordinal == 0 {
2632 return Ok(());
2633 }
2634 depth.increment()?;
2635 let envelope_size = 8;
2636 let bytes_len = max_ordinal as usize * envelope_size;
2637 #[allow(unused_variables)]
2638 let offset = encoder.out_of_line_offset(bytes_len);
2639 let mut _prev_end_offset: usize = 0;
2640 if 1 > max_ordinal {
2641 return Ok(());
2642 }
2643
2644 let cur_offset: usize = (1 - 1) * envelope_size;
2647
2648 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2650
2651 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2656 self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2657 encoder,
2658 offset + cur_offset,
2659 depth,
2660 )?;
2661
2662 _prev_end_offset = cur_offset + envelope_size;
2663 if 2 > max_ordinal {
2664 return Ok(());
2665 }
2666
2667 let cur_offset: usize = (2 - 1) * envelope_size;
2670
2671 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2673
2674 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2679 self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2680 encoder,
2681 offset + cur_offset,
2682 depth,
2683 )?;
2684
2685 _prev_end_offset = cur_offset + envelope_size;
2686
2687 Ok(())
2688 }
2689 }
2690
2691 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2692 for EthernetRxTransferRequest
2693 {
2694 #[inline(always)]
2695 fn new_empty() -> Self {
2696 Self::default()
2697 }
2698
2699 unsafe fn decode(
2700 &mut self,
2701 decoder: &mut fidl::encoding::Decoder<'_, D>,
2702 offset: usize,
2703 mut depth: fidl::encoding::Depth,
2704 ) -> fidl::Result<()> {
2705 decoder.debug_check_bounds::<Self>(offset);
2706 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2707 None => return Err(fidl::Error::NotNullable),
2708 Some(len) => len,
2709 };
2710 if len == 0 {
2712 return Ok(());
2713 };
2714 depth.increment()?;
2715 let envelope_size = 8;
2716 let bytes_len = len * envelope_size;
2717 let offset = decoder.out_of_line_offset(bytes_len)?;
2718 let mut _next_ordinal_to_read = 0;
2720 let mut next_offset = offset;
2721 let end_offset = offset + bytes_len;
2722 _next_ordinal_to_read += 1;
2723 if next_offset >= end_offset {
2724 return Ok(());
2725 }
2726
2727 while _next_ordinal_to_read < 1 {
2729 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2730 _next_ordinal_to_read += 1;
2731 next_offset += envelope_size;
2732 }
2733
2734 let next_out_of_line = decoder.next_out_of_line();
2735 let handles_before = decoder.remaining_handles();
2736 if let Some((inlined, num_bytes, num_handles)) =
2737 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2738 {
2739 let member_inline_size =
2740 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2741 if inlined != (member_inline_size <= 4) {
2742 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2743 }
2744 let inner_offset;
2745 let mut inner_depth = depth.clone();
2746 if inlined {
2747 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2748 inner_offset = next_offset;
2749 } else {
2750 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2751 inner_depth.increment()?;
2752 }
2753 let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
2754 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2755 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2756 {
2757 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2758 }
2759 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2760 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2761 }
2762 }
2763
2764 next_offset += envelope_size;
2765 _next_ordinal_to_read += 1;
2766 if next_offset >= end_offset {
2767 return Ok(());
2768 }
2769
2770 while _next_ordinal_to_read < 2 {
2772 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2773 _next_ordinal_to_read += 1;
2774 next_offset += envelope_size;
2775 }
2776
2777 let next_out_of_line = decoder.next_out_of_line();
2778 let handles_before = decoder.remaining_handles();
2779 if let Some((inlined, num_bytes, num_handles)) =
2780 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2781 {
2782 let member_inline_size =
2783 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2784 if inlined != (member_inline_size <= 4) {
2785 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2786 }
2787 let inner_offset;
2788 let mut inner_depth = depth.clone();
2789 if inlined {
2790 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2791 inner_offset = next_offset;
2792 } else {
2793 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2794 inner_depth.increment()?;
2795 }
2796 let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
2797 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2798 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2799 {
2800 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2801 }
2802 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2803 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2804 }
2805 }
2806
2807 next_offset += envelope_size;
2808
2809 while next_offset < end_offset {
2811 _next_ordinal_to_read += 1;
2812 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2813 next_offset += envelope_size;
2814 }
2815
2816 Ok(())
2817 }
2818 }
2819
2820 impl EthernetTxTransferRequest {
2821 #[inline(always)]
2822 fn max_ordinal_present(&self) -> u64 {
2823 if let Some(_) = self.complete_borrowed_operation {
2824 return 5;
2825 }
2826 if let Some(_) = self.borrowed_operation {
2827 return 4;
2828 }
2829 if let Some(_) = self.async_id {
2830 return 3;
2831 }
2832 if let Some(_) = self.packet_size {
2833 return 2;
2834 }
2835 if let Some(_) = self.packet_address {
2836 return 1;
2837 }
2838 0
2839 }
2840 }
2841
2842 impl fidl::encoding::ValueTypeMarker for EthernetTxTransferRequest {
2843 type Borrowed<'a> = &'a Self;
2844 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2845 value
2846 }
2847 }
2848
2849 unsafe impl fidl::encoding::TypeMarker for EthernetTxTransferRequest {
2850 type Owned = Self;
2851
2852 #[inline(always)]
2853 fn inline_align(_context: fidl::encoding::Context) -> usize {
2854 8
2855 }
2856
2857 #[inline(always)]
2858 fn inline_size(_context: fidl::encoding::Context) -> usize {
2859 16
2860 }
2861 }
2862
2863 unsafe impl<D: fidl::encoding::ResourceDialect>
2864 fidl::encoding::Encode<EthernetTxTransferRequest, D> for &EthernetTxTransferRequest
2865 {
2866 unsafe fn encode(
2867 self,
2868 encoder: &mut fidl::encoding::Encoder<'_, D>,
2869 offset: usize,
2870 mut depth: fidl::encoding::Depth,
2871 ) -> fidl::Result<()> {
2872 encoder.debug_check_bounds::<EthernetTxTransferRequest>(offset);
2873 let max_ordinal: u64 = self.max_ordinal_present();
2875 encoder.write_num(max_ordinal, offset);
2876 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2877 if max_ordinal == 0 {
2879 return Ok(());
2880 }
2881 depth.increment()?;
2882 let envelope_size = 8;
2883 let bytes_len = max_ordinal as usize * envelope_size;
2884 #[allow(unused_variables)]
2885 let offset = encoder.out_of_line_offset(bytes_len);
2886 let mut _prev_end_offset: usize = 0;
2887 if 1 > max_ordinal {
2888 return Ok(());
2889 }
2890
2891 let cur_offset: usize = (1 - 1) * envelope_size;
2894
2895 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2897
2898 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2903 self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2904 encoder,
2905 offset + cur_offset,
2906 depth,
2907 )?;
2908
2909 _prev_end_offset = cur_offset + envelope_size;
2910 if 2 > max_ordinal {
2911 return Ok(());
2912 }
2913
2914 let cur_offset: usize = (2 - 1) * envelope_size;
2917
2918 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2920
2921 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2926 self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2927 encoder,
2928 offset + cur_offset,
2929 depth,
2930 )?;
2931
2932 _prev_end_offset = cur_offset + envelope_size;
2933 if 3 > max_ordinal {
2934 return Ok(());
2935 }
2936
2937 let cur_offset: usize = (3 - 1) * envelope_size;
2940
2941 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2943
2944 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2949 self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2950 encoder,
2951 offset + cur_offset,
2952 depth,
2953 )?;
2954
2955 _prev_end_offset = cur_offset + envelope_size;
2956 if 4 > max_ordinal {
2957 return Ok(());
2958 }
2959
2960 let cur_offset: usize = (4 - 1) * envelope_size;
2963
2964 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2966
2967 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2972 self.borrowed_operation
2973 .as_ref()
2974 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2975 encoder,
2976 offset + cur_offset,
2977 depth,
2978 )?;
2979
2980 _prev_end_offset = cur_offset + envelope_size;
2981 if 5 > max_ordinal {
2982 return Ok(());
2983 }
2984
2985 let cur_offset: usize = (5 - 1) * envelope_size;
2988
2989 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2991
2992 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2997 self.complete_borrowed_operation
2998 .as_ref()
2999 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
3000 encoder,
3001 offset + cur_offset,
3002 depth,
3003 )?;
3004
3005 _prev_end_offset = cur_offset + envelope_size;
3006
3007 Ok(())
3008 }
3009 }
3010
3011 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3012 for EthernetTxTransferRequest
3013 {
3014 #[inline(always)]
3015 fn new_empty() -> Self {
3016 Self::default()
3017 }
3018
3019 unsafe fn decode(
3020 &mut self,
3021 decoder: &mut fidl::encoding::Decoder<'_, D>,
3022 offset: usize,
3023 mut depth: fidl::encoding::Depth,
3024 ) -> fidl::Result<()> {
3025 decoder.debug_check_bounds::<Self>(offset);
3026 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3027 None => return Err(fidl::Error::NotNullable),
3028 Some(len) => len,
3029 };
3030 if len == 0 {
3032 return Ok(());
3033 };
3034 depth.increment()?;
3035 let envelope_size = 8;
3036 let bytes_len = len * envelope_size;
3037 let offset = decoder.out_of_line_offset(bytes_len)?;
3038 let mut _next_ordinal_to_read = 0;
3040 let mut next_offset = offset;
3041 let end_offset = offset + bytes_len;
3042 _next_ordinal_to_read += 1;
3043 if next_offset >= end_offset {
3044 return Ok(());
3045 }
3046
3047 while _next_ordinal_to_read < 1 {
3049 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3050 _next_ordinal_to_read += 1;
3051 next_offset += envelope_size;
3052 }
3053
3054 let next_out_of_line = decoder.next_out_of_line();
3055 let handles_before = decoder.remaining_handles();
3056 if let Some((inlined, num_bytes, num_handles)) =
3057 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3058 {
3059 let member_inline_size =
3060 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3061 if inlined != (member_inline_size <= 4) {
3062 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3063 }
3064 let inner_offset;
3065 let mut inner_depth = depth.clone();
3066 if inlined {
3067 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3068 inner_offset = next_offset;
3069 } else {
3070 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3071 inner_depth.increment()?;
3072 }
3073 let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
3074 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3075 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3076 {
3077 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3078 }
3079 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3080 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3081 }
3082 }
3083
3084 next_offset += envelope_size;
3085 _next_ordinal_to_read += 1;
3086 if next_offset >= end_offset {
3087 return Ok(());
3088 }
3089
3090 while _next_ordinal_to_read < 2 {
3092 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3093 _next_ordinal_to_read += 1;
3094 next_offset += envelope_size;
3095 }
3096
3097 let next_out_of_line = decoder.next_out_of_line();
3098 let handles_before = decoder.remaining_handles();
3099 if let Some((inlined, num_bytes, num_handles)) =
3100 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3101 {
3102 let member_inline_size =
3103 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3104 if inlined != (member_inline_size <= 4) {
3105 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3106 }
3107 let inner_offset;
3108 let mut inner_depth = depth.clone();
3109 if inlined {
3110 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3111 inner_offset = next_offset;
3112 } else {
3113 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3114 inner_depth.increment()?;
3115 }
3116 let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
3117 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3118 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3119 {
3120 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3121 }
3122 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3123 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3124 }
3125 }
3126
3127 next_offset += envelope_size;
3128 _next_ordinal_to_read += 1;
3129 if next_offset >= end_offset {
3130 return Ok(());
3131 }
3132
3133 while _next_ordinal_to_read < 3 {
3135 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3136 _next_ordinal_to_read += 1;
3137 next_offset += envelope_size;
3138 }
3139
3140 let next_out_of_line = decoder.next_out_of_line();
3141 let handles_before = decoder.remaining_handles();
3142 if let Some((inlined, num_bytes, num_handles)) =
3143 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3144 {
3145 let member_inline_size =
3146 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3147 if inlined != (member_inline_size <= 4) {
3148 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3149 }
3150 let inner_offset;
3151 let mut inner_depth = depth.clone();
3152 if inlined {
3153 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3154 inner_offset = next_offset;
3155 } else {
3156 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3157 inner_depth.increment()?;
3158 }
3159 let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
3160 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3161 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3162 {
3163 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3164 }
3165 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3166 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3167 }
3168 }
3169
3170 next_offset += envelope_size;
3171 _next_ordinal_to_read += 1;
3172 if next_offset >= end_offset {
3173 return Ok(());
3174 }
3175
3176 while _next_ordinal_to_read < 4 {
3178 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3179 _next_ordinal_to_read += 1;
3180 next_offset += envelope_size;
3181 }
3182
3183 let next_out_of_line = decoder.next_out_of_line();
3184 let handles_before = decoder.remaining_handles();
3185 if let Some((inlined, num_bytes, num_handles)) =
3186 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3187 {
3188 let member_inline_size =
3189 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3190 if inlined != (member_inline_size <= 4) {
3191 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3192 }
3193 let inner_offset;
3194 let mut inner_depth = depth.clone();
3195 if inlined {
3196 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3197 inner_offset = next_offset;
3198 } else {
3199 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3200 inner_depth.increment()?;
3201 }
3202 let val_ref =
3203 self.borrowed_operation.get_or_insert_with(|| fidl::new_empty!(u64, D));
3204 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3205 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3206 {
3207 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3208 }
3209 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3210 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3211 }
3212 }
3213
3214 next_offset += envelope_size;
3215 _next_ordinal_to_read += 1;
3216 if next_offset >= end_offset {
3217 return Ok(());
3218 }
3219
3220 while _next_ordinal_to_read < 5 {
3222 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3223 _next_ordinal_to_read += 1;
3224 next_offset += envelope_size;
3225 }
3226
3227 let next_out_of_line = decoder.next_out_of_line();
3228 let handles_before = decoder.remaining_handles();
3229 if let Some((inlined, num_bytes, num_handles)) =
3230 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3231 {
3232 let member_inline_size =
3233 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3234 if inlined != (member_inline_size <= 4) {
3235 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3236 }
3237 let inner_offset;
3238 let mut inner_depth = depth.clone();
3239 if inlined {
3240 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3241 inner_offset = next_offset;
3242 } else {
3243 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3244 inner_depth.increment()?;
3245 }
3246 let val_ref = self
3247 .complete_borrowed_operation
3248 .get_or_insert_with(|| fidl::new_empty!(u64, D));
3249 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3250 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3251 {
3252 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3253 }
3254 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3255 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3256 }
3257 }
3258
3259 next_offset += envelope_size;
3260
3261 while next_offset < end_offset {
3263 _next_ordinal_to_read += 1;
3264 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3265 next_offset += envelope_size;
3266 }
3267
3268 Ok(())
3269 }
3270 }
3271
3272 impl WlanAssociationConfig {
3273 #[inline(always)]
3274 fn max_ordinal_present(&self) -> u64 {
3275 if let Some(_) = self.vht_op {
3276 return 12;
3277 }
3278 if let Some(_) = self.vht_cap {
3279 return 11;
3280 }
3281 if let Some(_) = self.ht_op {
3282 return 10;
3283 }
3284 if let Some(_) = self.ht_cap {
3285 return 9;
3286 }
3287 if let Some(_) = self.capability_info {
3288 return 8;
3289 }
3290 if let Some(_) = self.rates {
3291 return 7;
3292 }
3293 if let Some(_) = self.wmm_params {
3294 return 6;
3295 }
3296 if let Some(_) = self.qos {
3297 return 5;
3298 }
3299 if let Some(_) = self.channel {
3300 return 4;
3301 }
3302 if let Some(_) = self.listen_interval {
3303 return 3;
3304 }
3305 if let Some(_) = self.aid {
3306 return 2;
3307 }
3308 if let Some(_) = self.bssid {
3309 return 1;
3310 }
3311 0
3312 }
3313 }
3314
3315 impl fidl::encoding::ValueTypeMarker for WlanAssociationConfig {
3316 type Borrowed<'a> = &'a Self;
3317 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3318 value
3319 }
3320 }
3321
3322 unsafe impl fidl::encoding::TypeMarker for WlanAssociationConfig {
3323 type Owned = Self;
3324
3325 #[inline(always)]
3326 fn inline_align(_context: fidl::encoding::Context) -> usize {
3327 8
3328 }
3329
3330 #[inline(always)]
3331 fn inline_size(_context: fidl::encoding::Context) -> usize {
3332 16
3333 }
3334 }
3335
3336 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanAssociationConfig, D>
3337 for &WlanAssociationConfig
3338 {
3339 unsafe fn encode(
3340 self,
3341 encoder: &mut fidl::encoding::Encoder<'_, D>,
3342 offset: usize,
3343 mut depth: fidl::encoding::Depth,
3344 ) -> fidl::Result<()> {
3345 encoder.debug_check_bounds::<WlanAssociationConfig>(offset);
3346 let max_ordinal: u64 = self.max_ordinal_present();
3348 encoder.write_num(max_ordinal, offset);
3349 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3350 if max_ordinal == 0 {
3352 return Ok(());
3353 }
3354 depth.increment()?;
3355 let envelope_size = 8;
3356 let bytes_len = max_ordinal as usize * envelope_size;
3357 #[allow(unused_variables)]
3358 let offset = encoder.out_of_line_offset(bytes_len);
3359 let mut _prev_end_offset: usize = 0;
3360 if 1 > max_ordinal {
3361 return Ok(());
3362 }
3363
3364 let cur_offset: usize = (1 - 1) * envelope_size;
3367
3368 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3370
3371 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
3376 self.bssid
3377 .as_ref()
3378 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
3379 encoder,
3380 offset + cur_offset,
3381 depth,
3382 )?;
3383
3384 _prev_end_offset = cur_offset + envelope_size;
3385 if 2 > max_ordinal {
3386 return Ok(());
3387 }
3388
3389 let cur_offset: usize = (2 - 1) * envelope_size;
3392
3393 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3395
3396 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3401 self.aid.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3402 encoder,
3403 offset + cur_offset,
3404 depth,
3405 )?;
3406
3407 _prev_end_offset = cur_offset + envelope_size;
3408 if 3 > max_ordinal {
3409 return Ok(());
3410 }
3411
3412 let cur_offset: usize = (3 - 1) * envelope_size;
3415
3416 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3418
3419 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3424 self.listen_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3425 encoder,
3426 offset + cur_offset,
3427 depth,
3428 )?;
3429
3430 _prev_end_offset = cur_offset + envelope_size;
3431 if 4 > max_ordinal {
3432 return Ok(());
3433 }
3434
3435 let cur_offset: usize = (4 - 1) * envelope_size;
3438
3439 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3441
3442 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D>(
3447 self.channel.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow),
3448 encoder, offset + cur_offset, depth
3449 )?;
3450
3451 _prev_end_offset = cur_offset + envelope_size;
3452 if 5 > max_ordinal {
3453 return Ok(());
3454 }
3455
3456 let cur_offset: usize = (5 - 1) * envelope_size;
3459
3460 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3462
3463 fidl::encoding::encode_in_envelope_optional::<bool, D>(
3468 self.qos.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3469 encoder,
3470 offset + cur_offset,
3471 depth,
3472 )?;
3473
3474 _prev_end_offset = cur_offset + envelope_size;
3475 if 6 > max_ordinal {
3476 return Ok(());
3477 }
3478
3479 let cur_offset: usize = (6 - 1) * envelope_size;
3482
3483 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3485
3486 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanWmmParameters, D>(
3491 self.wmm_params.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow),
3492 encoder, offset + cur_offset, depth
3493 )?;
3494
3495 _prev_end_offset = cur_offset + envelope_size;
3496 if 7 > max_ordinal {
3497 return Ok(());
3498 }
3499
3500 let cur_offset: usize = (7 - 1) * envelope_size;
3503
3504 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3506
3507 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 263>, D>(
3512 self.rates.as_ref().map(
3513 <fidl::encoding::Vector<u8, 263> as fidl::encoding::ValueTypeMarker>::borrow,
3514 ),
3515 encoder,
3516 offset + cur_offset,
3517 depth,
3518 )?;
3519
3520 _prev_end_offset = cur_offset + envelope_size;
3521 if 8 > max_ordinal {
3522 return Ok(());
3523 }
3524
3525 let cur_offset: usize = (8 - 1) * envelope_size;
3528
3529 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3531
3532 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3537 self.capability_info.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3538 encoder,
3539 offset + cur_offset,
3540 depth,
3541 )?;
3542
3543 _prev_end_offset = cur_offset + envelope_size;
3544 if 9 > max_ordinal {
3545 return Ok(());
3546 }
3547
3548 let cur_offset: usize = (9 - 1) * envelope_size;
3551
3552 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3554
3555 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D>(
3560 self.ht_cap.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
3561 encoder, offset + cur_offset, depth
3562 )?;
3563
3564 _prev_end_offset = cur_offset + envelope_size;
3565 if 10 > max_ordinal {
3566 return Ok(());
3567 }
3568
3569 let cur_offset: usize = (10 - 1) * envelope_size;
3572
3573 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3575
3576 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::HtOperation, D>(
3581 self.ht_op.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::HtOperation as fidl::encoding::ValueTypeMarker>::borrow),
3582 encoder, offset + cur_offset, depth
3583 )?;
3584
3585 _prev_end_offset = cur_offset + envelope_size;
3586 if 11 > max_ordinal {
3587 return Ok(());
3588 }
3589
3590 let cur_offset: usize = (11 - 1) * envelope_size;
3593
3594 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3596
3597 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D>(
3602 self.vht_cap.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
3603 encoder, offset + cur_offset, depth
3604 )?;
3605
3606 _prev_end_offset = cur_offset + envelope_size;
3607 if 12 > max_ordinal {
3608 return Ok(());
3609 }
3610
3611 let cur_offset: usize = (12 - 1) * envelope_size;
3614
3615 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3617
3618 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::VhtOperation, D>(
3623 self.vht_op.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::VhtOperation as fidl::encoding::ValueTypeMarker>::borrow),
3624 encoder, offset + cur_offset, depth
3625 )?;
3626
3627 _prev_end_offset = cur_offset + envelope_size;
3628
3629 Ok(())
3630 }
3631 }
3632
3633 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanAssociationConfig {
3634 #[inline(always)]
3635 fn new_empty() -> Self {
3636 Self::default()
3637 }
3638
3639 unsafe fn decode(
3640 &mut self,
3641 decoder: &mut fidl::encoding::Decoder<'_, D>,
3642 offset: usize,
3643 mut depth: fidl::encoding::Depth,
3644 ) -> fidl::Result<()> {
3645 decoder.debug_check_bounds::<Self>(offset);
3646 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3647 None => return Err(fidl::Error::NotNullable),
3648 Some(len) => len,
3649 };
3650 if len == 0 {
3652 return Ok(());
3653 };
3654 depth.increment()?;
3655 let envelope_size = 8;
3656 let bytes_len = len * envelope_size;
3657 let offset = decoder.out_of_line_offset(bytes_len)?;
3658 let mut _next_ordinal_to_read = 0;
3660 let mut next_offset = offset;
3661 let end_offset = offset + bytes_len;
3662 _next_ordinal_to_read += 1;
3663 if next_offset >= end_offset {
3664 return Ok(());
3665 }
3666
3667 while _next_ordinal_to_read < 1 {
3669 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3670 _next_ordinal_to_read += 1;
3671 next_offset += envelope_size;
3672 }
3673
3674 let next_out_of_line = decoder.next_out_of_line();
3675 let handles_before = decoder.remaining_handles();
3676 if let Some((inlined, num_bytes, num_handles)) =
3677 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3678 {
3679 let member_inline_size =
3680 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
3681 decoder.context,
3682 );
3683 if inlined != (member_inline_size <= 4) {
3684 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3685 }
3686 let inner_offset;
3687 let mut inner_depth = depth.clone();
3688 if inlined {
3689 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3690 inner_offset = next_offset;
3691 } else {
3692 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3693 inner_depth.increment()?;
3694 }
3695 let val_ref = self
3696 .bssid
3697 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
3698 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
3699 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3700 {
3701 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3702 }
3703 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3704 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3705 }
3706 }
3707
3708 next_offset += envelope_size;
3709 _next_ordinal_to_read += 1;
3710 if next_offset >= end_offset {
3711 return Ok(());
3712 }
3713
3714 while _next_ordinal_to_read < 2 {
3716 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3717 _next_ordinal_to_read += 1;
3718 next_offset += envelope_size;
3719 }
3720
3721 let next_out_of_line = decoder.next_out_of_line();
3722 let handles_before = decoder.remaining_handles();
3723 if let Some((inlined, num_bytes, num_handles)) =
3724 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3725 {
3726 let member_inline_size =
3727 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3728 if inlined != (member_inline_size <= 4) {
3729 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3730 }
3731 let inner_offset;
3732 let mut inner_depth = depth.clone();
3733 if inlined {
3734 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3735 inner_offset = next_offset;
3736 } else {
3737 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3738 inner_depth.increment()?;
3739 }
3740 let val_ref = self.aid.get_or_insert_with(|| fidl::new_empty!(u16, D));
3741 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3742 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3743 {
3744 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3745 }
3746 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3747 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3748 }
3749 }
3750
3751 next_offset += envelope_size;
3752 _next_ordinal_to_read += 1;
3753 if next_offset >= end_offset {
3754 return Ok(());
3755 }
3756
3757 while _next_ordinal_to_read < 3 {
3759 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3760 _next_ordinal_to_read += 1;
3761 next_offset += envelope_size;
3762 }
3763
3764 let next_out_of_line = decoder.next_out_of_line();
3765 let handles_before = decoder.remaining_handles();
3766 if let Some((inlined, num_bytes, num_handles)) =
3767 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3768 {
3769 let member_inline_size =
3770 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3771 if inlined != (member_inline_size <= 4) {
3772 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3773 }
3774 let inner_offset;
3775 let mut inner_depth = depth.clone();
3776 if inlined {
3777 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3778 inner_offset = next_offset;
3779 } else {
3780 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3781 inner_depth.increment()?;
3782 }
3783 let val_ref = self.listen_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
3784 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3785 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3786 {
3787 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3788 }
3789 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3790 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3791 }
3792 }
3793
3794 next_offset += envelope_size;
3795 _next_ordinal_to_read += 1;
3796 if next_offset >= end_offset {
3797 return Ok(());
3798 }
3799
3800 while _next_ordinal_to_read < 4 {
3802 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3803 _next_ordinal_to_read += 1;
3804 next_offset += envelope_size;
3805 }
3806
3807 let next_out_of_line = decoder.next_out_of_line();
3808 let handles_before = decoder.remaining_handles();
3809 if let Some((inlined, num_bytes, num_handles)) =
3810 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3811 {
3812 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3813 if inlined != (member_inline_size <= 4) {
3814 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3815 }
3816 let inner_offset;
3817 let mut inner_depth = depth.clone();
3818 if inlined {
3819 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3820 inner_offset = next_offset;
3821 } else {
3822 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3823 inner_depth.increment()?;
3824 }
3825 let val_ref = self.channel.get_or_insert_with(|| {
3826 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D)
3827 });
3828 fidl::decode!(
3829 fidl_fuchsia_wlan_ieee80211__common::WlanChannel,
3830 D,
3831 val_ref,
3832 decoder,
3833 inner_offset,
3834 inner_depth
3835 )?;
3836 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3837 {
3838 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3839 }
3840 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3841 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3842 }
3843 }
3844
3845 next_offset += envelope_size;
3846 _next_ordinal_to_read += 1;
3847 if next_offset >= end_offset {
3848 return Ok(());
3849 }
3850
3851 while _next_ordinal_to_read < 5 {
3853 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3854 _next_ordinal_to_read += 1;
3855 next_offset += envelope_size;
3856 }
3857
3858 let next_out_of_line = decoder.next_out_of_line();
3859 let handles_before = decoder.remaining_handles();
3860 if let Some((inlined, num_bytes, num_handles)) =
3861 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3862 {
3863 let member_inline_size =
3864 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3865 if inlined != (member_inline_size <= 4) {
3866 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3867 }
3868 let inner_offset;
3869 let mut inner_depth = depth.clone();
3870 if inlined {
3871 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3872 inner_offset = next_offset;
3873 } else {
3874 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3875 inner_depth.increment()?;
3876 }
3877 let val_ref = self.qos.get_or_insert_with(|| fidl::new_empty!(bool, D));
3878 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3879 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3880 {
3881 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3882 }
3883 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3884 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3885 }
3886 }
3887
3888 next_offset += envelope_size;
3889 _next_ordinal_to_read += 1;
3890 if next_offset >= end_offset {
3891 return Ok(());
3892 }
3893
3894 while _next_ordinal_to_read < 6 {
3896 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3897 _next_ordinal_to_read += 1;
3898 next_offset += envelope_size;
3899 }
3900
3901 let next_out_of_line = decoder.next_out_of_line();
3902 let handles_before = decoder.remaining_handles();
3903 if let Some((inlined, num_bytes, num_handles)) =
3904 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3905 {
3906 let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3907 if inlined != (member_inline_size <= 4) {
3908 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3909 }
3910 let inner_offset;
3911 let mut inner_depth = depth.clone();
3912 if inlined {
3913 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3914 inner_offset = next_offset;
3915 } else {
3916 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3917 inner_depth.increment()?;
3918 }
3919 let val_ref = self.wmm_params.get_or_insert_with(|| {
3920 fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanWmmParameters, D)
3921 });
3922 fidl::decode!(
3923 fidl_fuchsia_wlan_common__common::WlanWmmParameters,
3924 D,
3925 val_ref,
3926 decoder,
3927 inner_offset,
3928 inner_depth
3929 )?;
3930 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3931 {
3932 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3933 }
3934 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3935 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3936 }
3937 }
3938
3939 next_offset += envelope_size;
3940 _next_ordinal_to_read += 1;
3941 if next_offset >= end_offset {
3942 return Ok(());
3943 }
3944
3945 while _next_ordinal_to_read < 7 {
3947 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3948 _next_ordinal_to_read += 1;
3949 next_offset += envelope_size;
3950 }
3951
3952 let next_out_of_line = decoder.next_out_of_line();
3953 let handles_before = decoder.remaining_handles();
3954 if let Some((inlined, num_bytes, num_handles)) =
3955 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3956 {
3957 let member_inline_size =
3958 <fidl::encoding::Vector<u8, 263> as fidl::encoding::TypeMarker>::inline_size(
3959 decoder.context,
3960 );
3961 if inlined != (member_inline_size <= 4) {
3962 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3963 }
3964 let inner_offset;
3965 let mut inner_depth = depth.clone();
3966 if inlined {
3967 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3968 inner_offset = next_offset;
3969 } else {
3970 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3971 inner_depth.increment()?;
3972 }
3973 let val_ref = self
3974 .rates
3975 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 263>, D));
3976 fidl::decode!(fidl::encoding::Vector<u8, 263>, D, val_ref, decoder, inner_offset, inner_depth)?;
3977 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3978 {
3979 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3980 }
3981 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3982 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3983 }
3984 }
3985
3986 next_offset += envelope_size;
3987 _next_ordinal_to_read += 1;
3988 if next_offset >= end_offset {
3989 return Ok(());
3990 }
3991
3992 while _next_ordinal_to_read < 8 {
3994 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3995 _next_ordinal_to_read += 1;
3996 next_offset += envelope_size;
3997 }
3998
3999 let next_out_of_line = decoder.next_out_of_line();
4000 let handles_before = decoder.remaining_handles();
4001 if let Some((inlined, num_bytes, num_handles)) =
4002 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4003 {
4004 let member_inline_size =
4005 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4006 if inlined != (member_inline_size <= 4) {
4007 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4008 }
4009 let inner_offset;
4010 let mut inner_depth = depth.clone();
4011 if inlined {
4012 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4013 inner_offset = next_offset;
4014 } else {
4015 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4016 inner_depth.increment()?;
4017 }
4018 let val_ref = self.capability_info.get_or_insert_with(|| fidl::new_empty!(u16, D));
4019 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
4020 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4021 {
4022 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4023 }
4024 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4025 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4026 }
4027 }
4028
4029 next_offset += envelope_size;
4030 _next_ordinal_to_read += 1;
4031 if next_offset >= end_offset {
4032 return Ok(());
4033 }
4034
4035 while _next_ordinal_to_read < 9 {
4037 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4038 _next_ordinal_to_read += 1;
4039 next_offset += envelope_size;
4040 }
4041
4042 let next_out_of_line = decoder.next_out_of_line();
4043 let handles_before = decoder.remaining_handles();
4044 if let Some((inlined, num_bytes, num_handles)) =
4045 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4046 {
4047 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4048 if inlined != (member_inline_size <= 4) {
4049 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4050 }
4051 let inner_offset;
4052 let mut inner_depth = depth.clone();
4053 if inlined {
4054 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4055 inner_offset = next_offset;
4056 } else {
4057 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4058 inner_depth.increment()?;
4059 }
4060 let val_ref = self.ht_cap.get_or_insert_with(|| {
4061 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D)
4062 });
4063 fidl::decode!(
4064 fidl_fuchsia_wlan_ieee80211__common::HtCapabilities,
4065 D,
4066 val_ref,
4067 decoder,
4068 inner_offset,
4069 inner_depth
4070 )?;
4071 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4072 {
4073 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4074 }
4075 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4076 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4077 }
4078 }
4079
4080 next_offset += envelope_size;
4081 _next_ordinal_to_read += 1;
4082 if next_offset >= end_offset {
4083 return Ok(());
4084 }
4085
4086 while _next_ordinal_to_read < 10 {
4088 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4089 _next_ordinal_to_read += 1;
4090 next_offset += envelope_size;
4091 }
4092
4093 let next_out_of_line = decoder.next_out_of_line();
4094 let handles_before = decoder.remaining_handles();
4095 if let Some((inlined, num_bytes, num_handles)) =
4096 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4097 {
4098 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::HtOperation as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4099 if inlined != (member_inline_size <= 4) {
4100 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4101 }
4102 let inner_offset;
4103 let mut inner_depth = depth.clone();
4104 if inlined {
4105 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4106 inner_offset = next_offset;
4107 } else {
4108 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4109 inner_depth.increment()?;
4110 }
4111 let val_ref = self.ht_op.get_or_insert_with(|| {
4112 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::HtOperation, D)
4113 });
4114 fidl::decode!(
4115 fidl_fuchsia_wlan_ieee80211__common::HtOperation,
4116 D,
4117 val_ref,
4118 decoder,
4119 inner_offset,
4120 inner_depth
4121 )?;
4122 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4123 {
4124 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4125 }
4126 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4127 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4128 }
4129 }
4130
4131 next_offset += envelope_size;
4132 _next_ordinal_to_read += 1;
4133 if next_offset >= end_offset {
4134 return Ok(());
4135 }
4136
4137 while _next_ordinal_to_read < 11 {
4139 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4140 _next_ordinal_to_read += 1;
4141 next_offset += envelope_size;
4142 }
4143
4144 let next_out_of_line = decoder.next_out_of_line();
4145 let handles_before = decoder.remaining_handles();
4146 if let Some((inlined, num_bytes, num_handles)) =
4147 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4148 {
4149 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4150 if inlined != (member_inline_size <= 4) {
4151 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4152 }
4153 let inner_offset;
4154 let mut inner_depth = depth.clone();
4155 if inlined {
4156 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4157 inner_offset = next_offset;
4158 } else {
4159 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4160 inner_depth.increment()?;
4161 }
4162 let val_ref = self.vht_cap.get_or_insert_with(|| {
4163 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D)
4164 });
4165 fidl::decode!(
4166 fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities,
4167 D,
4168 val_ref,
4169 decoder,
4170 inner_offset,
4171 inner_depth
4172 )?;
4173 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4174 {
4175 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4176 }
4177 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4178 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4179 }
4180 }
4181
4182 next_offset += envelope_size;
4183 _next_ordinal_to_read += 1;
4184 if next_offset >= end_offset {
4185 return Ok(());
4186 }
4187
4188 while _next_ordinal_to_read < 12 {
4190 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4191 _next_ordinal_to_read += 1;
4192 next_offset += envelope_size;
4193 }
4194
4195 let next_out_of_line = decoder.next_out_of_line();
4196 let handles_before = decoder.remaining_handles();
4197 if let Some((inlined, num_bytes, num_handles)) =
4198 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4199 {
4200 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::VhtOperation as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4201 if inlined != (member_inline_size <= 4) {
4202 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4203 }
4204 let inner_offset;
4205 let mut inner_depth = depth.clone();
4206 if inlined {
4207 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4208 inner_offset = next_offset;
4209 } else {
4210 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4211 inner_depth.increment()?;
4212 }
4213 let val_ref = self.vht_op.get_or_insert_with(|| {
4214 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::VhtOperation, D)
4215 });
4216 fidl::decode!(
4217 fidl_fuchsia_wlan_ieee80211__common::VhtOperation,
4218 D,
4219 val_ref,
4220 decoder,
4221 inner_offset,
4222 inner_depth
4223 )?;
4224 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4225 {
4226 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4227 }
4228 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4229 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4230 }
4231 }
4232
4233 next_offset += envelope_size;
4234
4235 while next_offset < end_offset {
4237 _next_ordinal_to_read += 1;
4238 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4239 next_offset += envelope_size;
4240 }
4241
4242 Ok(())
4243 }
4244 }
4245
4246 impl WlanKeyConfiguration {
4247 #[inline(always)]
4248 fn max_ordinal_present(&self) -> u64 {
4249 if let Some(_) = self.rsc {
4250 return 8;
4251 }
4252 if let Some(_) = self.key {
4253 return 7;
4254 }
4255 if let Some(_) = self.key_idx {
4256 return 6;
4257 }
4258 if let Some(_) = self.peer_addr {
4259 return 5;
4260 }
4261 if let Some(_) = self.key_type {
4262 return 4;
4263 }
4264 if let Some(_) = self.cipher_type {
4265 return 3;
4266 }
4267 if let Some(_) = self.cipher_oui {
4268 return 2;
4269 }
4270 if let Some(_) = self.protection {
4271 return 1;
4272 }
4273 0
4274 }
4275 }
4276
4277 impl fidl::encoding::ValueTypeMarker for WlanKeyConfiguration {
4278 type Borrowed<'a> = &'a Self;
4279 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4280 value
4281 }
4282 }
4283
4284 unsafe impl fidl::encoding::TypeMarker for WlanKeyConfiguration {
4285 type Owned = Self;
4286
4287 #[inline(always)]
4288 fn inline_align(_context: fidl::encoding::Context) -> usize {
4289 8
4290 }
4291
4292 #[inline(always)]
4293 fn inline_size(_context: fidl::encoding::Context) -> usize {
4294 16
4295 }
4296 }
4297
4298 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanKeyConfiguration, D>
4299 for &WlanKeyConfiguration
4300 {
4301 unsafe fn encode(
4302 self,
4303 encoder: &mut fidl::encoding::Encoder<'_, D>,
4304 offset: usize,
4305 mut depth: fidl::encoding::Depth,
4306 ) -> fidl::Result<()> {
4307 encoder.debug_check_bounds::<WlanKeyConfiguration>(offset);
4308 let max_ordinal: u64 = self.max_ordinal_present();
4310 encoder.write_num(max_ordinal, offset);
4311 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4312 if max_ordinal == 0 {
4314 return Ok(());
4315 }
4316 depth.increment()?;
4317 let envelope_size = 8;
4318 let bytes_len = max_ordinal as usize * envelope_size;
4319 #[allow(unused_variables)]
4320 let offset = encoder.out_of_line_offset(bytes_len);
4321 let mut _prev_end_offset: usize = 0;
4322 if 1 > max_ordinal {
4323 return Ok(());
4324 }
4325
4326 let cur_offset: usize = (1 - 1) * envelope_size;
4329
4330 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4332
4333 fidl::encoding::encode_in_envelope_optional::<WlanProtection, D>(
4338 self.protection
4339 .as_ref()
4340 .map(<WlanProtection as fidl::encoding::ValueTypeMarker>::borrow),
4341 encoder,
4342 offset + cur_offset,
4343 depth,
4344 )?;
4345
4346 _prev_end_offset = cur_offset + envelope_size;
4347 if 2 > max_ordinal {
4348 return Ok(());
4349 }
4350
4351 let cur_offset: usize = (2 - 1) * envelope_size;
4354
4355 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4357
4358 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 3>, D>(
4363 self.cipher_oui
4364 .as_ref()
4365 .map(<fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow),
4366 encoder,
4367 offset + cur_offset,
4368 depth,
4369 )?;
4370
4371 _prev_end_offset = cur_offset + envelope_size;
4372 if 3 > max_ordinal {
4373 return Ok(());
4374 }
4375
4376 let cur_offset: usize = (3 - 1) * envelope_size;
4379
4380 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4382
4383 fidl::encoding::encode_in_envelope_optional::<u8, D>(
4388 self.cipher_type.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4389 encoder,
4390 offset + cur_offset,
4391 depth,
4392 )?;
4393
4394 _prev_end_offset = cur_offset + envelope_size;
4395 if 4 > max_ordinal {
4396 return Ok(());
4397 }
4398
4399 let cur_offset: usize = (4 - 1) * envelope_size;
4402
4403 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4405
4406 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::KeyType, D>(
4411 self.key_type.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::KeyType as fidl::encoding::ValueTypeMarker>::borrow),
4412 encoder, offset + cur_offset, depth
4413 )?;
4414
4415 _prev_end_offset = cur_offset + envelope_size;
4416 if 5 > max_ordinal {
4417 return Ok(());
4418 }
4419
4420 let cur_offset: usize = (5 - 1) * envelope_size;
4423
4424 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4426
4427 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4432 self.peer_addr
4433 .as_ref()
4434 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4435 encoder,
4436 offset + cur_offset,
4437 depth,
4438 )?;
4439
4440 _prev_end_offset = cur_offset + envelope_size;
4441 if 6 > max_ordinal {
4442 return Ok(());
4443 }
4444
4445 let cur_offset: usize = (6 - 1) * envelope_size;
4448
4449 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4451
4452 fidl::encoding::encode_in_envelope_optional::<u8, D>(
4457 self.key_idx.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4458 encoder,
4459 offset + cur_offset,
4460 depth,
4461 )?;
4462
4463 _prev_end_offset = cur_offset + envelope_size;
4464 if 7 > max_ordinal {
4465 return Ok(());
4466 }
4467
4468 let cur_offset: usize = (7 - 1) * envelope_size;
4471
4472 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4474
4475 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
4480 self.key.as_ref().map(
4481 <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
4482 ),
4483 encoder,
4484 offset + cur_offset,
4485 depth,
4486 )?;
4487
4488 _prev_end_offset = cur_offset + envelope_size;
4489 if 8 > max_ordinal {
4490 return Ok(());
4491 }
4492
4493 let cur_offset: usize = (8 - 1) * envelope_size;
4496
4497 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4499
4500 fidl::encoding::encode_in_envelope_optional::<u64, D>(
4505 self.rsc.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4506 encoder,
4507 offset + cur_offset,
4508 depth,
4509 )?;
4510
4511 _prev_end_offset = cur_offset + envelope_size;
4512
4513 Ok(())
4514 }
4515 }
4516
4517 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyConfiguration {
4518 #[inline(always)]
4519 fn new_empty() -> Self {
4520 Self::default()
4521 }
4522
4523 unsafe fn decode(
4524 &mut self,
4525 decoder: &mut fidl::encoding::Decoder<'_, D>,
4526 offset: usize,
4527 mut depth: fidl::encoding::Depth,
4528 ) -> fidl::Result<()> {
4529 decoder.debug_check_bounds::<Self>(offset);
4530 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4531 None => return Err(fidl::Error::NotNullable),
4532 Some(len) => len,
4533 };
4534 if len == 0 {
4536 return Ok(());
4537 };
4538 depth.increment()?;
4539 let envelope_size = 8;
4540 let bytes_len = len * envelope_size;
4541 let offset = decoder.out_of_line_offset(bytes_len)?;
4542 let mut _next_ordinal_to_read = 0;
4544 let mut next_offset = offset;
4545 let end_offset = offset + bytes_len;
4546 _next_ordinal_to_read += 1;
4547 if next_offset >= end_offset {
4548 return Ok(());
4549 }
4550
4551 while _next_ordinal_to_read < 1 {
4553 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4554 _next_ordinal_to_read += 1;
4555 next_offset += envelope_size;
4556 }
4557
4558 let next_out_of_line = decoder.next_out_of_line();
4559 let handles_before = decoder.remaining_handles();
4560 if let Some((inlined, num_bytes, num_handles)) =
4561 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4562 {
4563 let member_inline_size =
4564 <WlanProtection as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4565 if inlined != (member_inline_size <= 4) {
4566 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4567 }
4568 let inner_offset;
4569 let mut inner_depth = depth.clone();
4570 if inlined {
4571 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4572 inner_offset = next_offset;
4573 } else {
4574 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4575 inner_depth.increment()?;
4576 }
4577 let val_ref =
4578 self.protection.get_or_insert_with(|| fidl::new_empty!(WlanProtection, D));
4579 fidl::decode!(WlanProtection, D, val_ref, decoder, inner_offset, inner_depth)?;
4580 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4581 {
4582 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4583 }
4584 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4585 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4586 }
4587 }
4588
4589 next_offset += envelope_size;
4590 _next_ordinal_to_read += 1;
4591 if next_offset >= end_offset {
4592 return Ok(());
4593 }
4594
4595 while _next_ordinal_to_read < 2 {
4597 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4598 _next_ordinal_to_read += 1;
4599 next_offset += envelope_size;
4600 }
4601
4602 let next_out_of_line = decoder.next_out_of_line();
4603 let handles_before = decoder.remaining_handles();
4604 if let Some((inlined, num_bytes, num_handles)) =
4605 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4606 {
4607 let member_inline_size =
4608 <fidl::encoding::Array<u8, 3> as fidl::encoding::TypeMarker>::inline_size(
4609 decoder.context,
4610 );
4611 if inlined != (member_inline_size <= 4) {
4612 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4613 }
4614 let inner_offset;
4615 let mut inner_depth = depth.clone();
4616 if inlined {
4617 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4618 inner_offset = next_offset;
4619 } else {
4620 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4621 inner_depth.increment()?;
4622 }
4623 let val_ref = self
4624 .cipher_oui
4625 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 3>, D));
4626 fidl::decode!(fidl::encoding::Array<u8, 3>, D, val_ref, decoder, inner_offset, inner_depth)?;
4627 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4628 {
4629 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4630 }
4631 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4632 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4633 }
4634 }
4635
4636 next_offset += envelope_size;
4637 _next_ordinal_to_read += 1;
4638 if next_offset >= end_offset {
4639 return Ok(());
4640 }
4641
4642 while _next_ordinal_to_read < 3 {
4644 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4645 _next_ordinal_to_read += 1;
4646 next_offset += envelope_size;
4647 }
4648
4649 let next_out_of_line = decoder.next_out_of_line();
4650 let handles_before = decoder.remaining_handles();
4651 if let Some((inlined, num_bytes, num_handles)) =
4652 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4653 {
4654 let member_inline_size =
4655 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4656 if inlined != (member_inline_size <= 4) {
4657 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4658 }
4659 let inner_offset;
4660 let mut inner_depth = depth.clone();
4661 if inlined {
4662 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4663 inner_offset = next_offset;
4664 } else {
4665 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4666 inner_depth.increment()?;
4667 }
4668 let val_ref = self.cipher_type.get_or_insert_with(|| fidl::new_empty!(u8, D));
4669 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4670 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4671 {
4672 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4673 }
4674 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4675 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4676 }
4677 }
4678
4679 next_offset += envelope_size;
4680 _next_ordinal_to_read += 1;
4681 if next_offset >= end_offset {
4682 return Ok(());
4683 }
4684
4685 while _next_ordinal_to_read < 4 {
4687 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4688 _next_ordinal_to_read += 1;
4689 next_offset += envelope_size;
4690 }
4691
4692 let next_out_of_line = decoder.next_out_of_line();
4693 let handles_before = decoder.remaining_handles();
4694 if let Some((inlined, num_bytes, num_handles)) =
4695 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4696 {
4697 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::KeyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4698 if inlined != (member_inline_size <= 4) {
4699 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4700 }
4701 let inner_offset;
4702 let mut inner_depth = depth.clone();
4703 if inlined {
4704 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4705 inner_offset = next_offset;
4706 } else {
4707 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4708 inner_depth.increment()?;
4709 }
4710 let val_ref = self.key_type.get_or_insert_with(|| {
4711 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::KeyType, D)
4712 });
4713 fidl::decode!(
4714 fidl_fuchsia_wlan_ieee80211__common::KeyType,
4715 D,
4716 val_ref,
4717 decoder,
4718 inner_offset,
4719 inner_depth
4720 )?;
4721 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4722 {
4723 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4724 }
4725 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4726 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4727 }
4728 }
4729
4730 next_offset += envelope_size;
4731 _next_ordinal_to_read += 1;
4732 if next_offset >= end_offset {
4733 return Ok(());
4734 }
4735
4736 while _next_ordinal_to_read < 5 {
4738 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4739 _next_ordinal_to_read += 1;
4740 next_offset += envelope_size;
4741 }
4742
4743 let next_out_of_line = decoder.next_out_of_line();
4744 let handles_before = decoder.remaining_handles();
4745 if let Some((inlined, num_bytes, num_handles)) =
4746 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4747 {
4748 let member_inline_size =
4749 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
4750 decoder.context,
4751 );
4752 if inlined != (member_inline_size <= 4) {
4753 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4754 }
4755 let inner_offset;
4756 let mut inner_depth = depth.clone();
4757 if inlined {
4758 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4759 inner_offset = next_offset;
4760 } else {
4761 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4762 inner_depth.increment()?;
4763 }
4764 let val_ref = self
4765 .peer_addr
4766 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
4767 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
4768 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4769 {
4770 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4771 }
4772 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4773 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4774 }
4775 }
4776
4777 next_offset += envelope_size;
4778 _next_ordinal_to_read += 1;
4779 if next_offset >= end_offset {
4780 return Ok(());
4781 }
4782
4783 while _next_ordinal_to_read < 6 {
4785 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4786 _next_ordinal_to_read += 1;
4787 next_offset += envelope_size;
4788 }
4789
4790 let next_out_of_line = decoder.next_out_of_line();
4791 let handles_before = decoder.remaining_handles();
4792 if let Some((inlined, num_bytes, num_handles)) =
4793 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4794 {
4795 let member_inline_size =
4796 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4797 if inlined != (member_inline_size <= 4) {
4798 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4799 }
4800 let inner_offset;
4801 let mut inner_depth = depth.clone();
4802 if inlined {
4803 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4804 inner_offset = next_offset;
4805 } else {
4806 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4807 inner_depth.increment()?;
4808 }
4809 let val_ref = self.key_idx.get_or_insert_with(|| fidl::new_empty!(u8, D));
4810 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4811 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4812 {
4813 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4814 }
4815 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4816 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4817 }
4818 }
4819
4820 next_offset += envelope_size;
4821 _next_ordinal_to_read += 1;
4822 if next_offset >= end_offset {
4823 return Ok(());
4824 }
4825
4826 while _next_ordinal_to_read < 7 {
4828 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4829 _next_ordinal_to_read += 1;
4830 next_offset += envelope_size;
4831 }
4832
4833 let next_out_of_line = decoder.next_out_of_line();
4834 let handles_before = decoder.remaining_handles();
4835 if let Some((inlined, num_bytes, num_handles)) =
4836 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4837 {
4838 let member_inline_size =
4839 <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
4840 decoder.context,
4841 );
4842 if inlined != (member_inline_size <= 4) {
4843 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4844 }
4845 let inner_offset;
4846 let mut inner_depth = depth.clone();
4847 if inlined {
4848 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4849 inner_offset = next_offset;
4850 } else {
4851 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4852 inner_depth.increment()?;
4853 }
4854 let val_ref = self
4855 .key
4856 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
4857 fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
4858 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4859 {
4860 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4861 }
4862 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4863 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4864 }
4865 }
4866
4867 next_offset += envelope_size;
4868 _next_ordinal_to_read += 1;
4869 if next_offset >= end_offset {
4870 return Ok(());
4871 }
4872
4873 while _next_ordinal_to_read < 8 {
4875 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4876 _next_ordinal_to_read += 1;
4877 next_offset += envelope_size;
4878 }
4879
4880 let next_out_of_line = decoder.next_out_of_line();
4881 let handles_before = decoder.remaining_handles();
4882 if let Some((inlined, num_bytes, num_handles)) =
4883 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4884 {
4885 let member_inline_size =
4886 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4887 if inlined != (member_inline_size <= 4) {
4888 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4889 }
4890 let inner_offset;
4891 let mut inner_depth = depth.clone();
4892 if inlined {
4893 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4894 inner_offset = next_offset;
4895 } else {
4896 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4897 inner_depth.increment()?;
4898 }
4899 let val_ref = self.rsc.get_or_insert_with(|| fidl::new_empty!(u64, D));
4900 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4901 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4902 {
4903 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4904 }
4905 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4906 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4907 }
4908 }
4909
4910 next_offset += envelope_size;
4911
4912 while next_offset < end_offset {
4914 _next_ordinal_to_read += 1;
4915 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4916 next_offset += envelope_size;
4917 }
4918
4919 Ok(())
4920 }
4921 }
4922
4923 impl WlanRxTransferRequest {
4924 #[inline(always)]
4925 fn max_ordinal_present(&self) -> u64 {
4926 if let Some(_) = self.arena {
4927 return 5;
4928 }
4929 if let Some(_) = self.async_id {
4930 return 4;
4931 }
4932 if let Some(_) = self.packet_info {
4933 return 3;
4934 }
4935 if let Some(_) = self.packet_size {
4936 return 2;
4937 }
4938 if let Some(_) = self.packet_address {
4939 return 1;
4940 }
4941 0
4942 }
4943 }
4944
4945 impl fidl::encoding::ValueTypeMarker for WlanRxTransferRequest {
4946 type Borrowed<'a> = &'a Self;
4947 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4948 value
4949 }
4950 }
4951
4952 unsafe impl fidl::encoding::TypeMarker for WlanRxTransferRequest {
4953 type Owned = Self;
4954
4955 #[inline(always)]
4956 fn inline_align(_context: fidl::encoding::Context) -> usize {
4957 8
4958 }
4959
4960 #[inline(always)]
4961 fn inline_size(_context: fidl::encoding::Context) -> usize {
4962 16
4963 }
4964 }
4965
4966 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxTransferRequest, D>
4967 for &WlanRxTransferRequest
4968 {
4969 unsafe fn encode(
4970 self,
4971 encoder: &mut fidl::encoding::Encoder<'_, D>,
4972 offset: usize,
4973 mut depth: fidl::encoding::Depth,
4974 ) -> fidl::Result<()> {
4975 encoder.debug_check_bounds::<WlanRxTransferRequest>(offset);
4976 let max_ordinal: u64 = self.max_ordinal_present();
4978 encoder.write_num(max_ordinal, offset);
4979 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4980 if max_ordinal == 0 {
4982 return Ok(());
4983 }
4984 depth.increment()?;
4985 let envelope_size = 8;
4986 let bytes_len = max_ordinal as usize * envelope_size;
4987 #[allow(unused_variables)]
4988 let offset = encoder.out_of_line_offset(bytes_len);
4989 let mut _prev_end_offset: usize = 0;
4990 if 1 > max_ordinal {
4991 return Ok(());
4992 }
4993
4994 let cur_offset: usize = (1 - 1) * envelope_size;
4997
4998 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5000
5001 fidl::encoding::encode_in_envelope_optional::<u64, D>(
5006 self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5007 encoder,
5008 offset + cur_offset,
5009 depth,
5010 )?;
5011
5012 _prev_end_offset = cur_offset + envelope_size;
5013 if 2 > max_ordinal {
5014 return Ok(());
5015 }
5016
5017 let cur_offset: usize = (2 - 1) * envelope_size;
5020
5021 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5023
5024 fidl::encoding::encode_in_envelope_optional::<u64, D>(
5029 self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5030 encoder,
5031 offset + cur_offset,
5032 depth,
5033 )?;
5034
5035 _prev_end_offset = cur_offset + envelope_size;
5036 if 3 > max_ordinal {
5037 return Ok(());
5038 }
5039
5040 let cur_offset: usize = (3 - 1) * envelope_size;
5043
5044 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5046
5047 fidl::encoding::encode_in_envelope_optional::<WlanRxInfo, D>(
5052 self.packet_info
5053 .as_ref()
5054 .map(<WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow),
5055 encoder,
5056 offset + cur_offset,
5057 depth,
5058 )?;
5059
5060 _prev_end_offset = cur_offset + envelope_size;
5061 if 4 > max_ordinal {
5062 return Ok(());
5063 }
5064
5065 let cur_offset: usize = (4 - 1) * envelope_size;
5068
5069 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5071
5072 fidl::encoding::encode_in_envelope_optional::<u64, D>(
5077 self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5078 encoder,
5079 offset + cur_offset,
5080 depth,
5081 )?;
5082
5083 _prev_end_offset = cur_offset + envelope_size;
5084 if 5 > max_ordinal {
5085 return Ok(());
5086 }
5087
5088 let cur_offset: usize = (5 - 1) * envelope_size;
5091
5092 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5094
5095 fidl::encoding::encode_in_envelope_optional::<u64, D>(
5100 self.arena.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5101 encoder,
5102 offset + cur_offset,
5103 depth,
5104 )?;
5105
5106 _prev_end_offset = cur_offset + envelope_size;
5107
5108 Ok(())
5109 }
5110 }
5111
5112 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxTransferRequest {
5113 #[inline(always)]
5114 fn new_empty() -> Self {
5115 Self::default()
5116 }
5117
5118 unsafe fn decode(
5119 &mut self,
5120 decoder: &mut fidl::encoding::Decoder<'_, D>,
5121 offset: usize,
5122 mut depth: fidl::encoding::Depth,
5123 ) -> fidl::Result<()> {
5124 decoder.debug_check_bounds::<Self>(offset);
5125 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5126 None => return Err(fidl::Error::NotNullable),
5127 Some(len) => len,
5128 };
5129 if len == 0 {
5131 return Ok(());
5132 };
5133 depth.increment()?;
5134 let envelope_size = 8;
5135 let bytes_len = len * envelope_size;
5136 let offset = decoder.out_of_line_offset(bytes_len)?;
5137 let mut _next_ordinal_to_read = 0;
5139 let mut next_offset = offset;
5140 let end_offset = offset + bytes_len;
5141 _next_ordinal_to_read += 1;
5142 if next_offset >= end_offset {
5143 return Ok(());
5144 }
5145
5146 while _next_ordinal_to_read < 1 {
5148 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5149 _next_ordinal_to_read += 1;
5150 next_offset += envelope_size;
5151 }
5152
5153 let next_out_of_line = decoder.next_out_of_line();
5154 let handles_before = decoder.remaining_handles();
5155 if let Some((inlined, num_bytes, num_handles)) =
5156 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5157 {
5158 let member_inline_size =
5159 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5160 if inlined != (member_inline_size <= 4) {
5161 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5162 }
5163 let inner_offset;
5164 let mut inner_depth = depth.clone();
5165 if inlined {
5166 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5167 inner_offset = next_offset;
5168 } else {
5169 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5170 inner_depth.increment()?;
5171 }
5172 let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
5173 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5174 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5175 {
5176 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5177 }
5178 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5179 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5180 }
5181 }
5182
5183 next_offset += envelope_size;
5184 _next_ordinal_to_read += 1;
5185 if next_offset >= end_offset {
5186 return Ok(());
5187 }
5188
5189 while _next_ordinal_to_read < 2 {
5191 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5192 _next_ordinal_to_read += 1;
5193 next_offset += envelope_size;
5194 }
5195
5196 let next_out_of_line = decoder.next_out_of_line();
5197 let handles_before = decoder.remaining_handles();
5198 if let Some((inlined, num_bytes, num_handles)) =
5199 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5200 {
5201 let member_inline_size =
5202 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5203 if inlined != (member_inline_size <= 4) {
5204 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5205 }
5206 let inner_offset;
5207 let mut inner_depth = depth.clone();
5208 if inlined {
5209 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5210 inner_offset = next_offset;
5211 } else {
5212 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5213 inner_depth.increment()?;
5214 }
5215 let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
5216 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5217 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5218 {
5219 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5220 }
5221 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5222 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5223 }
5224 }
5225
5226 next_offset += envelope_size;
5227 _next_ordinal_to_read += 1;
5228 if next_offset >= end_offset {
5229 return Ok(());
5230 }
5231
5232 while _next_ordinal_to_read < 3 {
5234 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5235 _next_ordinal_to_read += 1;
5236 next_offset += envelope_size;
5237 }
5238
5239 let next_out_of_line = decoder.next_out_of_line();
5240 let handles_before = decoder.remaining_handles();
5241 if let Some((inlined, num_bytes, num_handles)) =
5242 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5243 {
5244 let member_inline_size =
5245 <WlanRxInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5246 if inlined != (member_inline_size <= 4) {
5247 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5248 }
5249 let inner_offset;
5250 let mut inner_depth = depth.clone();
5251 if inlined {
5252 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5253 inner_offset = next_offset;
5254 } else {
5255 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5256 inner_depth.increment()?;
5257 }
5258 let val_ref =
5259 self.packet_info.get_or_insert_with(|| fidl::new_empty!(WlanRxInfo, D));
5260 fidl::decode!(WlanRxInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
5261 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5262 {
5263 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5264 }
5265 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5266 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5267 }
5268 }
5269
5270 next_offset += envelope_size;
5271 _next_ordinal_to_read += 1;
5272 if next_offset >= end_offset {
5273 return Ok(());
5274 }
5275
5276 while _next_ordinal_to_read < 4 {
5278 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5279 _next_ordinal_to_read += 1;
5280 next_offset += envelope_size;
5281 }
5282
5283 let next_out_of_line = decoder.next_out_of_line();
5284 let handles_before = decoder.remaining_handles();
5285 if let Some((inlined, num_bytes, num_handles)) =
5286 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5287 {
5288 let member_inline_size =
5289 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5290 if inlined != (member_inline_size <= 4) {
5291 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5292 }
5293 let inner_offset;
5294 let mut inner_depth = depth.clone();
5295 if inlined {
5296 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5297 inner_offset = next_offset;
5298 } else {
5299 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5300 inner_depth.increment()?;
5301 }
5302 let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
5303 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5304 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5305 {
5306 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5307 }
5308 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5309 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5310 }
5311 }
5312
5313 next_offset += envelope_size;
5314 _next_ordinal_to_read += 1;
5315 if next_offset >= end_offset {
5316 return Ok(());
5317 }
5318
5319 while _next_ordinal_to_read < 5 {
5321 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5322 _next_ordinal_to_read += 1;
5323 next_offset += envelope_size;
5324 }
5325
5326 let next_out_of_line = decoder.next_out_of_line();
5327 let handles_before = decoder.remaining_handles();
5328 if let Some((inlined, num_bytes, num_handles)) =
5329 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5330 {
5331 let member_inline_size =
5332 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5333 if inlined != (member_inline_size <= 4) {
5334 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5335 }
5336 let inner_offset;
5337 let mut inner_depth = depth.clone();
5338 if inlined {
5339 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5340 inner_offset = next_offset;
5341 } else {
5342 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5343 inner_depth.increment()?;
5344 }
5345 let val_ref = self.arena.get_or_insert_with(|| fidl::new_empty!(u64, D));
5346 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5347 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5348 {
5349 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5350 }
5351 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5352 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5353 }
5354 }
5355
5356 next_offset += envelope_size;
5357
5358 while next_offset < end_offset {
5360 _next_ordinal_to_read += 1;
5361 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5362 next_offset += envelope_size;
5363 }
5364
5365 Ok(())
5366 }
5367 }
5368
5369 impl WlanSoftmacBandCapability {
5370 #[inline(always)]
5371 fn max_ordinal_present(&self) -> u64 {
5372 if let Some(_) = self.operating_channels {
5373 return 11;
5374 }
5375 if let Some(_) = self.basic_rates {
5376 return 10;
5377 }
5378 if let Some(_) = self.operating_channel_list {
5379 return 9;
5380 }
5381 if let Some(_) = self.operating_channel_count {
5382 return 8;
5383 }
5384 if let Some(_) = self.vht_caps {
5385 return 7;
5386 }
5387 if let Some(_) = self.vht_supported {
5388 return 6;
5389 }
5390 if let Some(_) = self.ht_caps {
5391 return 5;
5392 }
5393 if let Some(_) = self.ht_supported {
5394 return 4;
5395 }
5396 if let Some(_) = self.basic_rate_list {
5397 return 3;
5398 }
5399 if let Some(_) = self.basic_rate_count {
5400 return 2;
5401 }
5402 if let Some(_) = self.band {
5403 return 1;
5404 }
5405 0
5406 }
5407 }
5408
5409 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBandCapability {
5410 type Borrowed<'a> = &'a Self;
5411 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5412 value
5413 }
5414 }
5415
5416 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBandCapability {
5417 type Owned = Self;
5418
5419 #[inline(always)]
5420 fn inline_align(_context: fidl::encoding::Context) -> usize {
5421 8
5422 }
5423
5424 #[inline(always)]
5425 fn inline_size(_context: fidl::encoding::Context) -> usize {
5426 16
5427 }
5428 }
5429
5430 unsafe impl<D: fidl::encoding::ResourceDialect>
5431 fidl::encoding::Encode<WlanSoftmacBandCapability, D> for &WlanSoftmacBandCapability
5432 {
5433 unsafe fn encode(
5434 self,
5435 encoder: &mut fidl::encoding::Encoder<'_, D>,
5436 offset: usize,
5437 mut depth: fidl::encoding::Depth,
5438 ) -> fidl::Result<()> {
5439 encoder.debug_check_bounds::<WlanSoftmacBandCapability>(offset);
5440 let max_ordinal: u64 = self.max_ordinal_present();
5442 encoder.write_num(max_ordinal, offset);
5443 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5444 if max_ordinal == 0 {
5446 return Ok(());
5447 }
5448 depth.increment()?;
5449 let envelope_size = 8;
5450 let bytes_len = max_ordinal as usize * envelope_size;
5451 #[allow(unused_variables)]
5452 let offset = encoder.out_of_line_offset(bytes_len);
5453 let mut _prev_end_offset: usize = 0;
5454 if 1 > max_ordinal {
5455 return Ok(());
5456 }
5457
5458 let cur_offset: usize = (1 - 1) * envelope_size;
5461
5462 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5464
5465 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanBand, D>(
5470 self.band.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanBand as fidl::encoding::ValueTypeMarker>::borrow),
5471 encoder, offset + cur_offset, depth
5472 )?;
5473
5474 _prev_end_offset = cur_offset + envelope_size;
5475 if 2 > max_ordinal {
5476 return Ok(());
5477 }
5478
5479 let cur_offset: usize = (2 - 1) * envelope_size;
5482
5483 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5485
5486 fidl::encoding::encode_in_envelope_optional::<u8, D>(
5491 self.basic_rate_count.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
5492 encoder,
5493 offset + cur_offset,
5494 depth,
5495 )?;
5496
5497 _prev_end_offset = cur_offset + envelope_size;
5498 if 3 > max_ordinal {
5499 return Ok(());
5500 }
5501
5502 let cur_offset: usize = (3 - 1) * envelope_size;
5505
5506 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5508
5509 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 12>, D>(
5514 self.basic_rate_list.as_ref().map(
5515 <fidl::encoding::Array<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
5516 ),
5517 encoder,
5518 offset + cur_offset,
5519 depth,
5520 )?;
5521
5522 _prev_end_offset = cur_offset + envelope_size;
5523 if 4 > max_ordinal {
5524 return Ok(());
5525 }
5526
5527 let cur_offset: usize = (4 - 1) * envelope_size;
5530
5531 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5533
5534 fidl::encoding::encode_in_envelope_optional::<bool, D>(
5539 self.ht_supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5540 encoder,
5541 offset + cur_offset,
5542 depth,
5543 )?;
5544
5545 _prev_end_offset = cur_offset + envelope_size;
5546 if 5 > max_ordinal {
5547 return Ok(());
5548 }
5549
5550 let cur_offset: usize = (5 - 1) * envelope_size;
5553
5554 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5556
5557 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D>(
5562 self.ht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
5563 encoder, offset + cur_offset, depth
5564 )?;
5565
5566 _prev_end_offset = cur_offset + envelope_size;
5567 if 6 > max_ordinal {
5568 return Ok(());
5569 }
5570
5571 let cur_offset: usize = (6 - 1) * envelope_size;
5574
5575 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5577
5578 fidl::encoding::encode_in_envelope_optional::<bool, D>(
5583 self.vht_supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5584 encoder,
5585 offset + cur_offset,
5586 depth,
5587 )?;
5588
5589 _prev_end_offset = cur_offset + envelope_size;
5590 if 7 > max_ordinal {
5591 return Ok(());
5592 }
5593
5594 let cur_offset: usize = (7 - 1) * envelope_size;
5597
5598 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5600
5601 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D>(
5606 self.vht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
5607 encoder, offset + cur_offset, depth
5608 )?;
5609
5610 _prev_end_offset = cur_offset + envelope_size;
5611 if 8 > max_ordinal {
5612 return Ok(());
5613 }
5614
5615 let cur_offset: usize = (8 - 1) * envelope_size;
5618
5619 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5621
5622 fidl::encoding::encode_in_envelope_optional::<u16, D>(
5627 self.operating_channel_count
5628 .as_ref()
5629 .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
5630 encoder,
5631 offset + cur_offset,
5632 depth,
5633 )?;
5634
5635 _prev_end_offset = cur_offset + envelope_size;
5636 if 9 > max_ordinal {
5637 return Ok(());
5638 }
5639
5640 let cur_offset: usize = (9 - 1) * envelope_size;
5643
5644 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5646
5647 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 256>, D>(
5652 self.operating_channel_list.as_ref().map(
5653 <fidl::encoding::Array<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
5654 ),
5655 encoder,
5656 offset + cur_offset,
5657 depth,
5658 )?;
5659
5660 _prev_end_offset = cur_offset + envelope_size;
5661 if 10 > max_ordinal {
5662 return Ok(());
5663 }
5664
5665 let cur_offset: usize = (10 - 1) * envelope_size;
5668
5669 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5671
5672 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 12>, D>(
5677 self.basic_rates.as_ref().map(
5678 <fidl::encoding::Vector<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
5679 ),
5680 encoder,
5681 offset + cur_offset,
5682 depth,
5683 )?;
5684
5685 _prev_end_offset = cur_offset + envelope_size;
5686 if 11 > max_ordinal {
5687 return Ok(());
5688 }
5689
5690 let cur_offset: usize = (11 - 1) * envelope_size;
5693
5694 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5696
5697 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
5702 self.operating_channels.as_ref().map(
5703 <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
5704 ),
5705 encoder,
5706 offset + cur_offset,
5707 depth,
5708 )?;
5709
5710 _prev_end_offset = cur_offset + envelope_size;
5711
5712 Ok(())
5713 }
5714 }
5715
5716 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5717 for WlanSoftmacBandCapability
5718 {
5719 #[inline(always)]
5720 fn new_empty() -> Self {
5721 Self::default()
5722 }
5723
5724 unsafe fn decode(
5725 &mut self,
5726 decoder: &mut fidl::encoding::Decoder<'_, D>,
5727 offset: usize,
5728 mut depth: fidl::encoding::Depth,
5729 ) -> fidl::Result<()> {
5730 decoder.debug_check_bounds::<Self>(offset);
5731 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5732 None => return Err(fidl::Error::NotNullable),
5733 Some(len) => len,
5734 };
5735 if len == 0 {
5737 return Ok(());
5738 };
5739 depth.increment()?;
5740 let envelope_size = 8;
5741 let bytes_len = len * envelope_size;
5742 let offset = decoder.out_of_line_offset(bytes_len)?;
5743 let mut _next_ordinal_to_read = 0;
5745 let mut next_offset = offset;
5746 let end_offset = offset + bytes_len;
5747 _next_ordinal_to_read += 1;
5748 if next_offset >= end_offset {
5749 return Ok(());
5750 }
5751
5752 while _next_ordinal_to_read < 1 {
5754 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5755 _next_ordinal_to_read += 1;
5756 next_offset += envelope_size;
5757 }
5758
5759 let next_out_of_line = decoder.next_out_of_line();
5760 let handles_before = decoder.remaining_handles();
5761 if let Some((inlined, num_bytes, num_handles)) =
5762 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5763 {
5764 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanBand as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5765 if inlined != (member_inline_size <= 4) {
5766 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5767 }
5768 let inner_offset;
5769 let mut inner_depth = depth.clone();
5770 if inlined {
5771 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5772 inner_offset = next_offset;
5773 } else {
5774 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5775 inner_depth.increment()?;
5776 }
5777 let val_ref = self.band.get_or_insert_with(|| {
5778 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanBand, D)
5779 });
5780 fidl::decode!(
5781 fidl_fuchsia_wlan_ieee80211__common::WlanBand,
5782 D,
5783 val_ref,
5784 decoder,
5785 inner_offset,
5786 inner_depth
5787 )?;
5788 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5789 {
5790 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5791 }
5792 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5793 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5794 }
5795 }
5796
5797 next_offset += envelope_size;
5798 _next_ordinal_to_read += 1;
5799 if next_offset >= end_offset {
5800 return Ok(());
5801 }
5802
5803 while _next_ordinal_to_read < 2 {
5805 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5806 _next_ordinal_to_read += 1;
5807 next_offset += envelope_size;
5808 }
5809
5810 let next_out_of_line = decoder.next_out_of_line();
5811 let handles_before = decoder.remaining_handles();
5812 if let Some((inlined, num_bytes, num_handles)) =
5813 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5814 {
5815 let member_inline_size =
5816 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5817 if inlined != (member_inline_size <= 4) {
5818 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5819 }
5820 let inner_offset;
5821 let mut inner_depth = depth.clone();
5822 if inlined {
5823 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5824 inner_offset = next_offset;
5825 } else {
5826 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5827 inner_depth.increment()?;
5828 }
5829 let val_ref = self.basic_rate_count.get_or_insert_with(|| fidl::new_empty!(u8, D));
5830 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
5831 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5832 {
5833 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5834 }
5835 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5836 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5837 }
5838 }
5839
5840 next_offset += envelope_size;
5841 _next_ordinal_to_read += 1;
5842 if next_offset >= end_offset {
5843 return Ok(());
5844 }
5845
5846 while _next_ordinal_to_read < 3 {
5848 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5849 _next_ordinal_to_read += 1;
5850 next_offset += envelope_size;
5851 }
5852
5853 let next_out_of_line = decoder.next_out_of_line();
5854 let handles_before = decoder.remaining_handles();
5855 if let Some((inlined, num_bytes, num_handles)) =
5856 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5857 {
5858 let member_inline_size =
5859 <fidl::encoding::Array<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
5860 decoder.context,
5861 );
5862 if inlined != (member_inline_size <= 4) {
5863 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5864 }
5865 let inner_offset;
5866 let mut inner_depth = depth.clone();
5867 if inlined {
5868 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5869 inner_offset = next_offset;
5870 } else {
5871 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5872 inner_depth.increment()?;
5873 }
5874 let val_ref = self
5875 .basic_rate_list
5876 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 12>, D));
5877 fidl::decode!(fidl::encoding::Array<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
5878 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5879 {
5880 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5881 }
5882 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5883 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5884 }
5885 }
5886
5887 next_offset += envelope_size;
5888 _next_ordinal_to_read += 1;
5889 if next_offset >= end_offset {
5890 return Ok(());
5891 }
5892
5893 while _next_ordinal_to_read < 4 {
5895 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5896 _next_ordinal_to_read += 1;
5897 next_offset += envelope_size;
5898 }
5899
5900 let next_out_of_line = decoder.next_out_of_line();
5901 let handles_before = decoder.remaining_handles();
5902 if let Some((inlined, num_bytes, num_handles)) =
5903 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5904 {
5905 let member_inline_size =
5906 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5907 if inlined != (member_inline_size <= 4) {
5908 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5909 }
5910 let inner_offset;
5911 let mut inner_depth = depth.clone();
5912 if inlined {
5913 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5914 inner_offset = next_offset;
5915 } else {
5916 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5917 inner_depth.increment()?;
5918 }
5919 let val_ref = self.ht_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
5920 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5921 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5922 {
5923 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5924 }
5925 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5926 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5927 }
5928 }
5929
5930 next_offset += envelope_size;
5931 _next_ordinal_to_read += 1;
5932 if next_offset >= end_offset {
5933 return Ok(());
5934 }
5935
5936 while _next_ordinal_to_read < 5 {
5938 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5939 _next_ordinal_to_read += 1;
5940 next_offset += envelope_size;
5941 }
5942
5943 let next_out_of_line = decoder.next_out_of_line();
5944 let handles_before = decoder.remaining_handles();
5945 if let Some((inlined, num_bytes, num_handles)) =
5946 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5947 {
5948 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5949 if inlined != (member_inline_size <= 4) {
5950 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5951 }
5952 let inner_offset;
5953 let mut inner_depth = depth.clone();
5954 if inlined {
5955 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5956 inner_offset = next_offset;
5957 } else {
5958 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5959 inner_depth.increment()?;
5960 }
5961 let val_ref = self.ht_caps.get_or_insert_with(|| {
5962 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D)
5963 });
5964 fidl::decode!(
5965 fidl_fuchsia_wlan_ieee80211__common::HtCapabilities,
5966 D,
5967 val_ref,
5968 decoder,
5969 inner_offset,
5970 inner_depth
5971 )?;
5972 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5973 {
5974 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5975 }
5976 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5977 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5978 }
5979 }
5980
5981 next_offset += envelope_size;
5982 _next_ordinal_to_read += 1;
5983 if next_offset >= end_offset {
5984 return Ok(());
5985 }
5986
5987 while _next_ordinal_to_read < 6 {
5989 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5990 _next_ordinal_to_read += 1;
5991 next_offset += envelope_size;
5992 }
5993
5994 let next_out_of_line = decoder.next_out_of_line();
5995 let handles_before = decoder.remaining_handles();
5996 if let Some((inlined, num_bytes, num_handles)) =
5997 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5998 {
5999 let member_inline_size =
6000 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6001 if inlined != (member_inline_size <= 4) {
6002 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6003 }
6004 let inner_offset;
6005 let mut inner_depth = depth.clone();
6006 if inlined {
6007 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6008 inner_offset = next_offset;
6009 } else {
6010 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6011 inner_depth.increment()?;
6012 }
6013 let val_ref = self.vht_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
6014 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6015 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6016 {
6017 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6018 }
6019 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6020 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6021 }
6022 }
6023
6024 next_offset += envelope_size;
6025 _next_ordinal_to_read += 1;
6026 if next_offset >= end_offset {
6027 return Ok(());
6028 }
6029
6030 while _next_ordinal_to_read < 7 {
6032 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6033 _next_ordinal_to_read += 1;
6034 next_offset += envelope_size;
6035 }
6036
6037 let next_out_of_line = decoder.next_out_of_line();
6038 let handles_before = decoder.remaining_handles();
6039 if let Some((inlined, num_bytes, num_handles)) =
6040 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6041 {
6042 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6043 if inlined != (member_inline_size <= 4) {
6044 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6045 }
6046 let inner_offset;
6047 let mut inner_depth = depth.clone();
6048 if inlined {
6049 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6050 inner_offset = next_offset;
6051 } else {
6052 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6053 inner_depth.increment()?;
6054 }
6055 let val_ref = self.vht_caps.get_or_insert_with(|| {
6056 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D)
6057 });
6058 fidl::decode!(
6059 fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities,
6060 D,
6061 val_ref,
6062 decoder,
6063 inner_offset,
6064 inner_depth
6065 )?;
6066 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6067 {
6068 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6069 }
6070 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6071 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6072 }
6073 }
6074
6075 next_offset += envelope_size;
6076 _next_ordinal_to_read += 1;
6077 if next_offset >= end_offset {
6078 return Ok(());
6079 }
6080
6081 while _next_ordinal_to_read < 8 {
6083 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6084 _next_ordinal_to_read += 1;
6085 next_offset += envelope_size;
6086 }
6087
6088 let next_out_of_line = decoder.next_out_of_line();
6089 let handles_before = decoder.remaining_handles();
6090 if let Some((inlined, num_bytes, num_handles)) =
6091 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6092 {
6093 let member_inline_size =
6094 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6095 if inlined != (member_inline_size <= 4) {
6096 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6097 }
6098 let inner_offset;
6099 let mut inner_depth = depth.clone();
6100 if inlined {
6101 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6102 inner_offset = next_offset;
6103 } else {
6104 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6105 inner_depth.increment()?;
6106 }
6107 let val_ref =
6108 self.operating_channel_count.get_or_insert_with(|| fidl::new_empty!(u16, D));
6109 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
6110 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6111 {
6112 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6113 }
6114 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6115 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6116 }
6117 }
6118
6119 next_offset += envelope_size;
6120 _next_ordinal_to_read += 1;
6121 if next_offset >= end_offset {
6122 return Ok(());
6123 }
6124
6125 while _next_ordinal_to_read < 9 {
6127 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6128 _next_ordinal_to_read += 1;
6129 next_offset += envelope_size;
6130 }
6131
6132 let next_out_of_line = decoder.next_out_of_line();
6133 let handles_before = decoder.remaining_handles();
6134 if let Some((inlined, num_bytes, num_handles)) =
6135 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6136 {
6137 let member_inline_size =
6138 <fidl::encoding::Array<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
6139 decoder.context,
6140 );
6141 if inlined != (member_inline_size <= 4) {
6142 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6143 }
6144 let inner_offset;
6145 let mut inner_depth = depth.clone();
6146 if inlined {
6147 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6148 inner_offset = next_offset;
6149 } else {
6150 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6151 inner_depth.increment()?;
6152 }
6153 let val_ref = self
6154 .operating_channel_list
6155 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 256>, D));
6156 fidl::decode!(fidl::encoding::Array<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
6157 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6158 {
6159 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6160 }
6161 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6162 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6163 }
6164 }
6165
6166 next_offset += envelope_size;
6167 _next_ordinal_to_read += 1;
6168 if next_offset >= end_offset {
6169 return Ok(());
6170 }
6171
6172 while _next_ordinal_to_read < 10 {
6174 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6175 _next_ordinal_to_read += 1;
6176 next_offset += envelope_size;
6177 }
6178
6179 let next_out_of_line = decoder.next_out_of_line();
6180 let handles_before = decoder.remaining_handles();
6181 if let Some((inlined, num_bytes, num_handles)) =
6182 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6183 {
6184 let member_inline_size =
6185 <fidl::encoding::Vector<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
6186 decoder.context,
6187 );
6188 if inlined != (member_inline_size <= 4) {
6189 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6190 }
6191 let inner_offset;
6192 let mut inner_depth = depth.clone();
6193 if inlined {
6194 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6195 inner_offset = next_offset;
6196 } else {
6197 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6198 inner_depth.increment()?;
6199 }
6200 let val_ref = self
6201 .basic_rates
6202 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 12>, D));
6203 fidl::decode!(fidl::encoding::Vector<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
6204 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6205 {
6206 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6207 }
6208 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6209 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6210 }
6211 }
6212
6213 next_offset += envelope_size;
6214 _next_ordinal_to_read += 1;
6215 if next_offset >= end_offset {
6216 return Ok(());
6217 }
6218
6219 while _next_ordinal_to_read < 11 {
6221 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6222 _next_ordinal_to_read += 1;
6223 next_offset += envelope_size;
6224 }
6225
6226 let next_out_of_line = decoder.next_out_of_line();
6227 let handles_before = decoder.remaining_handles();
6228 if let Some((inlined, num_bytes, num_handles)) =
6229 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6230 {
6231 let member_inline_size =
6232 <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
6233 decoder.context,
6234 );
6235 if inlined != (member_inline_size <= 4) {
6236 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6237 }
6238 let inner_offset;
6239 let mut inner_depth = depth.clone();
6240 if inlined {
6241 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6242 inner_offset = next_offset;
6243 } else {
6244 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6245 inner_depth.increment()?;
6246 }
6247 let val_ref = self
6248 .operating_channels
6249 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
6250 fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
6251 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6252 {
6253 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6254 }
6255 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6256 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6257 }
6258 }
6259
6260 next_offset += envelope_size;
6261
6262 while next_offset < end_offset {
6264 _next_ordinal_to_read += 1;
6265 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6266 next_offset += envelope_size;
6267 }
6268
6269 Ok(())
6270 }
6271 }
6272
6273 impl WlanSoftmacBaseCancelScanRequest {
6274 #[inline(always)]
6275 fn max_ordinal_present(&self) -> u64 {
6276 if let Some(_) = self.scan_id {
6277 return 1;
6278 }
6279 0
6280 }
6281 }
6282
6283 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseCancelScanRequest {
6284 type Borrowed<'a> = &'a Self;
6285 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6286 value
6287 }
6288 }
6289
6290 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseCancelScanRequest {
6291 type Owned = Self;
6292
6293 #[inline(always)]
6294 fn inline_align(_context: fidl::encoding::Context) -> usize {
6295 8
6296 }
6297
6298 #[inline(always)]
6299 fn inline_size(_context: fidl::encoding::Context) -> usize {
6300 16
6301 }
6302 }
6303
6304 unsafe impl<D: fidl::encoding::ResourceDialect>
6305 fidl::encoding::Encode<WlanSoftmacBaseCancelScanRequest, D>
6306 for &WlanSoftmacBaseCancelScanRequest
6307 {
6308 unsafe fn encode(
6309 self,
6310 encoder: &mut fidl::encoding::Encoder<'_, D>,
6311 offset: usize,
6312 mut depth: fidl::encoding::Depth,
6313 ) -> fidl::Result<()> {
6314 encoder.debug_check_bounds::<WlanSoftmacBaseCancelScanRequest>(offset);
6315 let max_ordinal: u64 = self.max_ordinal_present();
6317 encoder.write_num(max_ordinal, offset);
6318 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6319 if max_ordinal == 0 {
6321 return Ok(());
6322 }
6323 depth.increment()?;
6324 let envelope_size = 8;
6325 let bytes_len = max_ordinal as usize * envelope_size;
6326 #[allow(unused_variables)]
6327 let offset = encoder.out_of_line_offset(bytes_len);
6328 let mut _prev_end_offset: usize = 0;
6329 if 1 > max_ordinal {
6330 return Ok(());
6331 }
6332
6333 let cur_offset: usize = (1 - 1) * envelope_size;
6336
6337 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6339
6340 fidl::encoding::encode_in_envelope_optional::<u64, D>(
6345 self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
6346 encoder,
6347 offset + cur_offset,
6348 depth,
6349 )?;
6350
6351 _prev_end_offset = cur_offset + envelope_size;
6352
6353 Ok(())
6354 }
6355 }
6356
6357 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6358 for WlanSoftmacBaseCancelScanRequest
6359 {
6360 #[inline(always)]
6361 fn new_empty() -> Self {
6362 Self::default()
6363 }
6364
6365 unsafe fn decode(
6366 &mut self,
6367 decoder: &mut fidl::encoding::Decoder<'_, D>,
6368 offset: usize,
6369 mut depth: fidl::encoding::Depth,
6370 ) -> fidl::Result<()> {
6371 decoder.debug_check_bounds::<Self>(offset);
6372 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6373 None => return Err(fidl::Error::NotNullable),
6374 Some(len) => len,
6375 };
6376 if len == 0 {
6378 return Ok(());
6379 };
6380 depth.increment()?;
6381 let envelope_size = 8;
6382 let bytes_len = len * envelope_size;
6383 let offset = decoder.out_of_line_offset(bytes_len)?;
6384 let mut _next_ordinal_to_read = 0;
6386 let mut next_offset = offset;
6387 let end_offset = offset + bytes_len;
6388 _next_ordinal_to_read += 1;
6389 if next_offset >= end_offset {
6390 return Ok(());
6391 }
6392
6393 while _next_ordinal_to_read < 1 {
6395 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6396 _next_ordinal_to_read += 1;
6397 next_offset += envelope_size;
6398 }
6399
6400 let next_out_of_line = decoder.next_out_of_line();
6401 let handles_before = decoder.remaining_handles();
6402 if let Some((inlined, num_bytes, num_handles)) =
6403 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6404 {
6405 let member_inline_size =
6406 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6407 if inlined != (member_inline_size <= 4) {
6408 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6409 }
6410 let inner_offset;
6411 let mut inner_depth = depth.clone();
6412 if inlined {
6413 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6414 inner_offset = next_offset;
6415 } else {
6416 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6417 inner_depth.increment()?;
6418 }
6419 let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
6420 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
6421 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6422 {
6423 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6424 }
6425 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6426 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6427 }
6428 }
6429
6430 next_offset += envelope_size;
6431
6432 while next_offset < end_offset {
6434 _next_ordinal_to_read += 1;
6435 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6436 next_offset += envelope_size;
6437 }
6438
6439 Ok(())
6440 }
6441 }
6442
6443 impl WlanSoftmacBaseClearAssociationRequest {
6444 #[inline(always)]
6445 fn max_ordinal_present(&self) -> u64 {
6446 if let Some(_) = self.peer_addr {
6447 return 1;
6448 }
6449 0
6450 }
6451 }
6452
6453 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseClearAssociationRequest {
6454 type Borrowed<'a> = &'a Self;
6455 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6456 value
6457 }
6458 }
6459
6460 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseClearAssociationRequest {
6461 type Owned = Self;
6462
6463 #[inline(always)]
6464 fn inline_align(_context: fidl::encoding::Context) -> usize {
6465 8
6466 }
6467
6468 #[inline(always)]
6469 fn inline_size(_context: fidl::encoding::Context) -> usize {
6470 16
6471 }
6472 }
6473
6474 unsafe impl<D: fidl::encoding::ResourceDialect>
6475 fidl::encoding::Encode<WlanSoftmacBaseClearAssociationRequest, D>
6476 for &WlanSoftmacBaseClearAssociationRequest
6477 {
6478 unsafe fn encode(
6479 self,
6480 encoder: &mut fidl::encoding::Encoder<'_, D>,
6481 offset: usize,
6482 mut depth: fidl::encoding::Depth,
6483 ) -> fidl::Result<()> {
6484 encoder.debug_check_bounds::<WlanSoftmacBaseClearAssociationRequest>(offset);
6485 let max_ordinal: u64 = self.max_ordinal_present();
6487 encoder.write_num(max_ordinal, offset);
6488 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6489 if max_ordinal == 0 {
6491 return Ok(());
6492 }
6493 depth.increment()?;
6494 let envelope_size = 8;
6495 let bytes_len = max_ordinal as usize * envelope_size;
6496 #[allow(unused_variables)]
6497 let offset = encoder.out_of_line_offset(bytes_len);
6498 let mut _prev_end_offset: usize = 0;
6499 if 1 > max_ordinal {
6500 return Ok(());
6501 }
6502
6503 let cur_offset: usize = (1 - 1) * envelope_size;
6506
6507 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6509
6510 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
6515 self.peer_addr
6516 .as_ref()
6517 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
6518 encoder,
6519 offset + cur_offset,
6520 depth,
6521 )?;
6522
6523 _prev_end_offset = cur_offset + envelope_size;
6524
6525 Ok(())
6526 }
6527 }
6528
6529 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6530 for WlanSoftmacBaseClearAssociationRequest
6531 {
6532 #[inline(always)]
6533 fn new_empty() -> Self {
6534 Self::default()
6535 }
6536
6537 unsafe fn decode(
6538 &mut self,
6539 decoder: &mut fidl::encoding::Decoder<'_, D>,
6540 offset: usize,
6541 mut depth: fidl::encoding::Depth,
6542 ) -> fidl::Result<()> {
6543 decoder.debug_check_bounds::<Self>(offset);
6544 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6545 None => return Err(fidl::Error::NotNullable),
6546 Some(len) => len,
6547 };
6548 if len == 0 {
6550 return Ok(());
6551 };
6552 depth.increment()?;
6553 let envelope_size = 8;
6554 let bytes_len = len * envelope_size;
6555 let offset = decoder.out_of_line_offset(bytes_len)?;
6556 let mut _next_ordinal_to_read = 0;
6558 let mut next_offset = offset;
6559 let end_offset = offset + bytes_len;
6560 _next_ordinal_to_read += 1;
6561 if next_offset >= end_offset {
6562 return Ok(());
6563 }
6564
6565 while _next_ordinal_to_read < 1 {
6567 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6568 _next_ordinal_to_read += 1;
6569 next_offset += envelope_size;
6570 }
6571
6572 let next_out_of_line = decoder.next_out_of_line();
6573 let handles_before = decoder.remaining_handles();
6574 if let Some((inlined, num_bytes, num_handles)) =
6575 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6576 {
6577 let member_inline_size =
6578 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
6579 decoder.context,
6580 );
6581 if inlined != (member_inline_size <= 4) {
6582 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6583 }
6584 let inner_offset;
6585 let mut inner_depth = depth.clone();
6586 if inlined {
6587 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6588 inner_offset = next_offset;
6589 } else {
6590 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6591 inner_depth.increment()?;
6592 }
6593 let val_ref = self
6594 .peer_addr
6595 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
6596 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
6597 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6598 {
6599 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6600 }
6601 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6602 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6603 }
6604 }
6605
6606 next_offset += envelope_size;
6607
6608 while next_offset < end_offset {
6610 _next_ordinal_to_read += 1;
6611 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6612 next_offset += envelope_size;
6613 }
6614
6615 Ok(())
6616 }
6617 }
6618
6619 impl WlanSoftmacBaseEnableBeaconingRequest {
6620 #[inline(always)]
6621 fn max_ordinal_present(&self) -> u64 {
6622 if let Some(_) = self.beacon_interval {
6623 return 3;
6624 }
6625 if let Some(_) = self.tim_ele_offset {
6626 return 2;
6627 }
6628 if let Some(_) = self.packet_template {
6629 return 1;
6630 }
6631 0
6632 }
6633 }
6634
6635 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseEnableBeaconingRequest {
6636 type Borrowed<'a> = &'a Self;
6637 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6638 value
6639 }
6640 }
6641
6642 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseEnableBeaconingRequest {
6643 type Owned = Self;
6644
6645 #[inline(always)]
6646 fn inline_align(_context: fidl::encoding::Context) -> usize {
6647 8
6648 }
6649
6650 #[inline(always)]
6651 fn inline_size(_context: fidl::encoding::Context) -> usize {
6652 16
6653 }
6654 }
6655
6656 unsafe impl<D: fidl::encoding::ResourceDialect>
6657 fidl::encoding::Encode<WlanSoftmacBaseEnableBeaconingRequest, D>
6658 for &WlanSoftmacBaseEnableBeaconingRequest
6659 {
6660 unsafe fn encode(
6661 self,
6662 encoder: &mut fidl::encoding::Encoder<'_, D>,
6663 offset: usize,
6664 mut depth: fidl::encoding::Depth,
6665 ) -> fidl::Result<()> {
6666 encoder.debug_check_bounds::<WlanSoftmacBaseEnableBeaconingRequest>(offset);
6667 let max_ordinal: u64 = self.max_ordinal_present();
6669 encoder.write_num(max_ordinal, offset);
6670 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6671 if max_ordinal == 0 {
6673 return Ok(());
6674 }
6675 depth.increment()?;
6676 let envelope_size = 8;
6677 let bytes_len = max_ordinal as usize * envelope_size;
6678 #[allow(unused_variables)]
6679 let offset = encoder.out_of_line_offset(bytes_len);
6680 let mut _prev_end_offset: usize = 0;
6681 if 1 > max_ordinal {
6682 return Ok(());
6683 }
6684
6685 let cur_offset: usize = (1 - 1) * envelope_size;
6688
6689 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6691
6692 fidl::encoding::encode_in_envelope_optional::<WlanTxPacket, D>(
6697 self.packet_template
6698 .as_ref()
6699 .map(<WlanTxPacket as fidl::encoding::ValueTypeMarker>::borrow),
6700 encoder,
6701 offset + cur_offset,
6702 depth,
6703 )?;
6704
6705 _prev_end_offset = cur_offset + envelope_size;
6706 if 2 > max_ordinal {
6707 return Ok(());
6708 }
6709
6710 let cur_offset: usize = (2 - 1) * envelope_size;
6713
6714 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6716
6717 fidl::encoding::encode_in_envelope_optional::<u64, D>(
6722 self.tim_ele_offset.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
6723 encoder,
6724 offset + cur_offset,
6725 depth,
6726 )?;
6727
6728 _prev_end_offset = cur_offset + envelope_size;
6729 if 3 > max_ordinal {
6730 return Ok(());
6731 }
6732
6733 let cur_offset: usize = (3 - 1) * envelope_size;
6736
6737 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6739
6740 fidl::encoding::encode_in_envelope_optional::<u16, D>(
6745 self.beacon_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
6746 encoder,
6747 offset + cur_offset,
6748 depth,
6749 )?;
6750
6751 _prev_end_offset = cur_offset + envelope_size;
6752
6753 Ok(())
6754 }
6755 }
6756
6757 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6758 for WlanSoftmacBaseEnableBeaconingRequest
6759 {
6760 #[inline(always)]
6761 fn new_empty() -> Self {
6762 Self::default()
6763 }
6764
6765 unsafe fn decode(
6766 &mut self,
6767 decoder: &mut fidl::encoding::Decoder<'_, D>,
6768 offset: usize,
6769 mut depth: fidl::encoding::Depth,
6770 ) -> fidl::Result<()> {
6771 decoder.debug_check_bounds::<Self>(offset);
6772 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6773 None => return Err(fidl::Error::NotNullable),
6774 Some(len) => len,
6775 };
6776 if len == 0 {
6778 return Ok(());
6779 };
6780 depth.increment()?;
6781 let envelope_size = 8;
6782 let bytes_len = len * envelope_size;
6783 let offset = decoder.out_of_line_offset(bytes_len)?;
6784 let mut _next_ordinal_to_read = 0;
6786 let mut next_offset = offset;
6787 let end_offset = offset + bytes_len;
6788 _next_ordinal_to_read += 1;
6789 if next_offset >= end_offset {
6790 return Ok(());
6791 }
6792
6793 while _next_ordinal_to_read < 1 {
6795 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6796 _next_ordinal_to_read += 1;
6797 next_offset += envelope_size;
6798 }
6799
6800 let next_out_of_line = decoder.next_out_of_line();
6801 let handles_before = decoder.remaining_handles();
6802 if let Some((inlined, num_bytes, num_handles)) =
6803 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6804 {
6805 let member_inline_size =
6806 <WlanTxPacket as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6807 if inlined != (member_inline_size <= 4) {
6808 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6809 }
6810 let inner_offset;
6811 let mut inner_depth = depth.clone();
6812 if inlined {
6813 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6814 inner_offset = next_offset;
6815 } else {
6816 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6817 inner_depth.increment()?;
6818 }
6819 let val_ref =
6820 self.packet_template.get_or_insert_with(|| fidl::new_empty!(WlanTxPacket, D));
6821 fidl::decode!(WlanTxPacket, D, val_ref, decoder, inner_offset, inner_depth)?;
6822 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6823 {
6824 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6825 }
6826 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6827 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6828 }
6829 }
6830
6831 next_offset += envelope_size;
6832 _next_ordinal_to_read += 1;
6833 if next_offset >= end_offset {
6834 return Ok(());
6835 }
6836
6837 while _next_ordinal_to_read < 2 {
6839 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6840 _next_ordinal_to_read += 1;
6841 next_offset += envelope_size;
6842 }
6843
6844 let next_out_of_line = decoder.next_out_of_line();
6845 let handles_before = decoder.remaining_handles();
6846 if let Some((inlined, num_bytes, num_handles)) =
6847 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6848 {
6849 let member_inline_size =
6850 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6851 if inlined != (member_inline_size <= 4) {
6852 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6853 }
6854 let inner_offset;
6855 let mut inner_depth = depth.clone();
6856 if inlined {
6857 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6858 inner_offset = next_offset;
6859 } else {
6860 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6861 inner_depth.increment()?;
6862 }
6863 let val_ref = self.tim_ele_offset.get_or_insert_with(|| fidl::new_empty!(u64, D));
6864 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
6865 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6866 {
6867 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6868 }
6869 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6870 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6871 }
6872 }
6873
6874 next_offset += envelope_size;
6875 _next_ordinal_to_read += 1;
6876 if next_offset >= end_offset {
6877 return Ok(());
6878 }
6879
6880 while _next_ordinal_to_read < 3 {
6882 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6883 _next_ordinal_to_read += 1;
6884 next_offset += envelope_size;
6885 }
6886
6887 let next_out_of_line = decoder.next_out_of_line();
6888 let handles_before = decoder.remaining_handles();
6889 if let Some((inlined, num_bytes, num_handles)) =
6890 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6891 {
6892 let member_inline_size =
6893 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6894 if inlined != (member_inline_size <= 4) {
6895 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6896 }
6897 let inner_offset;
6898 let mut inner_depth = depth.clone();
6899 if inlined {
6900 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6901 inner_offset = next_offset;
6902 } else {
6903 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6904 inner_depth.increment()?;
6905 }
6906 let val_ref = self.beacon_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
6907 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
6908 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6909 {
6910 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6911 }
6912 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6913 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6914 }
6915 }
6916
6917 next_offset += envelope_size;
6918
6919 while next_offset < end_offset {
6921 _next_ordinal_to_read += 1;
6922 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6923 next_offset += envelope_size;
6924 }
6925
6926 Ok(())
6927 }
6928 }
6929
6930 impl WlanSoftmacBaseSetChannelRequest {
6931 #[inline(always)]
6932 fn max_ordinal_present(&self) -> u64 {
6933 if let Some(_) = self.channel {
6934 return 1;
6935 }
6936 0
6937 }
6938 }
6939
6940 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseSetChannelRequest {
6941 type Borrowed<'a> = &'a Self;
6942 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6943 value
6944 }
6945 }
6946
6947 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseSetChannelRequest {
6948 type Owned = Self;
6949
6950 #[inline(always)]
6951 fn inline_align(_context: fidl::encoding::Context) -> usize {
6952 8
6953 }
6954
6955 #[inline(always)]
6956 fn inline_size(_context: fidl::encoding::Context) -> usize {
6957 16
6958 }
6959 }
6960
6961 unsafe impl<D: fidl::encoding::ResourceDialect>
6962 fidl::encoding::Encode<WlanSoftmacBaseSetChannelRequest, D>
6963 for &WlanSoftmacBaseSetChannelRequest
6964 {
6965 unsafe fn encode(
6966 self,
6967 encoder: &mut fidl::encoding::Encoder<'_, D>,
6968 offset: usize,
6969 mut depth: fidl::encoding::Depth,
6970 ) -> fidl::Result<()> {
6971 encoder.debug_check_bounds::<WlanSoftmacBaseSetChannelRequest>(offset);
6972 let max_ordinal: u64 = self.max_ordinal_present();
6974 encoder.write_num(max_ordinal, offset);
6975 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6976 if max_ordinal == 0 {
6978 return Ok(());
6979 }
6980 depth.increment()?;
6981 let envelope_size = 8;
6982 let bytes_len = max_ordinal as usize * envelope_size;
6983 #[allow(unused_variables)]
6984 let offset = encoder.out_of_line_offset(bytes_len);
6985 let mut _prev_end_offset: usize = 0;
6986 if 1 > max_ordinal {
6987 return Ok(());
6988 }
6989
6990 let cur_offset: usize = (1 - 1) * envelope_size;
6993
6994 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6996
6997 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D>(
7002 self.channel.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow),
7003 encoder, offset + cur_offset, depth
7004 )?;
7005
7006 _prev_end_offset = cur_offset + envelope_size;
7007
7008 Ok(())
7009 }
7010 }
7011
7012 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7013 for WlanSoftmacBaseSetChannelRequest
7014 {
7015 #[inline(always)]
7016 fn new_empty() -> Self {
7017 Self::default()
7018 }
7019
7020 unsafe fn decode(
7021 &mut self,
7022 decoder: &mut fidl::encoding::Decoder<'_, D>,
7023 offset: usize,
7024 mut depth: fidl::encoding::Depth,
7025 ) -> fidl::Result<()> {
7026 decoder.debug_check_bounds::<Self>(offset);
7027 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7028 None => return Err(fidl::Error::NotNullable),
7029 Some(len) => len,
7030 };
7031 if len == 0 {
7033 return Ok(());
7034 };
7035 depth.increment()?;
7036 let envelope_size = 8;
7037 let bytes_len = len * envelope_size;
7038 let offset = decoder.out_of_line_offset(bytes_len)?;
7039 let mut _next_ordinal_to_read = 0;
7041 let mut next_offset = offset;
7042 let end_offset = offset + bytes_len;
7043 _next_ordinal_to_read += 1;
7044 if next_offset >= end_offset {
7045 return Ok(());
7046 }
7047
7048 while _next_ordinal_to_read < 1 {
7050 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7051 _next_ordinal_to_read += 1;
7052 next_offset += envelope_size;
7053 }
7054
7055 let next_out_of_line = decoder.next_out_of_line();
7056 let handles_before = decoder.remaining_handles();
7057 if let Some((inlined, num_bytes, num_handles)) =
7058 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7059 {
7060 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7061 if inlined != (member_inline_size <= 4) {
7062 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7063 }
7064 let inner_offset;
7065 let mut inner_depth = depth.clone();
7066 if inlined {
7067 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7068 inner_offset = next_offset;
7069 } else {
7070 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7071 inner_depth.increment()?;
7072 }
7073 let val_ref = self.channel.get_or_insert_with(|| {
7074 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D)
7075 });
7076 fidl::decode!(
7077 fidl_fuchsia_wlan_ieee80211__common::WlanChannel,
7078 D,
7079 val_ref,
7080 decoder,
7081 inner_offset,
7082 inner_depth
7083 )?;
7084 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7085 {
7086 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7087 }
7088 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7089 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7090 }
7091 }
7092
7093 next_offset += envelope_size;
7094
7095 while next_offset < end_offset {
7097 _next_ordinal_to_read += 1;
7098 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7099 next_offset += envelope_size;
7100 }
7101
7102 Ok(())
7103 }
7104 }
7105
7106 impl WlanSoftmacBaseStartPassiveScanRequest {
7107 #[inline(always)]
7108 fn max_ordinal_present(&self) -> u64 {
7109 if let Some(_) = self.min_home_time {
7110 return 4;
7111 }
7112 if let Some(_) = self.max_channel_time {
7113 return 3;
7114 }
7115 if let Some(_) = self.min_channel_time {
7116 return 2;
7117 }
7118 if let Some(_) = self.channels {
7119 return 1;
7120 }
7121 0
7122 }
7123 }
7124
7125 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartPassiveScanRequest {
7126 type Borrowed<'a> = &'a Self;
7127 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7128 value
7129 }
7130 }
7131
7132 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartPassiveScanRequest {
7133 type Owned = Self;
7134
7135 #[inline(always)]
7136 fn inline_align(_context: fidl::encoding::Context) -> usize {
7137 8
7138 }
7139
7140 #[inline(always)]
7141 fn inline_size(_context: fidl::encoding::Context) -> usize {
7142 16
7143 }
7144 }
7145
7146 unsafe impl<D: fidl::encoding::ResourceDialect>
7147 fidl::encoding::Encode<WlanSoftmacBaseStartPassiveScanRequest, D>
7148 for &WlanSoftmacBaseStartPassiveScanRequest
7149 {
7150 unsafe fn encode(
7151 self,
7152 encoder: &mut fidl::encoding::Encoder<'_, D>,
7153 offset: usize,
7154 mut depth: fidl::encoding::Depth,
7155 ) -> fidl::Result<()> {
7156 encoder.debug_check_bounds::<WlanSoftmacBaseStartPassiveScanRequest>(offset);
7157 let max_ordinal: u64 = self.max_ordinal_present();
7159 encoder.write_num(max_ordinal, offset);
7160 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7161 if max_ordinal == 0 {
7163 return Ok(());
7164 }
7165 depth.increment()?;
7166 let envelope_size = 8;
7167 let bytes_len = max_ordinal as usize * envelope_size;
7168 #[allow(unused_variables)]
7169 let offset = encoder.out_of_line_offset(bytes_len);
7170 let mut _prev_end_offset: usize = 0;
7171 if 1 > max_ordinal {
7172 return Ok(());
7173 }
7174
7175 let cur_offset: usize = (1 - 1) * envelope_size;
7178
7179 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7181
7182 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
7187 self.channels.as_ref().map(
7188 <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
7189 ),
7190 encoder,
7191 offset + cur_offset,
7192 depth,
7193 )?;
7194
7195 _prev_end_offset = cur_offset + envelope_size;
7196 if 2 > max_ordinal {
7197 return Ok(());
7198 }
7199
7200 let cur_offset: usize = (2 - 1) * envelope_size;
7203
7204 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7206
7207 fidl::encoding::encode_in_envelope_optional::<i64, D>(
7212 self.min_channel_time
7213 .as_ref()
7214 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7215 encoder,
7216 offset + cur_offset,
7217 depth,
7218 )?;
7219
7220 _prev_end_offset = cur_offset + envelope_size;
7221 if 3 > max_ordinal {
7222 return Ok(());
7223 }
7224
7225 let cur_offset: usize = (3 - 1) * envelope_size;
7228
7229 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7231
7232 fidl::encoding::encode_in_envelope_optional::<i64, D>(
7237 self.max_channel_time
7238 .as_ref()
7239 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7240 encoder,
7241 offset + cur_offset,
7242 depth,
7243 )?;
7244
7245 _prev_end_offset = cur_offset + envelope_size;
7246 if 4 > max_ordinal {
7247 return Ok(());
7248 }
7249
7250 let cur_offset: usize = (4 - 1) * envelope_size;
7253
7254 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7256
7257 fidl::encoding::encode_in_envelope_optional::<i64, D>(
7262 self.min_home_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7263 encoder,
7264 offset + cur_offset,
7265 depth,
7266 )?;
7267
7268 _prev_end_offset = cur_offset + envelope_size;
7269
7270 Ok(())
7271 }
7272 }
7273
7274 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7275 for WlanSoftmacBaseStartPassiveScanRequest
7276 {
7277 #[inline(always)]
7278 fn new_empty() -> Self {
7279 Self::default()
7280 }
7281
7282 unsafe fn decode(
7283 &mut self,
7284 decoder: &mut fidl::encoding::Decoder<'_, D>,
7285 offset: usize,
7286 mut depth: fidl::encoding::Depth,
7287 ) -> fidl::Result<()> {
7288 decoder.debug_check_bounds::<Self>(offset);
7289 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7290 None => return Err(fidl::Error::NotNullable),
7291 Some(len) => len,
7292 };
7293 if len == 0 {
7295 return Ok(());
7296 };
7297 depth.increment()?;
7298 let envelope_size = 8;
7299 let bytes_len = len * envelope_size;
7300 let offset = decoder.out_of_line_offset(bytes_len)?;
7301 let mut _next_ordinal_to_read = 0;
7303 let mut next_offset = offset;
7304 let end_offset = offset + bytes_len;
7305 _next_ordinal_to_read += 1;
7306 if next_offset >= end_offset {
7307 return Ok(());
7308 }
7309
7310 while _next_ordinal_to_read < 1 {
7312 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7313 _next_ordinal_to_read += 1;
7314 next_offset += envelope_size;
7315 }
7316
7317 let next_out_of_line = decoder.next_out_of_line();
7318 let handles_before = decoder.remaining_handles();
7319 if let Some((inlined, num_bytes, num_handles)) =
7320 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7321 {
7322 let member_inline_size =
7323 <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
7324 decoder.context,
7325 );
7326 if inlined != (member_inline_size <= 4) {
7327 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7328 }
7329 let inner_offset;
7330 let mut inner_depth = depth.clone();
7331 if inlined {
7332 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7333 inner_offset = next_offset;
7334 } else {
7335 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7336 inner_depth.increment()?;
7337 }
7338 let val_ref = self
7339 .channels
7340 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
7341 fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
7342 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7343 {
7344 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7345 }
7346 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7347 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7348 }
7349 }
7350
7351 next_offset += envelope_size;
7352 _next_ordinal_to_read += 1;
7353 if next_offset >= end_offset {
7354 return Ok(());
7355 }
7356
7357 while _next_ordinal_to_read < 2 {
7359 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7360 _next_ordinal_to_read += 1;
7361 next_offset += envelope_size;
7362 }
7363
7364 let next_out_of_line = decoder.next_out_of_line();
7365 let handles_before = decoder.remaining_handles();
7366 if let Some((inlined, num_bytes, num_handles)) =
7367 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7368 {
7369 let member_inline_size =
7370 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7371 if inlined != (member_inline_size <= 4) {
7372 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7373 }
7374 let inner_offset;
7375 let mut inner_depth = depth.clone();
7376 if inlined {
7377 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7378 inner_offset = next_offset;
7379 } else {
7380 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7381 inner_depth.increment()?;
7382 }
7383 let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
7384 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7385 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7386 {
7387 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7388 }
7389 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7390 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7391 }
7392 }
7393
7394 next_offset += envelope_size;
7395 _next_ordinal_to_read += 1;
7396 if next_offset >= end_offset {
7397 return Ok(());
7398 }
7399
7400 while _next_ordinal_to_read < 3 {
7402 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7403 _next_ordinal_to_read += 1;
7404 next_offset += envelope_size;
7405 }
7406
7407 let next_out_of_line = decoder.next_out_of_line();
7408 let handles_before = decoder.remaining_handles();
7409 if let Some((inlined, num_bytes, num_handles)) =
7410 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7411 {
7412 let member_inline_size =
7413 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7414 if inlined != (member_inline_size <= 4) {
7415 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7416 }
7417 let inner_offset;
7418 let mut inner_depth = depth.clone();
7419 if inlined {
7420 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7421 inner_offset = next_offset;
7422 } else {
7423 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7424 inner_depth.increment()?;
7425 }
7426 let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
7427 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7428 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7429 {
7430 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7431 }
7432 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7433 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7434 }
7435 }
7436
7437 next_offset += envelope_size;
7438 _next_ordinal_to_read += 1;
7439 if next_offset >= end_offset {
7440 return Ok(());
7441 }
7442
7443 while _next_ordinal_to_read < 4 {
7445 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7446 _next_ordinal_to_read += 1;
7447 next_offset += envelope_size;
7448 }
7449
7450 let next_out_of_line = decoder.next_out_of_line();
7451 let handles_before = decoder.remaining_handles();
7452 if let Some((inlined, num_bytes, num_handles)) =
7453 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7454 {
7455 let member_inline_size =
7456 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7457 if inlined != (member_inline_size <= 4) {
7458 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7459 }
7460 let inner_offset;
7461 let mut inner_depth = depth.clone();
7462 if inlined {
7463 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7464 inner_offset = next_offset;
7465 } else {
7466 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7467 inner_depth.increment()?;
7468 }
7469 let val_ref = self.min_home_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
7470 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7471 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7472 {
7473 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7474 }
7475 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7476 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7477 }
7478 }
7479
7480 next_offset += envelope_size;
7481
7482 while next_offset < end_offset {
7484 _next_ordinal_to_read += 1;
7485 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7486 next_offset += envelope_size;
7487 }
7488
7489 Ok(())
7490 }
7491 }
7492
7493 impl WlanSoftmacBaseUpdateWmmParametersRequest {
7494 #[inline(always)]
7495 fn max_ordinal_present(&self) -> u64 {
7496 if let Some(_) = self.params {
7497 return 2;
7498 }
7499 if let Some(_) = self.ac {
7500 return 1;
7501 }
7502 0
7503 }
7504 }
7505
7506 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseUpdateWmmParametersRequest {
7507 type Borrowed<'a> = &'a Self;
7508 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7509 value
7510 }
7511 }
7512
7513 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseUpdateWmmParametersRequest {
7514 type Owned = Self;
7515
7516 #[inline(always)]
7517 fn inline_align(_context: fidl::encoding::Context) -> usize {
7518 8
7519 }
7520
7521 #[inline(always)]
7522 fn inline_size(_context: fidl::encoding::Context) -> usize {
7523 16
7524 }
7525 }
7526
7527 unsafe impl<D: fidl::encoding::ResourceDialect>
7528 fidl::encoding::Encode<WlanSoftmacBaseUpdateWmmParametersRequest, D>
7529 for &WlanSoftmacBaseUpdateWmmParametersRequest
7530 {
7531 unsafe fn encode(
7532 self,
7533 encoder: &mut fidl::encoding::Encoder<'_, D>,
7534 offset: usize,
7535 mut depth: fidl::encoding::Depth,
7536 ) -> fidl::Result<()> {
7537 encoder.debug_check_bounds::<WlanSoftmacBaseUpdateWmmParametersRequest>(offset);
7538 let max_ordinal: u64 = self.max_ordinal_present();
7540 encoder.write_num(max_ordinal, offset);
7541 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7542 if max_ordinal == 0 {
7544 return Ok(());
7545 }
7546 depth.increment()?;
7547 let envelope_size = 8;
7548 let bytes_len = max_ordinal as usize * envelope_size;
7549 #[allow(unused_variables)]
7550 let offset = encoder.out_of_line_offset(bytes_len);
7551 let mut _prev_end_offset: usize = 0;
7552 if 1 > max_ordinal {
7553 return Ok(());
7554 }
7555
7556 let cur_offset: usize = (1 - 1) * envelope_size;
7559
7560 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7562
7563 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory, D>(
7568 self.ac.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory as fidl::encoding::ValueTypeMarker>::borrow),
7569 encoder, offset + cur_offset, depth
7570 )?;
7571
7572 _prev_end_offset = cur_offset + envelope_size;
7573 if 2 > max_ordinal {
7574 return Ok(());
7575 }
7576
7577 let cur_offset: usize = (2 - 1) * envelope_size;
7580
7581 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7583
7584 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanWmmParameters, D>(
7589 self.params.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow),
7590 encoder, offset + cur_offset, depth
7591 )?;
7592
7593 _prev_end_offset = cur_offset + envelope_size;
7594
7595 Ok(())
7596 }
7597 }
7598
7599 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7600 for WlanSoftmacBaseUpdateWmmParametersRequest
7601 {
7602 #[inline(always)]
7603 fn new_empty() -> Self {
7604 Self::default()
7605 }
7606
7607 unsafe fn decode(
7608 &mut self,
7609 decoder: &mut fidl::encoding::Decoder<'_, D>,
7610 offset: usize,
7611 mut depth: fidl::encoding::Depth,
7612 ) -> fidl::Result<()> {
7613 decoder.debug_check_bounds::<Self>(offset);
7614 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7615 None => return Err(fidl::Error::NotNullable),
7616 Some(len) => len,
7617 };
7618 if len == 0 {
7620 return Ok(());
7621 };
7622 depth.increment()?;
7623 let envelope_size = 8;
7624 let bytes_len = len * envelope_size;
7625 let offset = decoder.out_of_line_offset(bytes_len)?;
7626 let mut _next_ordinal_to_read = 0;
7628 let mut next_offset = offset;
7629 let end_offset = offset + bytes_len;
7630 _next_ordinal_to_read += 1;
7631 if next_offset >= end_offset {
7632 return Ok(());
7633 }
7634
7635 while _next_ordinal_to_read < 1 {
7637 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7638 _next_ordinal_to_read += 1;
7639 next_offset += envelope_size;
7640 }
7641
7642 let next_out_of_line = decoder.next_out_of_line();
7643 let handles_before = decoder.remaining_handles();
7644 if let Some((inlined, num_bytes, num_handles)) =
7645 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7646 {
7647 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7648 if inlined != (member_inline_size <= 4) {
7649 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7650 }
7651 let inner_offset;
7652 let mut inner_depth = depth.clone();
7653 if inlined {
7654 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7655 inner_offset = next_offset;
7656 } else {
7657 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7658 inner_depth.increment()?;
7659 }
7660 let val_ref = self.ac.get_or_insert_with(|| {
7661 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory, D)
7662 });
7663 fidl::decode!(
7664 fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory,
7665 D,
7666 val_ref,
7667 decoder,
7668 inner_offset,
7669 inner_depth
7670 )?;
7671 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7672 {
7673 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7674 }
7675 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7676 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7677 }
7678 }
7679
7680 next_offset += envelope_size;
7681 _next_ordinal_to_read += 1;
7682 if next_offset >= end_offset {
7683 return Ok(());
7684 }
7685
7686 while _next_ordinal_to_read < 2 {
7688 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7689 _next_ordinal_to_read += 1;
7690 next_offset += envelope_size;
7691 }
7692
7693 let next_out_of_line = decoder.next_out_of_line();
7694 let handles_before = decoder.remaining_handles();
7695 if let Some((inlined, num_bytes, num_handles)) =
7696 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7697 {
7698 let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7699 if inlined != (member_inline_size <= 4) {
7700 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7701 }
7702 let inner_offset;
7703 let mut inner_depth = depth.clone();
7704 if inlined {
7705 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7706 inner_offset = next_offset;
7707 } else {
7708 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7709 inner_depth.increment()?;
7710 }
7711 let val_ref = self.params.get_or_insert_with(|| {
7712 fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanWmmParameters, D)
7713 });
7714 fidl::decode!(
7715 fidl_fuchsia_wlan_common__common::WlanWmmParameters,
7716 D,
7717 val_ref,
7718 decoder,
7719 inner_offset,
7720 inner_depth
7721 )?;
7722 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7723 {
7724 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7725 }
7726 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7727 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7728 }
7729 }
7730
7731 next_offset += envelope_size;
7732
7733 while next_offset < end_offset {
7735 _next_ordinal_to_read += 1;
7736 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7737 next_offset += envelope_size;
7738 }
7739
7740 Ok(())
7741 }
7742 }
7743
7744 impl WlanSoftmacBaseStartActiveScanResponse {
7745 #[inline(always)]
7746 fn max_ordinal_present(&self) -> u64 {
7747 if let Some(_) = self.scan_id {
7748 return 1;
7749 }
7750 0
7751 }
7752 }
7753
7754 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartActiveScanResponse {
7755 type Borrowed<'a> = &'a Self;
7756 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7757 value
7758 }
7759 }
7760
7761 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartActiveScanResponse {
7762 type Owned = Self;
7763
7764 #[inline(always)]
7765 fn inline_align(_context: fidl::encoding::Context) -> usize {
7766 8
7767 }
7768
7769 #[inline(always)]
7770 fn inline_size(_context: fidl::encoding::Context) -> usize {
7771 16
7772 }
7773 }
7774
7775 unsafe impl<D: fidl::encoding::ResourceDialect>
7776 fidl::encoding::Encode<WlanSoftmacBaseStartActiveScanResponse, D>
7777 for &WlanSoftmacBaseStartActiveScanResponse
7778 {
7779 unsafe fn encode(
7780 self,
7781 encoder: &mut fidl::encoding::Encoder<'_, D>,
7782 offset: usize,
7783 mut depth: fidl::encoding::Depth,
7784 ) -> fidl::Result<()> {
7785 encoder.debug_check_bounds::<WlanSoftmacBaseStartActiveScanResponse>(offset);
7786 let max_ordinal: u64 = self.max_ordinal_present();
7788 encoder.write_num(max_ordinal, offset);
7789 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7790 if max_ordinal == 0 {
7792 return Ok(());
7793 }
7794 depth.increment()?;
7795 let envelope_size = 8;
7796 let bytes_len = max_ordinal as usize * envelope_size;
7797 #[allow(unused_variables)]
7798 let offset = encoder.out_of_line_offset(bytes_len);
7799 let mut _prev_end_offset: usize = 0;
7800 if 1 > max_ordinal {
7801 return Ok(());
7802 }
7803
7804 let cur_offset: usize = (1 - 1) * envelope_size;
7807
7808 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7810
7811 fidl::encoding::encode_in_envelope_optional::<u64, D>(
7816 self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7817 encoder,
7818 offset + cur_offset,
7819 depth,
7820 )?;
7821
7822 _prev_end_offset = cur_offset + envelope_size;
7823
7824 Ok(())
7825 }
7826 }
7827
7828 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7829 for WlanSoftmacBaseStartActiveScanResponse
7830 {
7831 #[inline(always)]
7832 fn new_empty() -> Self {
7833 Self::default()
7834 }
7835
7836 unsafe fn decode(
7837 &mut self,
7838 decoder: &mut fidl::encoding::Decoder<'_, D>,
7839 offset: usize,
7840 mut depth: fidl::encoding::Depth,
7841 ) -> fidl::Result<()> {
7842 decoder.debug_check_bounds::<Self>(offset);
7843 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7844 None => return Err(fidl::Error::NotNullable),
7845 Some(len) => len,
7846 };
7847 if len == 0 {
7849 return Ok(());
7850 };
7851 depth.increment()?;
7852 let envelope_size = 8;
7853 let bytes_len = len * envelope_size;
7854 let offset = decoder.out_of_line_offset(bytes_len)?;
7855 let mut _next_ordinal_to_read = 0;
7857 let mut next_offset = offset;
7858 let end_offset = offset + bytes_len;
7859 _next_ordinal_to_read += 1;
7860 if next_offset >= end_offset {
7861 return Ok(());
7862 }
7863
7864 while _next_ordinal_to_read < 1 {
7866 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7867 _next_ordinal_to_read += 1;
7868 next_offset += envelope_size;
7869 }
7870
7871 let next_out_of_line = decoder.next_out_of_line();
7872 let handles_before = decoder.remaining_handles();
7873 if let Some((inlined, num_bytes, num_handles)) =
7874 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7875 {
7876 let member_inline_size =
7877 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7878 if inlined != (member_inline_size <= 4) {
7879 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7880 }
7881 let inner_offset;
7882 let mut inner_depth = depth.clone();
7883 if inlined {
7884 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7885 inner_offset = next_offset;
7886 } else {
7887 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7888 inner_depth.increment()?;
7889 }
7890 let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
7891 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7892 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7893 {
7894 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7895 }
7896 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7897 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7898 }
7899 }
7900
7901 next_offset += envelope_size;
7902
7903 while next_offset < end_offset {
7905 _next_ordinal_to_read += 1;
7906 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7907 next_offset += envelope_size;
7908 }
7909
7910 Ok(())
7911 }
7912 }
7913
7914 impl WlanSoftmacBaseStartPassiveScanResponse {
7915 #[inline(always)]
7916 fn max_ordinal_present(&self) -> u64 {
7917 if let Some(_) = self.scan_id {
7918 return 1;
7919 }
7920 0
7921 }
7922 }
7923
7924 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartPassiveScanResponse {
7925 type Borrowed<'a> = &'a Self;
7926 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7927 value
7928 }
7929 }
7930
7931 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartPassiveScanResponse {
7932 type Owned = Self;
7933
7934 #[inline(always)]
7935 fn inline_align(_context: fidl::encoding::Context) -> usize {
7936 8
7937 }
7938
7939 #[inline(always)]
7940 fn inline_size(_context: fidl::encoding::Context) -> usize {
7941 16
7942 }
7943 }
7944
7945 unsafe impl<D: fidl::encoding::ResourceDialect>
7946 fidl::encoding::Encode<WlanSoftmacBaseStartPassiveScanResponse, D>
7947 for &WlanSoftmacBaseStartPassiveScanResponse
7948 {
7949 unsafe fn encode(
7950 self,
7951 encoder: &mut fidl::encoding::Encoder<'_, D>,
7952 offset: usize,
7953 mut depth: fidl::encoding::Depth,
7954 ) -> fidl::Result<()> {
7955 encoder.debug_check_bounds::<WlanSoftmacBaseStartPassiveScanResponse>(offset);
7956 let max_ordinal: u64 = self.max_ordinal_present();
7958 encoder.write_num(max_ordinal, offset);
7959 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7960 if max_ordinal == 0 {
7962 return Ok(());
7963 }
7964 depth.increment()?;
7965 let envelope_size = 8;
7966 let bytes_len = max_ordinal as usize * envelope_size;
7967 #[allow(unused_variables)]
7968 let offset = encoder.out_of_line_offset(bytes_len);
7969 let mut _prev_end_offset: usize = 0;
7970 if 1 > max_ordinal {
7971 return Ok(());
7972 }
7973
7974 let cur_offset: usize = (1 - 1) * envelope_size;
7977
7978 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7980
7981 fidl::encoding::encode_in_envelope_optional::<u64, D>(
7986 self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7987 encoder,
7988 offset + cur_offset,
7989 depth,
7990 )?;
7991
7992 _prev_end_offset = cur_offset + envelope_size;
7993
7994 Ok(())
7995 }
7996 }
7997
7998 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7999 for WlanSoftmacBaseStartPassiveScanResponse
8000 {
8001 #[inline(always)]
8002 fn new_empty() -> Self {
8003 Self::default()
8004 }
8005
8006 unsafe fn decode(
8007 &mut self,
8008 decoder: &mut fidl::encoding::Decoder<'_, D>,
8009 offset: usize,
8010 mut depth: fidl::encoding::Depth,
8011 ) -> fidl::Result<()> {
8012 decoder.debug_check_bounds::<Self>(offset);
8013 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8014 None => return Err(fidl::Error::NotNullable),
8015 Some(len) => len,
8016 };
8017 if len == 0 {
8019 return Ok(());
8020 };
8021 depth.increment()?;
8022 let envelope_size = 8;
8023 let bytes_len = len * envelope_size;
8024 let offset = decoder.out_of_line_offset(bytes_len)?;
8025 let mut _next_ordinal_to_read = 0;
8027 let mut next_offset = offset;
8028 let end_offset = offset + bytes_len;
8029 _next_ordinal_to_read += 1;
8030 if next_offset >= end_offset {
8031 return Ok(());
8032 }
8033
8034 while _next_ordinal_to_read < 1 {
8036 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8037 _next_ordinal_to_read += 1;
8038 next_offset += envelope_size;
8039 }
8040
8041 let next_out_of_line = decoder.next_out_of_line();
8042 let handles_before = decoder.remaining_handles();
8043 if let Some((inlined, num_bytes, num_handles)) =
8044 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8045 {
8046 let member_inline_size =
8047 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8048 if inlined != (member_inline_size <= 4) {
8049 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8050 }
8051 let inner_offset;
8052 let mut inner_depth = depth.clone();
8053 if inlined {
8054 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8055 inner_offset = next_offset;
8056 } else {
8057 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8058 inner_depth.increment()?;
8059 }
8060 let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
8061 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8062 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8063 {
8064 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8065 }
8066 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8067 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8068 }
8069 }
8070
8071 next_offset += envelope_size;
8072
8073 while next_offset < end_offset {
8075 _next_ordinal_to_read += 1;
8076 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8077 next_offset += envelope_size;
8078 }
8079
8080 Ok(())
8081 }
8082 }
8083
8084 impl WlanSoftmacIfcBaseNotifyScanCompleteRequest {
8085 #[inline(always)]
8086 fn max_ordinal_present(&self) -> u64 {
8087 if let Some(_) = self.scan_id {
8088 return 2;
8089 }
8090 if let Some(_) = self.status {
8091 return 1;
8092 }
8093 0
8094 }
8095 }
8096
8097 impl fidl::encoding::ValueTypeMarker for WlanSoftmacIfcBaseNotifyScanCompleteRequest {
8098 type Borrowed<'a> = &'a Self;
8099 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8100 value
8101 }
8102 }
8103
8104 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacIfcBaseNotifyScanCompleteRequest {
8105 type Owned = Self;
8106
8107 #[inline(always)]
8108 fn inline_align(_context: fidl::encoding::Context) -> usize {
8109 8
8110 }
8111
8112 #[inline(always)]
8113 fn inline_size(_context: fidl::encoding::Context) -> usize {
8114 16
8115 }
8116 }
8117
8118 unsafe impl<D: fidl::encoding::ResourceDialect>
8119 fidl::encoding::Encode<WlanSoftmacIfcBaseNotifyScanCompleteRequest, D>
8120 for &WlanSoftmacIfcBaseNotifyScanCompleteRequest
8121 {
8122 unsafe fn encode(
8123 self,
8124 encoder: &mut fidl::encoding::Encoder<'_, D>,
8125 offset: usize,
8126 mut depth: fidl::encoding::Depth,
8127 ) -> fidl::Result<()> {
8128 encoder.debug_check_bounds::<WlanSoftmacIfcBaseNotifyScanCompleteRequest>(offset);
8129 let max_ordinal: u64 = self.max_ordinal_present();
8131 encoder.write_num(max_ordinal, offset);
8132 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8133 if max_ordinal == 0 {
8135 return Ok(());
8136 }
8137 depth.increment()?;
8138 let envelope_size = 8;
8139 let bytes_len = max_ordinal as usize * envelope_size;
8140 #[allow(unused_variables)]
8141 let offset = encoder.out_of_line_offset(bytes_len);
8142 let mut _prev_end_offset: usize = 0;
8143 if 1 > max_ordinal {
8144 return Ok(());
8145 }
8146
8147 let cur_offset: usize = (1 - 1) * envelope_size;
8150
8151 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8153
8154 fidl::encoding::encode_in_envelope_optional::<i32, D>(
8159 self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
8160 encoder,
8161 offset + cur_offset,
8162 depth,
8163 )?;
8164
8165 _prev_end_offset = cur_offset + envelope_size;
8166 if 2 > max_ordinal {
8167 return Ok(());
8168 }
8169
8170 let cur_offset: usize = (2 - 1) * envelope_size;
8173
8174 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8176
8177 fidl::encoding::encode_in_envelope_optional::<u64, D>(
8182 self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8183 encoder,
8184 offset + cur_offset,
8185 depth,
8186 )?;
8187
8188 _prev_end_offset = cur_offset + envelope_size;
8189
8190 Ok(())
8191 }
8192 }
8193
8194 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8195 for WlanSoftmacIfcBaseNotifyScanCompleteRequest
8196 {
8197 #[inline(always)]
8198 fn new_empty() -> Self {
8199 Self::default()
8200 }
8201
8202 unsafe fn decode(
8203 &mut self,
8204 decoder: &mut fidl::encoding::Decoder<'_, D>,
8205 offset: usize,
8206 mut depth: fidl::encoding::Depth,
8207 ) -> fidl::Result<()> {
8208 decoder.debug_check_bounds::<Self>(offset);
8209 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8210 None => return Err(fidl::Error::NotNullable),
8211 Some(len) => len,
8212 };
8213 if len == 0 {
8215 return Ok(());
8216 };
8217 depth.increment()?;
8218 let envelope_size = 8;
8219 let bytes_len = len * envelope_size;
8220 let offset = decoder.out_of_line_offset(bytes_len)?;
8221 let mut _next_ordinal_to_read = 0;
8223 let mut next_offset = offset;
8224 let end_offset = offset + bytes_len;
8225 _next_ordinal_to_read += 1;
8226 if next_offset >= end_offset {
8227 return Ok(());
8228 }
8229
8230 while _next_ordinal_to_read < 1 {
8232 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8233 _next_ordinal_to_read += 1;
8234 next_offset += envelope_size;
8235 }
8236
8237 let next_out_of_line = decoder.next_out_of_line();
8238 let handles_before = decoder.remaining_handles();
8239 if let Some((inlined, num_bytes, num_handles)) =
8240 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8241 {
8242 let member_inline_size =
8243 <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8244 if inlined != (member_inline_size <= 4) {
8245 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8246 }
8247 let inner_offset;
8248 let mut inner_depth = depth.clone();
8249 if inlined {
8250 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8251 inner_offset = next_offset;
8252 } else {
8253 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8254 inner_depth.increment()?;
8255 }
8256 let val_ref = self.status.get_or_insert_with(|| fidl::new_empty!(i32, D));
8257 fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
8258 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8259 {
8260 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8261 }
8262 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8263 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8264 }
8265 }
8266
8267 next_offset += envelope_size;
8268 _next_ordinal_to_read += 1;
8269 if next_offset >= end_offset {
8270 return Ok(());
8271 }
8272
8273 while _next_ordinal_to_read < 2 {
8275 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8276 _next_ordinal_to_read += 1;
8277 next_offset += envelope_size;
8278 }
8279
8280 let next_out_of_line = decoder.next_out_of_line();
8281 let handles_before = decoder.remaining_handles();
8282 if let Some((inlined, num_bytes, num_handles)) =
8283 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8284 {
8285 let member_inline_size =
8286 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8287 if inlined != (member_inline_size <= 4) {
8288 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8289 }
8290 let inner_offset;
8291 let mut inner_depth = depth.clone();
8292 if inlined {
8293 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8294 inner_offset = next_offset;
8295 } else {
8296 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8297 inner_depth.increment()?;
8298 }
8299 let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
8300 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8301 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8302 {
8303 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8304 }
8305 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8306 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8307 }
8308 }
8309
8310 next_offset += envelope_size;
8311
8312 while next_offset < end_offset {
8314 _next_ordinal_to_read += 1;
8315 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8316 next_offset += envelope_size;
8317 }
8318
8319 Ok(())
8320 }
8321 }
8322
8323 impl WlanSoftmacQueryResponse {
8324 #[inline(always)]
8325 fn max_ordinal_present(&self) -> u64 {
8326 if let Some(_) = self.factory_addr {
8327 return 6;
8328 }
8329 if let Some(_) = self.band_caps {
8330 return 5;
8331 }
8332 if let Some(_) = self.hardware_capability {
8333 return 4;
8334 }
8335 if let Some(_) = self.supported_phys {
8336 return 3;
8337 }
8338 if let Some(_) = self.mac_role {
8339 return 2;
8340 }
8341 if let Some(_) = self.sta_addr {
8342 return 1;
8343 }
8344 0
8345 }
8346 }
8347
8348 impl fidl::encoding::ValueTypeMarker for WlanSoftmacQueryResponse {
8349 type Borrowed<'a> = &'a Self;
8350 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8351 value
8352 }
8353 }
8354
8355 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacQueryResponse {
8356 type Owned = Self;
8357
8358 #[inline(always)]
8359 fn inline_align(_context: fidl::encoding::Context) -> usize {
8360 8
8361 }
8362
8363 #[inline(always)]
8364 fn inline_size(_context: fidl::encoding::Context) -> usize {
8365 16
8366 }
8367 }
8368
8369 unsafe impl<D: fidl::encoding::ResourceDialect>
8370 fidl::encoding::Encode<WlanSoftmacQueryResponse, D> for &WlanSoftmacQueryResponse
8371 {
8372 unsafe fn encode(
8373 self,
8374 encoder: &mut fidl::encoding::Encoder<'_, D>,
8375 offset: usize,
8376 mut depth: fidl::encoding::Depth,
8377 ) -> fidl::Result<()> {
8378 encoder.debug_check_bounds::<WlanSoftmacQueryResponse>(offset);
8379 let max_ordinal: u64 = self.max_ordinal_present();
8381 encoder.write_num(max_ordinal, offset);
8382 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8383 if max_ordinal == 0 {
8385 return Ok(());
8386 }
8387 depth.increment()?;
8388 let envelope_size = 8;
8389 let bytes_len = max_ordinal as usize * envelope_size;
8390 #[allow(unused_variables)]
8391 let offset = encoder.out_of_line_offset(bytes_len);
8392 let mut _prev_end_offset: usize = 0;
8393 if 1 > max_ordinal {
8394 return Ok(());
8395 }
8396
8397 let cur_offset: usize = (1 - 1) * envelope_size;
8400
8401 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8403
8404 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
8409 self.sta_addr
8410 .as_ref()
8411 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
8412 encoder,
8413 offset + cur_offset,
8414 depth,
8415 )?;
8416
8417 _prev_end_offset = cur_offset + envelope_size;
8418 if 2 > max_ordinal {
8419 return Ok(());
8420 }
8421
8422 let cur_offset: usize = (2 - 1) * envelope_size;
8425
8426 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8428
8429 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanMacRole, D>(
8434 self.mac_role.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow),
8435 encoder, offset + cur_offset, depth
8436 )?;
8437
8438 _prev_end_offset = cur_offset + envelope_size;
8439 if 3 > max_ordinal {
8440 return Ok(());
8441 }
8442
8443 let cur_offset: usize = (3 - 1) * envelope_size;
8446
8447 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8449
8450 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D>(
8455 self.supported_phys.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64> as fidl::encoding::ValueTypeMarker>::borrow),
8456 encoder, offset + cur_offset, depth
8457 )?;
8458
8459 _prev_end_offset = cur_offset + envelope_size;
8460 if 4 > max_ordinal {
8461 return Ok(());
8462 }
8463
8464 let cur_offset: usize = (4 - 1) * envelope_size;
8467
8468 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8470
8471 fidl::encoding::encode_in_envelope_optional::<u32, D>(
8476 self.hardware_capability
8477 .as_ref()
8478 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
8479 encoder,
8480 offset + cur_offset,
8481 depth,
8482 )?;
8483
8484 _prev_end_offset = cur_offset + envelope_size;
8485 if 5 > max_ordinal {
8486 return Ok(());
8487 }
8488
8489 let cur_offset: usize = (5 - 1) * envelope_size;
8492
8493 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8495
8496 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D>(
8501 self.band_caps.as_ref().map(<fidl::encoding::Vector<WlanSoftmacBandCapability, 16> as fidl::encoding::ValueTypeMarker>::borrow),
8502 encoder, offset + cur_offset, depth
8503 )?;
8504
8505 _prev_end_offset = cur_offset + envelope_size;
8506 if 6 > max_ordinal {
8507 return Ok(());
8508 }
8509
8510 let cur_offset: usize = (6 - 1) * envelope_size;
8513
8514 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8516
8517 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
8522 self.factory_addr
8523 .as_ref()
8524 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
8525 encoder,
8526 offset + cur_offset,
8527 depth,
8528 )?;
8529
8530 _prev_end_offset = cur_offset + envelope_size;
8531
8532 Ok(())
8533 }
8534 }
8535
8536 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8537 for WlanSoftmacQueryResponse
8538 {
8539 #[inline(always)]
8540 fn new_empty() -> Self {
8541 Self::default()
8542 }
8543
8544 unsafe fn decode(
8545 &mut self,
8546 decoder: &mut fidl::encoding::Decoder<'_, D>,
8547 offset: usize,
8548 mut depth: fidl::encoding::Depth,
8549 ) -> fidl::Result<()> {
8550 decoder.debug_check_bounds::<Self>(offset);
8551 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8552 None => return Err(fidl::Error::NotNullable),
8553 Some(len) => len,
8554 };
8555 if len == 0 {
8557 return Ok(());
8558 };
8559 depth.increment()?;
8560 let envelope_size = 8;
8561 let bytes_len = len * envelope_size;
8562 let offset = decoder.out_of_line_offset(bytes_len)?;
8563 let mut _next_ordinal_to_read = 0;
8565 let mut next_offset = offset;
8566 let end_offset = offset + bytes_len;
8567 _next_ordinal_to_read += 1;
8568 if next_offset >= end_offset {
8569 return Ok(());
8570 }
8571
8572 while _next_ordinal_to_read < 1 {
8574 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8575 _next_ordinal_to_read += 1;
8576 next_offset += envelope_size;
8577 }
8578
8579 let next_out_of_line = decoder.next_out_of_line();
8580 let handles_before = decoder.remaining_handles();
8581 if let Some((inlined, num_bytes, num_handles)) =
8582 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8583 {
8584 let member_inline_size =
8585 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
8586 decoder.context,
8587 );
8588 if inlined != (member_inline_size <= 4) {
8589 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8590 }
8591 let inner_offset;
8592 let mut inner_depth = depth.clone();
8593 if inlined {
8594 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8595 inner_offset = next_offset;
8596 } else {
8597 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8598 inner_depth.increment()?;
8599 }
8600 let val_ref = self
8601 .sta_addr
8602 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
8603 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
8604 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8605 {
8606 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8607 }
8608 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8609 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8610 }
8611 }
8612
8613 next_offset += envelope_size;
8614 _next_ordinal_to_read += 1;
8615 if next_offset >= end_offset {
8616 return Ok(());
8617 }
8618
8619 while _next_ordinal_to_read < 2 {
8621 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8622 _next_ordinal_to_read += 1;
8623 next_offset += envelope_size;
8624 }
8625
8626 let next_out_of_line = decoder.next_out_of_line();
8627 let handles_before = decoder.remaining_handles();
8628 if let Some((inlined, num_bytes, num_handles)) =
8629 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8630 {
8631 let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8632 if inlined != (member_inline_size <= 4) {
8633 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8634 }
8635 let inner_offset;
8636 let mut inner_depth = depth.clone();
8637 if inlined {
8638 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8639 inner_offset = next_offset;
8640 } else {
8641 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8642 inner_depth.increment()?;
8643 }
8644 let val_ref = self.mac_role.get_or_insert_with(|| {
8645 fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanMacRole, D)
8646 });
8647 fidl::decode!(
8648 fidl_fuchsia_wlan_common__common::WlanMacRole,
8649 D,
8650 val_ref,
8651 decoder,
8652 inner_offset,
8653 inner_depth
8654 )?;
8655 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8656 {
8657 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8658 }
8659 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8660 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8661 }
8662 }
8663
8664 next_offset += envelope_size;
8665 _next_ordinal_to_read += 1;
8666 if next_offset >= end_offset {
8667 return Ok(());
8668 }
8669
8670 while _next_ordinal_to_read < 3 {
8672 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8673 _next_ordinal_to_read += 1;
8674 next_offset += envelope_size;
8675 }
8676
8677 let next_out_of_line = decoder.next_out_of_line();
8678 let handles_before = decoder.remaining_handles();
8679 if let Some((inlined, num_bytes, num_handles)) =
8680 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8681 {
8682 let member_inline_size = <fidl::encoding::Vector<
8683 fidl_fuchsia_wlan_common__common::WlanPhyType,
8684 64,
8685 > as fidl::encoding::TypeMarker>::inline_size(
8686 decoder.context
8687 );
8688 if inlined != (member_inline_size <= 4) {
8689 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8690 }
8691 let inner_offset;
8692 let mut inner_depth = depth.clone();
8693 if inlined {
8694 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8695 inner_offset = next_offset;
8696 } else {
8697 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8698 inner_depth.increment()?;
8699 }
8700 let val_ref =
8701 self.supported_phys.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D));
8702 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
8703 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8704 {
8705 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8706 }
8707 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8708 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8709 }
8710 }
8711
8712 next_offset += envelope_size;
8713 _next_ordinal_to_read += 1;
8714 if next_offset >= end_offset {
8715 return Ok(());
8716 }
8717
8718 while _next_ordinal_to_read < 4 {
8720 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8721 _next_ordinal_to_read += 1;
8722 next_offset += envelope_size;
8723 }
8724
8725 let next_out_of_line = decoder.next_out_of_line();
8726 let handles_before = decoder.remaining_handles();
8727 if let Some((inlined, num_bytes, num_handles)) =
8728 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8729 {
8730 let member_inline_size =
8731 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8732 if inlined != (member_inline_size <= 4) {
8733 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8734 }
8735 let inner_offset;
8736 let mut inner_depth = depth.clone();
8737 if inlined {
8738 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8739 inner_offset = next_offset;
8740 } else {
8741 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8742 inner_depth.increment()?;
8743 }
8744 let val_ref =
8745 self.hardware_capability.get_or_insert_with(|| fidl::new_empty!(u32, D));
8746 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
8747 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8748 {
8749 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8750 }
8751 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8752 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8753 }
8754 }
8755
8756 next_offset += envelope_size;
8757 _next_ordinal_to_read += 1;
8758 if next_offset >= end_offset {
8759 return Ok(());
8760 }
8761
8762 while _next_ordinal_to_read < 5 {
8764 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8765 _next_ordinal_to_read += 1;
8766 next_offset += envelope_size;
8767 }
8768
8769 let next_out_of_line = decoder.next_out_of_line();
8770 let handles_before = decoder.remaining_handles();
8771 if let Some((inlined, num_bytes, num_handles)) =
8772 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8773 {
8774 let member_inline_size = <fidl::encoding::Vector<WlanSoftmacBandCapability, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8775 if inlined != (member_inline_size <= 4) {
8776 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8777 }
8778 let inner_offset;
8779 let mut inner_depth = depth.clone();
8780 if inlined {
8781 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8782 inner_offset = next_offset;
8783 } else {
8784 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8785 inner_depth.increment()?;
8786 }
8787 let val_ref = self.band_caps.get_or_insert_with(
8788 || fidl::new_empty!(fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D),
8789 );
8790 fidl::decode!(fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
8791 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8792 {
8793 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8794 }
8795 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8796 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8797 }
8798 }
8799
8800 next_offset += envelope_size;
8801 _next_ordinal_to_read += 1;
8802 if next_offset >= end_offset {
8803 return Ok(());
8804 }
8805
8806 while _next_ordinal_to_read < 6 {
8808 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8809 _next_ordinal_to_read += 1;
8810 next_offset += envelope_size;
8811 }
8812
8813 let next_out_of_line = decoder.next_out_of_line();
8814 let handles_before = decoder.remaining_handles();
8815 if let Some((inlined, num_bytes, num_handles)) =
8816 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8817 {
8818 let member_inline_size =
8819 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
8820 decoder.context,
8821 );
8822 if inlined != (member_inline_size <= 4) {
8823 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8824 }
8825 let inner_offset;
8826 let mut inner_depth = depth.clone();
8827 if inlined {
8828 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8829 inner_offset = next_offset;
8830 } else {
8831 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8832 inner_depth.increment()?;
8833 }
8834 let val_ref = self
8835 .factory_addr
8836 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
8837 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
8838 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8839 {
8840 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8841 }
8842 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8843 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8844 }
8845 }
8846
8847 next_offset += envelope_size;
8848
8849 while next_offset < end_offset {
8851 _next_ordinal_to_read += 1;
8852 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8853 next_offset += envelope_size;
8854 }
8855
8856 Ok(())
8857 }
8858 }
8859
8860 impl WlanSoftmacStartActiveScanRequest {
8861 #[inline(always)]
8862 fn max_ordinal_present(&self) -> u64 {
8863 if let Some(_) = self.max_probes_per_channel {
8864 return 9;
8865 }
8866 if let Some(_) = self.min_probes_per_channel {
8867 return 8;
8868 }
8869 if let Some(_) = self.min_home_time {
8870 return 7;
8871 }
8872 if let Some(_) = self.max_channel_time {
8873 return 6;
8874 }
8875 if let Some(_) = self.min_channel_time {
8876 return 5;
8877 }
8878 if let Some(_) = self.ies {
8879 return 4;
8880 }
8881 if let Some(_) = self.mac_header {
8882 return 3;
8883 }
8884 if let Some(_) = self.ssids {
8885 return 2;
8886 }
8887 if let Some(_) = self.channels {
8888 return 1;
8889 }
8890 0
8891 }
8892 }
8893
8894 impl fidl::encoding::ValueTypeMarker for WlanSoftmacStartActiveScanRequest {
8895 type Borrowed<'a> = &'a Self;
8896 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8897 value
8898 }
8899 }
8900
8901 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacStartActiveScanRequest {
8902 type Owned = Self;
8903
8904 #[inline(always)]
8905 fn inline_align(_context: fidl::encoding::Context) -> usize {
8906 8
8907 }
8908
8909 #[inline(always)]
8910 fn inline_size(_context: fidl::encoding::Context) -> usize {
8911 16
8912 }
8913 }
8914
8915 unsafe impl<D: fidl::encoding::ResourceDialect>
8916 fidl::encoding::Encode<WlanSoftmacStartActiveScanRequest, D>
8917 for &WlanSoftmacStartActiveScanRequest
8918 {
8919 unsafe fn encode(
8920 self,
8921 encoder: &mut fidl::encoding::Encoder<'_, D>,
8922 offset: usize,
8923 mut depth: fidl::encoding::Depth,
8924 ) -> fidl::Result<()> {
8925 encoder.debug_check_bounds::<WlanSoftmacStartActiveScanRequest>(offset);
8926 let max_ordinal: u64 = self.max_ordinal_present();
8928 encoder.write_num(max_ordinal, offset);
8929 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8930 if max_ordinal == 0 {
8932 return Ok(());
8933 }
8934 depth.increment()?;
8935 let envelope_size = 8;
8936 let bytes_len = max_ordinal as usize * envelope_size;
8937 #[allow(unused_variables)]
8938 let offset = encoder.out_of_line_offset(bytes_len);
8939 let mut _prev_end_offset: usize = 0;
8940 if 1 > max_ordinal {
8941 return Ok(());
8942 }
8943
8944 let cur_offset: usize = (1 - 1) * envelope_size;
8947
8948 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8950
8951 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
8956 self.channels.as_ref().map(
8957 <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
8958 ),
8959 encoder,
8960 offset + cur_offset,
8961 depth,
8962 )?;
8963
8964 _prev_end_offset = cur_offset + envelope_size;
8965 if 2 > max_ordinal {
8966 return Ok(());
8967 }
8968
8969 let cur_offset: usize = (2 - 1) * envelope_size;
8972
8973 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8975
8976 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84>, D>(
8981 self.ssids.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84> as fidl::encoding::ValueTypeMarker>::borrow),
8982 encoder, offset + cur_offset, depth
8983 )?;
8984
8985 _prev_end_offset = cur_offset + envelope_size;
8986 if 3 > max_ordinal {
8987 return Ok(());
8988 }
8989
8990 let cur_offset: usize = (3 - 1) * envelope_size;
8993
8994 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8996
8997 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 28>, D>(
9002 self.mac_header.as_ref().map(
9003 <fidl::encoding::Vector<u8, 28> as fidl::encoding::ValueTypeMarker>::borrow,
9004 ),
9005 encoder,
9006 offset + cur_offset,
9007 depth,
9008 )?;
9009
9010 _prev_end_offset = cur_offset + envelope_size;
9011 if 4 > max_ordinal {
9012 return Ok(());
9013 }
9014
9015 let cur_offset: usize = (4 - 1) * envelope_size;
9018
9019 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9021
9022 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 11454>, D>(
9027 self.ies.as_ref().map(
9028 <fidl::encoding::Vector<u8, 11454> as fidl::encoding::ValueTypeMarker>::borrow,
9029 ),
9030 encoder,
9031 offset + cur_offset,
9032 depth,
9033 )?;
9034
9035 _prev_end_offset = cur_offset + envelope_size;
9036 if 5 > max_ordinal {
9037 return Ok(());
9038 }
9039
9040 let cur_offset: usize = (5 - 1) * envelope_size;
9043
9044 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9046
9047 fidl::encoding::encode_in_envelope_optional::<i64, D>(
9052 self.min_channel_time
9053 .as_ref()
9054 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9055 encoder,
9056 offset + cur_offset,
9057 depth,
9058 )?;
9059
9060 _prev_end_offset = cur_offset + envelope_size;
9061 if 6 > max_ordinal {
9062 return Ok(());
9063 }
9064
9065 let cur_offset: usize = (6 - 1) * envelope_size;
9068
9069 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9071
9072 fidl::encoding::encode_in_envelope_optional::<i64, D>(
9077 self.max_channel_time
9078 .as_ref()
9079 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9080 encoder,
9081 offset + cur_offset,
9082 depth,
9083 )?;
9084
9085 _prev_end_offset = cur_offset + envelope_size;
9086 if 7 > max_ordinal {
9087 return Ok(());
9088 }
9089
9090 let cur_offset: usize = (7 - 1) * envelope_size;
9093
9094 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9096
9097 fidl::encoding::encode_in_envelope_optional::<i64, D>(
9102 self.min_home_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9103 encoder,
9104 offset + cur_offset,
9105 depth,
9106 )?;
9107
9108 _prev_end_offset = cur_offset + envelope_size;
9109 if 8 > max_ordinal {
9110 return Ok(());
9111 }
9112
9113 let cur_offset: usize = (8 - 1) * envelope_size;
9116
9117 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9119
9120 fidl::encoding::encode_in_envelope_optional::<u8, D>(
9125 self.min_probes_per_channel
9126 .as_ref()
9127 .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
9128 encoder,
9129 offset + cur_offset,
9130 depth,
9131 )?;
9132
9133 _prev_end_offset = cur_offset + envelope_size;
9134 if 9 > max_ordinal {
9135 return Ok(());
9136 }
9137
9138 let cur_offset: usize = (9 - 1) * envelope_size;
9141
9142 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9144
9145 fidl::encoding::encode_in_envelope_optional::<u8, D>(
9150 self.max_probes_per_channel
9151 .as_ref()
9152 .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
9153 encoder,
9154 offset + cur_offset,
9155 depth,
9156 )?;
9157
9158 _prev_end_offset = cur_offset + envelope_size;
9159
9160 Ok(())
9161 }
9162 }
9163
9164 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9165 for WlanSoftmacStartActiveScanRequest
9166 {
9167 #[inline(always)]
9168 fn new_empty() -> Self {
9169 Self::default()
9170 }
9171
9172 unsafe fn decode(
9173 &mut self,
9174 decoder: &mut fidl::encoding::Decoder<'_, D>,
9175 offset: usize,
9176 mut depth: fidl::encoding::Depth,
9177 ) -> fidl::Result<()> {
9178 decoder.debug_check_bounds::<Self>(offset);
9179 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9180 None => return Err(fidl::Error::NotNullable),
9181 Some(len) => len,
9182 };
9183 if len == 0 {
9185 return Ok(());
9186 };
9187 depth.increment()?;
9188 let envelope_size = 8;
9189 let bytes_len = len * envelope_size;
9190 let offset = decoder.out_of_line_offset(bytes_len)?;
9191 let mut _next_ordinal_to_read = 0;
9193 let mut next_offset = offset;
9194 let end_offset = offset + bytes_len;
9195 _next_ordinal_to_read += 1;
9196 if next_offset >= end_offset {
9197 return Ok(());
9198 }
9199
9200 while _next_ordinal_to_read < 1 {
9202 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9203 _next_ordinal_to_read += 1;
9204 next_offset += envelope_size;
9205 }
9206
9207 let next_out_of_line = decoder.next_out_of_line();
9208 let handles_before = decoder.remaining_handles();
9209 if let Some((inlined, num_bytes, num_handles)) =
9210 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9211 {
9212 let member_inline_size =
9213 <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
9214 decoder.context,
9215 );
9216 if inlined != (member_inline_size <= 4) {
9217 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9218 }
9219 let inner_offset;
9220 let mut inner_depth = depth.clone();
9221 if inlined {
9222 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9223 inner_offset = next_offset;
9224 } else {
9225 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9226 inner_depth.increment()?;
9227 }
9228 let val_ref = self
9229 .channels
9230 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
9231 fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
9232 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9233 {
9234 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9235 }
9236 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9237 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9238 }
9239 }
9240
9241 next_offset += envelope_size;
9242 _next_ordinal_to_read += 1;
9243 if next_offset >= end_offset {
9244 return Ok(());
9245 }
9246
9247 while _next_ordinal_to_read < 2 {
9249 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9250 _next_ordinal_to_read += 1;
9251 next_offset += envelope_size;
9252 }
9253
9254 let next_out_of_line = decoder.next_out_of_line();
9255 let handles_before = decoder.remaining_handles();
9256 if let Some((inlined, num_bytes, num_handles)) =
9257 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9258 {
9259 let member_inline_size = <fidl::encoding::Vector<
9260 fidl_fuchsia_wlan_ieee80211__common::CSsid,
9261 84,
9262 > as fidl::encoding::TypeMarker>::inline_size(
9263 decoder.context
9264 );
9265 if inlined != (member_inline_size <= 4) {
9266 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9267 }
9268 let inner_offset;
9269 let mut inner_depth = depth.clone();
9270 if inlined {
9271 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9272 inner_offset = next_offset;
9273 } else {
9274 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9275 inner_depth.increment()?;
9276 }
9277 let val_ref =
9278 self.ssids.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84>, D));
9279 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84>, D, val_ref, decoder, inner_offset, inner_depth)?;
9280 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9281 {
9282 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9283 }
9284 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9285 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9286 }
9287 }
9288
9289 next_offset += envelope_size;
9290 _next_ordinal_to_read += 1;
9291 if next_offset >= end_offset {
9292 return Ok(());
9293 }
9294
9295 while _next_ordinal_to_read < 3 {
9297 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9298 _next_ordinal_to_read += 1;
9299 next_offset += envelope_size;
9300 }
9301
9302 let next_out_of_line = decoder.next_out_of_line();
9303 let handles_before = decoder.remaining_handles();
9304 if let Some((inlined, num_bytes, num_handles)) =
9305 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9306 {
9307 let member_inline_size =
9308 <fidl::encoding::Vector<u8, 28> as fidl::encoding::TypeMarker>::inline_size(
9309 decoder.context,
9310 );
9311 if inlined != (member_inline_size <= 4) {
9312 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9313 }
9314 let inner_offset;
9315 let mut inner_depth = depth.clone();
9316 if inlined {
9317 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9318 inner_offset = next_offset;
9319 } else {
9320 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9321 inner_depth.increment()?;
9322 }
9323 let val_ref = self
9324 .mac_header
9325 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 28>, D));
9326 fidl::decode!(fidl::encoding::Vector<u8, 28>, D, val_ref, decoder, inner_offset, inner_depth)?;
9327 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9328 {
9329 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9330 }
9331 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9332 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9333 }
9334 }
9335
9336 next_offset += envelope_size;
9337 _next_ordinal_to_read += 1;
9338 if next_offset >= end_offset {
9339 return Ok(());
9340 }
9341
9342 while _next_ordinal_to_read < 4 {
9344 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9345 _next_ordinal_to_read += 1;
9346 next_offset += envelope_size;
9347 }
9348
9349 let next_out_of_line = decoder.next_out_of_line();
9350 let handles_before = decoder.remaining_handles();
9351 if let Some((inlined, num_bytes, num_handles)) =
9352 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9353 {
9354 let member_inline_size =
9355 <fidl::encoding::Vector<u8, 11454> as fidl::encoding::TypeMarker>::inline_size(
9356 decoder.context,
9357 );
9358 if inlined != (member_inline_size <= 4) {
9359 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9360 }
9361 let inner_offset;
9362 let mut inner_depth = depth.clone();
9363 if inlined {
9364 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9365 inner_offset = next_offset;
9366 } else {
9367 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9368 inner_depth.increment()?;
9369 }
9370 let val_ref = self
9371 .ies
9372 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 11454>, D));
9373 fidl::decode!(fidl::encoding::Vector<u8, 11454>, D, val_ref, decoder, inner_offset, inner_depth)?;
9374 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9375 {
9376 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9377 }
9378 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9379 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9380 }
9381 }
9382
9383 next_offset += envelope_size;
9384 _next_ordinal_to_read += 1;
9385 if next_offset >= end_offset {
9386 return Ok(());
9387 }
9388
9389 while _next_ordinal_to_read < 5 {
9391 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9392 _next_ordinal_to_read += 1;
9393 next_offset += envelope_size;
9394 }
9395
9396 let next_out_of_line = decoder.next_out_of_line();
9397 let handles_before = decoder.remaining_handles();
9398 if let Some((inlined, num_bytes, num_handles)) =
9399 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9400 {
9401 let member_inline_size =
9402 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9403 if inlined != (member_inline_size <= 4) {
9404 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9405 }
9406 let inner_offset;
9407 let mut inner_depth = depth.clone();
9408 if inlined {
9409 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9410 inner_offset = next_offset;
9411 } else {
9412 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9413 inner_depth.increment()?;
9414 }
9415 let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
9416 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9417 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9418 {
9419 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9420 }
9421 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9422 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9423 }
9424 }
9425
9426 next_offset += envelope_size;
9427 _next_ordinal_to_read += 1;
9428 if next_offset >= end_offset {
9429 return Ok(());
9430 }
9431
9432 while _next_ordinal_to_read < 6 {
9434 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9435 _next_ordinal_to_read += 1;
9436 next_offset += envelope_size;
9437 }
9438
9439 let next_out_of_line = decoder.next_out_of_line();
9440 let handles_before = decoder.remaining_handles();
9441 if let Some((inlined, num_bytes, num_handles)) =
9442 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9443 {
9444 let member_inline_size =
9445 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9446 if inlined != (member_inline_size <= 4) {
9447 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9448 }
9449 let inner_offset;
9450 let mut inner_depth = depth.clone();
9451 if inlined {
9452 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9453 inner_offset = next_offset;
9454 } else {
9455 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9456 inner_depth.increment()?;
9457 }
9458 let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
9459 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9460 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9461 {
9462 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9463 }
9464 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9465 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9466 }
9467 }
9468
9469 next_offset += envelope_size;
9470 _next_ordinal_to_read += 1;
9471 if next_offset >= end_offset {
9472 return Ok(());
9473 }
9474
9475 while _next_ordinal_to_read < 7 {
9477 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9478 _next_ordinal_to_read += 1;
9479 next_offset += envelope_size;
9480 }
9481
9482 let next_out_of_line = decoder.next_out_of_line();
9483 let handles_before = decoder.remaining_handles();
9484 if let Some((inlined, num_bytes, num_handles)) =
9485 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9486 {
9487 let member_inline_size =
9488 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9489 if inlined != (member_inline_size <= 4) {
9490 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9491 }
9492 let inner_offset;
9493 let mut inner_depth = depth.clone();
9494 if inlined {
9495 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9496 inner_offset = next_offset;
9497 } else {
9498 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9499 inner_depth.increment()?;
9500 }
9501 let val_ref = self.min_home_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
9502 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9503 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9504 {
9505 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9506 }
9507 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9508 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9509 }
9510 }
9511
9512 next_offset += envelope_size;
9513 _next_ordinal_to_read += 1;
9514 if next_offset >= end_offset {
9515 return Ok(());
9516 }
9517
9518 while _next_ordinal_to_read < 8 {
9520 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9521 _next_ordinal_to_read += 1;
9522 next_offset += envelope_size;
9523 }
9524
9525 let next_out_of_line = decoder.next_out_of_line();
9526 let handles_before = decoder.remaining_handles();
9527 if let Some((inlined, num_bytes, num_handles)) =
9528 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9529 {
9530 let member_inline_size =
9531 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9532 if inlined != (member_inline_size <= 4) {
9533 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9534 }
9535 let inner_offset;
9536 let mut inner_depth = depth.clone();
9537 if inlined {
9538 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9539 inner_offset = next_offset;
9540 } else {
9541 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9542 inner_depth.increment()?;
9543 }
9544 let val_ref =
9545 self.min_probes_per_channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
9546 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
9547 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9548 {
9549 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9550 }
9551 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9552 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9553 }
9554 }
9555
9556 next_offset += envelope_size;
9557 _next_ordinal_to_read += 1;
9558 if next_offset >= end_offset {
9559 return Ok(());
9560 }
9561
9562 while _next_ordinal_to_read < 9 {
9564 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9565 _next_ordinal_to_read += 1;
9566 next_offset += envelope_size;
9567 }
9568
9569 let next_out_of_line = decoder.next_out_of_line();
9570 let handles_before = decoder.remaining_handles();
9571 if let Some((inlined, num_bytes, num_handles)) =
9572 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9573 {
9574 let member_inline_size =
9575 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9576 if inlined != (member_inline_size <= 4) {
9577 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9578 }
9579 let inner_offset;
9580 let mut inner_depth = depth.clone();
9581 if inlined {
9582 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9583 inner_offset = next_offset;
9584 } else {
9585 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9586 inner_depth.increment()?;
9587 }
9588 let val_ref =
9589 self.max_probes_per_channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
9590 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
9591 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9592 {
9593 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9594 }
9595 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9596 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9597 }
9598 }
9599
9600 next_offset += envelope_size;
9601
9602 while next_offset < end_offset {
9604 _next_ordinal_to_read += 1;
9605 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9606 next_offset += envelope_size;
9607 }
9608
9609 Ok(())
9610 }
9611 }
9612
9613 impl WlanTxTransferRequest {
9614 #[inline(always)]
9615 fn max_ordinal_present(&self) -> u64 {
9616 if let Some(_) = self.arena {
9617 return 5;
9618 }
9619 if let Some(_) = self.async_id {
9620 return 4;
9621 }
9622 if let Some(_) = self.packet_info {
9623 return 3;
9624 }
9625 if let Some(_) = self.packet_size {
9626 return 2;
9627 }
9628 if let Some(_) = self.packet_address {
9629 return 1;
9630 }
9631 0
9632 }
9633 }
9634
9635 impl fidl::encoding::ValueTypeMarker for WlanTxTransferRequest {
9636 type Borrowed<'a> = &'a Self;
9637 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9638 value
9639 }
9640 }
9641
9642 unsafe impl fidl::encoding::TypeMarker for WlanTxTransferRequest {
9643 type Owned = Self;
9644
9645 #[inline(always)]
9646 fn inline_align(_context: fidl::encoding::Context) -> usize {
9647 8
9648 }
9649
9650 #[inline(always)]
9651 fn inline_size(_context: fidl::encoding::Context) -> usize {
9652 16
9653 }
9654 }
9655
9656 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxTransferRequest, D>
9657 for &WlanTxTransferRequest
9658 {
9659 unsafe fn encode(
9660 self,
9661 encoder: &mut fidl::encoding::Encoder<'_, D>,
9662 offset: usize,
9663 mut depth: fidl::encoding::Depth,
9664 ) -> fidl::Result<()> {
9665 encoder.debug_check_bounds::<WlanTxTransferRequest>(offset);
9666 let max_ordinal: u64 = self.max_ordinal_present();
9668 encoder.write_num(max_ordinal, offset);
9669 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9670 if max_ordinal == 0 {
9672 return Ok(());
9673 }
9674 depth.increment()?;
9675 let envelope_size = 8;
9676 let bytes_len = max_ordinal as usize * envelope_size;
9677 #[allow(unused_variables)]
9678 let offset = encoder.out_of_line_offset(bytes_len);
9679 let mut _prev_end_offset: usize = 0;
9680 if 1 > max_ordinal {
9681 return Ok(());
9682 }
9683
9684 let cur_offset: usize = (1 - 1) * envelope_size;
9687
9688 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9690
9691 fidl::encoding::encode_in_envelope_optional::<u64, D>(
9696 self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9697 encoder,
9698 offset + cur_offset,
9699 depth,
9700 )?;
9701
9702 _prev_end_offset = cur_offset + envelope_size;
9703 if 2 > max_ordinal {
9704 return Ok(());
9705 }
9706
9707 let cur_offset: usize = (2 - 1) * envelope_size;
9710
9711 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9713
9714 fidl::encoding::encode_in_envelope_optional::<u64, D>(
9719 self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9720 encoder,
9721 offset + cur_offset,
9722 depth,
9723 )?;
9724
9725 _prev_end_offset = cur_offset + envelope_size;
9726 if 3 > max_ordinal {
9727 return Ok(());
9728 }
9729
9730 let cur_offset: usize = (3 - 1) * envelope_size;
9733
9734 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9736
9737 fidl::encoding::encode_in_envelope_optional::<WlanTxInfo, D>(
9742 self.packet_info
9743 .as_ref()
9744 .map(<WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow),
9745 encoder,
9746 offset + cur_offset,
9747 depth,
9748 )?;
9749
9750 _prev_end_offset = cur_offset + envelope_size;
9751 if 4 > max_ordinal {
9752 return Ok(());
9753 }
9754
9755 let cur_offset: usize = (4 - 1) * envelope_size;
9758
9759 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9761
9762 fidl::encoding::encode_in_envelope_optional::<u64, D>(
9767 self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9768 encoder,
9769 offset + cur_offset,
9770 depth,
9771 )?;
9772
9773 _prev_end_offset = cur_offset + envelope_size;
9774 if 5 > max_ordinal {
9775 return Ok(());
9776 }
9777
9778 let cur_offset: usize = (5 - 1) * envelope_size;
9781
9782 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9784
9785 fidl::encoding::encode_in_envelope_optional::<u64, D>(
9790 self.arena.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9791 encoder,
9792 offset + cur_offset,
9793 depth,
9794 )?;
9795
9796 _prev_end_offset = cur_offset + envelope_size;
9797
9798 Ok(())
9799 }
9800 }
9801
9802 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxTransferRequest {
9803 #[inline(always)]
9804 fn new_empty() -> Self {
9805 Self::default()
9806 }
9807
9808 unsafe fn decode(
9809 &mut self,
9810 decoder: &mut fidl::encoding::Decoder<'_, D>,
9811 offset: usize,
9812 mut depth: fidl::encoding::Depth,
9813 ) -> fidl::Result<()> {
9814 decoder.debug_check_bounds::<Self>(offset);
9815 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9816 None => return Err(fidl::Error::NotNullable),
9817 Some(len) => len,
9818 };
9819 if len == 0 {
9821 return Ok(());
9822 };
9823 depth.increment()?;
9824 let envelope_size = 8;
9825 let bytes_len = len * envelope_size;
9826 let offset = decoder.out_of_line_offset(bytes_len)?;
9827 let mut _next_ordinal_to_read = 0;
9829 let mut next_offset = offset;
9830 let end_offset = offset + bytes_len;
9831 _next_ordinal_to_read += 1;
9832 if next_offset >= end_offset {
9833 return Ok(());
9834 }
9835
9836 while _next_ordinal_to_read < 1 {
9838 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9839 _next_ordinal_to_read += 1;
9840 next_offset += envelope_size;
9841 }
9842
9843 let next_out_of_line = decoder.next_out_of_line();
9844 let handles_before = decoder.remaining_handles();
9845 if let Some((inlined, num_bytes, num_handles)) =
9846 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9847 {
9848 let member_inline_size =
9849 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9850 if inlined != (member_inline_size <= 4) {
9851 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9852 }
9853 let inner_offset;
9854 let mut inner_depth = depth.clone();
9855 if inlined {
9856 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9857 inner_offset = next_offset;
9858 } else {
9859 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9860 inner_depth.increment()?;
9861 }
9862 let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
9863 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9864 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9865 {
9866 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9867 }
9868 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9869 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9870 }
9871 }
9872
9873 next_offset += envelope_size;
9874 _next_ordinal_to_read += 1;
9875 if next_offset >= end_offset {
9876 return Ok(());
9877 }
9878
9879 while _next_ordinal_to_read < 2 {
9881 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9882 _next_ordinal_to_read += 1;
9883 next_offset += envelope_size;
9884 }
9885
9886 let next_out_of_line = decoder.next_out_of_line();
9887 let handles_before = decoder.remaining_handles();
9888 if let Some((inlined, num_bytes, num_handles)) =
9889 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9890 {
9891 let member_inline_size =
9892 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9893 if inlined != (member_inline_size <= 4) {
9894 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9895 }
9896 let inner_offset;
9897 let mut inner_depth = depth.clone();
9898 if inlined {
9899 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9900 inner_offset = next_offset;
9901 } else {
9902 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9903 inner_depth.increment()?;
9904 }
9905 let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
9906 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9907 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9908 {
9909 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9910 }
9911 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9912 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9913 }
9914 }
9915
9916 next_offset += envelope_size;
9917 _next_ordinal_to_read += 1;
9918 if next_offset >= end_offset {
9919 return Ok(());
9920 }
9921
9922 while _next_ordinal_to_read < 3 {
9924 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9925 _next_ordinal_to_read += 1;
9926 next_offset += envelope_size;
9927 }
9928
9929 let next_out_of_line = decoder.next_out_of_line();
9930 let handles_before = decoder.remaining_handles();
9931 if let Some((inlined, num_bytes, num_handles)) =
9932 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9933 {
9934 let member_inline_size =
9935 <WlanTxInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9936 if inlined != (member_inline_size <= 4) {
9937 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9938 }
9939 let inner_offset;
9940 let mut inner_depth = depth.clone();
9941 if inlined {
9942 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9943 inner_offset = next_offset;
9944 } else {
9945 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9946 inner_depth.increment()?;
9947 }
9948 let val_ref =
9949 self.packet_info.get_or_insert_with(|| fidl::new_empty!(WlanTxInfo, D));
9950 fidl::decode!(WlanTxInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
9951 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9952 {
9953 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9954 }
9955 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9956 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9957 }
9958 }
9959
9960 next_offset += envelope_size;
9961 _next_ordinal_to_read += 1;
9962 if next_offset >= end_offset {
9963 return Ok(());
9964 }
9965
9966 while _next_ordinal_to_read < 4 {
9968 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9969 _next_ordinal_to_read += 1;
9970 next_offset += envelope_size;
9971 }
9972
9973 let next_out_of_line = decoder.next_out_of_line();
9974 let handles_before = decoder.remaining_handles();
9975 if let Some((inlined, num_bytes, num_handles)) =
9976 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9977 {
9978 let member_inline_size =
9979 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9980 if inlined != (member_inline_size <= 4) {
9981 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9982 }
9983 let inner_offset;
9984 let mut inner_depth = depth.clone();
9985 if inlined {
9986 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9987 inner_offset = next_offset;
9988 } else {
9989 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9990 inner_depth.increment()?;
9991 }
9992 let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
9993 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9994 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9995 {
9996 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9997 }
9998 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9999 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10000 }
10001 }
10002
10003 next_offset += envelope_size;
10004 _next_ordinal_to_read += 1;
10005 if next_offset >= end_offset {
10006 return Ok(());
10007 }
10008
10009 while _next_ordinal_to_read < 5 {
10011 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10012 _next_ordinal_to_read += 1;
10013 next_offset += envelope_size;
10014 }
10015
10016 let next_out_of_line = decoder.next_out_of_line();
10017 let handles_before = decoder.remaining_handles();
10018 if let Some((inlined, num_bytes, num_handles)) =
10019 fidl::encoding::decode_envelope_header(decoder, next_offset)?
10020 {
10021 let member_inline_size =
10022 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10023 if inlined != (member_inline_size <= 4) {
10024 return Err(fidl::Error::InvalidInlineBitInEnvelope);
10025 }
10026 let inner_offset;
10027 let mut inner_depth = depth.clone();
10028 if inlined {
10029 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10030 inner_offset = next_offset;
10031 } else {
10032 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10033 inner_depth.increment()?;
10034 }
10035 let val_ref = self.arena.get_or_insert_with(|| fidl::new_empty!(u64, D));
10036 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
10037 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10038 {
10039 return Err(fidl::Error::InvalidNumBytesInEnvelope);
10040 }
10041 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10042 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10043 }
10044 }
10045
10046 next_offset += envelope_size;
10047
10048 while next_offset < end_offset {
10050 _next_ordinal_to_read += 1;
10051 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10052 next_offset += envelope_size;
10053 }
10054
10055 Ok(())
10056 }
10057 }
10058}