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