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>
2088 for (T0,)
2089 {
2090 #[inline]
2091 unsafe fn encode(
2092 self,
2093 encoder: &mut fidl::encoding::Encoder<'_, D>,
2094 offset: usize,
2095 depth: fidl::encoding::Depth,
2096 ) -> fidl::Result<()> {
2097 encoder.debug_check_bounds::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse>(
2098 offset,
2099 );
2100 self.0.encode(encoder, offset + 0, depth)?;
2104 Ok(())
2105 }
2106 }
2107
2108 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2109 for WlanSoftmacBaseQuerySpectrumManagementSupportResponse
2110 {
2111 #[inline(always)]
2112 fn new_empty() -> Self {
2113 Self {
2114 resp: fidl::new_empty!(
2115 fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
2116 D
2117 ),
2118 }
2119 }
2120
2121 #[inline]
2122 unsafe fn decode(
2123 &mut self,
2124 decoder: &mut fidl::encoding::Decoder<'_, D>,
2125 offset: usize,
2126 _depth: fidl::encoding::Depth,
2127 ) -> fidl::Result<()> {
2128 decoder.debug_check_bounds::<Self>(offset);
2129 fidl::decode!(
2131 fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
2132 D,
2133 &mut self.resp,
2134 decoder,
2135 offset + 0,
2136 _depth
2137 )?;
2138 Ok(())
2139 }
2140 }
2141
2142 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBridgeSetEthernetStatusRequest {
2143 type Borrowed<'a> = &'a Self;
2144 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2145 value
2146 }
2147 }
2148
2149 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBridgeSetEthernetStatusRequest {
2150 type Owned = Self;
2151
2152 #[inline(always)]
2153 fn inline_align(_context: fidl::encoding::Context) -> usize {
2154 4
2155 }
2156
2157 #[inline(always)]
2158 fn inline_size(_context: fidl::encoding::Context) -> usize {
2159 4
2160 }
2161 #[inline(always)]
2162 fn encode_is_copy() -> bool {
2163 true
2164 }
2165
2166 #[inline(always)]
2167 fn decode_is_copy() -> bool {
2168 true
2169 }
2170 }
2171
2172 unsafe impl<D: fidl::encoding::ResourceDialect>
2173 fidl::encoding::Encode<WlanSoftmacBridgeSetEthernetStatusRequest, D>
2174 for &WlanSoftmacBridgeSetEthernetStatusRequest
2175 {
2176 #[inline]
2177 unsafe fn encode(
2178 self,
2179 encoder: &mut fidl::encoding::Encoder<'_, D>,
2180 offset: usize,
2181 _depth: fidl::encoding::Depth,
2182 ) -> fidl::Result<()> {
2183 encoder.debug_check_bounds::<WlanSoftmacBridgeSetEthernetStatusRequest>(offset);
2184 unsafe {
2185 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2187 (buf_ptr as *mut WlanSoftmacBridgeSetEthernetStatusRequest).write_unaligned(
2188 (self as *const WlanSoftmacBridgeSetEthernetStatusRequest).read(),
2189 );
2190 }
2193 Ok(())
2194 }
2195 }
2196 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
2197 fidl::encoding::Encode<WlanSoftmacBridgeSetEthernetStatusRequest, D> for (T0,)
2198 {
2199 #[inline]
2200 unsafe fn encode(
2201 self,
2202 encoder: &mut fidl::encoding::Encoder<'_, D>,
2203 offset: usize,
2204 depth: fidl::encoding::Depth,
2205 ) -> fidl::Result<()> {
2206 encoder.debug_check_bounds::<WlanSoftmacBridgeSetEthernetStatusRequest>(offset);
2207 self.0.encode(encoder, offset + 0, depth)?;
2211 Ok(())
2212 }
2213 }
2214
2215 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2216 for WlanSoftmacBridgeSetEthernetStatusRequest
2217 {
2218 #[inline(always)]
2219 fn new_empty() -> Self {
2220 Self { status: fidl::new_empty!(u32, D) }
2221 }
2222
2223 #[inline]
2224 unsafe fn decode(
2225 &mut self,
2226 decoder: &mut fidl::encoding::Decoder<'_, D>,
2227 offset: usize,
2228 _depth: fidl::encoding::Depth,
2229 ) -> fidl::Result<()> {
2230 decoder.debug_check_bounds::<Self>(offset);
2231 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2232 unsafe {
2235 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
2236 }
2237 Ok(())
2238 }
2239 }
2240
2241 impl fidl::encoding::ValueTypeMarker for WlanSoftmacIfcBaseReportTxResultRequest {
2242 type Borrowed<'a> = &'a Self;
2243 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2244 value
2245 }
2246 }
2247
2248 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacIfcBaseReportTxResultRequest {
2249 type Owned = Self;
2250
2251 #[inline(always)]
2252 fn inline_align(_context: fidl::encoding::Context) -> usize {
2253 2
2254 }
2255
2256 #[inline(always)]
2257 fn inline_size(_context: fidl::encoding::Context) -> usize {
2258 40
2259 }
2260 }
2261
2262 unsafe impl<D: fidl::encoding::ResourceDialect>
2263 fidl::encoding::Encode<WlanSoftmacIfcBaseReportTxResultRequest, D>
2264 for &WlanSoftmacIfcBaseReportTxResultRequest
2265 {
2266 #[inline]
2267 unsafe fn encode(
2268 self,
2269 encoder: &mut fidl::encoding::Encoder<'_, D>,
2270 offset: usize,
2271 _depth: fidl::encoding::Depth,
2272 ) -> fidl::Result<()> {
2273 encoder.debug_check_bounds::<WlanSoftmacIfcBaseReportTxResultRequest>(offset);
2274 fidl::encoding::Encode::<WlanSoftmacIfcBaseReportTxResultRequest, D>::encode(
2276 (
2277 <fidl_fuchsia_wlan_common__common::WlanTxResult as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_result),
2278 ),
2279 encoder, offset, _depth
2280 )
2281 }
2282 }
2283 unsafe impl<
2284 D: fidl::encoding::ResourceDialect,
2285 T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanTxResult, D>,
2286 > fidl::encoding::Encode<WlanSoftmacIfcBaseReportTxResultRequest, D> for (T0,)
2287 {
2288 #[inline]
2289 unsafe fn encode(
2290 self,
2291 encoder: &mut fidl::encoding::Encoder<'_, D>,
2292 offset: usize,
2293 depth: fidl::encoding::Depth,
2294 ) -> fidl::Result<()> {
2295 encoder.debug_check_bounds::<WlanSoftmacIfcBaseReportTxResultRequest>(offset);
2296 self.0.encode(encoder, offset + 0, depth)?;
2300 Ok(())
2301 }
2302 }
2303
2304 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2305 for WlanSoftmacIfcBaseReportTxResultRequest
2306 {
2307 #[inline(always)]
2308 fn new_empty() -> Self {
2309 Self { tx_result: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanTxResult, D) }
2310 }
2311
2312 #[inline]
2313 unsafe fn decode(
2314 &mut self,
2315 decoder: &mut fidl::encoding::Decoder<'_, D>,
2316 offset: usize,
2317 _depth: fidl::encoding::Depth,
2318 ) -> fidl::Result<()> {
2319 decoder.debug_check_bounds::<Self>(offset);
2320 fidl::decode!(
2322 fidl_fuchsia_wlan_common__common::WlanTxResult,
2323 D,
2324 &mut self.tx_result,
2325 decoder,
2326 offset + 0,
2327 _depth
2328 )?;
2329 Ok(())
2330 }
2331 }
2332
2333 impl fidl::encoding::ValueTypeMarker for WlanTxInfo {
2334 type Borrowed<'a> = &'a Self;
2335 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2336 value
2337 }
2338 }
2339
2340 unsafe impl fidl::encoding::TypeMarker for WlanTxInfo {
2341 type Owned = Self;
2342
2343 #[inline(always)]
2344 fn inline_align(_context: fidl::encoding::Context) -> usize {
2345 4
2346 }
2347
2348 #[inline(always)]
2349 fn inline_size(_context: fidl::encoding::Context) -> usize {
2350 24
2351 }
2352 }
2353
2354 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxInfo, D>
2355 for &WlanTxInfo
2356 {
2357 #[inline]
2358 unsafe fn encode(
2359 self,
2360 encoder: &mut fidl::encoding::Encoder<'_, D>,
2361 offset: usize,
2362 _depth: fidl::encoding::Depth,
2363 ) -> fidl::Result<()> {
2364 encoder.debug_check_bounds::<WlanTxInfo>(offset);
2365 fidl::encoding::Encode::<WlanTxInfo, D>::encode(
2367 (
2368 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_flags),
2369 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
2370 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_vector_idx),
2371 <fidl_fuchsia_wlan_common__common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
2372 <fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_bandwidth),
2373 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
2374 ),
2375 encoder, offset, _depth
2376 )
2377 }
2378 }
2379 unsafe impl<
2380 D: fidl::encoding::ResourceDialect,
2381 T0: fidl::encoding::Encode<u32, D>,
2382 T1: fidl::encoding::Encode<u32, D>,
2383 T2: fidl::encoding::Encode<u16, D>,
2384 T3: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanPhyType, D>,
2385 T4: fidl::encoding::Encode<fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth, D>,
2386 T5: fidl::encoding::Encode<u8, D>,
2387 > fidl::encoding::Encode<WlanTxInfo, D> for (T0, T1, T2, T3, T4, T5)
2388 {
2389 #[inline]
2390 unsafe fn encode(
2391 self,
2392 encoder: &mut fidl::encoding::Encoder<'_, D>,
2393 offset: usize,
2394 depth: fidl::encoding::Depth,
2395 ) -> fidl::Result<()> {
2396 encoder.debug_check_bounds::<WlanTxInfo>(offset);
2397 unsafe {
2400 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2401 (ptr as *mut u32).write_unaligned(0);
2402 }
2403 unsafe {
2404 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(20);
2405 (ptr as *mut u32).write_unaligned(0);
2406 }
2407 self.0.encode(encoder, offset + 0, depth)?;
2409 self.1.encode(encoder, offset + 4, depth)?;
2410 self.2.encode(encoder, offset + 8, depth)?;
2411 self.3.encode(encoder, offset + 12, depth)?;
2412 self.4.encode(encoder, offset + 16, depth)?;
2413 self.5.encode(encoder, offset + 20, depth)?;
2414 Ok(())
2415 }
2416 }
2417
2418 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfo {
2419 #[inline(always)]
2420 fn new_empty() -> Self {
2421 Self {
2422 tx_flags: fidl::new_empty!(u32, D),
2423 valid_fields: fidl::new_empty!(u32, D),
2424 tx_vector_idx: fidl::new_empty!(u16, D),
2425 phy: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanPhyType, D),
2426 channel_bandwidth: fidl::new_empty!(
2427 fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth,
2428 D
2429 ),
2430 mcs: fidl::new_empty!(u8, D),
2431 }
2432 }
2433
2434 #[inline]
2435 unsafe fn decode(
2436 &mut self,
2437 decoder: &mut fidl::encoding::Decoder<'_, D>,
2438 offset: usize,
2439 _depth: fidl::encoding::Depth,
2440 ) -> fidl::Result<()> {
2441 decoder.debug_check_bounds::<Self>(offset);
2442 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2444 let padval = unsafe { (ptr as *const u32).read_unaligned() };
2445 let mask = 0xffff0000u32;
2446 let maskedval = padval & mask;
2447 if maskedval != 0 {
2448 return Err(fidl::Error::NonZeroPadding {
2449 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2450 });
2451 }
2452 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(20) };
2453 let padval = unsafe { (ptr as *const u32).read_unaligned() };
2454 let mask = 0xffffff00u32;
2455 let maskedval = padval & mask;
2456 if maskedval != 0 {
2457 return Err(fidl::Error::NonZeroPadding {
2458 padding_start: offset + 20 + ((mask as u64).trailing_zeros() / 8) as usize,
2459 });
2460 }
2461 fidl::decode!(u32, D, &mut self.tx_flags, decoder, offset + 0, _depth)?;
2462 fidl::decode!(u32, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
2463 fidl::decode!(u16, D, &mut self.tx_vector_idx, decoder, offset + 8, _depth)?;
2464 fidl::decode!(
2465 fidl_fuchsia_wlan_common__common::WlanPhyType,
2466 D,
2467 &mut self.phy,
2468 decoder,
2469 offset + 12,
2470 _depth
2471 )?;
2472 fidl::decode!(
2473 fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth,
2474 D,
2475 &mut self.channel_bandwidth,
2476 decoder,
2477 offset + 16,
2478 _depth
2479 )?;
2480 fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 20, _depth)?;
2481 Ok(())
2482 }
2483 }
2484
2485 impl fidl::encoding::ValueTypeMarker for WlanTxPacket {
2486 type Borrowed<'a> = &'a Self;
2487 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2488 value
2489 }
2490 }
2491
2492 unsafe impl fidl::encoding::TypeMarker for WlanTxPacket {
2493 type Owned = Self;
2494
2495 #[inline(always)]
2496 fn inline_align(_context: fidl::encoding::Context) -> usize {
2497 8
2498 }
2499
2500 #[inline(always)]
2501 fn inline_size(_context: fidl::encoding::Context) -> usize {
2502 40
2503 }
2504 }
2505
2506 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxPacket, D>
2507 for &WlanTxPacket
2508 {
2509 #[inline]
2510 unsafe fn encode(
2511 self,
2512 encoder: &mut fidl::encoding::Encoder<'_, D>,
2513 offset: usize,
2514 _depth: fidl::encoding::Depth,
2515 ) -> fidl::Result<()> {
2516 encoder.debug_check_bounds::<WlanTxPacket>(offset);
2517 fidl::encoding::Encode::<WlanTxPacket, D>::encode(
2519 (
2520 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_frame),
2521 <WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
2522 ),
2523 encoder, offset, _depth
2524 )
2525 }
2526 }
2527 unsafe impl<
2528 D: fidl::encoding::ResourceDialect,
2529 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
2530 T1: fidl::encoding::Encode<WlanTxInfo, D>,
2531 > fidl::encoding::Encode<WlanTxPacket, D> for (T0, T1)
2532 {
2533 #[inline]
2534 unsafe fn encode(
2535 self,
2536 encoder: &mut fidl::encoding::Encoder<'_, D>,
2537 offset: usize,
2538 depth: fidl::encoding::Depth,
2539 ) -> fidl::Result<()> {
2540 encoder.debug_check_bounds::<WlanTxPacket>(offset);
2541 self.0.encode(encoder, offset + 0, depth)?;
2545 self.1.encode(encoder, offset + 16, depth)?;
2546 Ok(())
2547 }
2548 }
2549
2550 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxPacket {
2551 #[inline(always)]
2552 fn new_empty() -> Self {
2553 Self {
2554 mac_frame: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
2555 info: fidl::new_empty!(WlanTxInfo, D),
2556 }
2557 }
2558
2559 #[inline]
2560 unsafe fn decode(
2561 &mut self,
2562 decoder: &mut fidl::encoding::Decoder<'_, D>,
2563 offset: usize,
2564 _depth: fidl::encoding::Depth,
2565 ) -> fidl::Result<()> {
2566 decoder.debug_check_bounds::<Self>(offset);
2567 fidl::decode!(
2569 fidl::encoding::UnboundedVector<u8>,
2570 D,
2571 &mut self.mac_frame,
2572 decoder,
2573 offset + 0,
2574 _depth
2575 )?;
2576 fidl::decode!(WlanTxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
2577 Ok(())
2578 }
2579 }
2580
2581 impl EthernetRxTransferRequest {
2582 #[inline(always)]
2583 fn max_ordinal_present(&self) -> u64 {
2584 if let Some(_) = self.packet_size {
2585 return 2;
2586 }
2587 if let Some(_) = self.packet_address {
2588 return 1;
2589 }
2590 0
2591 }
2592 }
2593
2594 impl fidl::encoding::ValueTypeMarker for EthernetRxTransferRequest {
2595 type Borrowed<'a> = &'a Self;
2596 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2597 value
2598 }
2599 }
2600
2601 unsafe impl fidl::encoding::TypeMarker for EthernetRxTransferRequest {
2602 type Owned = Self;
2603
2604 #[inline(always)]
2605 fn inline_align(_context: fidl::encoding::Context) -> usize {
2606 8
2607 }
2608
2609 #[inline(always)]
2610 fn inline_size(_context: fidl::encoding::Context) -> usize {
2611 16
2612 }
2613 }
2614
2615 unsafe impl<D: fidl::encoding::ResourceDialect>
2616 fidl::encoding::Encode<EthernetRxTransferRequest, D> for &EthernetRxTransferRequest
2617 {
2618 unsafe fn encode(
2619 self,
2620 encoder: &mut fidl::encoding::Encoder<'_, D>,
2621 offset: usize,
2622 mut depth: fidl::encoding::Depth,
2623 ) -> fidl::Result<()> {
2624 encoder.debug_check_bounds::<EthernetRxTransferRequest>(offset);
2625 let max_ordinal: u64 = self.max_ordinal_present();
2627 encoder.write_num(max_ordinal, offset);
2628 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2629 if max_ordinal == 0 {
2631 return Ok(());
2632 }
2633 depth.increment()?;
2634 let envelope_size = 8;
2635 let bytes_len = max_ordinal as usize * envelope_size;
2636 #[allow(unused_variables)]
2637 let offset = encoder.out_of_line_offset(bytes_len);
2638 let mut _prev_end_offset: usize = 0;
2639 if 1 > max_ordinal {
2640 return Ok(());
2641 }
2642
2643 let cur_offset: usize = (1 - 1) * envelope_size;
2646
2647 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2649
2650 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2655 self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2656 encoder,
2657 offset + cur_offset,
2658 depth,
2659 )?;
2660
2661 _prev_end_offset = cur_offset + envelope_size;
2662 if 2 > max_ordinal {
2663 return Ok(());
2664 }
2665
2666 let cur_offset: usize = (2 - 1) * envelope_size;
2669
2670 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2672
2673 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2678 self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2679 encoder,
2680 offset + cur_offset,
2681 depth,
2682 )?;
2683
2684 _prev_end_offset = cur_offset + envelope_size;
2685
2686 Ok(())
2687 }
2688 }
2689
2690 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2691 for EthernetRxTransferRequest
2692 {
2693 #[inline(always)]
2694 fn new_empty() -> Self {
2695 Self::default()
2696 }
2697
2698 unsafe fn decode(
2699 &mut self,
2700 decoder: &mut fidl::encoding::Decoder<'_, D>,
2701 offset: usize,
2702 mut depth: fidl::encoding::Depth,
2703 ) -> fidl::Result<()> {
2704 decoder.debug_check_bounds::<Self>(offset);
2705 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2706 None => return Err(fidl::Error::NotNullable),
2707 Some(len) => len,
2708 };
2709 if len == 0 {
2711 return Ok(());
2712 };
2713 depth.increment()?;
2714 let envelope_size = 8;
2715 let bytes_len = len * envelope_size;
2716 let offset = decoder.out_of_line_offset(bytes_len)?;
2717 let mut _next_ordinal_to_read = 0;
2719 let mut next_offset = offset;
2720 let end_offset = offset + bytes_len;
2721 _next_ordinal_to_read += 1;
2722 if next_offset >= end_offset {
2723 return Ok(());
2724 }
2725
2726 while _next_ordinal_to_read < 1 {
2728 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2729 _next_ordinal_to_read += 1;
2730 next_offset += envelope_size;
2731 }
2732
2733 let next_out_of_line = decoder.next_out_of_line();
2734 let handles_before = decoder.remaining_handles();
2735 if let Some((inlined, num_bytes, num_handles)) =
2736 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2737 {
2738 let member_inline_size =
2739 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2740 if inlined != (member_inline_size <= 4) {
2741 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2742 }
2743 let inner_offset;
2744 let mut inner_depth = depth.clone();
2745 if inlined {
2746 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2747 inner_offset = next_offset;
2748 } else {
2749 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2750 inner_depth.increment()?;
2751 }
2752 let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
2753 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2754 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2755 {
2756 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2757 }
2758 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2759 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2760 }
2761 }
2762
2763 next_offset += envelope_size;
2764 _next_ordinal_to_read += 1;
2765 if next_offset >= end_offset {
2766 return Ok(());
2767 }
2768
2769 while _next_ordinal_to_read < 2 {
2771 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2772 _next_ordinal_to_read += 1;
2773 next_offset += envelope_size;
2774 }
2775
2776 let next_out_of_line = decoder.next_out_of_line();
2777 let handles_before = decoder.remaining_handles();
2778 if let Some((inlined, num_bytes, num_handles)) =
2779 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2780 {
2781 let member_inline_size =
2782 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2783 if inlined != (member_inline_size <= 4) {
2784 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2785 }
2786 let inner_offset;
2787 let mut inner_depth = depth.clone();
2788 if inlined {
2789 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2790 inner_offset = next_offset;
2791 } else {
2792 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2793 inner_depth.increment()?;
2794 }
2795 let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
2796 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2797 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2798 {
2799 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2800 }
2801 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2802 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2803 }
2804 }
2805
2806 next_offset += envelope_size;
2807
2808 while next_offset < end_offset {
2810 _next_ordinal_to_read += 1;
2811 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2812 next_offset += envelope_size;
2813 }
2814
2815 Ok(())
2816 }
2817 }
2818
2819 impl EthernetTxTransferRequest {
2820 #[inline(always)]
2821 fn max_ordinal_present(&self) -> u64 {
2822 if let Some(_) = self.complete_borrowed_operation {
2823 return 5;
2824 }
2825 if let Some(_) = self.borrowed_operation {
2826 return 4;
2827 }
2828 if let Some(_) = self.async_id {
2829 return 3;
2830 }
2831 if let Some(_) = self.packet_size {
2832 return 2;
2833 }
2834 if let Some(_) = self.packet_address {
2835 return 1;
2836 }
2837 0
2838 }
2839 }
2840
2841 impl fidl::encoding::ValueTypeMarker for EthernetTxTransferRequest {
2842 type Borrowed<'a> = &'a Self;
2843 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2844 value
2845 }
2846 }
2847
2848 unsafe impl fidl::encoding::TypeMarker for EthernetTxTransferRequest {
2849 type Owned = Self;
2850
2851 #[inline(always)]
2852 fn inline_align(_context: fidl::encoding::Context) -> usize {
2853 8
2854 }
2855
2856 #[inline(always)]
2857 fn inline_size(_context: fidl::encoding::Context) -> usize {
2858 16
2859 }
2860 }
2861
2862 unsafe impl<D: fidl::encoding::ResourceDialect>
2863 fidl::encoding::Encode<EthernetTxTransferRequest, D> for &EthernetTxTransferRequest
2864 {
2865 unsafe fn encode(
2866 self,
2867 encoder: &mut fidl::encoding::Encoder<'_, D>,
2868 offset: usize,
2869 mut depth: fidl::encoding::Depth,
2870 ) -> fidl::Result<()> {
2871 encoder.debug_check_bounds::<EthernetTxTransferRequest>(offset);
2872 let max_ordinal: u64 = self.max_ordinal_present();
2874 encoder.write_num(max_ordinal, offset);
2875 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2876 if max_ordinal == 0 {
2878 return Ok(());
2879 }
2880 depth.increment()?;
2881 let envelope_size = 8;
2882 let bytes_len = max_ordinal as usize * envelope_size;
2883 #[allow(unused_variables)]
2884 let offset = encoder.out_of_line_offset(bytes_len);
2885 let mut _prev_end_offset: usize = 0;
2886 if 1 > max_ordinal {
2887 return Ok(());
2888 }
2889
2890 let cur_offset: usize = (1 - 1) * envelope_size;
2893
2894 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2896
2897 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2902 self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2903 encoder,
2904 offset + cur_offset,
2905 depth,
2906 )?;
2907
2908 _prev_end_offset = cur_offset + envelope_size;
2909 if 2 > max_ordinal {
2910 return Ok(());
2911 }
2912
2913 let cur_offset: usize = (2 - 1) * envelope_size;
2916
2917 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2919
2920 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2925 self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2926 encoder,
2927 offset + cur_offset,
2928 depth,
2929 )?;
2930
2931 _prev_end_offset = cur_offset + envelope_size;
2932 if 3 > max_ordinal {
2933 return Ok(());
2934 }
2935
2936 let cur_offset: usize = (3 - 1) * envelope_size;
2939
2940 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2942
2943 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2948 self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2949 encoder,
2950 offset + cur_offset,
2951 depth,
2952 )?;
2953
2954 _prev_end_offset = cur_offset + envelope_size;
2955 if 4 > max_ordinal {
2956 return Ok(());
2957 }
2958
2959 let cur_offset: usize = (4 - 1) * envelope_size;
2962
2963 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2965
2966 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2971 self.borrowed_operation
2972 .as_ref()
2973 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2974 encoder,
2975 offset + cur_offset,
2976 depth,
2977 )?;
2978
2979 _prev_end_offset = cur_offset + envelope_size;
2980 if 5 > max_ordinal {
2981 return Ok(());
2982 }
2983
2984 let cur_offset: usize = (5 - 1) * envelope_size;
2987
2988 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2990
2991 fidl::encoding::encode_in_envelope_optional::<u64, D>(
2996 self.complete_borrowed_operation
2997 .as_ref()
2998 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2999 encoder,
3000 offset + cur_offset,
3001 depth,
3002 )?;
3003
3004 _prev_end_offset = cur_offset + envelope_size;
3005
3006 Ok(())
3007 }
3008 }
3009
3010 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3011 for EthernetTxTransferRequest
3012 {
3013 #[inline(always)]
3014 fn new_empty() -> Self {
3015 Self::default()
3016 }
3017
3018 unsafe fn decode(
3019 &mut self,
3020 decoder: &mut fidl::encoding::Decoder<'_, D>,
3021 offset: usize,
3022 mut depth: fidl::encoding::Depth,
3023 ) -> fidl::Result<()> {
3024 decoder.debug_check_bounds::<Self>(offset);
3025 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3026 None => return Err(fidl::Error::NotNullable),
3027 Some(len) => len,
3028 };
3029 if len == 0 {
3031 return Ok(());
3032 };
3033 depth.increment()?;
3034 let envelope_size = 8;
3035 let bytes_len = len * envelope_size;
3036 let offset = decoder.out_of_line_offset(bytes_len)?;
3037 let mut _next_ordinal_to_read = 0;
3039 let mut next_offset = offset;
3040 let end_offset = offset + bytes_len;
3041 _next_ordinal_to_read += 1;
3042 if next_offset >= end_offset {
3043 return Ok(());
3044 }
3045
3046 while _next_ordinal_to_read < 1 {
3048 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3049 _next_ordinal_to_read += 1;
3050 next_offset += envelope_size;
3051 }
3052
3053 let next_out_of_line = decoder.next_out_of_line();
3054 let handles_before = decoder.remaining_handles();
3055 if let Some((inlined, num_bytes, num_handles)) =
3056 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3057 {
3058 let member_inline_size =
3059 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3060 if inlined != (member_inline_size <= 4) {
3061 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3062 }
3063 let inner_offset;
3064 let mut inner_depth = depth.clone();
3065 if inlined {
3066 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3067 inner_offset = next_offset;
3068 } else {
3069 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3070 inner_depth.increment()?;
3071 }
3072 let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
3073 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3074 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3075 {
3076 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3077 }
3078 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3079 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3080 }
3081 }
3082
3083 next_offset += envelope_size;
3084 _next_ordinal_to_read += 1;
3085 if next_offset >= end_offset {
3086 return Ok(());
3087 }
3088
3089 while _next_ordinal_to_read < 2 {
3091 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3092 _next_ordinal_to_read += 1;
3093 next_offset += envelope_size;
3094 }
3095
3096 let next_out_of_line = decoder.next_out_of_line();
3097 let handles_before = decoder.remaining_handles();
3098 if let Some((inlined, num_bytes, num_handles)) =
3099 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3100 {
3101 let member_inline_size =
3102 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3103 if inlined != (member_inline_size <= 4) {
3104 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3105 }
3106 let inner_offset;
3107 let mut inner_depth = depth.clone();
3108 if inlined {
3109 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3110 inner_offset = next_offset;
3111 } else {
3112 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3113 inner_depth.increment()?;
3114 }
3115 let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
3116 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3117 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3118 {
3119 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3120 }
3121 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3122 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3123 }
3124 }
3125
3126 next_offset += envelope_size;
3127 _next_ordinal_to_read += 1;
3128 if next_offset >= end_offset {
3129 return Ok(());
3130 }
3131
3132 while _next_ordinal_to_read < 3 {
3134 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3135 _next_ordinal_to_read += 1;
3136 next_offset += envelope_size;
3137 }
3138
3139 let next_out_of_line = decoder.next_out_of_line();
3140 let handles_before = decoder.remaining_handles();
3141 if let Some((inlined, num_bytes, num_handles)) =
3142 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3143 {
3144 let member_inline_size =
3145 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3146 if inlined != (member_inline_size <= 4) {
3147 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3148 }
3149 let inner_offset;
3150 let mut inner_depth = depth.clone();
3151 if inlined {
3152 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3153 inner_offset = next_offset;
3154 } else {
3155 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3156 inner_depth.increment()?;
3157 }
3158 let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
3159 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3160 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3161 {
3162 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3163 }
3164 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3165 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3166 }
3167 }
3168
3169 next_offset += envelope_size;
3170 _next_ordinal_to_read += 1;
3171 if next_offset >= end_offset {
3172 return Ok(());
3173 }
3174
3175 while _next_ordinal_to_read < 4 {
3177 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3178 _next_ordinal_to_read += 1;
3179 next_offset += envelope_size;
3180 }
3181
3182 let next_out_of_line = decoder.next_out_of_line();
3183 let handles_before = decoder.remaining_handles();
3184 if let Some((inlined, num_bytes, num_handles)) =
3185 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3186 {
3187 let member_inline_size =
3188 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3189 if inlined != (member_inline_size <= 4) {
3190 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3191 }
3192 let inner_offset;
3193 let mut inner_depth = depth.clone();
3194 if inlined {
3195 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3196 inner_offset = next_offset;
3197 } else {
3198 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3199 inner_depth.increment()?;
3200 }
3201 let val_ref =
3202 self.borrowed_operation.get_or_insert_with(|| fidl::new_empty!(u64, D));
3203 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3204 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3205 {
3206 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3207 }
3208 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3209 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3210 }
3211 }
3212
3213 next_offset += envelope_size;
3214 _next_ordinal_to_read += 1;
3215 if next_offset >= end_offset {
3216 return Ok(());
3217 }
3218
3219 while _next_ordinal_to_read < 5 {
3221 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3222 _next_ordinal_to_read += 1;
3223 next_offset += envelope_size;
3224 }
3225
3226 let next_out_of_line = decoder.next_out_of_line();
3227 let handles_before = decoder.remaining_handles();
3228 if let Some((inlined, num_bytes, num_handles)) =
3229 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3230 {
3231 let member_inline_size =
3232 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3233 if inlined != (member_inline_size <= 4) {
3234 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3235 }
3236 let inner_offset;
3237 let mut inner_depth = depth.clone();
3238 if inlined {
3239 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3240 inner_offset = next_offset;
3241 } else {
3242 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3243 inner_depth.increment()?;
3244 }
3245 let val_ref = self
3246 .complete_borrowed_operation
3247 .get_or_insert_with(|| fidl::new_empty!(u64, D));
3248 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3249 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3250 {
3251 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3252 }
3253 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3254 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3255 }
3256 }
3257
3258 next_offset += envelope_size;
3259
3260 while next_offset < end_offset {
3262 _next_ordinal_to_read += 1;
3263 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3264 next_offset += envelope_size;
3265 }
3266
3267 Ok(())
3268 }
3269 }
3270
3271 impl WlanAssociationConfig {
3272 #[inline(always)]
3273 fn max_ordinal_present(&self) -> u64 {
3274 if let Some(_) = self.vht_op {
3275 return 12;
3276 }
3277 if let Some(_) = self.vht_cap {
3278 return 11;
3279 }
3280 if let Some(_) = self.ht_op {
3281 return 10;
3282 }
3283 if let Some(_) = self.ht_cap {
3284 return 9;
3285 }
3286 if let Some(_) = self.capability_info {
3287 return 8;
3288 }
3289 if let Some(_) = self.rates {
3290 return 7;
3291 }
3292 if let Some(_) = self.wmm_params {
3293 return 6;
3294 }
3295 if let Some(_) = self.qos {
3296 return 5;
3297 }
3298 if let Some(_) = self.channel {
3299 return 4;
3300 }
3301 if let Some(_) = self.listen_interval {
3302 return 3;
3303 }
3304 if let Some(_) = self.aid {
3305 return 2;
3306 }
3307 if let Some(_) = self.bssid {
3308 return 1;
3309 }
3310 0
3311 }
3312 }
3313
3314 impl fidl::encoding::ValueTypeMarker for WlanAssociationConfig {
3315 type Borrowed<'a> = &'a Self;
3316 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3317 value
3318 }
3319 }
3320
3321 unsafe impl fidl::encoding::TypeMarker for WlanAssociationConfig {
3322 type Owned = Self;
3323
3324 #[inline(always)]
3325 fn inline_align(_context: fidl::encoding::Context) -> usize {
3326 8
3327 }
3328
3329 #[inline(always)]
3330 fn inline_size(_context: fidl::encoding::Context) -> usize {
3331 16
3332 }
3333 }
3334
3335 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanAssociationConfig, D>
3336 for &WlanAssociationConfig
3337 {
3338 unsafe fn encode(
3339 self,
3340 encoder: &mut fidl::encoding::Encoder<'_, D>,
3341 offset: usize,
3342 mut depth: fidl::encoding::Depth,
3343 ) -> fidl::Result<()> {
3344 encoder.debug_check_bounds::<WlanAssociationConfig>(offset);
3345 let max_ordinal: u64 = self.max_ordinal_present();
3347 encoder.write_num(max_ordinal, offset);
3348 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3349 if max_ordinal == 0 {
3351 return Ok(());
3352 }
3353 depth.increment()?;
3354 let envelope_size = 8;
3355 let bytes_len = max_ordinal as usize * envelope_size;
3356 #[allow(unused_variables)]
3357 let offset = encoder.out_of_line_offset(bytes_len);
3358 let mut _prev_end_offset: usize = 0;
3359 if 1 > max_ordinal {
3360 return Ok(());
3361 }
3362
3363 let cur_offset: usize = (1 - 1) * envelope_size;
3366
3367 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3369
3370 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
3375 self.bssid
3376 .as_ref()
3377 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
3378 encoder,
3379 offset + cur_offset,
3380 depth,
3381 )?;
3382
3383 _prev_end_offset = cur_offset + envelope_size;
3384 if 2 > max_ordinal {
3385 return Ok(());
3386 }
3387
3388 let cur_offset: usize = (2 - 1) * envelope_size;
3391
3392 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3394
3395 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3400 self.aid.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3401 encoder,
3402 offset + cur_offset,
3403 depth,
3404 )?;
3405
3406 _prev_end_offset = cur_offset + envelope_size;
3407 if 3 > max_ordinal {
3408 return Ok(());
3409 }
3410
3411 let cur_offset: usize = (3 - 1) * envelope_size;
3414
3415 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3417
3418 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3423 self.listen_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3424 encoder,
3425 offset + cur_offset,
3426 depth,
3427 )?;
3428
3429 _prev_end_offset = cur_offset + envelope_size;
3430 if 4 > max_ordinal {
3431 return Ok(());
3432 }
3433
3434 let cur_offset: usize = (4 - 1) * envelope_size;
3437
3438 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3440
3441 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D>(
3446 self.channel.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow),
3447 encoder, offset + cur_offset, depth
3448 )?;
3449
3450 _prev_end_offset = cur_offset + envelope_size;
3451 if 5 > max_ordinal {
3452 return Ok(());
3453 }
3454
3455 let cur_offset: usize = (5 - 1) * envelope_size;
3458
3459 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3461
3462 fidl::encoding::encode_in_envelope_optional::<bool, D>(
3467 self.qos.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3468 encoder,
3469 offset + cur_offset,
3470 depth,
3471 )?;
3472
3473 _prev_end_offset = cur_offset + envelope_size;
3474 if 6 > max_ordinal {
3475 return Ok(());
3476 }
3477
3478 let cur_offset: usize = (6 - 1) * envelope_size;
3481
3482 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3484
3485 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanWmmParameters, D>(
3490 self.wmm_params.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow),
3491 encoder, offset + cur_offset, depth
3492 )?;
3493
3494 _prev_end_offset = cur_offset + envelope_size;
3495 if 7 > max_ordinal {
3496 return Ok(());
3497 }
3498
3499 let cur_offset: usize = (7 - 1) * envelope_size;
3502
3503 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3505
3506 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 263>, D>(
3511 self.rates.as_ref().map(
3512 <fidl::encoding::Vector<u8, 263> as fidl::encoding::ValueTypeMarker>::borrow,
3513 ),
3514 encoder,
3515 offset + cur_offset,
3516 depth,
3517 )?;
3518
3519 _prev_end_offset = cur_offset + envelope_size;
3520 if 8 > max_ordinal {
3521 return Ok(());
3522 }
3523
3524 let cur_offset: usize = (8 - 1) * envelope_size;
3527
3528 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3530
3531 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3536 self.capability_info.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3537 encoder,
3538 offset + cur_offset,
3539 depth,
3540 )?;
3541
3542 _prev_end_offset = cur_offset + envelope_size;
3543 if 9 > max_ordinal {
3544 return Ok(());
3545 }
3546
3547 let cur_offset: usize = (9 - 1) * envelope_size;
3550
3551 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3553
3554 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D>(
3559 self.ht_cap.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
3560 encoder, offset + cur_offset, depth
3561 )?;
3562
3563 _prev_end_offset = cur_offset + envelope_size;
3564 if 10 > max_ordinal {
3565 return Ok(());
3566 }
3567
3568 let cur_offset: usize = (10 - 1) * envelope_size;
3571
3572 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3574
3575 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::HtOperation, D>(
3580 self.ht_op.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::HtOperation as fidl::encoding::ValueTypeMarker>::borrow),
3581 encoder, offset + cur_offset, depth
3582 )?;
3583
3584 _prev_end_offset = cur_offset + envelope_size;
3585 if 11 > max_ordinal {
3586 return Ok(());
3587 }
3588
3589 let cur_offset: usize = (11 - 1) * envelope_size;
3592
3593 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3595
3596 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D>(
3601 self.vht_cap.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
3602 encoder, offset + cur_offset, depth
3603 )?;
3604
3605 _prev_end_offset = cur_offset + envelope_size;
3606 if 12 > max_ordinal {
3607 return Ok(());
3608 }
3609
3610 let cur_offset: usize = (12 - 1) * envelope_size;
3613
3614 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3616
3617 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::VhtOperation, D>(
3622 self.vht_op.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::VhtOperation as fidl::encoding::ValueTypeMarker>::borrow),
3623 encoder, offset + cur_offset, depth
3624 )?;
3625
3626 _prev_end_offset = cur_offset + envelope_size;
3627
3628 Ok(())
3629 }
3630 }
3631
3632 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanAssociationConfig {
3633 #[inline(always)]
3634 fn new_empty() -> Self {
3635 Self::default()
3636 }
3637
3638 unsafe fn decode(
3639 &mut self,
3640 decoder: &mut fidl::encoding::Decoder<'_, D>,
3641 offset: usize,
3642 mut depth: fidl::encoding::Depth,
3643 ) -> fidl::Result<()> {
3644 decoder.debug_check_bounds::<Self>(offset);
3645 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3646 None => return Err(fidl::Error::NotNullable),
3647 Some(len) => len,
3648 };
3649 if len == 0 {
3651 return Ok(());
3652 };
3653 depth.increment()?;
3654 let envelope_size = 8;
3655 let bytes_len = len * envelope_size;
3656 let offset = decoder.out_of_line_offset(bytes_len)?;
3657 let mut _next_ordinal_to_read = 0;
3659 let mut next_offset = offset;
3660 let end_offset = offset + bytes_len;
3661 _next_ordinal_to_read += 1;
3662 if next_offset >= end_offset {
3663 return Ok(());
3664 }
3665
3666 while _next_ordinal_to_read < 1 {
3668 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3669 _next_ordinal_to_read += 1;
3670 next_offset += envelope_size;
3671 }
3672
3673 let next_out_of_line = decoder.next_out_of_line();
3674 let handles_before = decoder.remaining_handles();
3675 if let Some((inlined, num_bytes, num_handles)) =
3676 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3677 {
3678 let member_inline_size =
3679 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
3680 decoder.context,
3681 );
3682 if inlined != (member_inline_size <= 4) {
3683 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3684 }
3685 let inner_offset;
3686 let mut inner_depth = depth.clone();
3687 if inlined {
3688 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3689 inner_offset = next_offset;
3690 } else {
3691 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3692 inner_depth.increment()?;
3693 }
3694 let val_ref = self
3695 .bssid
3696 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
3697 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
3698 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3699 {
3700 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3701 }
3702 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3703 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3704 }
3705 }
3706
3707 next_offset += envelope_size;
3708 _next_ordinal_to_read += 1;
3709 if next_offset >= end_offset {
3710 return Ok(());
3711 }
3712
3713 while _next_ordinal_to_read < 2 {
3715 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3716 _next_ordinal_to_read += 1;
3717 next_offset += envelope_size;
3718 }
3719
3720 let next_out_of_line = decoder.next_out_of_line();
3721 let handles_before = decoder.remaining_handles();
3722 if let Some((inlined, num_bytes, num_handles)) =
3723 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3724 {
3725 let member_inline_size =
3726 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3727 if inlined != (member_inline_size <= 4) {
3728 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3729 }
3730 let inner_offset;
3731 let mut inner_depth = depth.clone();
3732 if inlined {
3733 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3734 inner_offset = next_offset;
3735 } else {
3736 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3737 inner_depth.increment()?;
3738 }
3739 let val_ref = self.aid.get_or_insert_with(|| fidl::new_empty!(u16, D));
3740 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3741 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3742 {
3743 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3744 }
3745 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3746 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3747 }
3748 }
3749
3750 next_offset += envelope_size;
3751 _next_ordinal_to_read += 1;
3752 if next_offset >= end_offset {
3753 return Ok(());
3754 }
3755
3756 while _next_ordinal_to_read < 3 {
3758 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3759 _next_ordinal_to_read += 1;
3760 next_offset += envelope_size;
3761 }
3762
3763 let next_out_of_line = decoder.next_out_of_line();
3764 let handles_before = decoder.remaining_handles();
3765 if let Some((inlined, num_bytes, num_handles)) =
3766 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3767 {
3768 let member_inline_size =
3769 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3770 if inlined != (member_inline_size <= 4) {
3771 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3772 }
3773 let inner_offset;
3774 let mut inner_depth = depth.clone();
3775 if inlined {
3776 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3777 inner_offset = next_offset;
3778 } else {
3779 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3780 inner_depth.increment()?;
3781 }
3782 let val_ref = self.listen_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
3783 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
3784 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3785 {
3786 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3787 }
3788 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3789 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3790 }
3791 }
3792
3793 next_offset += envelope_size;
3794 _next_ordinal_to_read += 1;
3795 if next_offset >= end_offset {
3796 return Ok(());
3797 }
3798
3799 while _next_ordinal_to_read < 4 {
3801 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3802 _next_ordinal_to_read += 1;
3803 next_offset += envelope_size;
3804 }
3805
3806 let next_out_of_line = decoder.next_out_of_line();
3807 let handles_before = decoder.remaining_handles();
3808 if let Some((inlined, num_bytes, num_handles)) =
3809 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3810 {
3811 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3812 if inlined != (member_inline_size <= 4) {
3813 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3814 }
3815 let inner_offset;
3816 let mut inner_depth = depth.clone();
3817 if inlined {
3818 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3819 inner_offset = next_offset;
3820 } else {
3821 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3822 inner_depth.increment()?;
3823 }
3824 let val_ref = self.channel.get_or_insert_with(|| {
3825 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D)
3826 });
3827 fidl::decode!(
3828 fidl_fuchsia_wlan_ieee80211__common::WlanChannel,
3829 D,
3830 val_ref,
3831 decoder,
3832 inner_offset,
3833 inner_depth
3834 )?;
3835 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3836 {
3837 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3838 }
3839 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3840 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3841 }
3842 }
3843
3844 next_offset += envelope_size;
3845 _next_ordinal_to_read += 1;
3846 if next_offset >= end_offset {
3847 return Ok(());
3848 }
3849
3850 while _next_ordinal_to_read < 5 {
3852 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3853 _next_ordinal_to_read += 1;
3854 next_offset += envelope_size;
3855 }
3856
3857 let next_out_of_line = decoder.next_out_of_line();
3858 let handles_before = decoder.remaining_handles();
3859 if let Some((inlined, num_bytes, num_handles)) =
3860 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3861 {
3862 let member_inline_size =
3863 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3864 if inlined != (member_inline_size <= 4) {
3865 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3866 }
3867 let inner_offset;
3868 let mut inner_depth = depth.clone();
3869 if inlined {
3870 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3871 inner_offset = next_offset;
3872 } else {
3873 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3874 inner_depth.increment()?;
3875 }
3876 let val_ref = self.qos.get_or_insert_with(|| fidl::new_empty!(bool, D));
3877 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3878 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3879 {
3880 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3881 }
3882 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3883 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3884 }
3885 }
3886
3887 next_offset += envelope_size;
3888 _next_ordinal_to_read += 1;
3889 if next_offset >= end_offset {
3890 return Ok(());
3891 }
3892
3893 while _next_ordinal_to_read < 6 {
3895 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3896 _next_ordinal_to_read += 1;
3897 next_offset += envelope_size;
3898 }
3899
3900 let next_out_of_line = decoder.next_out_of_line();
3901 let handles_before = decoder.remaining_handles();
3902 if let Some((inlined, num_bytes, num_handles)) =
3903 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3904 {
3905 let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3906 if inlined != (member_inline_size <= 4) {
3907 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3908 }
3909 let inner_offset;
3910 let mut inner_depth = depth.clone();
3911 if inlined {
3912 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3913 inner_offset = next_offset;
3914 } else {
3915 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3916 inner_depth.increment()?;
3917 }
3918 let val_ref = self.wmm_params.get_or_insert_with(|| {
3919 fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanWmmParameters, D)
3920 });
3921 fidl::decode!(
3922 fidl_fuchsia_wlan_common__common::WlanWmmParameters,
3923 D,
3924 val_ref,
3925 decoder,
3926 inner_offset,
3927 inner_depth
3928 )?;
3929 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3930 {
3931 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3932 }
3933 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3934 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3935 }
3936 }
3937
3938 next_offset += envelope_size;
3939 _next_ordinal_to_read += 1;
3940 if next_offset >= end_offset {
3941 return Ok(());
3942 }
3943
3944 while _next_ordinal_to_read < 7 {
3946 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3947 _next_ordinal_to_read += 1;
3948 next_offset += envelope_size;
3949 }
3950
3951 let next_out_of_line = decoder.next_out_of_line();
3952 let handles_before = decoder.remaining_handles();
3953 if let Some((inlined, num_bytes, num_handles)) =
3954 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3955 {
3956 let member_inline_size =
3957 <fidl::encoding::Vector<u8, 263> as fidl::encoding::TypeMarker>::inline_size(
3958 decoder.context,
3959 );
3960 if inlined != (member_inline_size <= 4) {
3961 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3962 }
3963 let inner_offset;
3964 let mut inner_depth = depth.clone();
3965 if inlined {
3966 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3967 inner_offset = next_offset;
3968 } else {
3969 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3970 inner_depth.increment()?;
3971 }
3972 let val_ref = self
3973 .rates
3974 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 263>, D));
3975 fidl::decode!(fidl::encoding::Vector<u8, 263>, D, val_ref, decoder, inner_offset, inner_depth)?;
3976 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3977 {
3978 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3979 }
3980 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3981 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3982 }
3983 }
3984
3985 next_offset += envelope_size;
3986 _next_ordinal_to_read += 1;
3987 if next_offset >= end_offset {
3988 return Ok(());
3989 }
3990
3991 while _next_ordinal_to_read < 8 {
3993 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3994 _next_ordinal_to_read += 1;
3995 next_offset += envelope_size;
3996 }
3997
3998 let next_out_of_line = decoder.next_out_of_line();
3999 let handles_before = decoder.remaining_handles();
4000 if let Some((inlined, num_bytes, num_handles)) =
4001 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4002 {
4003 let member_inline_size =
4004 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4005 if inlined != (member_inline_size <= 4) {
4006 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4007 }
4008 let inner_offset;
4009 let mut inner_depth = depth.clone();
4010 if inlined {
4011 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4012 inner_offset = next_offset;
4013 } else {
4014 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4015 inner_depth.increment()?;
4016 }
4017 let val_ref = self.capability_info.get_or_insert_with(|| fidl::new_empty!(u16, D));
4018 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
4019 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4020 {
4021 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4022 }
4023 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4024 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4025 }
4026 }
4027
4028 next_offset += envelope_size;
4029 _next_ordinal_to_read += 1;
4030 if next_offset >= end_offset {
4031 return Ok(());
4032 }
4033
4034 while _next_ordinal_to_read < 9 {
4036 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4037 _next_ordinal_to_read += 1;
4038 next_offset += envelope_size;
4039 }
4040
4041 let next_out_of_line = decoder.next_out_of_line();
4042 let handles_before = decoder.remaining_handles();
4043 if let Some((inlined, num_bytes, num_handles)) =
4044 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4045 {
4046 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4047 if inlined != (member_inline_size <= 4) {
4048 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4049 }
4050 let inner_offset;
4051 let mut inner_depth = depth.clone();
4052 if inlined {
4053 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4054 inner_offset = next_offset;
4055 } else {
4056 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4057 inner_depth.increment()?;
4058 }
4059 let val_ref = self.ht_cap.get_or_insert_with(|| {
4060 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D)
4061 });
4062 fidl::decode!(
4063 fidl_fuchsia_wlan_ieee80211__common::HtCapabilities,
4064 D,
4065 val_ref,
4066 decoder,
4067 inner_offset,
4068 inner_depth
4069 )?;
4070 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4071 {
4072 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4073 }
4074 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4075 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4076 }
4077 }
4078
4079 next_offset += envelope_size;
4080 _next_ordinal_to_read += 1;
4081 if next_offset >= end_offset {
4082 return Ok(());
4083 }
4084
4085 while _next_ordinal_to_read < 10 {
4087 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4088 _next_ordinal_to_read += 1;
4089 next_offset += envelope_size;
4090 }
4091
4092 let next_out_of_line = decoder.next_out_of_line();
4093 let handles_before = decoder.remaining_handles();
4094 if let Some((inlined, num_bytes, num_handles)) =
4095 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4096 {
4097 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::HtOperation as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4098 if inlined != (member_inline_size <= 4) {
4099 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4100 }
4101 let inner_offset;
4102 let mut inner_depth = depth.clone();
4103 if inlined {
4104 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4105 inner_offset = next_offset;
4106 } else {
4107 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4108 inner_depth.increment()?;
4109 }
4110 let val_ref = self.ht_op.get_or_insert_with(|| {
4111 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::HtOperation, D)
4112 });
4113 fidl::decode!(
4114 fidl_fuchsia_wlan_ieee80211__common::HtOperation,
4115 D,
4116 val_ref,
4117 decoder,
4118 inner_offset,
4119 inner_depth
4120 )?;
4121 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4122 {
4123 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4124 }
4125 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4126 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4127 }
4128 }
4129
4130 next_offset += envelope_size;
4131 _next_ordinal_to_read += 1;
4132 if next_offset >= end_offset {
4133 return Ok(());
4134 }
4135
4136 while _next_ordinal_to_read < 11 {
4138 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4139 _next_ordinal_to_read += 1;
4140 next_offset += envelope_size;
4141 }
4142
4143 let next_out_of_line = decoder.next_out_of_line();
4144 let handles_before = decoder.remaining_handles();
4145 if let Some((inlined, num_bytes, num_handles)) =
4146 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4147 {
4148 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4149 if inlined != (member_inline_size <= 4) {
4150 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4151 }
4152 let inner_offset;
4153 let mut inner_depth = depth.clone();
4154 if inlined {
4155 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4156 inner_offset = next_offset;
4157 } else {
4158 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4159 inner_depth.increment()?;
4160 }
4161 let val_ref = self.vht_cap.get_or_insert_with(|| {
4162 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D)
4163 });
4164 fidl::decode!(
4165 fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities,
4166 D,
4167 val_ref,
4168 decoder,
4169 inner_offset,
4170 inner_depth
4171 )?;
4172 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4173 {
4174 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4175 }
4176 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4177 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4178 }
4179 }
4180
4181 next_offset += envelope_size;
4182 _next_ordinal_to_read += 1;
4183 if next_offset >= end_offset {
4184 return Ok(());
4185 }
4186
4187 while _next_ordinal_to_read < 12 {
4189 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4190 _next_ordinal_to_read += 1;
4191 next_offset += envelope_size;
4192 }
4193
4194 let next_out_of_line = decoder.next_out_of_line();
4195 let handles_before = decoder.remaining_handles();
4196 if let Some((inlined, num_bytes, num_handles)) =
4197 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4198 {
4199 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::VhtOperation as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4200 if inlined != (member_inline_size <= 4) {
4201 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4202 }
4203 let inner_offset;
4204 let mut inner_depth = depth.clone();
4205 if inlined {
4206 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4207 inner_offset = next_offset;
4208 } else {
4209 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4210 inner_depth.increment()?;
4211 }
4212 let val_ref = self.vht_op.get_or_insert_with(|| {
4213 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::VhtOperation, D)
4214 });
4215 fidl::decode!(
4216 fidl_fuchsia_wlan_ieee80211__common::VhtOperation,
4217 D,
4218 val_ref,
4219 decoder,
4220 inner_offset,
4221 inner_depth
4222 )?;
4223 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4224 {
4225 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4226 }
4227 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4228 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4229 }
4230 }
4231
4232 next_offset += envelope_size;
4233
4234 while next_offset < end_offset {
4236 _next_ordinal_to_read += 1;
4237 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4238 next_offset += envelope_size;
4239 }
4240
4241 Ok(())
4242 }
4243 }
4244
4245 impl WlanKeyConfiguration {
4246 #[inline(always)]
4247 fn max_ordinal_present(&self) -> u64 {
4248 if let Some(_) = self.rsc {
4249 return 8;
4250 }
4251 if let Some(_) = self.key {
4252 return 7;
4253 }
4254 if let Some(_) = self.key_idx {
4255 return 6;
4256 }
4257 if let Some(_) = self.peer_addr {
4258 return 5;
4259 }
4260 if let Some(_) = self.key_type {
4261 return 4;
4262 }
4263 if let Some(_) = self.cipher_type {
4264 return 3;
4265 }
4266 if let Some(_) = self.cipher_oui {
4267 return 2;
4268 }
4269 if let Some(_) = self.protection {
4270 return 1;
4271 }
4272 0
4273 }
4274 }
4275
4276 impl fidl::encoding::ValueTypeMarker for WlanKeyConfiguration {
4277 type Borrowed<'a> = &'a Self;
4278 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4279 value
4280 }
4281 }
4282
4283 unsafe impl fidl::encoding::TypeMarker for WlanKeyConfiguration {
4284 type Owned = Self;
4285
4286 #[inline(always)]
4287 fn inline_align(_context: fidl::encoding::Context) -> usize {
4288 8
4289 }
4290
4291 #[inline(always)]
4292 fn inline_size(_context: fidl::encoding::Context) -> usize {
4293 16
4294 }
4295 }
4296
4297 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanKeyConfiguration, D>
4298 for &WlanKeyConfiguration
4299 {
4300 unsafe fn encode(
4301 self,
4302 encoder: &mut fidl::encoding::Encoder<'_, D>,
4303 offset: usize,
4304 mut depth: fidl::encoding::Depth,
4305 ) -> fidl::Result<()> {
4306 encoder.debug_check_bounds::<WlanKeyConfiguration>(offset);
4307 let max_ordinal: u64 = self.max_ordinal_present();
4309 encoder.write_num(max_ordinal, offset);
4310 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4311 if max_ordinal == 0 {
4313 return Ok(());
4314 }
4315 depth.increment()?;
4316 let envelope_size = 8;
4317 let bytes_len = max_ordinal as usize * envelope_size;
4318 #[allow(unused_variables)]
4319 let offset = encoder.out_of_line_offset(bytes_len);
4320 let mut _prev_end_offset: usize = 0;
4321 if 1 > max_ordinal {
4322 return Ok(());
4323 }
4324
4325 let cur_offset: usize = (1 - 1) * envelope_size;
4328
4329 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4331
4332 fidl::encoding::encode_in_envelope_optional::<WlanProtection, D>(
4337 self.protection
4338 .as_ref()
4339 .map(<WlanProtection as fidl::encoding::ValueTypeMarker>::borrow),
4340 encoder,
4341 offset + cur_offset,
4342 depth,
4343 )?;
4344
4345 _prev_end_offset = cur_offset + envelope_size;
4346 if 2 > max_ordinal {
4347 return Ok(());
4348 }
4349
4350 let cur_offset: usize = (2 - 1) * envelope_size;
4353
4354 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4356
4357 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 3>, D>(
4362 self.cipher_oui
4363 .as_ref()
4364 .map(<fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow),
4365 encoder,
4366 offset + cur_offset,
4367 depth,
4368 )?;
4369
4370 _prev_end_offset = cur_offset + envelope_size;
4371 if 3 > max_ordinal {
4372 return Ok(());
4373 }
4374
4375 let cur_offset: usize = (3 - 1) * envelope_size;
4378
4379 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4381
4382 fidl::encoding::encode_in_envelope_optional::<u8, D>(
4387 self.cipher_type.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4388 encoder,
4389 offset + cur_offset,
4390 depth,
4391 )?;
4392
4393 _prev_end_offset = cur_offset + envelope_size;
4394 if 4 > max_ordinal {
4395 return Ok(());
4396 }
4397
4398 let cur_offset: usize = (4 - 1) * envelope_size;
4401
4402 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4404
4405 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::KeyType, D>(
4410 self.key_type.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::KeyType as fidl::encoding::ValueTypeMarker>::borrow),
4411 encoder, offset + cur_offset, depth
4412 )?;
4413
4414 _prev_end_offset = cur_offset + envelope_size;
4415 if 5 > max_ordinal {
4416 return Ok(());
4417 }
4418
4419 let cur_offset: usize = (5 - 1) * envelope_size;
4422
4423 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4425
4426 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4431 self.peer_addr
4432 .as_ref()
4433 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4434 encoder,
4435 offset + cur_offset,
4436 depth,
4437 )?;
4438
4439 _prev_end_offset = cur_offset + envelope_size;
4440 if 6 > max_ordinal {
4441 return Ok(());
4442 }
4443
4444 let cur_offset: usize = (6 - 1) * envelope_size;
4447
4448 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4450
4451 fidl::encoding::encode_in_envelope_optional::<u8, D>(
4456 self.key_idx.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4457 encoder,
4458 offset + cur_offset,
4459 depth,
4460 )?;
4461
4462 _prev_end_offset = cur_offset + envelope_size;
4463 if 7 > max_ordinal {
4464 return Ok(());
4465 }
4466
4467 let cur_offset: usize = (7 - 1) * envelope_size;
4470
4471 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4473
4474 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
4479 self.key.as_ref().map(
4480 <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
4481 ),
4482 encoder,
4483 offset + cur_offset,
4484 depth,
4485 )?;
4486
4487 _prev_end_offset = cur_offset + envelope_size;
4488 if 8 > max_ordinal {
4489 return Ok(());
4490 }
4491
4492 let cur_offset: usize = (8 - 1) * envelope_size;
4495
4496 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4498
4499 fidl::encoding::encode_in_envelope_optional::<u64, D>(
4504 self.rsc.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4505 encoder,
4506 offset + cur_offset,
4507 depth,
4508 )?;
4509
4510 _prev_end_offset = cur_offset + envelope_size;
4511
4512 Ok(())
4513 }
4514 }
4515
4516 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyConfiguration {
4517 #[inline(always)]
4518 fn new_empty() -> Self {
4519 Self::default()
4520 }
4521
4522 unsafe fn decode(
4523 &mut self,
4524 decoder: &mut fidl::encoding::Decoder<'_, D>,
4525 offset: usize,
4526 mut depth: fidl::encoding::Depth,
4527 ) -> fidl::Result<()> {
4528 decoder.debug_check_bounds::<Self>(offset);
4529 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4530 None => return Err(fidl::Error::NotNullable),
4531 Some(len) => len,
4532 };
4533 if len == 0 {
4535 return Ok(());
4536 };
4537 depth.increment()?;
4538 let envelope_size = 8;
4539 let bytes_len = len * envelope_size;
4540 let offset = decoder.out_of_line_offset(bytes_len)?;
4541 let mut _next_ordinal_to_read = 0;
4543 let mut next_offset = offset;
4544 let end_offset = offset + bytes_len;
4545 _next_ordinal_to_read += 1;
4546 if next_offset >= end_offset {
4547 return Ok(());
4548 }
4549
4550 while _next_ordinal_to_read < 1 {
4552 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4553 _next_ordinal_to_read += 1;
4554 next_offset += envelope_size;
4555 }
4556
4557 let next_out_of_line = decoder.next_out_of_line();
4558 let handles_before = decoder.remaining_handles();
4559 if let Some((inlined, num_bytes, num_handles)) =
4560 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4561 {
4562 let member_inline_size =
4563 <WlanProtection as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4564 if inlined != (member_inline_size <= 4) {
4565 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4566 }
4567 let inner_offset;
4568 let mut inner_depth = depth.clone();
4569 if inlined {
4570 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4571 inner_offset = next_offset;
4572 } else {
4573 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4574 inner_depth.increment()?;
4575 }
4576 let val_ref =
4577 self.protection.get_or_insert_with(|| fidl::new_empty!(WlanProtection, D));
4578 fidl::decode!(WlanProtection, D, val_ref, decoder, inner_offset, inner_depth)?;
4579 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4580 {
4581 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4582 }
4583 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4584 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4585 }
4586 }
4587
4588 next_offset += envelope_size;
4589 _next_ordinal_to_read += 1;
4590 if next_offset >= end_offset {
4591 return Ok(());
4592 }
4593
4594 while _next_ordinal_to_read < 2 {
4596 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4597 _next_ordinal_to_read += 1;
4598 next_offset += envelope_size;
4599 }
4600
4601 let next_out_of_line = decoder.next_out_of_line();
4602 let handles_before = decoder.remaining_handles();
4603 if let Some((inlined, num_bytes, num_handles)) =
4604 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4605 {
4606 let member_inline_size =
4607 <fidl::encoding::Array<u8, 3> as fidl::encoding::TypeMarker>::inline_size(
4608 decoder.context,
4609 );
4610 if inlined != (member_inline_size <= 4) {
4611 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4612 }
4613 let inner_offset;
4614 let mut inner_depth = depth.clone();
4615 if inlined {
4616 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4617 inner_offset = next_offset;
4618 } else {
4619 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4620 inner_depth.increment()?;
4621 }
4622 let val_ref = self
4623 .cipher_oui
4624 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 3>, D));
4625 fidl::decode!(fidl::encoding::Array<u8, 3>, D, val_ref, decoder, inner_offset, inner_depth)?;
4626 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4627 {
4628 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4629 }
4630 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4631 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4632 }
4633 }
4634
4635 next_offset += envelope_size;
4636 _next_ordinal_to_read += 1;
4637 if next_offset >= end_offset {
4638 return Ok(());
4639 }
4640
4641 while _next_ordinal_to_read < 3 {
4643 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4644 _next_ordinal_to_read += 1;
4645 next_offset += envelope_size;
4646 }
4647
4648 let next_out_of_line = decoder.next_out_of_line();
4649 let handles_before = decoder.remaining_handles();
4650 if let Some((inlined, num_bytes, num_handles)) =
4651 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4652 {
4653 let member_inline_size =
4654 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4655 if inlined != (member_inline_size <= 4) {
4656 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4657 }
4658 let inner_offset;
4659 let mut inner_depth = depth.clone();
4660 if inlined {
4661 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4662 inner_offset = next_offset;
4663 } else {
4664 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4665 inner_depth.increment()?;
4666 }
4667 let val_ref = self.cipher_type.get_or_insert_with(|| fidl::new_empty!(u8, D));
4668 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4669 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4670 {
4671 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4672 }
4673 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4674 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4675 }
4676 }
4677
4678 next_offset += envelope_size;
4679 _next_ordinal_to_read += 1;
4680 if next_offset >= end_offset {
4681 return Ok(());
4682 }
4683
4684 while _next_ordinal_to_read < 4 {
4686 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4687 _next_ordinal_to_read += 1;
4688 next_offset += envelope_size;
4689 }
4690
4691 let next_out_of_line = decoder.next_out_of_line();
4692 let handles_before = decoder.remaining_handles();
4693 if let Some((inlined, num_bytes, num_handles)) =
4694 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4695 {
4696 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::KeyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4697 if inlined != (member_inline_size <= 4) {
4698 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4699 }
4700 let inner_offset;
4701 let mut inner_depth = depth.clone();
4702 if inlined {
4703 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4704 inner_offset = next_offset;
4705 } else {
4706 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4707 inner_depth.increment()?;
4708 }
4709 let val_ref = self.key_type.get_or_insert_with(|| {
4710 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::KeyType, D)
4711 });
4712 fidl::decode!(
4713 fidl_fuchsia_wlan_ieee80211__common::KeyType,
4714 D,
4715 val_ref,
4716 decoder,
4717 inner_offset,
4718 inner_depth
4719 )?;
4720 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4721 {
4722 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4723 }
4724 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4725 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4726 }
4727 }
4728
4729 next_offset += envelope_size;
4730 _next_ordinal_to_read += 1;
4731 if next_offset >= end_offset {
4732 return Ok(());
4733 }
4734
4735 while _next_ordinal_to_read < 5 {
4737 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4738 _next_ordinal_to_read += 1;
4739 next_offset += envelope_size;
4740 }
4741
4742 let next_out_of_line = decoder.next_out_of_line();
4743 let handles_before = decoder.remaining_handles();
4744 if let Some((inlined, num_bytes, num_handles)) =
4745 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4746 {
4747 let member_inline_size =
4748 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
4749 decoder.context,
4750 );
4751 if inlined != (member_inline_size <= 4) {
4752 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4753 }
4754 let inner_offset;
4755 let mut inner_depth = depth.clone();
4756 if inlined {
4757 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4758 inner_offset = next_offset;
4759 } else {
4760 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4761 inner_depth.increment()?;
4762 }
4763 let val_ref = self
4764 .peer_addr
4765 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
4766 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
4767 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4768 {
4769 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4770 }
4771 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4772 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4773 }
4774 }
4775
4776 next_offset += envelope_size;
4777 _next_ordinal_to_read += 1;
4778 if next_offset >= end_offset {
4779 return Ok(());
4780 }
4781
4782 while _next_ordinal_to_read < 6 {
4784 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4785 _next_ordinal_to_read += 1;
4786 next_offset += envelope_size;
4787 }
4788
4789 let next_out_of_line = decoder.next_out_of_line();
4790 let handles_before = decoder.remaining_handles();
4791 if let Some((inlined, num_bytes, num_handles)) =
4792 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4793 {
4794 let member_inline_size =
4795 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4796 if inlined != (member_inline_size <= 4) {
4797 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4798 }
4799 let inner_offset;
4800 let mut inner_depth = depth.clone();
4801 if inlined {
4802 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4803 inner_offset = next_offset;
4804 } else {
4805 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4806 inner_depth.increment()?;
4807 }
4808 let val_ref = self.key_idx.get_or_insert_with(|| fidl::new_empty!(u8, D));
4809 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4810 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4811 {
4812 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4813 }
4814 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4815 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4816 }
4817 }
4818
4819 next_offset += envelope_size;
4820 _next_ordinal_to_read += 1;
4821 if next_offset >= end_offset {
4822 return Ok(());
4823 }
4824
4825 while _next_ordinal_to_read < 7 {
4827 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4828 _next_ordinal_to_read += 1;
4829 next_offset += envelope_size;
4830 }
4831
4832 let next_out_of_line = decoder.next_out_of_line();
4833 let handles_before = decoder.remaining_handles();
4834 if let Some((inlined, num_bytes, num_handles)) =
4835 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4836 {
4837 let member_inline_size =
4838 <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
4839 decoder.context,
4840 );
4841 if inlined != (member_inline_size <= 4) {
4842 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4843 }
4844 let inner_offset;
4845 let mut inner_depth = depth.clone();
4846 if inlined {
4847 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4848 inner_offset = next_offset;
4849 } else {
4850 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4851 inner_depth.increment()?;
4852 }
4853 let val_ref = self
4854 .key
4855 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
4856 fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
4857 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4858 {
4859 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4860 }
4861 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4862 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4863 }
4864 }
4865
4866 next_offset += envelope_size;
4867 _next_ordinal_to_read += 1;
4868 if next_offset >= end_offset {
4869 return Ok(());
4870 }
4871
4872 while _next_ordinal_to_read < 8 {
4874 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4875 _next_ordinal_to_read += 1;
4876 next_offset += envelope_size;
4877 }
4878
4879 let next_out_of_line = decoder.next_out_of_line();
4880 let handles_before = decoder.remaining_handles();
4881 if let Some((inlined, num_bytes, num_handles)) =
4882 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4883 {
4884 let member_inline_size =
4885 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4886 if inlined != (member_inline_size <= 4) {
4887 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4888 }
4889 let inner_offset;
4890 let mut inner_depth = depth.clone();
4891 if inlined {
4892 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4893 inner_offset = next_offset;
4894 } else {
4895 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4896 inner_depth.increment()?;
4897 }
4898 let val_ref = self.rsc.get_or_insert_with(|| fidl::new_empty!(u64, D));
4899 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4900 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4901 {
4902 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4903 }
4904 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4905 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4906 }
4907 }
4908
4909 next_offset += envelope_size;
4910
4911 while next_offset < end_offset {
4913 _next_ordinal_to_read += 1;
4914 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4915 next_offset += envelope_size;
4916 }
4917
4918 Ok(())
4919 }
4920 }
4921
4922 impl WlanRxTransferRequest {
4923 #[inline(always)]
4924 fn max_ordinal_present(&self) -> u64 {
4925 if let Some(_) = self.arena {
4926 return 5;
4927 }
4928 if let Some(_) = self.async_id {
4929 return 4;
4930 }
4931 if let Some(_) = self.packet_info {
4932 return 3;
4933 }
4934 if let Some(_) = self.packet_size {
4935 return 2;
4936 }
4937 if let Some(_) = self.packet_address {
4938 return 1;
4939 }
4940 0
4941 }
4942 }
4943
4944 impl fidl::encoding::ValueTypeMarker for WlanRxTransferRequest {
4945 type Borrowed<'a> = &'a Self;
4946 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4947 value
4948 }
4949 }
4950
4951 unsafe impl fidl::encoding::TypeMarker for WlanRxTransferRequest {
4952 type Owned = Self;
4953
4954 #[inline(always)]
4955 fn inline_align(_context: fidl::encoding::Context) -> usize {
4956 8
4957 }
4958
4959 #[inline(always)]
4960 fn inline_size(_context: fidl::encoding::Context) -> usize {
4961 16
4962 }
4963 }
4964
4965 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxTransferRequest, D>
4966 for &WlanRxTransferRequest
4967 {
4968 unsafe fn encode(
4969 self,
4970 encoder: &mut fidl::encoding::Encoder<'_, D>,
4971 offset: usize,
4972 mut depth: fidl::encoding::Depth,
4973 ) -> fidl::Result<()> {
4974 encoder.debug_check_bounds::<WlanRxTransferRequest>(offset);
4975 let max_ordinal: u64 = self.max_ordinal_present();
4977 encoder.write_num(max_ordinal, offset);
4978 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4979 if max_ordinal == 0 {
4981 return Ok(());
4982 }
4983 depth.increment()?;
4984 let envelope_size = 8;
4985 let bytes_len = max_ordinal as usize * envelope_size;
4986 #[allow(unused_variables)]
4987 let offset = encoder.out_of_line_offset(bytes_len);
4988 let mut _prev_end_offset: usize = 0;
4989 if 1 > max_ordinal {
4990 return Ok(());
4991 }
4992
4993 let cur_offset: usize = (1 - 1) * envelope_size;
4996
4997 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4999
5000 fidl::encoding::encode_in_envelope_optional::<u64, D>(
5005 self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5006 encoder,
5007 offset + cur_offset,
5008 depth,
5009 )?;
5010
5011 _prev_end_offset = cur_offset + envelope_size;
5012 if 2 > max_ordinal {
5013 return Ok(());
5014 }
5015
5016 let cur_offset: usize = (2 - 1) * envelope_size;
5019
5020 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5022
5023 fidl::encoding::encode_in_envelope_optional::<u64, D>(
5028 self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5029 encoder,
5030 offset + cur_offset,
5031 depth,
5032 )?;
5033
5034 _prev_end_offset = cur_offset + envelope_size;
5035 if 3 > max_ordinal {
5036 return Ok(());
5037 }
5038
5039 let cur_offset: usize = (3 - 1) * envelope_size;
5042
5043 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5045
5046 fidl::encoding::encode_in_envelope_optional::<WlanRxInfo, D>(
5051 self.packet_info
5052 .as_ref()
5053 .map(<WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow),
5054 encoder,
5055 offset + cur_offset,
5056 depth,
5057 )?;
5058
5059 _prev_end_offset = cur_offset + envelope_size;
5060 if 4 > max_ordinal {
5061 return Ok(());
5062 }
5063
5064 let cur_offset: usize = (4 - 1) * envelope_size;
5067
5068 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5070
5071 fidl::encoding::encode_in_envelope_optional::<u64, D>(
5076 self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5077 encoder,
5078 offset + cur_offset,
5079 depth,
5080 )?;
5081
5082 _prev_end_offset = cur_offset + envelope_size;
5083 if 5 > max_ordinal {
5084 return Ok(());
5085 }
5086
5087 let cur_offset: usize = (5 - 1) * envelope_size;
5090
5091 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5093
5094 fidl::encoding::encode_in_envelope_optional::<u64, D>(
5099 self.arena.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5100 encoder,
5101 offset + cur_offset,
5102 depth,
5103 )?;
5104
5105 _prev_end_offset = cur_offset + envelope_size;
5106
5107 Ok(())
5108 }
5109 }
5110
5111 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxTransferRequest {
5112 #[inline(always)]
5113 fn new_empty() -> Self {
5114 Self::default()
5115 }
5116
5117 unsafe fn decode(
5118 &mut self,
5119 decoder: &mut fidl::encoding::Decoder<'_, D>,
5120 offset: usize,
5121 mut depth: fidl::encoding::Depth,
5122 ) -> fidl::Result<()> {
5123 decoder.debug_check_bounds::<Self>(offset);
5124 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5125 None => return Err(fidl::Error::NotNullable),
5126 Some(len) => len,
5127 };
5128 if len == 0 {
5130 return Ok(());
5131 };
5132 depth.increment()?;
5133 let envelope_size = 8;
5134 let bytes_len = len * envelope_size;
5135 let offset = decoder.out_of_line_offset(bytes_len)?;
5136 let mut _next_ordinal_to_read = 0;
5138 let mut next_offset = offset;
5139 let end_offset = offset + bytes_len;
5140 _next_ordinal_to_read += 1;
5141 if next_offset >= end_offset {
5142 return Ok(());
5143 }
5144
5145 while _next_ordinal_to_read < 1 {
5147 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5148 _next_ordinal_to_read += 1;
5149 next_offset += envelope_size;
5150 }
5151
5152 let next_out_of_line = decoder.next_out_of_line();
5153 let handles_before = decoder.remaining_handles();
5154 if let Some((inlined, num_bytes, num_handles)) =
5155 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5156 {
5157 let member_inline_size =
5158 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5159 if inlined != (member_inline_size <= 4) {
5160 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5161 }
5162 let inner_offset;
5163 let mut inner_depth = depth.clone();
5164 if inlined {
5165 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5166 inner_offset = next_offset;
5167 } else {
5168 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5169 inner_depth.increment()?;
5170 }
5171 let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
5172 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5173 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5174 {
5175 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5176 }
5177 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5178 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5179 }
5180 }
5181
5182 next_offset += envelope_size;
5183 _next_ordinal_to_read += 1;
5184 if next_offset >= end_offset {
5185 return Ok(());
5186 }
5187
5188 while _next_ordinal_to_read < 2 {
5190 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5191 _next_ordinal_to_read += 1;
5192 next_offset += envelope_size;
5193 }
5194
5195 let next_out_of_line = decoder.next_out_of_line();
5196 let handles_before = decoder.remaining_handles();
5197 if let Some((inlined, num_bytes, num_handles)) =
5198 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5199 {
5200 let member_inline_size =
5201 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5202 if inlined != (member_inline_size <= 4) {
5203 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5204 }
5205 let inner_offset;
5206 let mut inner_depth = depth.clone();
5207 if inlined {
5208 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5209 inner_offset = next_offset;
5210 } else {
5211 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5212 inner_depth.increment()?;
5213 }
5214 let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
5215 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5216 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5217 {
5218 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5219 }
5220 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5221 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5222 }
5223 }
5224
5225 next_offset += envelope_size;
5226 _next_ordinal_to_read += 1;
5227 if next_offset >= end_offset {
5228 return Ok(());
5229 }
5230
5231 while _next_ordinal_to_read < 3 {
5233 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5234 _next_ordinal_to_read += 1;
5235 next_offset += envelope_size;
5236 }
5237
5238 let next_out_of_line = decoder.next_out_of_line();
5239 let handles_before = decoder.remaining_handles();
5240 if let Some((inlined, num_bytes, num_handles)) =
5241 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5242 {
5243 let member_inline_size =
5244 <WlanRxInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5245 if inlined != (member_inline_size <= 4) {
5246 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5247 }
5248 let inner_offset;
5249 let mut inner_depth = depth.clone();
5250 if inlined {
5251 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5252 inner_offset = next_offset;
5253 } else {
5254 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5255 inner_depth.increment()?;
5256 }
5257 let val_ref =
5258 self.packet_info.get_or_insert_with(|| fidl::new_empty!(WlanRxInfo, D));
5259 fidl::decode!(WlanRxInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
5260 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5261 {
5262 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5263 }
5264 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5265 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5266 }
5267 }
5268
5269 next_offset += envelope_size;
5270 _next_ordinal_to_read += 1;
5271 if next_offset >= end_offset {
5272 return Ok(());
5273 }
5274
5275 while _next_ordinal_to_read < 4 {
5277 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5278 _next_ordinal_to_read += 1;
5279 next_offset += envelope_size;
5280 }
5281
5282 let next_out_of_line = decoder.next_out_of_line();
5283 let handles_before = decoder.remaining_handles();
5284 if let Some((inlined, num_bytes, num_handles)) =
5285 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5286 {
5287 let member_inline_size =
5288 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5289 if inlined != (member_inline_size <= 4) {
5290 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5291 }
5292 let inner_offset;
5293 let mut inner_depth = depth.clone();
5294 if inlined {
5295 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5296 inner_offset = next_offset;
5297 } else {
5298 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5299 inner_depth.increment()?;
5300 }
5301 let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
5302 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5303 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5304 {
5305 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5306 }
5307 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5308 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5309 }
5310 }
5311
5312 next_offset += envelope_size;
5313 _next_ordinal_to_read += 1;
5314 if next_offset >= end_offset {
5315 return Ok(());
5316 }
5317
5318 while _next_ordinal_to_read < 5 {
5320 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5321 _next_ordinal_to_read += 1;
5322 next_offset += envelope_size;
5323 }
5324
5325 let next_out_of_line = decoder.next_out_of_line();
5326 let handles_before = decoder.remaining_handles();
5327 if let Some((inlined, num_bytes, num_handles)) =
5328 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5329 {
5330 let member_inline_size =
5331 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5332 if inlined != (member_inline_size <= 4) {
5333 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5334 }
5335 let inner_offset;
5336 let mut inner_depth = depth.clone();
5337 if inlined {
5338 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5339 inner_offset = next_offset;
5340 } else {
5341 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5342 inner_depth.increment()?;
5343 }
5344 let val_ref = self.arena.get_or_insert_with(|| fidl::new_empty!(u64, D));
5345 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5346 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5347 {
5348 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5349 }
5350 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5351 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5352 }
5353 }
5354
5355 next_offset += envelope_size;
5356
5357 while next_offset < end_offset {
5359 _next_ordinal_to_read += 1;
5360 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5361 next_offset += envelope_size;
5362 }
5363
5364 Ok(())
5365 }
5366 }
5367
5368 impl WlanSoftmacBandCapability {
5369 #[inline(always)]
5370 fn max_ordinal_present(&self) -> u64 {
5371 if let Some(_) = self.operating_channels {
5372 return 11;
5373 }
5374 if let Some(_) = self.basic_rates {
5375 return 10;
5376 }
5377 if let Some(_) = self.operating_channel_list {
5378 return 9;
5379 }
5380 if let Some(_) = self.operating_channel_count {
5381 return 8;
5382 }
5383 if let Some(_) = self.vht_caps {
5384 return 7;
5385 }
5386 if let Some(_) = self.vht_supported {
5387 return 6;
5388 }
5389 if let Some(_) = self.ht_caps {
5390 return 5;
5391 }
5392 if let Some(_) = self.ht_supported {
5393 return 4;
5394 }
5395 if let Some(_) = self.basic_rate_list {
5396 return 3;
5397 }
5398 if let Some(_) = self.basic_rate_count {
5399 return 2;
5400 }
5401 if let Some(_) = self.band {
5402 return 1;
5403 }
5404 0
5405 }
5406 }
5407
5408 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBandCapability {
5409 type Borrowed<'a> = &'a Self;
5410 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5411 value
5412 }
5413 }
5414
5415 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBandCapability {
5416 type Owned = Self;
5417
5418 #[inline(always)]
5419 fn inline_align(_context: fidl::encoding::Context) -> usize {
5420 8
5421 }
5422
5423 #[inline(always)]
5424 fn inline_size(_context: fidl::encoding::Context) -> usize {
5425 16
5426 }
5427 }
5428
5429 unsafe impl<D: fidl::encoding::ResourceDialect>
5430 fidl::encoding::Encode<WlanSoftmacBandCapability, D> for &WlanSoftmacBandCapability
5431 {
5432 unsafe fn encode(
5433 self,
5434 encoder: &mut fidl::encoding::Encoder<'_, D>,
5435 offset: usize,
5436 mut depth: fidl::encoding::Depth,
5437 ) -> fidl::Result<()> {
5438 encoder.debug_check_bounds::<WlanSoftmacBandCapability>(offset);
5439 let max_ordinal: u64 = self.max_ordinal_present();
5441 encoder.write_num(max_ordinal, offset);
5442 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5443 if max_ordinal == 0 {
5445 return Ok(());
5446 }
5447 depth.increment()?;
5448 let envelope_size = 8;
5449 let bytes_len = max_ordinal as usize * envelope_size;
5450 #[allow(unused_variables)]
5451 let offset = encoder.out_of_line_offset(bytes_len);
5452 let mut _prev_end_offset: usize = 0;
5453 if 1 > max_ordinal {
5454 return Ok(());
5455 }
5456
5457 let cur_offset: usize = (1 - 1) * envelope_size;
5460
5461 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5463
5464 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanBand, D>(
5469 self.band.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanBand as fidl::encoding::ValueTypeMarker>::borrow),
5470 encoder, offset + cur_offset, depth
5471 )?;
5472
5473 _prev_end_offset = cur_offset + envelope_size;
5474 if 2 > max_ordinal {
5475 return Ok(());
5476 }
5477
5478 let cur_offset: usize = (2 - 1) * envelope_size;
5481
5482 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5484
5485 fidl::encoding::encode_in_envelope_optional::<u8, D>(
5490 self.basic_rate_count.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
5491 encoder,
5492 offset + cur_offset,
5493 depth,
5494 )?;
5495
5496 _prev_end_offset = cur_offset + envelope_size;
5497 if 3 > max_ordinal {
5498 return Ok(());
5499 }
5500
5501 let cur_offset: usize = (3 - 1) * envelope_size;
5504
5505 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5507
5508 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 12>, D>(
5513 self.basic_rate_list.as_ref().map(
5514 <fidl::encoding::Array<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
5515 ),
5516 encoder,
5517 offset + cur_offset,
5518 depth,
5519 )?;
5520
5521 _prev_end_offset = cur_offset + envelope_size;
5522 if 4 > max_ordinal {
5523 return Ok(());
5524 }
5525
5526 let cur_offset: usize = (4 - 1) * envelope_size;
5529
5530 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5532
5533 fidl::encoding::encode_in_envelope_optional::<bool, D>(
5538 self.ht_supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5539 encoder,
5540 offset + cur_offset,
5541 depth,
5542 )?;
5543
5544 _prev_end_offset = cur_offset + envelope_size;
5545 if 5 > max_ordinal {
5546 return Ok(());
5547 }
5548
5549 let cur_offset: usize = (5 - 1) * envelope_size;
5552
5553 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5555
5556 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D>(
5561 self.ht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
5562 encoder, offset + cur_offset, depth
5563 )?;
5564
5565 _prev_end_offset = cur_offset + envelope_size;
5566 if 6 > max_ordinal {
5567 return Ok(());
5568 }
5569
5570 let cur_offset: usize = (6 - 1) * envelope_size;
5573
5574 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5576
5577 fidl::encoding::encode_in_envelope_optional::<bool, D>(
5582 self.vht_supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5583 encoder,
5584 offset + cur_offset,
5585 depth,
5586 )?;
5587
5588 _prev_end_offset = cur_offset + envelope_size;
5589 if 7 > max_ordinal {
5590 return Ok(());
5591 }
5592
5593 let cur_offset: usize = (7 - 1) * envelope_size;
5596
5597 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5599
5600 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D>(
5605 self.vht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
5606 encoder, offset + cur_offset, depth
5607 )?;
5608
5609 _prev_end_offset = cur_offset + envelope_size;
5610 if 8 > max_ordinal {
5611 return Ok(());
5612 }
5613
5614 let cur_offset: usize = (8 - 1) * envelope_size;
5617
5618 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5620
5621 fidl::encoding::encode_in_envelope_optional::<u16, D>(
5626 self.operating_channel_count
5627 .as_ref()
5628 .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
5629 encoder,
5630 offset + cur_offset,
5631 depth,
5632 )?;
5633
5634 _prev_end_offset = cur_offset + envelope_size;
5635 if 9 > max_ordinal {
5636 return Ok(());
5637 }
5638
5639 let cur_offset: usize = (9 - 1) * envelope_size;
5642
5643 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5645
5646 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 256>, D>(
5651 self.operating_channel_list.as_ref().map(
5652 <fidl::encoding::Array<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
5653 ),
5654 encoder,
5655 offset + cur_offset,
5656 depth,
5657 )?;
5658
5659 _prev_end_offset = cur_offset + envelope_size;
5660 if 10 > max_ordinal {
5661 return Ok(());
5662 }
5663
5664 let cur_offset: usize = (10 - 1) * envelope_size;
5667
5668 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5670
5671 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 12>, D>(
5676 self.basic_rates.as_ref().map(
5677 <fidl::encoding::Vector<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
5678 ),
5679 encoder,
5680 offset + cur_offset,
5681 depth,
5682 )?;
5683
5684 _prev_end_offset = cur_offset + envelope_size;
5685 if 11 > max_ordinal {
5686 return Ok(());
5687 }
5688
5689 let cur_offset: usize = (11 - 1) * envelope_size;
5692
5693 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5695
5696 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
5701 self.operating_channels.as_ref().map(
5702 <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
5703 ),
5704 encoder,
5705 offset + cur_offset,
5706 depth,
5707 )?;
5708
5709 _prev_end_offset = cur_offset + envelope_size;
5710
5711 Ok(())
5712 }
5713 }
5714
5715 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5716 for WlanSoftmacBandCapability
5717 {
5718 #[inline(always)]
5719 fn new_empty() -> Self {
5720 Self::default()
5721 }
5722
5723 unsafe fn decode(
5724 &mut self,
5725 decoder: &mut fidl::encoding::Decoder<'_, D>,
5726 offset: usize,
5727 mut depth: fidl::encoding::Depth,
5728 ) -> fidl::Result<()> {
5729 decoder.debug_check_bounds::<Self>(offset);
5730 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5731 None => return Err(fidl::Error::NotNullable),
5732 Some(len) => len,
5733 };
5734 if len == 0 {
5736 return Ok(());
5737 };
5738 depth.increment()?;
5739 let envelope_size = 8;
5740 let bytes_len = len * envelope_size;
5741 let offset = decoder.out_of_line_offset(bytes_len)?;
5742 let mut _next_ordinal_to_read = 0;
5744 let mut next_offset = offset;
5745 let end_offset = offset + bytes_len;
5746 _next_ordinal_to_read += 1;
5747 if next_offset >= end_offset {
5748 return Ok(());
5749 }
5750
5751 while _next_ordinal_to_read < 1 {
5753 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5754 _next_ordinal_to_read += 1;
5755 next_offset += envelope_size;
5756 }
5757
5758 let next_out_of_line = decoder.next_out_of_line();
5759 let handles_before = decoder.remaining_handles();
5760 if let Some((inlined, num_bytes, num_handles)) =
5761 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5762 {
5763 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanBand as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5764 if inlined != (member_inline_size <= 4) {
5765 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5766 }
5767 let inner_offset;
5768 let mut inner_depth = depth.clone();
5769 if inlined {
5770 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5771 inner_offset = next_offset;
5772 } else {
5773 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5774 inner_depth.increment()?;
5775 }
5776 let val_ref = self.band.get_or_insert_with(|| {
5777 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanBand, D)
5778 });
5779 fidl::decode!(
5780 fidl_fuchsia_wlan_ieee80211__common::WlanBand,
5781 D,
5782 val_ref,
5783 decoder,
5784 inner_offset,
5785 inner_depth
5786 )?;
5787 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5788 {
5789 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5790 }
5791 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5792 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5793 }
5794 }
5795
5796 next_offset += envelope_size;
5797 _next_ordinal_to_read += 1;
5798 if next_offset >= end_offset {
5799 return Ok(());
5800 }
5801
5802 while _next_ordinal_to_read < 2 {
5804 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5805 _next_ordinal_to_read += 1;
5806 next_offset += envelope_size;
5807 }
5808
5809 let next_out_of_line = decoder.next_out_of_line();
5810 let handles_before = decoder.remaining_handles();
5811 if let Some((inlined, num_bytes, num_handles)) =
5812 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5813 {
5814 let member_inline_size =
5815 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5816 if inlined != (member_inline_size <= 4) {
5817 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5818 }
5819 let inner_offset;
5820 let mut inner_depth = depth.clone();
5821 if inlined {
5822 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5823 inner_offset = next_offset;
5824 } else {
5825 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5826 inner_depth.increment()?;
5827 }
5828 let val_ref = self.basic_rate_count.get_or_insert_with(|| fidl::new_empty!(u8, D));
5829 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
5830 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5831 {
5832 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5833 }
5834 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5835 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5836 }
5837 }
5838
5839 next_offset += envelope_size;
5840 _next_ordinal_to_read += 1;
5841 if next_offset >= end_offset {
5842 return Ok(());
5843 }
5844
5845 while _next_ordinal_to_read < 3 {
5847 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5848 _next_ordinal_to_read += 1;
5849 next_offset += envelope_size;
5850 }
5851
5852 let next_out_of_line = decoder.next_out_of_line();
5853 let handles_before = decoder.remaining_handles();
5854 if let Some((inlined, num_bytes, num_handles)) =
5855 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5856 {
5857 let member_inline_size =
5858 <fidl::encoding::Array<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
5859 decoder.context,
5860 );
5861 if inlined != (member_inline_size <= 4) {
5862 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5863 }
5864 let inner_offset;
5865 let mut inner_depth = depth.clone();
5866 if inlined {
5867 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5868 inner_offset = next_offset;
5869 } else {
5870 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5871 inner_depth.increment()?;
5872 }
5873 let val_ref = self
5874 .basic_rate_list
5875 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 12>, D));
5876 fidl::decode!(fidl::encoding::Array<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
5877 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5878 {
5879 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5880 }
5881 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5882 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5883 }
5884 }
5885
5886 next_offset += envelope_size;
5887 _next_ordinal_to_read += 1;
5888 if next_offset >= end_offset {
5889 return Ok(());
5890 }
5891
5892 while _next_ordinal_to_read < 4 {
5894 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5895 _next_ordinal_to_read += 1;
5896 next_offset += envelope_size;
5897 }
5898
5899 let next_out_of_line = decoder.next_out_of_line();
5900 let handles_before = decoder.remaining_handles();
5901 if let Some((inlined, num_bytes, num_handles)) =
5902 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5903 {
5904 let member_inline_size =
5905 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5906 if inlined != (member_inline_size <= 4) {
5907 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5908 }
5909 let inner_offset;
5910 let mut inner_depth = depth.clone();
5911 if inlined {
5912 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5913 inner_offset = next_offset;
5914 } else {
5915 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5916 inner_depth.increment()?;
5917 }
5918 let val_ref = self.ht_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
5919 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
5920 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5921 {
5922 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5923 }
5924 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5925 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5926 }
5927 }
5928
5929 next_offset += envelope_size;
5930 _next_ordinal_to_read += 1;
5931 if next_offset >= end_offset {
5932 return Ok(());
5933 }
5934
5935 while _next_ordinal_to_read < 5 {
5937 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5938 _next_ordinal_to_read += 1;
5939 next_offset += envelope_size;
5940 }
5941
5942 let next_out_of_line = decoder.next_out_of_line();
5943 let handles_before = decoder.remaining_handles();
5944 if let Some((inlined, num_bytes, num_handles)) =
5945 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5946 {
5947 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5948 if inlined != (member_inline_size <= 4) {
5949 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5950 }
5951 let inner_offset;
5952 let mut inner_depth = depth.clone();
5953 if inlined {
5954 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5955 inner_offset = next_offset;
5956 } else {
5957 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5958 inner_depth.increment()?;
5959 }
5960 let val_ref = self.ht_caps.get_or_insert_with(|| {
5961 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D)
5962 });
5963 fidl::decode!(
5964 fidl_fuchsia_wlan_ieee80211__common::HtCapabilities,
5965 D,
5966 val_ref,
5967 decoder,
5968 inner_offset,
5969 inner_depth
5970 )?;
5971 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5972 {
5973 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5974 }
5975 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5976 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5977 }
5978 }
5979
5980 next_offset += envelope_size;
5981 _next_ordinal_to_read += 1;
5982 if next_offset >= end_offset {
5983 return Ok(());
5984 }
5985
5986 while _next_ordinal_to_read < 6 {
5988 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5989 _next_ordinal_to_read += 1;
5990 next_offset += envelope_size;
5991 }
5992
5993 let next_out_of_line = decoder.next_out_of_line();
5994 let handles_before = decoder.remaining_handles();
5995 if let Some((inlined, num_bytes, num_handles)) =
5996 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5997 {
5998 let member_inline_size =
5999 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6000 if inlined != (member_inline_size <= 4) {
6001 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6002 }
6003 let inner_offset;
6004 let mut inner_depth = depth.clone();
6005 if inlined {
6006 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6007 inner_offset = next_offset;
6008 } else {
6009 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6010 inner_depth.increment()?;
6011 }
6012 let val_ref = self.vht_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
6013 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6014 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6015 {
6016 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6017 }
6018 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6019 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6020 }
6021 }
6022
6023 next_offset += envelope_size;
6024 _next_ordinal_to_read += 1;
6025 if next_offset >= end_offset {
6026 return Ok(());
6027 }
6028
6029 while _next_ordinal_to_read < 7 {
6031 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6032 _next_ordinal_to_read += 1;
6033 next_offset += envelope_size;
6034 }
6035
6036 let next_out_of_line = decoder.next_out_of_line();
6037 let handles_before = decoder.remaining_handles();
6038 if let Some((inlined, num_bytes, num_handles)) =
6039 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6040 {
6041 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6042 if inlined != (member_inline_size <= 4) {
6043 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6044 }
6045 let inner_offset;
6046 let mut inner_depth = depth.clone();
6047 if inlined {
6048 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6049 inner_offset = next_offset;
6050 } else {
6051 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6052 inner_depth.increment()?;
6053 }
6054 let val_ref = self.vht_caps.get_or_insert_with(|| {
6055 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D)
6056 });
6057 fidl::decode!(
6058 fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities,
6059 D,
6060 val_ref,
6061 decoder,
6062 inner_offset,
6063 inner_depth
6064 )?;
6065 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6066 {
6067 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6068 }
6069 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6070 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6071 }
6072 }
6073
6074 next_offset += envelope_size;
6075 _next_ordinal_to_read += 1;
6076 if next_offset >= end_offset {
6077 return Ok(());
6078 }
6079
6080 while _next_ordinal_to_read < 8 {
6082 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6083 _next_ordinal_to_read += 1;
6084 next_offset += envelope_size;
6085 }
6086
6087 let next_out_of_line = decoder.next_out_of_line();
6088 let handles_before = decoder.remaining_handles();
6089 if let Some((inlined, num_bytes, num_handles)) =
6090 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6091 {
6092 let member_inline_size =
6093 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6094 if inlined != (member_inline_size <= 4) {
6095 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6096 }
6097 let inner_offset;
6098 let mut inner_depth = depth.clone();
6099 if inlined {
6100 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6101 inner_offset = next_offset;
6102 } else {
6103 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6104 inner_depth.increment()?;
6105 }
6106 let val_ref =
6107 self.operating_channel_count.get_or_insert_with(|| fidl::new_empty!(u16, D));
6108 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
6109 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6110 {
6111 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6112 }
6113 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6114 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6115 }
6116 }
6117
6118 next_offset += envelope_size;
6119 _next_ordinal_to_read += 1;
6120 if next_offset >= end_offset {
6121 return Ok(());
6122 }
6123
6124 while _next_ordinal_to_read < 9 {
6126 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6127 _next_ordinal_to_read += 1;
6128 next_offset += envelope_size;
6129 }
6130
6131 let next_out_of_line = decoder.next_out_of_line();
6132 let handles_before = decoder.remaining_handles();
6133 if let Some((inlined, num_bytes, num_handles)) =
6134 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6135 {
6136 let member_inline_size =
6137 <fidl::encoding::Array<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
6138 decoder.context,
6139 );
6140 if inlined != (member_inline_size <= 4) {
6141 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6142 }
6143 let inner_offset;
6144 let mut inner_depth = depth.clone();
6145 if inlined {
6146 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6147 inner_offset = next_offset;
6148 } else {
6149 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6150 inner_depth.increment()?;
6151 }
6152 let val_ref = self
6153 .operating_channel_list
6154 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 256>, D));
6155 fidl::decode!(fidl::encoding::Array<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
6156 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6157 {
6158 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6159 }
6160 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6161 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6162 }
6163 }
6164
6165 next_offset += envelope_size;
6166 _next_ordinal_to_read += 1;
6167 if next_offset >= end_offset {
6168 return Ok(());
6169 }
6170
6171 while _next_ordinal_to_read < 10 {
6173 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6174 _next_ordinal_to_read += 1;
6175 next_offset += envelope_size;
6176 }
6177
6178 let next_out_of_line = decoder.next_out_of_line();
6179 let handles_before = decoder.remaining_handles();
6180 if let Some((inlined, num_bytes, num_handles)) =
6181 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6182 {
6183 let member_inline_size =
6184 <fidl::encoding::Vector<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
6185 decoder.context,
6186 );
6187 if inlined != (member_inline_size <= 4) {
6188 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6189 }
6190 let inner_offset;
6191 let mut inner_depth = depth.clone();
6192 if inlined {
6193 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6194 inner_offset = next_offset;
6195 } else {
6196 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6197 inner_depth.increment()?;
6198 }
6199 let val_ref = self
6200 .basic_rates
6201 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 12>, D));
6202 fidl::decode!(fidl::encoding::Vector<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
6203 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6204 {
6205 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6206 }
6207 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6208 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6209 }
6210 }
6211
6212 next_offset += envelope_size;
6213 _next_ordinal_to_read += 1;
6214 if next_offset >= end_offset {
6215 return Ok(());
6216 }
6217
6218 while _next_ordinal_to_read < 11 {
6220 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6221 _next_ordinal_to_read += 1;
6222 next_offset += envelope_size;
6223 }
6224
6225 let next_out_of_line = decoder.next_out_of_line();
6226 let handles_before = decoder.remaining_handles();
6227 if let Some((inlined, num_bytes, num_handles)) =
6228 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6229 {
6230 let member_inline_size =
6231 <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
6232 decoder.context,
6233 );
6234 if inlined != (member_inline_size <= 4) {
6235 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6236 }
6237 let inner_offset;
6238 let mut inner_depth = depth.clone();
6239 if inlined {
6240 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6241 inner_offset = next_offset;
6242 } else {
6243 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6244 inner_depth.increment()?;
6245 }
6246 let val_ref = self
6247 .operating_channels
6248 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
6249 fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
6250 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6251 {
6252 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6253 }
6254 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6255 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6256 }
6257 }
6258
6259 next_offset += envelope_size;
6260
6261 while next_offset < end_offset {
6263 _next_ordinal_to_read += 1;
6264 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6265 next_offset += envelope_size;
6266 }
6267
6268 Ok(())
6269 }
6270 }
6271
6272 impl WlanSoftmacBaseCancelScanRequest {
6273 #[inline(always)]
6274 fn max_ordinal_present(&self) -> u64 {
6275 if let Some(_) = self.scan_id {
6276 return 1;
6277 }
6278 0
6279 }
6280 }
6281
6282 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseCancelScanRequest {
6283 type Borrowed<'a> = &'a Self;
6284 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6285 value
6286 }
6287 }
6288
6289 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseCancelScanRequest {
6290 type Owned = Self;
6291
6292 #[inline(always)]
6293 fn inline_align(_context: fidl::encoding::Context) -> usize {
6294 8
6295 }
6296
6297 #[inline(always)]
6298 fn inline_size(_context: fidl::encoding::Context) -> usize {
6299 16
6300 }
6301 }
6302
6303 unsafe impl<D: fidl::encoding::ResourceDialect>
6304 fidl::encoding::Encode<WlanSoftmacBaseCancelScanRequest, D>
6305 for &WlanSoftmacBaseCancelScanRequest
6306 {
6307 unsafe fn encode(
6308 self,
6309 encoder: &mut fidl::encoding::Encoder<'_, D>,
6310 offset: usize,
6311 mut depth: fidl::encoding::Depth,
6312 ) -> fidl::Result<()> {
6313 encoder.debug_check_bounds::<WlanSoftmacBaseCancelScanRequest>(offset);
6314 let max_ordinal: u64 = self.max_ordinal_present();
6316 encoder.write_num(max_ordinal, offset);
6317 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6318 if max_ordinal == 0 {
6320 return Ok(());
6321 }
6322 depth.increment()?;
6323 let envelope_size = 8;
6324 let bytes_len = max_ordinal as usize * envelope_size;
6325 #[allow(unused_variables)]
6326 let offset = encoder.out_of_line_offset(bytes_len);
6327 let mut _prev_end_offset: usize = 0;
6328 if 1 > max_ordinal {
6329 return Ok(());
6330 }
6331
6332 let cur_offset: usize = (1 - 1) * envelope_size;
6335
6336 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6338
6339 fidl::encoding::encode_in_envelope_optional::<u64, D>(
6344 self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
6345 encoder,
6346 offset + cur_offset,
6347 depth,
6348 )?;
6349
6350 _prev_end_offset = cur_offset + envelope_size;
6351
6352 Ok(())
6353 }
6354 }
6355
6356 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6357 for WlanSoftmacBaseCancelScanRequest
6358 {
6359 #[inline(always)]
6360 fn new_empty() -> Self {
6361 Self::default()
6362 }
6363
6364 unsafe fn decode(
6365 &mut self,
6366 decoder: &mut fidl::encoding::Decoder<'_, D>,
6367 offset: usize,
6368 mut depth: fidl::encoding::Depth,
6369 ) -> fidl::Result<()> {
6370 decoder.debug_check_bounds::<Self>(offset);
6371 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6372 None => return Err(fidl::Error::NotNullable),
6373 Some(len) => len,
6374 };
6375 if len == 0 {
6377 return Ok(());
6378 };
6379 depth.increment()?;
6380 let envelope_size = 8;
6381 let bytes_len = len * envelope_size;
6382 let offset = decoder.out_of_line_offset(bytes_len)?;
6383 let mut _next_ordinal_to_read = 0;
6385 let mut next_offset = offset;
6386 let end_offset = offset + bytes_len;
6387 _next_ordinal_to_read += 1;
6388 if next_offset >= end_offset {
6389 return Ok(());
6390 }
6391
6392 while _next_ordinal_to_read < 1 {
6394 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6395 _next_ordinal_to_read += 1;
6396 next_offset += envelope_size;
6397 }
6398
6399 let next_out_of_line = decoder.next_out_of_line();
6400 let handles_before = decoder.remaining_handles();
6401 if let Some((inlined, num_bytes, num_handles)) =
6402 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6403 {
6404 let member_inline_size =
6405 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6406 if inlined != (member_inline_size <= 4) {
6407 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6408 }
6409 let inner_offset;
6410 let mut inner_depth = depth.clone();
6411 if inlined {
6412 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6413 inner_offset = next_offset;
6414 } else {
6415 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6416 inner_depth.increment()?;
6417 }
6418 let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
6419 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
6420 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6421 {
6422 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6423 }
6424 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6425 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6426 }
6427 }
6428
6429 next_offset += envelope_size;
6430
6431 while next_offset < end_offset {
6433 _next_ordinal_to_read += 1;
6434 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6435 next_offset += envelope_size;
6436 }
6437
6438 Ok(())
6439 }
6440 }
6441
6442 impl WlanSoftmacBaseClearAssociationRequest {
6443 #[inline(always)]
6444 fn max_ordinal_present(&self) -> u64 {
6445 if let Some(_) = self.peer_addr {
6446 return 1;
6447 }
6448 0
6449 }
6450 }
6451
6452 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseClearAssociationRequest {
6453 type Borrowed<'a> = &'a Self;
6454 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6455 value
6456 }
6457 }
6458
6459 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseClearAssociationRequest {
6460 type Owned = Self;
6461
6462 #[inline(always)]
6463 fn inline_align(_context: fidl::encoding::Context) -> usize {
6464 8
6465 }
6466
6467 #[inline(always)]
6468 fn inline_size(_context: fidl::encoding::Context) -> usize {
6469 16
6470 }
6471 }
6472
6473 unsafe impl<D: fidl::encoding::ResourceDialect>
6474 fidl::encoding::Encode<WlanSoftmacBaseClearAssociationRequest, D>
6475 for &WlanSoftmacBaseClearAssociationRequest
6476 {
6477 unsafe fn encode(
6478 self,
6479 encoder: &mut fidl::encoding::Encoder<'_, D>,
6480 offset: usize,
6481 mut depth: fidl::encoding::Depth,
6482 ) -> fidl::Result<()> {
6483 encoder.debug_check_bounds::<WlanSoftmacBaseClearAssociationRequest>(offset);
6484 let max_ordinal: u64 = self.max_ordinal_present();
6486 encoder.write_num(max_ordinal, offset);
6487 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6488 if max_ordinal == 0 {
6490 return Ok(());
6491 }
6492 depth.increment()?;
6493 let envelope_size = 8;
6494 let bytes_len = max_ordinal as usize * envelope_size;
6495 #[allow(unused_variables)]
6496 let offset = encoder.out_of_line_offset(bytes_len);
6497 let mut _prev_end_offset: usize = 0;
6498 if 1 > max_ordinal {
6499 return Ok(());
6500 }
6501
6502 let cur_offset: usize = (1 - 1) * envelope_size;
6505
6506 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6508
6509 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
6514 self.peer_addr
6515 .as_ref()
6516 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
6517 encoder,
6518 offset + cur_offset,
6519 depth,
6520 )?;
6521
6522 _prev_end_offset = cur_offset + envelope_size;
6523
6524 Ok(())
6525 }
6526 }
6527
6528 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6529 for WlanSoftmacBaseClearAssociationRequest
6530 {
6531 #[inline(always)]
6532 fn new_empty() -> Self {
6533 Self::default()
6534 }
6535
6536 unsafe fn decode(
6537 &mut self,
6538 decoder: &mut fidl::encoding::Decoder<'_, D>,
6539 offset: usize,
6540 mut depth: fidl::encoding::Depth,
6541 ) -> fidl::Result<()> {
6542 decoder.debug_check_bounds::<Self>(offset);
6543 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6544 None => return Err(fidl::Error::NotNullable),
6545 Some(len) => len,
6546 };
6547 if len == 0 {
6549 return Ok(());
6550 };
6551 depth.increment()?;
6552 let envelope_size = 8;
6553 let bytes_len = len * envelope_size;
6554 let offset = decoder.out_of_line_offset(bytes_len)?;
6555 let mut _next_ordinal_to_read = 0;
6557 let mut next_offset = offset;
6558 let end_offset = offset + bytes_len;
6559 _next_ordinal_to_read += 1;
6560 if next_offset >= end_offset {
6561 return Ok(());
6562 }
6563
6564 while _next_ordinal_to_read < 1 {
6566 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6567 _next_ordinal_to_read += 1;
6568 next_offset += envelope_size;
6569 }
6570
6571 let next_out_of_line = decoder.next_out_of_line();
6572 let handles_before = decoder.remaining_handles();
6573 if let Some((inlined, num_bytes, num_handles)) =
6574 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6575 {
6576 let member_inline_size =
6577 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
6578 decoder.context,
6579 );
6580 if inlined != (member_inline_size <= 4) {
6581 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6582 }
6583 let inner_offset;
6584 let mut inner_depth = depth.clone();
6585 if inlined {
6586 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6587 inner_offset = next_offset;
6588 } else {
6589 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6590 inner_depth.increment()?;
6591 }
6592 let val_ref = self
6593 .peer_addr
6594 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
6595 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
6596 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6597 {
6598 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6599 }
6600 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6601 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6602 }
6603 }
6604
6605 next_offset += envelope_size;
6606
6607 while next_offset < end_offset {
6609 _next_ordinal_to_read += 1;
6610 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6611 next_offset += envelope_size;
6612 }
6613
6614 Ok(())
6615 }
6616 }
6617
6618 impl WlanSoftmacBaseEnableBeaconingRequest {
6619 #[inline(always)]
6620 fn max_ordinal_present(&self) -> u64 {
6621 if let Some(_) = self.beacon_interval {
6622 return 3;
6623 }
6624 if let Some(_) = self.tim_ele_offset {
6625 return 2;
6626 }
6627 if let Some(_) = self.packet_template {
6628 return 1;
6629 }
6630 0
6631 }
6632 }
6633
6634 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseEnableBeaconingRequest {
6635 type Borrowed<'a> = &'a Self;
6636 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6637 value
6638 }
6639 }
6640
6641 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseEnableBeaconingRequest {
6642 type Owned = Self;
6643
6644 #[inline(always)]
6645 fn inline_align(_context: fidl::encoding::Context) -> usize {
6646 8
6647 }
6648
6649 #[inline(always)]
6650 fn inline_size(_context: fidl::encoding::Context) -> usize {
6651 16
6652 }
6653 }
6654
6655 unsafe impl<D: fidl::encoding::ResourceDialect>
6656 fidl::encoding::Encode<WlanSoftmacBaseEnableBeaconingRequest, D>
6657 for &WlanSoftmacBaseEnableBeaconingRequest
6658 {
6659 unsafe fn encode(
6660 self,
6661 encoder: &mut fidl::encoding::Encoder<'_, D>,
6662 offset: usize,
6663 mut depth: fidl::encoding::Depth,
6664 ) -> fidl::Result<()> {
6665 encoder.debug_check_bounds::<WlanSoftmacBaseEnableBeaconingRequest>(offset);
6666 let max_ordinal: u64 = self.max_ordinal_present();
6668 encoder.write_num(max_ordinal, offset);
6669 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6670 if max_ordinal == 0 {
6672 return Ok(());
6673 }
6674 depth.increment()?;
6675 let envelope_size = 8;
6676 let bytes_len = max_ordinal as usize * envelope_size;
6677 #[allow(unused_variables)]
6678 let offset = encoder.out_of_line_offset(bytes_len);
6679 let mut _prev_end_offset: usize = 0;
6680 if 1 > max_ordinal {
6681 return Ok(());
6682 }
6683
6684 let cur_offset: usize = (1 - 1) * envelope_size;
6687
6688 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6690
6691 fidl::encoding::encode_in_envelope_optional::<WlanTxPacket, D>(
6696 self.packet_template
6697 .as_ref()
6698 .map(<WlanTxPacket as fidl::encoding::ValueTypeMarker>::borrow),
6699 encoder,
6700 offset + cur_offset,
6701 depth,
6702 )?;
6703
6704 _prev_end_offset = cur_offset + envelope_size;
6705 if 2 > max_ordinal {
6706 return Ok(());
6707 }
6708
6709 let cur_offset: usize = (2 - 1) * envelope_size;
6712
6713 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6715
6716 fidl::encoding::encode_in_envelope_optional::<u64, D>(
6721 self.tim_ele_offset.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
6722 encoder,
6723 offset + cur_offset,
6724 depth,
6725 )?;
6726
6727 _prev_end_offset = cur_offset + envelope_size;
6728 if 3 > max_ordinal {
6729 return Ok(());
6730 }
6731
6732 let cur_offset: usize = (3 - 1) * envelope_size;
6735
6736 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6738
6739 fidl::encoding::encode_in_envelope_optional::<u16, D>(
6744 self.beacon_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
6745 encoder,
6746 offset + cur_offset,
6747 depth,
6748 )?;
6749
6750 _prev_end_offset = cur_offset + envelope_size;
6751
6752 Ok(())
6753 }
6754 }
6755
6756 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6757 for WlanSoftmacBaseEnableBeaconingRequest
6758 {
6759 #[inline(always)]
6760 fn new_empty() -> Self {
6761 Self::default()
6762 }
6763
6764 unsafe fn decode(
6765 &mut self,
6766 decoder: &mut fidl::encoding::Decoder<'_, D>,
6767 offset: usize,
6768 mut depth: fidl::encoding::Depth,
6769 ) -> fidl::Result<()> {
6770 decoder.debug_check_bounds::<Self>(offset);
6771 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6772 None => return Err(fidl::Error::NotNullable),
6773 Some(len) => len,
6774 };
6775 if len == 0 {
6777 return Ok(());
6778 };
6779 depth.increment()?;
6780 let envelope_size = 8;
6781 let bytes_len = len * envelope_size;
6782 let offset = decoder.out_of_line_offset(bytes_len)?;
6783 let mut _next_ordinal_to_read = 0;
6785 let mut next_offset = offset;
6786 let end_offset = offset + bytes_len;
6787 _next_ordinal_to_read += 1;
6788 if next_offset >= end_offset {
6789 return Ok(());
6790 }
6791
6792 while _next_ordinal_to_read < 1 {
6794 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6795 _next_ordinal_to_read += 1;
6796 next_offset += envelope_size;
6797 }
6798
6799 let next_out_of_line = decoder.next_out_of_line();
6800 let handles_before = decoder.remaining_handles();
6801 if let Some((inlined, num_bytes, num_handles)) =
6802 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6803 {
6804 let member_inline_size =
6805 <WlanTxPacket as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6806 if inlined != (member_inline_size <= 4) {
6807 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6808 }
6809 let inner_offset;
6810 let mut inner_depth = depth.clone();
6811 if inlined {
6812 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6813 inner_offset = next_offset;
6814 } else {
6815 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6816 inner_depth.increment()?;
6817 }
6818 let val_ref =
6819 self.packet_template.get_or_insert_with(|| fidl::new_empty!(WlanTxPacket, D));
6820 fidl::decode!(WlanTxPacket, D, val_ref, decoder, inner_offset, inner_depth)?;
6821 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6822 {
6823 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6824 }
6825 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6826 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6827 }
6828 }
6829
6830 next_offset += envelope_size;
6831 _next_ordinal_to_read += 1;
6832 if next_offset >= end_offset {
6833 return Ok(());
6834 }
6835
6836 while _next_ordinal_to_read < 2 {
6838 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6839 _next_ordinal_to_read += 1;
6840 next_offset += envelope_size;
6841 }
6842
6843 let next_out_of_line = decoder.next_out_of_line();
6844 let handles_before = decoder.remaining_handles();
6845 if let Some((inlined, num_bytes, num_handles)) =
6846 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6847 {
6848 let member_inline_size =
6849 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6850 if inlined != (member_inline_size <= 4) {
6851 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6852 }
6853 let inner_offset;
6854 let mut inner_depth = depth.clone();
6855 if inlined {
6856 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6857 inner_offset = next_offset;
6858 } else {
6859 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6860 inner_depth.increment()?;
6861 }
6862 let val_ref = self.tim_ele_offset.get_or_insert_with(|| fidl::new_empty!(u64, D));
6863 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
6864 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6865 {
6866 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6867 }
6868 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6869 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6870 }
6871 }
6872
6873 next_offset += envelope_size;
6874 _next_ordinal_to_read += 1;
6875 if next_offset >= end_offset {
6876 return Ok(());
6877 }
6878
6879 while _next_ordinal_to_read < 3 {
6881 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6882 _next_ordinal_to_read += 1;
6883 next_offset += envelope_size;
6884 }
6885
6886 let next_out_of_line = decoder.next_out_of_line();
6887 let handles_before = decoder.remaining_handles();
6888 if let Some((inlined, num_bytes, num_handles)) =
6889 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6890 {
6891 let member_inline_size =
6892 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6893 if inlined != (member_inline_size <= 4) {
6894 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6895 }
6896 let inner_offset;
6897 let mut inner_depth = depth.clone();
6898 if inlined {
6899 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6900 inner_offset = next_offset;
6901 } else {
6902 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6903 inner_depth.increment()?;
6904 }
6905 let val_ref = self.beacon_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
6906 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
6907 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6908 {
6909 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6910 }
6911 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6912 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6913 }
6914 }
6915
6916 next_offset += envelope_size;
6917
6918 while next_offset < end_offset {
6920 _next_ordinal_to_read += 1;
6921 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6922 next_offset += envelope_size;
6923 }
6924
6925 Ok(())
6926 }
6927 }
6928
6929 impl WlanSoftmacBaseSetChannelRequest {
6930 #[inline(always)]
6931 fn max_ordinal_present(&self) -> u64 {
6932 if let Some(_) = self.channel {
6933 return 1;
6934 }
6935 0
6936 }
6937 }
6938
6939 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseSetChannelRequest {
6940 type Borrowed<'a> = &'a Self;
6941 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6942 value
6943 }
6944 }
6945
6946 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseSetChannelRequest {
6947 type Owned = Self;
6948
6949 #[inline(always)]
6950 fn inline_align(_context: fidl::encoding::Context) -> usize {
6951 8
6952 }
6953
6954 #[inline(always)]
6955 fn inline_size(_context: fidl::encoding::Context) -> usize {
6956 16
6957 }
6958 }
6959
6960 unsafe impl<D: fidl::encoding::ResourceDialect>
6961 fidl::encoding::Encode<WlanSoftmacBaseSetChannelRequest, D>
6962 for &WlanSoftmacBaseSetChannelRequest
6963 {
6964 unsafe fn encode(
6965 self,
6966 encoder: &mut fidl::encoding::Encoder<'_, D>,
6967 offset: usize,
6968 mut depth: fidl::encoding::Depth,
6969 ) -> fidl::Result<()> {
6970 encoder.debug_check_bounds::<WlanSoftmacBaseSetChannelRequest>(offset);
6971 let max_ordinal: u64 = self.max_ordinal_present();
6973 encoder.write_num(max_ordinal, offset);
6974 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6975 if max_ordinal == 0 {
6977 return Ok(());
6978 }
6979 depth.increment()?;
6980 let envelope_size = 8;
6981 let bytes_len = max_ordinal as usize * envelope_size;
6982 #[allow(unused_variables)]
6983 let offset = encoder.out_of_line_offset(bytes_len);
6984 let mut _prev_end_offset: usize = 0;
6985 if 1 > max_ordinal {
6986 return Ok(());
6987 }
6988
6989 let cur_offset: usize = (1 - 1) * envelope_size;
6992
6993 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6995
6996 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D>(
7001 self.channel.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow),
7002 encoder, offset + cur_offset, depth
7003 )?;
7004
7005 _prev_end_offset = cur_offset + envelope_size;
7006
7007 Ok(())
7008 }
7009 }
7010
7011 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7012 for WlanSoftmacBaseSetChannelRequest
7013 {
7014 #[inline(always)]
7015 fn new_empty() -> Self {
7016 Self::default()
7017 }
7018
7019 unsafe fn decode(
7020 &mut self,
7021 decoder: &mut fidl::encoding::Decoder<'_, D>,
7022 offset: usize,
7023 mut depth: fidl::encoding::Depth,
7024 ) -> fidl::Result<()> {
7025 decoder.debug_check_bounds::<Self>(offset);
7026 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7027 None => return Err(fidl::Error::NotNullable),
7028 Some(len) => len,
7029 };
7030 if len == 0 {
7032 return Ok(());
7033 };
7034 depth.increment()?;
7035 let envelope_size = 8;
7036 let bytes_len = len * envelope_size;
7037 let offset = decoder.out_of_line_offset(bytes_len)?;
7038 let mut _next_ordinal_to_read = 0;
7040 let mut next_offset = offset;
7041 let end_offset = offset + bytes_len;
7042 _next_ordinal_to_read += 1;
7043 if next_offset >= end_offset {
7044 return Ok(());
7045 }
7046
7047 while _next_ordinal_to_read < 1 {
7049 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7050 _next_ordinal_to_read += 1;
7051 next_offset += envelope_size;
7052 }
7053
7054 let next_out_of_line = decoder.next_out_of_line();
7055 let handles_before = decoder.remaining_handles();
7056 if let Some((inlined, num_bytes, num_handles)) =
7057 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7058 {
7059 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7060 if inlined != (member_inline_size <= 4) {
7061 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7062 }
7063 let inner_offset;
7064 let mut inner_depth = depth.clone();
7065 if inlined {
7066 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7067 inner_offset = next_offset;
7068 } else {
7069 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7070 inner_depth.increment()?;
7071 }
7072 let val_ref = self.channel.get_or_insert_with(|| {
7073 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D)
7074 });
7075 fidl::decode!(
7076 fidl_fuchsia_wlan_ieee80211__common::WlanChannel,
7077 D,
7078 val_ref,
7079 decoder,
7080 inner_offset,
7081 inner_depth
7082 )?;
7083 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7084 {
7085 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7086 }
7087 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7088 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7089 }
7090 }
7091
7092 next_offset += envelope_size;
7093
7094 while next_offset < end_offset {
7096 _next_ordinal_to_read += 1;
7097 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7098 next_offset += envelope_size;
7099 }
7100
7101 Ok(())
7102 }
7103 }
7104
7105 impl WlanSoftmacBaseStartPassiveScanRequest {
7106 #[inline(always)]
7107 fn max_ordinal_present(&self) -> u64 {
7108 if let Some(_) = self.min_home_time {
7109 return 4;
7110 }
7111 if let Some(_) = self.max_channel_time {
7112 return 3;
7113 }
7114 if let Some(_) = self.min_channel_time {
7115 return 2;
7116 }
7117 if let Some(_) = self.channels {
7118 return 1;
7119 }
7120 0
7121 }
7122 }
7123
7124 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartPassiveScanRequest {
7125 type Borrowed<'a> = &'a Self;
7126 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7127 value
7128 }
7129 }
7130
7131 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartPassiveScanRequest {
7132 type Owned = Self;
7133
7134 #[inline(always)]
7135 fn inline_align(_context: fidl::encoding::Context) -> usize {
7136 8
7137 }
7138
7139 #[inline(always)]
7140 fn inline_size(_context: fidl::encoding::Context) -> usize {
7141 16
7142 }
7143 }
7144
7145 unsafe impl<D: fidl::encoding::ResourceDialect>
7146 fidl::encoding::Encode<WlanSoftmacBaseStartPassiveScanRequest, D>
7147 for &WlanSoftmacBaseStartPassiveScanRequest
7148 {
7149 unsafe fn encode(
7150 self,
7151 encoder: &mut fidl::encoding::Encoder<'_, D>,
7152 offset: usize,
7153 mut depth: fidl::encoding::Depth,
7154 ) -> fidl::Result<()> {
7155 encoder.debug_check_bounds::<WlanSoftmacBaseStartPassiveScanRequest>(offset);
7156 let max_ordinal: u64 = self.max_ordinal_present();
7158 encoder.write_num(max_ordinal, offset);
7159 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7160 if max_ordinal == 0 {
7162 return Ok(());
7163 }
7164 depth.increment()?;
7165 let envelope_size = 8;
7166 let bytes_len = max_ordinal as usize * envelope_size;
7167 #[allow(unused_variables)]
7168 let offset = encoder.out_of_line_offset(bytes_len);
7169 let mut _prev_end_offset: usize = 0;
7170 if 1 > max_ordinal {
7171 return Ok(());
7172 }
7173
7174 let cur_offset: usize = (1 - 1) * envelope_size;
7177
7178 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7180
7181 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
7186 self.channels.as_ref().map(
7187 <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
7188 ),
7189 encoder,
7190 offset + cur_offset,
7191 depth,
7192 )?;
7193
7194 _prev_end_offset = cur_offset + envelope_size;
7195 if 2 > max_ordinal {
7196 return Ok(());
7197 }
7198
7199 let cur_offset: usize = (2 - 1) * envelope_size;
7202
7203 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7205
7206 fidl::encoding::encode_in_envelope_optional::<i64, D>(
7211 self.min_channel_time
7212 .as_ref()
7213 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7214 encoder,
7215 offset + cur_offset,
7216 depth,
7217 )?;
7218
7219 _prev_end_offset = cur_offset + envelope_size;
7220 if 3 > max_ordinal {
7221 return Ok(());
7222 }
7223
7224 let cur_offset: usize = (3 - 1) * envelope_size;
7227
7228 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7230
7231 fidl::encoding::encode_in_envelope_optional::<i64, D>(
7236 self.max_channel_time
7237 .as_ref()
7238 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7239 encoder,
7240 offset + cur_offset,
7241 depth,
7242 )?;
7243
7244 _prev_end_offset = cur_offset + envelope_size;
7245 if 4 > max_ordinal {
7246 return Ok(());
7247 }
7248
7249 let cur_offset: usize = (4 - 1) * envelope_size;
7252
7253 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7255
7256 fidl::encoding::encode_in_envelope_optional::<i64, D>(
7261 self.min_home_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7262 encoder,
7263 offset + cur_offset,
7264 depth,
7265 )?;
7266
7267 _prev_end_offset = cur_offset + envelope_size;
7268
7269 Ok(())
7270 }
7271 }
7272
7273 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7274 for WlanSoftmacBaseStartPassiveScanRequest
7275 {
7276 #[inline(always)]
7277 fn new_empty() -> Self {
7278 Self::default()
7279 }
7280
7281 unsafe fn decode(
7282 &mut self,
7283 decoder: &mut fidl::encoding::Decoder<'_, D>,
7284 offset: usize,
7285 mut depth: fidl::encoding::Depth,
7286 ) -> fidl::Result<()> {
7287 decoder.debug_check_bounds::<Self>(offset);
7288 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7289 None => return Err(fidl::Error::NotNullable),
7290 Some(len) => len,
7291 };
7292 if len == 0 {
7294 return Ok(());
7295 };
7296 depth.increment()?;
7297 let envelope_size = 8;
7298 let bytes_len = len * envelope_size;
7299 let offset = decoder.out_of_line_offset(bytes_len)?;
7300 let mut _next_ordinal_to_read = 0;
7302 let mut next_offset = offset;
7303 let end_offset = offset + bytes_len;
7304 _next_ordinal_to_read += 1;
7305 if next_offset >= end_offset {
7306 return Ok(());
7307 }
7308
7309 while _next_ordinal_to_read < 1 {
7311 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7312 _next_ordinal_to_read += 1;
7313 next_offset += envelope_size;
7314 }
7315
7316 let next_out_of_line = decoder.next_out_of_line();
7317 let handles_before = decoder.remaining_handles();
7318 if let Some((inlined, num_bytes, num_handles)) =
7319 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7320 {
7321 let member_inline_size =
7322 <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
7323 decoder.context,
7324 );
7325 if inlined != (member_inline_size <= 4) {
7326 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7327 }
7328 let inner_offset;
7329 let mut inner_depth = depth.clone();
7330 if inlined {
7331 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7332 inner_offset = next_offset;
7333 } else {
7334 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7335 inner_depth.increment()?;
7336 }
7337 let val_ref = self
7338 .channels
7339 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
7340 fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
7341 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7342 {
7343 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7344 }
7345 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7346 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7347 }
7348 }
7349
7350 next_offset += envelope_size;
7351 _next_ordinal_to_read += 1;
7352 if next_offset >= end_offset {
7353 return Ok(());
7354 }
7355
7356 while _next_ordinal_to_read < 2 {
7358 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7359 _next_ordinal_to_read += 1;
7360 next_offset += envelope_size;
7361 }
7362
7363 let next_out_of_line = decoder.next_out_of_line();
7364 let handles_before = decoder.remaining_handles();
7365 if let Some((inlined, num_bytes, num_handles)) =
7366 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7367 {
7368 let member_inline_size =
7369 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7370 if inlined != (member_inline_size <= 4) {
7371 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7372 }
7373 let inner_offset;
7374 let mut inner_depth = depth.clone();
7375 if inlined {
7376 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7377 inner_offset = next_offset;
7378 } else {
7379 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7380 inner_depth.increment()?;
7381 }
7382 let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
7383 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7384 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7385 {
7386 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7387 }
7388 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7389 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7390 }
7391 }
7392
7393 next_offset += envelope_size;
7394 _next_ordinal_to_read += 1;
7395 if next_offset >= end_offset {
7396 return Ok(());
7397 }
7398
7399 while _next_ordinal_to_read < 3 {
7401 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7402 _next_ordinal_to_read += 1;
7403 next_offset += envelope_size;
7404 }
7405
7406 let next_out_of_line = decoder.next_out_of_line();
7407 let handles_before = decoder.remaining_handles();
7408 if let Some((inlined, num_bytes, num_handles)) =
7409 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7410 {
7411 let member_inline_size =
7412 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7413 if inlined != (member_inline_size <= 4) {
7414 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7415 }
7416 let inner_offset;
7417 let mut inner_depth = depth.clone();
7418 if inlined {
7419 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7420 inner_offset = next_offset;
7421 } else {
7422 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7423 inner_depth.increment()?;
7424 }
7425 let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
7426 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7427 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7428 {
7429 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7430 }
7431 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7432 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7433 }
7434 }
7435
7436 next_offset += envelope_size;
7437 _next_ordinal_to_read += 1;
7438 if next_offset >= end_offset {
7439 return Ok(());
7440 }
7441
7442 while _next_ordinal_to_read < 4 {
7444 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7445 _next_ordinal_to_read += 1;
7446 next_offset += envelope_size;
7447 }
7448
7449 let next_out_of_line = decoder.next_out_of_line();
7450 let handles_before = decoder.remaining_handles();
7451 if let Some((inlined, num_bytes, num_handles)) =
7452 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7453 {
7454 let member_inline_size =
7455 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7456 if inlined != (member_inline_size <= 4) {
7457 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7458 }
7459 let inner_offset;
7460 let mut inner_depth = depth.clone();
7461 if inlined {
7462 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7463 inner_offset = next_offset;
7464 } else {
7465 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7466 inner_depth.increment()?;
7467 }
7468 let val_ref = self.min_home_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
7469 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7470 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7471 {
7472 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7473 }
7474 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7475 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7476 }
7477 }
7478
7479 next_offset += envelope_size;
7480
7481 while next_offset < end_offset {
7483 _next_ordinal_to_read += 1;
7484 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7485 next_offset += envelope_size;
7486 }
7487
7488 Ok(())
7489 }
7490 }
7491
7492 impl WlanSoftmacBaseUpdateWmmParametersRequest {
7493 #[inline(always)]
7494 fn max_ordinal_present(&self) -> u64 {
7495 if let Some(_) = self.params {
7496 return 2;
7497 }
7498 if let Some(_) = self.ac {
7499 return 1;
7500 }
7501 0
7502 }
7503 }
7504
7505 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseUpdateWmmParametersRequest {
7506 type Borrowed<'a> = &'a Self;
7507 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7508 value
7509 }
7510 }
7511
7512 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseUpdateWmmParametersRequest {
7513 type Owned = Self;
7514
7515 #[inline(always)]
7516 fn inline_align(_context: fidl::encoding::Context) -> usize {
7517 8
7518 }
7519
7520 #[inline(always)]
7521 fn inline_size(_context: fidl::encoding::Context) -> usize {
7522 16
7523 }
7524 }
7525
7526 unsafe impl<D: fidl::encoding::ResourceDialect>
7527 fidl::encoding::Encode<WlanSoftmacBaseUpdateWmmParametersRequest, D>
7528 for &WlanSoftmacBaseUpdateWmmParametersRequest
7529 {
7530 unsafe fn encode(
7531 self,
7532 encoder: &mut fidl::encoding::Encoder<'_, D>,
7533 offset: usize,
7534 mut depth: fidl::encoding::Depth,
7535 ) -> fidl::Result<()> {
7536 encoder.debug_check_bounds::<WlanSoftmacBaseUpdateWmmParametersRequest>(offset);
7537 let max_ordinal: u64 = self.max_ordinal_present();
7539 encoder.write_num(max_ordinal, offset);
7540 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7541 if max_ordinal == 0 {
7543 return Ok(());
7544 }
7545 depth.increment()?;
7546 let envelope_size = 8;
7547 let bytes_len = max_ordinal as usize * envelope_size;
7548 #[allow(unused_variables)]
7549 let offset = encoder.out_of_line_offset(bytes_len);
7550 let mut _prev_end_offset: usize = 0;
7551 if 1 > max_ordinal {
7552 return Ok(());
7553 }
7554
7555 let cur_offset: usize = (1 - 1) * envelope_size;
7558
7559 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7561
7562 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory, D>(
7567 self.ac.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory as fidl::encoding::ValueTypeMarker>::borrow),
7568 encoder, offset + cur_offset, depth
7569 )?;
7570
7571 _prev_end_offset = cur_offset + envelope_size;
7572 if 2 > max_ordinal {
7573 return Ok(());
7574 }
7575
7576 let cur_offset: usize = (2 - 1) * envelope_size;
7579
7580 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7582
7583 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanWmmParameters, D>(
7588 self.params.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow),
7589 encoder, offset + cur_offset, depth
7590 )?;
7591
7592 _prev_end_offset = cur_offset + envelope_size;
7593
7594 Ok(())
7595 }
7596 }
7597
7598 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7599 for WlanSoftmacBaseUpdateWmmParametersRequest
7600 {
7601 #[inline(always)]
7602 fn new_empty() -> Self {
7603 Self::default()
7604 }
7605
7606 unsafe fn decode(
7607 &mut self,
7608 decoder: &mut fidl::encoding::Decoder<'_, D>,
7609 offset: usize,
7610 mut depth: fidl::encoding::Depth,
7611 ) -> fidl::Result<()> {
7612 decoder.debug_check_bounds::<Self>(offset);
7613 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7614 None => return Err(fidl::Error::NotNullable),
7615 Some(len) => len,
7616 };
7617 if len == 0 {
7619 return Ok(());
7620 };
7621 depth.increment()?;
7622 let envelope_size = 8;
7623 let bytes_len = len * envelope_size;
7624 let offset = decoder.out_of_line_offset(bytes_len)?;
7625 let mut _next_ordinal_to_read = 0;
7627 let mut next_offset = offset;
7628 let end_offset = offset + bytes_len;
7629 _next_ordinal_to_read += 1;
7630 if next_offset >= end_offset {
7631 return Ok(());
7632 }
7633
7634 while _next_ordinal_to_read < 1 {
7636 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7637 _next_ordinal_to_read += 1;
7638 next_offset += envelope_size;
7639 }
7640
7641 let next_out_of_line = decoder.next_out_of_line();
7642 let handles_before = decoder.remaining_handles();
7643 if let Some((inlined, num_bytes, num_handles)) =
7644 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7645 {
7646 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7647 if inlined != (member_inline_size <= 4) {
7648 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7649 }
7650 let inner_offset;
7651 let mut inner_depth = depth.clone();
7652 if inlined {
7653 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7654 inner_offset = next_offset;
7655 } else {
7656 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7657 inner_depth.increment()?;
7658 }
7659 let val_ref = self.ac.get_or_insert_with(|| {
7660 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory, D)
7661 });
7662 fidl::decode!(
7663 fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory,
7664 D,
7665 val_ref,
7666 decoder,
7667 inner_offset,
7668 inner_depth
7669 )?;
7670 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7671 {
7672 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7673 }
7674 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7675 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7676 }
7677 }
7678
7679 next_offset += envelope_size;
7680 _next_ordinal_to_read += 1;
7681 if next_offset >= end_offset {
7682 return Ok(());
7683 }
7684
7685 while _next_ordinal_to_read < 2 {
7687 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7688 _next_ordinal_to_read += 1;
7689 next_offset += envelope_size;
7690 }
7691
7692 let next_out_of_line = decoder.next_out_of_line();
7693 let handles_before = decoder.remaining_handles();
7694 if let Some((inlined, num_bytes, num_handles)) =
7695 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7696 {
7697 let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7698 if inlined != (member_inline_size <= 4) {
7699 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7700 }
7701 let inner_offset;
7702 let mut inner_depth = depth.clone();
7703 if inlined {
7704 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7705 inner_offset = next_offset;
7706 } else {
7707 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7708 inner_depth.increment()?;
7709 }
7710 let val_ref = self.params.get_or_insert_with(|| {
7711 fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanWmmParameters, D)
7712 });
7713 fidl::decode!(
7714 fidl_fuchsia_wlan_common__common::WlanWmmParameters,
7715 D,
7716 val_ref,
7717 decoder,
7718 inner_offset,
7719 inner_depth
7720 )?;
7721 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7722 {
7723 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7724 }
7725 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7726 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7727 }
7728 }
7729
7730 next_offset += envelope_size;
7731
7732 while next_offset < end_offset {
7734 _next_ordinal_to_read += 1;
7735 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7736 next_offset += envelope_size;
7737 }
7738
7739 Ok(())
7740 }
7741 }
7742
7743 impl WlanSoftmacBaseStartActiveScanResponse {
7744 #[inline(always)]
7745 fn max_ordinal_present(&self) -> u64 {
7746 if let Some(_) = self.scan_id {
7747 return 1;
7748 }
7749 0
7750 }
7751 }
7752
7753 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartActiveScanResponse {
7754 type Borrowed<'a> = &'a Self;
7755 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7756 value
7757 }
7758 }
7759
7760 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartActiveScanResponse {
7761 type Owned = Self;
7762
7763 #[inline(always)]
7764 fn inline_align(_context: fidl::encoding::Context) -> usize {
7765 8
7766 }
7767
7768 #[inline(always)]
7769 fn inline_size(_context: fidl::encoding::Context) -> usize {
7770 16
7771 }
7772 }
7773
7774 unsafe impl<D: fidl::encoding::ResourceDialect>
7775 fidl::encoding::Encode<WlanSoftmacBaseStartActiveScanResponse, D>
7776 for &WlanSoftmacBaseStartActiveScanResponse
7777 {
7778 unsafe fn encode(
7779 self,
7780 encoder: &mut fidl::encoding::Encoder<'_, D>,
7781 offset: usize,
7782 mut depth: fidl::encoding::Depth,
7783 ) -> fidl::Result<()> {
7784 encoder.debug_check_bounds::<WlanSoftmacBaseStartActiveScanResponse>(offset);
7785 let max_ordinal: u64 = self.max_ordinal_present();
7787 encoder.write_num(max_ordinal, offset);
7788 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7789 if max_ordinal == 0 {
7791 return Ok(());
7792 }
7793 depth.increment()?;
7794 let envelope_size = 8;
7795 let bytes_len = max_ordinal as usize * envelope_size;
7796 #[allow(unused_variables)]
7797 let offset = encoder.out_of_line_offset(bytes_len);
7798 let mut _prev_end_offset: usize = 0;
7799 if 1 > max_ordinal {
7800 return Ok(());
7801 }
7802
7803 let cur_offset: usize = (1 - 1) * envelope_size;
7806
7807 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7809
7810 fidl::encoding::encode_in_envelope_optional::<u64, D>(
7815 self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7816 encoder,
7817 offset + cur_offset,
7818 depth,
7819 )?;
7820
7821 _prev_end_offset = cur_offset + envelope_size;
7822
7823 Ok(())
7824 }
7825 }
7826
7827 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7828 for WlanSoftmacBaseStartActiveScanResponse
7829 {
7830 #[inline(always)]
7831 fn new_empty() -> Self {
7832 Self::default()
7833 }
7834
7835 unsafe fn decode(
7836 &mut self,
7837 decoder: &mut fidl::encoding::Decoder<'_, D>,
7838 offset: usize,
7839 mut depth: fidl::encoding::Depth,
7840 ) -> fidl::Result<()> {
7841 decoder.debug_check_bounds::<Self>(offset);
7842 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7843 None => return Err(fidl::Error::NotNullable),
7844 Some(len) => len,
7845 };
7846 if len == 0 {
7848 return Ok(());
7849 };
7850 depth.increment()?;
7851 let envelope_size = 8;
7852 let bytes_len = len * envelope_size;
7853 let offset = decoder.out_of_line_offset(bytes_len)?;
7854 let mut _next_ordinal_to_read = 0;
7856 let mut next_offset = offset;
7857 let end_offset = offset + bytes_len;
7858 _next_ordinal_to_read += 1;
7859 if next_offset >= end_offset {
7860 return Ok(());
7861 }
7862
7863 while _next_ordinal_to_read < 1 {
7865 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7866 _next_ordinal_to_read += 1;
7867 next_offset += envelope_size;
7868 }
7869
7870 let next_out_of_line = decoder.next_out_of_line();
7871 let handles_before = decoder.remaining_handles();
7872 if let Some((inlined, num_bytes, num_handles)) =
7873 fidl::encoding::decode_envelope_header(decoder, next_offset)?
7874 {
7875 let member_inline_size =
7876 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7877 if inlined != (member_inline_size <= 4) {
7878 return Err(fidl::Error::InvalidInlineBitInEnvelope);
7879 }
7880 let inner_offset;
7881 let mut inner_depth = depth.clone();
7882 if inlined {
7883 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7884 inner_offset = next_offset;
7885 } else {
7886 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7887 inner_depth.increment()?;
7888 }
7889 let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
7890 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7891 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7892 {
7893 return Err(fidl::Error::InvalidNumBytesInEnvelope);
7894 }
7895 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7896 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7897 }
7898 }
7899
7900 next_offset += envelope_size;
7901
7902 while next_offset < end_offset {
7904 _next_ordinal_to_read += 1;
7905 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7906 next_offset += envelope_size;
7907 }
7908
7909 Ok(())
7910 }
7911 }
7912
7913 impl WlanSoftmacBaseStartPassiveScanResponse {
7914 #[inline(always)]
7915 fn max_ordinal_present(&self) -> u64 {
7916 if let Some(_) = self.scan_id {
7917 return 1;
7918 }
7919 0
7920 }
7921 }
7922
7923 impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartPassiveScanResponse {
7924 type Borrowed<'a> = &'a Self;
7925 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7926 value
7927 }
7928 }
7929
7930 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartPassiveScanResponse {
7931 type Owned = Self;
7932
7933 #[inline(always)]
7934 fn inline_align(_context: fidl::encoding::Context) -> usize {
7935 8
7936 }
7937
7938 #[inline(always)]
7939 fn inline_size(_context: fidl::encoding::Context) -> usize {
7940 16
7941 }
7942 }
7943
7944 unsafe impl<D: fidl::encoding::ResourceDialect>
7945 fidl::encoding::Encode<WlanSoftmacBaseStartPassiveScanResponse, D>
7946 for &WlanSoftmacBaseStartPassiveScanResponse
7947 {
7948 unsafe fn encode(
7949 self,
7950 encoder: &mut fidl::encoding::Encoder<'_, D>,
7951 offset: usize,
7952 mut depth: fidl::encoding::Depth,
7953 ) -> fidl::Result<()> {
7954 encoder.debug_check_bounds::<WlanSoftmacBaseStartPassiveScanResponse>(offset);
7955 let max_ordinal: u64 = self.max_ordinal_present();
7957 encoder.write_num(max_ordinal, offset);
7958 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7959 if max_ordinal == 0 {
7961 return Ok(());
7962 }
7963 depth.increment()?;
7964 let envelope_size = 8;
7965 let bytes_len = max_ordinal as usize * envelope_size;
7966 #[allow(unused_variables)]
7967 let offset = encoder.out_of_line_offset(bytes_len);
7968 let mut _prev_end_offset: usize = 0;
7969 if 1 > max_ordinal {
7970 return Ok(());
7971 }
7972
7973 let cur_offset: usize = (1 - 1) * envelope_size;
7976
7977 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7979
7980 fidl::encoding::encode_in_envelope_optional::<u64, D>(
7985 self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7986 encoder,
7987 offset + cur_offset,
7988 depth,
7989 )?;
7990
7991 _prev_end_offset = cur_offset + envelope_size;
7992
7993 Ok(())
7994 }
7995 }
7996
7997 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7998 for WlanSoftmacBaseStartPassiveScanResponse
7999 {
8000 #[inline(always)]
8001 fn new_empty() -> Self {
8002 Self::default()
8003 }
8004
8005 unsafe fn decode(
8006 &mut self,
8007 decoder: &mut fidl::encoding::Decoder<'_, D>,
8008 offset: usize,
8009 mut depth: fidl::encoding::Depth,
8010 ) -> fidl::Result<()> {
8011 decoder.debug_check_bounds::<Self>(offset);
8012 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8013 None => return Err(fidl::Error::NotNullable),
8014 Some(len) => len,
8015 };
8016 if len == 0 {
8018 return Ok(());
8019 };
8020 depth.increment()?;
8021 let envelope_size = 8;
8022 let bytes_len = len * envelope_size;
8023 let offset = decoder.out_of_line_offset(bytes_len)?;
8024 let mut _next_ordinal_to_read = 0;
8026 let mut next_offset = offset;
8027 let end_offset = offset + bytes_len;
8028 _next_ordinal_to_read += 1;
8029 if next_offset >= end_offset {
8030 return Ok(());
8031 }
8032
8033 while _next_ordinal_to_read < 1 {
8035 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8036 _next_ordinal_to_read += 1;
8037 next_offset += envelope_size;
8038 }
8039
8040 let next_out_of_line = decoder.next_out_of_line();
8041 let handles_before = decoder.remaining_handles();
8042 if let Some((inlined, num_bytes, num_handles)) =
8043 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8044 {
8045 let member_inline_size =
8046 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8047 if inlined != (member_inline_size <= 4) {
8048 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8049 }
8050 let inner_offset;
8051 let mut inner_depth = depth.clone();
8052 if inlined {
8053 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8054 inner_offset = next_offset;
8055 } else {
8056 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8057 inner_depth.increment()?;
8058 }
8059 let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
8060 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8061 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8062 {
8063 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8064 }
8065 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8066 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8067 }
8068 }
8069
8070 next_offset += envelope_size;
8071
8072 while next_offset < end_offset {
8074 _next_ordinal_to_read += 1;
8075 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8076 next_offset += envelope_size;
8077 }
8078
8079 Ok(())
8080 }
8081 }
8082
8083 impl WlanSoftmacIfcBaseNotifyScanCompleteRequest {
8084 #[inline(always)]
8085 fn max_ordinal_present(&self) -> u64 {
8086 if let Some(_) = self.scan_id {
8087 return 2;
8088 }
8089 if let Some(_) = self.status {
8090 return 1;
8091 }
8092 0
8093 }
8094 }
8095
8096 impl fidl::encoding::ValueTypeMarker for WlanSoftmacIfcBaseNotifyScanCompleteRequest {
8097 type Borrowed<'a> = &'a Self;
8098 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8099 value
8100 }
8101 }
8102
8103 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacIfcBaseNotifyScanCompleteRequest {
8104 type Owned = Self;
8105
8106 #[inline(always)]
8107 fn inline_align(_context: fidl::encoding::Context) -> usize {
8108 8
8109 }
8110
8111 #[inline(always)]
8112 fn inline_size(_context: fidl::encoding::Context) -> usize {
8113 16
8114 }
8115 }
8116
8117 unsafe impl<D: fidl::encoding::ResourceDialect>
8118 fidl::encoding::Encode<WlanSoftmacIfcBaseNotifyScanCompleteRequest, D>
8119 for &WlanSoftmacIfcBaseNotifyScanCompleteRequest
8120 {
8121 unsafe fn encode(
8122 self,
8123 encoder: &mut fidl::encoding::Encoder<'_, D>,
8124 offset: usize,
8125 mut depth: fidl::encoding::Depth,
8126 ) -> fidl::Result<()> {
8127 encoder.debug_check_bounds::<WlanSoftmacIfcBaseNotifyScanCompleteRequest>(offset);
8128 let max_ordinal: u64 = self.max_ordinal_present();
8130 encoder.write_num(max_ordinal, offset);
8131 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8132 if max_ordinal == 0 {
8134 return Ok(());
8135 }
8136 depth.increment()?;
8137 let envelope_size = 8;
8138 let bytes_len = max_ordinal as usize * envelope_size;
8139 #[allow(unused_variables)]
8140 let offset = encoder.out_of_line_offset(bytes_len);
8141 let mut _prev_end_offset: usize = 0;
8142 if 1 > max_ordinal {
8143 return Ok(());
8144 }
8145
8146 let cur_offset: usize = (1 - 1) * envelope_size;
8149
8150 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8152
8153 fidl::encoding::encode_in_envelope_optional::<i32, D>(
8158 self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
8159 encoder,
8160 offset + cur_offset,
8161 depth,
8162 )?;
8163
8164 _prev_end_offset = cur_offset + envelope_size;
8165 if 2 > max_ordinal {
8166 return Ok(());
8167 }
8168
8169 let cur_offset: usize = (2 - 1) * envelope_size;
8172
8173 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8175
8176 fidl::encoding::encode_in_envelope_optional::<u64, D>(
8181 self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8182 encoder,
8183 offset + cur_offset,
8184 depth,
8185 )?;
8186
8187 _prev_end_offset = cur_offset + envelope_size;
8188
8189 Ok(())
8190 }
8191 }
8192
8193 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8194 for WlanSoftmacIfcBaseNotifyScanCompleteRequest
8195 {
8196 #[inline(always)]
8197 fn new_empty() -> Self {
8198 Self::default()
8199 }
8200
8201 unsafe fn decode(
8202 &mut self,
8203 decoder: &mut fidl::encoding::Decoder<'_, D>,
8204 offset: usize,
8205 mut depth: fidl::encoding::Depth,
8206 ) -> fidl::Result<()> {
8207 decoder.debug_check_bounds::<Self>(offset);
8208 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8209 None => return Err(fidl::Error::NotNullable),
8210 Some(len) => len,
8211 };
8212 if len == 0 {
8214 return Ok(());
8215 };
8216 depth.increment()?;
8217 let envelope_size = 8;
8218 let bytes_len = len * envelope_size;
8219 let offset = decoder.out_of_line_offset(bytes_len)?;
8220 let mut _next_ordinal_to_read = 0;
8222 let mut next_offset = offset;
8223 let end_offset = offset + bytes_len;
8224 _next_ordinal_to_read += 1;
8225 if next_offset >= end_offset {
8226 return Ok(());
8227 }
8228
8229 while _next_ordinal_to_read < 1 {
8231 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8232 _next_ordinal_to_read += 1;
8233 next_offset += envelope_size;
8234 }
8235
8236 let next_out_of_line = decoder.next_out_of_line();
8237 let handles_before = decoder.remaining_handles();
8238 if let Some((inlined, num_bytes, num_handles)) =
8239 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8240 {
8241 let member_inline_size =
8242 <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8243 if inlined != (member_inline_size <= 4) {
8244 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8245 }
8246 let inner_offset;
8247 let mut inner_depth = depth.clone();
8248 if inlined {
8249 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8250 inner_offset = next_offset;
8251 } else {
8252 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8253 inner_depth.increment()?;
8254 }
8255 let val_ref = self.status.get_or_insert_with(|| fidl::new_empty!(i32, D));
8256 fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
8257 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8258 {
8259 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8260 }
8261 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8262 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8263 }
8264 }
8265
8266 next_offset += envelope_size;
8267 _next_ordinal_to_read += 1;
8268 if next_offset >= end_offset {
8269 return Ok(());
8270 }
8271
8272 while _next_ordinal_to_read < 2 {
8274 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8275 _next_ordinal_to_read += 1;
8276 next_offset += envelope_size;
8277 }
8278
8279 let next_out_of_line = decoder.next_out_of_line();
8280 let handles_before = decoder.remaining_handles();
8281 if let Some((inlined, num_bytes, num_handles)) =
8282 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8283 {
8284 let member_inline_size =
8285 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8286 if inlined != (member_inline_size <= 4) {
8287 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8288 }
8289 let inner_offset;
8290 let mut inner_depth = depth.clone();
8291 if inlined {
8292 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8293 inner_offset = next_offset;
8294 } else {
8295 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8296 inner_depth.increment()?;
8297 }
8298 let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
8299 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8300 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8301 {
8302 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8303 }
8304 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8305 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8306 }
8307 }
8308
8309 next_offset += envelope_size;
8310
8311 while next_offset < end_offset {
8313 _next_ordinal_to_read += 1;
8314 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8315 next_offset += envelope_size;
8316 }
8317
8318 Ok(())
8319 }
8320 }
8321
8322 impl WlanSoftmacQueryResponse {
8323 #[inline(always)]
8324 fn max_ordinal_present(&self) -> u64 {
8325 if let Some(_) = self.band_caps {
8326 return 5;
8327 }
8328 if let Some(_) = self.hardware_capability {
8329 return 4;
8330 }
8331 if let Some(_) = self.supported_phys {
8332 return 3;
8333 }
8334 if let Some(_) = self.mac_role {
8335 return 2;
8336 }
8337 if let Some(_) = self.sta_addr {
8338 return 1;
8339 }
8340 0
8341 }
8342 }
8343
8344 impl fidl::encoding::ValueTypeMarker for WlanSoftmacQueryResponse {
8345 type Borrowed<'a> = &'a Self;
8346 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8347 value
8348 }
8349 }
8350
8351 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacQueryResponse {
8352 type Owned = Self;
8353
8354 #[inline(always)]
8355 fn inline_align(_context: fidl::encoding::Context) -> usize {
8356 8
8357 }
8358
8359 #[inline(always)]
8360 fn inline_size(_context: fidl::encoding::Context) -> usize {
8361 16
8362 }
8363 }
8364
8365 unsafe impl<D: fidl::encoding::ResourceDialect>
8366 fidl::encoding::Encode<WlanSoftmacQueryResponse, D> for &WlanSoftmacQueryResponse
8367 {
8368 unsafe fn encode(
8369 self,
8370 encoder: &mut fidl::encoding::Encoder<'_, D>,
8371 offset: usize,
8372 mut depth: fidl::encoding::Depth,
8373 ) -> fidl::Result<()> {
8374 encoder.debug_check_bounds::<WlanSoftmacQueryResponse>(offset);
8375 let max_ordinal: u64 = self.max_ordinal_present();
8377 encoder.write_num(max_ordinal, offset);
8378 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8379 if max_ordinal == 0 {
8381 return Ok(());
8382 }
8383 depth.increment()?;
8384 let envelope_size = 8;
8385 let bytes_len = max_ordinal as usize * envelope_size;
8386 #[allow(unused_variables)]
8387 let offset = encoder.out_of_line_offset(bytes_len);
8388 let mut _prev_end_offset: usize = 0;
8389 if 1 > max_ordinal {
8390 return Ok(());
8391 }
8392
8393 let cur_offset: usize = (1 - 1) * envelope_size;
8396
8397 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8399
8400 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
8405 self.sta_addr
8406 .as_ref()
8407 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
8408 encoder,
8409 offset + cur_offset,
8410 depth,
8411 )?;
8412
8413 _prev_end_offset = cur_offset + envelope_size;
8414 if 2 > max_ordinal {
8415 return Ok(());
8416 }
8417
8418 let cur_offset: usize = (2 - 1) * envelope_size;
8421
8422 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8424
8425 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanMacRole, D>(
8430 self.mac_role.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow),
8431 encoder, offset + cur_offset, depth
8432 )?;
8433
8434 _prev_end_offset = cur_offset + envelope_size;
8435 if 3 > max_ordinal {
8436 return Ok(());
8437 }
8438
8439 let cur_offset: usize = (3 - 1) * envelope_size;
8442
8443 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8445
8446 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D>(
8451 self.supported_phys.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64> as fidl::encoding::ValueTypeMarker>::borrow),
8452 encoder, offset + cur_offset, depth
8453 )?;
8454
8455 _prev_end_offset = cur_offset + envelope_size;
8456 if 4 > max_ordinal {
8457 return Ok(());
8458 }
8459
8460 let cur_offset: usize = (4 - 1) * envelope_size;
8463
8464 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8466
8467 fidl::encoding::encode_in_envelope_optional::<u32, D>(
8472 self.hardware_capability
8473 .as_ref()
8474 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
8475 encoder,
8476 offset + cur_offset,
8477 depth,
8478 )?;
8479
8480 _prev_end_offset = cur_offset + envelope_size;
8481 if 5 > max_ordinal {
8482 return Ok(());
8483 }
8484
8485 let cur_offset: usize = (5 - 1) * envelope_size;
8488
8489 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8491
8492 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D>(
8497 self.band_caps.as_ref().map(<fidl::encoding::Vector<WlanSoftmacBandCapability, 16> as fidl::encoding::ValueTypeMarker>::borrow),
8498 encoder, offset + cur_offset, depth
8499 )?;
8500
8501 _prev_end_offset = cur_offset + envelope_size;
8502
8503 Ok(())
8504 }
8505 }
8506
8507 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8508 for WlanSoftmacQueryResponse
8509 {
8510 #[inline(always)]
8511 fn new_empty() -> Self {
8512 Self::default()
8513 }
8514
8515 unsafe fn decode(
8516 &mut self,
8517 decoder: &mut fidl::encoding::Decoder<'_, D>,
8518 offset: usize,
8519 mut depth: fidl::encoding::Depth,
8520 ) -> fidl::Result<()> {
8521 decoder.debug_check_bounds::<Self>(offset);
8522 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8523 None => return Err(fidl::Error::NotNullable),
8524 Some(len) => len,
8525 };
8526 if len == 0 {
8528 return Ok(());
8529 };
8530 depth.increment()?;
8531 let envelope_size = 8;
8532 let bytes_len = len * envelope_size;
8533 let offset = decoder.out_of_line_offset(bytes_len)?;
8534 let mut _next_ordinal_to_read = 0;
8536 let mut next_offset = offset;
8537 let end_offset = offset + bytes_len;
8538 _next_ordinal_to_read += 1;
8539 if next_offset >= end_offset {
8540 return Ok(());
8541 }
8542
8543 while _next_ordinal_to_read < 1 {
8545 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8546 _next_ordinal_to_read += 1;
8547 next_offset += envelope_size;
8548 }
8549
8550 let next_out_of_line = decoder.next_out_of_line();
8551 let handles_before = decoder.remaining_handles();
8552 if let Some((inlined, num_bytes, num_handles)) =
8553 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8554 {
8555 let member_inline_size =
8556 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
8557 decoder.context,
8558 );
8559 if inlined != (member_inline_size <= 4) {
8560 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8561 }
8562 let inner_offset;
8563 let mut inner_depth = depth.clone();
8564 if inlined {
8565 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8566 inner_offset = next_offset;
8567 } else {
8568 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8569 inner_depth.increment()?;
8570 }
8571 let val_ref = self
8572 .sta_addr
8573 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
8574 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
8575 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8576 {
8577 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8578 }
8579 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8580 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8581 }
8582 }
8583
8584 next_offset += envelope_size;
8585 _next_ordinal_to_read += 1;
8586 if next_offset >= end_offset {
8587 return Ok(());
8588 }
8589
8590 while _next_ordinal_to_read < 2 {
8592 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8593 _next_ordinal_to_read += 1;
8594 next_offset += envelope_size;
8595 }
8596
8597 let next_out_of_line = decoder.next_out_of_line();
8598 let handles_before = decoder.remaining_handles();
8599 if let Some((inlined, num_bytes, num_handles)) =
8600 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8601 {
8602 let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8603 if inlined != (member_inline_size <= 4) {
8604 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8605 }
8606 let inner_offset;
8607 let mut inner_depth = depth.clone();
8608 if inlined {
8609 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8610 inner_offset = next_offset;
8611 } else {
8612 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8613 inner_depth.increment()?;
8614 }
8615 let val_ref = self.mac_role.get_or_insert_with(|| {
8616 fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanMacRole, D)
8617 });
8618 fidl::decode!(
8619 fidl_fuchsia_wlan_common__common::WlanMacRole,
8620 D,
8621 val_ref,
8622 decoder,
8623 inner_offset,
8624 inner_depth
8625 )?;
8626 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8627 {
8628 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8629 }
8630 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8631 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8632 }
8633 }
8634
8635 next_offset += envelope_size;
8636 _next_ordinal_to_read += 1;
8637 if next_offset >= end_offset {
8638 return Ok(());
8639 }
8640
8641 while _next_ordinal_to_read < 3 {
8643 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8644 _next_ordinal_to_read += 1;
8645 next_offset += envelope_size;
8646 }
8647
8648 let next_out_of_line = decoder.next_out_of_line();
8649 let handles_before = decoder.remaining_handles();
8650 if let Some((inlined, num_bytes, num_handles)) =
8651 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8652 {
8653 let member_inline_size = <fidl::encoding::Vector<
8654 fidl_fuchsia_wlan_common__common::WlanPhyType,
8655 64,
8656 > as fidl::encoding::TypeMarker>::inline_size(
8657 decoder.context
8658 );
8659 if inlined != (member_inline_size <= 4) {
8660 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8661 }
8662 let inner_offset;
8663 let mut inner_depth = depth.clone();
8664 if inlined {
8665 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8666 inner_offset = next_offset;
8667 } else {
8668 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8669 inner_depth.increment()?;
8670 }
8671 let val_ref =
8672 self.supported_phys.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D));
8673 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
8674 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8675 {
8676 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8677 }
8678 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8679 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8680 }
8681 }
8682
8683 next_offset += envelope_size;
8684 _next_ordinal_to_read += 1;
8685 if next_offset >= end_offset {
8686 return Ok(());
8687 }
8688
8689 while _next_ordinal_to_read < 4 {
8691 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8692 _next_ordinal_to_read += 1;
8693 next_offset += envelope_size;
8694 }
8695
8696 let next_out_of_line = decoder.next_out_of_line();
8697 let handles_before = decoder.remaining_handles();
8698 if let Some((inlined, num_bytes, num_handles)) =
8699 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8700 {
8701 let member_inline_size =
8702 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8703 if inlined != (member_inline_size <= 4) {
8704 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8705 }
8706 let inner_offset;
8707 let mut inner_depth = depth.clone();
8708 if inlined {
8709 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8710 inner_offset = next_offset;
8711 } else {
8712 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8713 inner_depth.increment()?;
8714 }
8715 let val_ref =
8716 self.hardware_capability.get_or_insert_with(|| fidl::new_empty!(u32, D));
8717 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
8718 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8719 {
8720 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8721 }
8722 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8723 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8724 }
8725 }
8726
8727 next_offset += envelope_size;
8728 _next_ordinal_to_read += 1;
8729 if next_offset >= end_offset {
8730 return Ok(());
8731 }
8732
8733 while _next_ordinal_to_read < 5 {
8735 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8736 _next_ordinal_to_read += 1;
8737 next_offset += envelope_size;
8738 }
8739
8740 let next_out_of_line = decoder.next_out_of_line();
8741 let handles_before = decoder.remaining_handles();
8742 if let Some((inlined, num_bytes, num_handles)) =
8743 fidl::encoding::decode_envelope_header(decoder, next_offset)?
8744 {
8745 let member_inline_size = <fidl::encoding::Vector<WlanSoftmacBandCapability, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8746 if inlined != (member_inline_size <= 4) {
8747 return Err(fidl::Error::InvalidInlineBitInEnvelope);
8748 }
8749 let inner_offset;
8750 let mut inner_depth = depth.clone();
8751 if inlined {
8752 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8753 inner_offset = next_offset;
8754 } else {
8755 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8756 inner_depth.increment()?;
8757 }
8758 let val_ref = self.band_caps.get_or_insert_with(
8759 || fidl::new_empty!(fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D),
8760 );
8761 fidl::decode!(fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
8762 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8763 {
8764 return Err(fidl::Error::InvalidNumBytesInEnvelope);
8765 }
8766 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8767 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8768 }
8769 }
8770
8771 next_offset += envelope_size;
8772
8773 while next_offset < end_offset {
8775 _next_ordinal_to_read += 1;
8776 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8777 next_offset += envelope_size;
8778 }
8779
8780 Ok(())
8781 }
8782 }
8783
8784 impl WlanSoftmacStartActiveScanRequest {
8785 #[inline(always)]
8786 fn max_ordinal_present(&self) -> u64 {
8787 if let Some(_) = self.max_probes_per_channel {
8788 return 9;
8789 }
8790 if let Some(_) = self.min_probes_per_channel {
8791 return 8;
8792 }
8793 if let Some(_) = self.min_home_time {
8794 return 7;
8795 }
8796 if let Some(_) = self.max_channel_time {
8797 return 6;
8798 }
8799 if let Some(_) = self.min_channel_time {
8800 return 5;
8801 }
8802 if let Some(_) = self.ies {
8803 return 4;
8804 }
8805 if let Some(_) = self.mac_header {
8806 return 3;
8807 }
8808 if let Some(_) = self.ssids {
8809 return 2;
8810 }
8811 if let Some(_) = self.channels {
8812 return 1;
8813 }
8814 0
8815 }
8816 }
8817
8818 impl fidl::encoding::ValueTypeMarker for WlanSoftmacStartActiveScanRequest {
8819 type Borrowed<'a> = &'a Self;
8820 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8821 value
8822 }
8823 }
8824
8825 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacStartActiveScanRequest {
8826 type Owned = Self;
8827
8828 #[inline(always)]
8829 fn inline_align(_context: fidl::encoding::Context) -> usize {
8830 8
8831 }
8832
8833 #[inline(always)]
8834 fn inline_size(_context: fidl::encoding::Context) -> usize {
8835 16
8836 }
8837 }
8838
8839 unsafe impl<D: fidl::encoding::ResourceDialect>
8840 fidl::encoding::Encode<WlanSoftmacStartActiveScanRequest, D>
8841 for &WlanSoftmacStartActiveScanRequest
8842 {
8843 unsafe fn encode(
8844 self,
8845 encoder: &mut fidl::encoding::Encoder<'_, D>,
8846 offset: usize,
8847 mut depth: fidl::encoding::Depth,
8848 ) -> fidl::Result<()> {
8849 encoder.debug_check_bounds::<WlanSoftmacStartActiveScanRequest>(offset);
8850 let max_ordinal: u64 = self.max_ordinal_present();
8852 encoder.write_num(max_ordinal, offset);
8853 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8854 if max_ordinal == 0 {
8856 return Ok(());
8857 }
8858 depth.increment()?;
8859 let envelope_size = 8;
8860 let bytes_len = max_ordinal as usize * envelope_size;
8861 #[allow(unused_variables)]
8862 let offset = encoder.out_of_line_offset(bytes_len);
8863 let mut _prev_end_offset: usize = 0;
8864 if 1 > max_ordinal {
8865 return Ok(());
8866 }
8867
8868 let cur_offset: usize = (1 - 1) * envelope_size;
8871
8872 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8874
8875 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
8880 self.channels.as_ref().map(
8881 <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
8882 ),
8883 encoder,
8884 offset + cur_offset,
8885 depth,
8886 )?;
8887
8888 _prev_end_offset = cur_offset + envelope_size;
8889 if 2 > max_ordinal {
8890 return Ok(());
8891 }
8892
8893 let cur_offset: usize = (2 - 1) * envelope_size;
8896
8897 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8899
8900 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84>, D>(
8905 self.ssids.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84> as fidl::encoding::ValueTypeMarker>::borrow),
8906 encoder, offset + cur_offset, depth
8907 )?;
8908
8909 _prev_end_offset = cur_offset + envelope_size;
8910 if 3 > max_ordinal {
8911 return Ok(());
8912 }
8913
8914 let cur_offset: usize = (3 - 1) * envelope_size;
8917
8918 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8920
8921 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 28>, D>(
8926 self.mac_header.as_ref().map(
8927 <fidl::encoding::Vector<u8, 28> as fidl::encoding::ValueTypeMarker>::borrow,
8928 ),
8929 encoder,
8930 offset + cur_offset,
8931 depth,
8932 )?;
8933
8934 _prev_end_offset = cur_offset + envelope_size;
8935 if 4 > max_ordinal {
8936 return Ok(());
8937 }
8938
8939 let cur_offset: usize = (4 - 1) * envelope_size;
8942
8943 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8945
8946 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 11454>, D>(
8951 self.ies.as_ref().map(
8952 <fidl::encoding::Vector<u8, 11454> as fidl::encoding::ValueTypeMarker>::borrow,
8953 ),
8954 encoder,
8955 offset + cur_offset,
8956 depth,
8957 )?;
8958
8959 _prev_end_offset = cur_offset + envelope_size;
8960 if 5 > max_ordinal {
8961 return Ok(());
8962 }
8963
8964 let cur_offset: usize = (5 - 1) * envelope_size;
8967
8968 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8970
8971 fidl::encoding::encode_in_envelope_optional::<i64, D>(
8976 self.min_channel_time
8977 .as_ref()
8978 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
8979 encoder,
8980 offset + cur_offset,
8981 depth,
8982 )?;
8983
8984 _prev_end_offset = cur_offset + envelope_size;
8985 if 6 > max_ordinal {
8986 return Ok(());
8987 }
8988
8989 let cur_offset: usize = (6 - 1) * envelope_size;
8992
8993 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8995
8996 fidl::encoding::encode_in_envelope_optional::<i64, D>(
9001 self.max_channel_time
9002 .as_ref()
9003 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9004 encoder,
9005 offset + cur_offset,
9006 depth,
9007 )?;
9008
9009 _prev_end_offset = cur_offset + envelope_size;
9010 if 7 > max_ordinal {
9011 return Ok(());
9012 }
9013
9014 let cur_offset: usize = (7 - 1) * envelope_size;
9017
9018 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9020
9021 fidl::encoding::encode_in_envelope_optional::<i64, D>(
9026 self.min_home_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9027 encoder,
9028 offset + cur_offset,
9029 depth,
9030 )?;
9031
9032 _prev_end_offset = cur_offset + envelope_size;
9033 if 8 > max_ordinal {
9034 return Ok(());
9035 }
9036
9037 let cur_offset: usize = (8 - 1) * envelope_size;
9040
9041 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9043
9044 fidl::encoding::encode_in_envelope_optional::<u8, D>(
9049 self.min_probes_per_channel
9050 .as_ref()
9051 .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
9052 encoder,
9053 offset + cur_offset,
9054 depth,
9055 )?;
9056
9057 _prev_end_offset = cur_offset + envelope_size;
9058 if 9 > max_ordinal {
9059 return Ok(());
9060 }
9061
9062 let cur_offset: usize = (9 - 1) * envelope_size;
9065
9066 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9068
9069 fidl::encoding::encode_in_envelope_optional::<u8, D>(
9074 self.max_probes_per_channel
9075 .as_ref()
9076 .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
9077 encoder,
9078 offset + cur_offset,
9079 depth,
9080 )?;
9081
9082 _prev_end_offset = cur_offset + envelope_size;
9083
9084 Ok(())
9085 }
9086 }
9087
9088 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9089 for WlanSoftmacStartActiveScanRequest
9090 {
9091 #[inline(always)]
9092 fn new_empty() -> Self {
9093 Self::default()
9094 }
9095
9096 unsafe fn decode(
9097 &mut self,
9098 decoder: &mut fidl::encoding::Decoder<'_, D>,
9099 offset: usize,
9100 mut depth: fidl::encoding::Depth,
9101 ) -> fidl::Result<()> {
9102 decoder.debug_check_bounds::<Self>(offset);
9103 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9104 None => return Err(fidl::Error::NotNullable),
9105 Some(len) => len,
9106 };
9107 if len == 0 {
9109 return Ok(());
9110 };
9111 depth.increment()?;
9112 let envelope_size = 8;
9113 let bytes_len = len * envelope_size;
9114 let offset = decoder.out_of_line_offset(bytes_len)?;
9115 let mut _next_ordinal_to_read = 0;
9117 let mut next_offset = offset;
9118 let end_offset = offset + bytes_len;
9119 _next_ordinal_to_read += 1;
9120 if next_offset >= end_offset {
9121 return Ok(());
9122 }
9123
9124 while _next_ordinal_to_read < 1 {
9126 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9127 _next_ordinal_to_read += 1;
9128 next_offset += envelope_size;
9129 }
9130
9131 let next_out_of_line = decoder.next_out_of_line();
9132 let handles_before = decoder.remaining_handles();
9133 if let Some((inlined, num_bytes, num_handles)) =
9134 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9135 {
9136 let member_inline_size =
9137 <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
9138 decoder.context,
9139 );
9140 if inlined != (member_inline_size <= 4) {
9141 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9142 }
9143 let inner_offset;
9144 let mut inner_depth = depth.clone();
9145 if inlined {
9146 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9147 inner_offset = next_offset;
9148 } else {
9149 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9150 inner_depth.increment()?;
9151 }
9152 let val_ref = self
9153 .channels
9154 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
9155 fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
9156 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9157 {
9158 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9159 }
9160 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9161 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9162 }
9163 }
9164
9165 next_offset += envelope_size;
9166 _next_ordinal_to_read += 1;
9167 if next_offset >= end_offset {
9168 return Ok(());
9169 }
9170
9171 while _next_ordinal_to_read < 2 {
9173 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9174 _next_ordinal_to_read += 1;
9175 next_offset += envelope_size;
9176 }
9177
9178 let next_out_of_line = decoder.next_out_of_line();
9179 let handles_before = decoder.remaining_handles();
9180 if let Some((inlined, num_bytes, num_handles)) =
9181 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9182 {
9183 let member_inline_size = <fidl::encoding::Vector<
9184 fidl_fuchsia_wlan_ieee80211__common::CSsid,
9185 84,
9186 > as fidl::encoding::TypeMarker>::inline_size(
9187 decoder.context
9188 );
9189 if inlined != (member_inline_size <= 4) {
9190 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9191 }
9192 let inner_offset;
9193 let mut inner_depth = depth.clone();
9194 if inlined {
9195 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9196 inner_offset = next_offset;
9197 } else {
9198 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9199 inner_depth.increment()?;
9200 }
9201 let val_ref =
9202 self.ssids.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84>, D));
9203 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84>, D, val_ref, decoder, inner_offset, inner_depth)?;
9204 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9205 {
9206 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9207 }
9208 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9209 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9210 }
9211 }
9212
9213 next_offset += envelope_size;
9214 _next_ordinal_to_read += 1;
9215 if next_offset >= end_offset {
9216 return Ok(());
9217 }
9218
9219 while _next_ordinal_to_read < 3 {
9221 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9222 _next_ordinal_to_read += 1;
9223 next_offset += envelope_size;
9224 }
9225
9226 let next_out_of_line = decoder.next_out_of_line();
9227 let handles_before = decoder.remaining_handles();
9228 if let Some((inlined, num_bytes, num_handles)) =
9229 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9230 {
9231 let member_inline_size =
9232 <fidl::encoding::Vector<u8, 28> as fidl::encoding::TypeMarker>::inline_size(
9233 decoder.context,
9234 );
9235 if inlined != (member_inline_size <= 4) {
9236 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9237 }
9238 let inner_offset;
9239 let mut inner_depth = depth.clone();
9240 if inlined {
9241 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9242 inner_offset = next_offset;
9243 } else {
9244 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9245 inner_depth.increment()?;
9246 }
9247 let val_ref = self
9248 .mac_header
9249 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 28>, D));
9250 fidl::decode!(fidl::encoding::Vector<u8, 28>, D, val_ref, decoder, inner_offset, inner_depth)?;
9251 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9252 {
9253 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9254 }
9255 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9256 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9257 }
9258 }
9259
9260 next_offset += envelope_size;
9261 _next_ordinal_to_read += 1;
9262 if next_offset >= end_offset {
9263 return Ok(());
9264 }
9265
9266 while _next_ordinal_to_read < 4 {
9268 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9269 _next_ordinal_to_read += 1;
9270 next_offset += envelope_size;
9271 }
9272
9273 let next_out_of_line = decoder.next_out_of_line();
9274 let handles_before = decoder.remaining_handles();
9275 if let Some((inlined, num_bytes, num_handles)) =
9276 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9277 {
9278 let member_inline_size =
9279 <fidl::encoding::Vector<u8, 11454> as fidl::encoding::TypeMarker>::inline_size(
9280 decoder.context,
9281 );
9282 if inlined != (member_inline_size <= 4) {
9283 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9284 }
9285 let inner_offset;
9286 let mut inner_depth = depth.clone();
9287 if inlined {
9288 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9289 inner_offset = next_offset;
9290 } else {
9291 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9292 inner_depth.increment()?;
9293 }
9294 let val_ref = self
9295 .ies
9296 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 11454>, D));
9297 fidl::decode!(fidl::encoding::Vector<u8, 11454>, D, val_ref, decoder, inner_offset, inner_depth)?;
9298 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9299 {
9300 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9301 }
9302 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9303 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9304 }
9305 }
9306
9307 next_offset += envelope_size;
9308 _next_ordinal_to_read += 1;
9309 if next_offset >= end_offset {
9310 return Ok(());
9311 }
9312
9313 while _next_ordinal_to_read < 5 {
9315 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9316 _next_ordinal_to_read += 1;
9317 next_offset += envelope_size;
9318 }
9319
9320 let next_out_of_line = decoder.next_out_of_line();
9321 let handles_before = decoder.remaining_handles();
9322 if let Some((inlined, num_bytes, num_handles)) =
9323 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9324 {
9325 let member_inline_size =
9326 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9327 if inlined != (member_inline_size <= 4) {
9328 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9329 }
9330 let inner_offset;
9331 let mut inner_depth = depth.clone();
9332 if inlined {
9333 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9334 inner_offset = next_offset;
9335 } else {
9336 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9337 inner_depth.increment()?;
9338 }
9339 let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
9340 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9341 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9342 {
9343 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9344 }
9345 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9346 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9347 }
9348 }
9349
9350 next_offset += envelope_size;
9351 _next_ordinal_to_read += 1;
9352 if next_offset >= end_offset {
9353 return Ok(());
9354 }
9355
9356 while _next_ordinal_to_read < 6 {
9358 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9359 _next_ordinal_to_read += 1;
9360 next_offset += envelope_size;
9361 }
9362
9363 let next_out_of_line = decoder.next_out_of_line();
9364 let handles_before = decoder.remaining_handles();
9365 if let Some((inlined, num_bytes, num_handles)) =
9366 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9367 {
9368 let member_inline_size =
9369 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9370 if inlined != (member_inline_size <= 4) {
9371 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9372 }
9373 let inner_offset;
9374 let mut inner_depth = depth.clone();
9375 if inlined {
9376 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9377 inner_offset = next_offset;
9378 } else {
9379 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9380 inner_depth.increment()?;
9381 }
9382 let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
9383 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9384 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9385 {
9386 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9387 }
9388 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9389 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9390 }
9391 }
9392
9393 next_offset += envelope_size;
9394 _next_ordinal_to_read += 1;
9395 if next_offset >= end_offset {
9396 return Ok(());
9397 }
9398
9399 while _next_ordinal_to_read < 7 {
9401 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9402 _next_ordinal_to_read += 1;
9403 next_offset += envelope_size;
9404 }
9405
9406 let next_out_of_line = decoder.next_out_of_line();
9407 let handles_before = decoder.remaining_handles();
9408 if let Some((inlined, num_bytes, num_handles)) =
9409 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9410 {
9411 let member_inline_size =
9412 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9413 if inlined != (member_inline_size <= 4) {
9414 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9415 }
9416 let inner_offset;
9417 let mut inner_depth = depth.clone();
9418 if inlined {
9419 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9420 inner_offset = next_offset;
9421 } else {
9422 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9423 inner_depth.increment()?;
9424 }
9425 let val_ref = self.min_home_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
9426 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9427 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9428 {
9429 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9430 }
9431 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9432 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9433 }
9434 }
9435
9436 next_offset += envelope_size;
9437 _next_ordinal_to_read += 1;
9438 if next_offset >= end_offset {
9439 return Ok(());
9440 }
9441
9442 while _next_ordinal_to_read < 8 {
9444 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9445 _next_ordinal_to_read += 1;
9446 next_offset += envelope_size;
9447 }
9448
9449 let next_out_of_line = decoder.next_out_of_line();
9450 let handles_before = decoder.remaining_handles();
9451 if let Some((inlined, num_bytes, num_handles)) =
9452 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9453 {
9454 let member_inline_size =
9455 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9456 if inlined != (member_inline_size <= 4) {
9457 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9458 }
9459 let inner_offset;
9460 let mut inner_depth = depth.clone();
9461 if inlined {
9462 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9463 inner_offset = next_offset;
9464 } else {
9465 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9466 inner_depth.increment()?;
9467 }
9468 let val_ref =
9469 self.min_probes_per_channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
9470 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
9471 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9472 {
9473 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9474 }
9475 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9476 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9477 }
9478 }
9479
9480 next_offset += envelope_size;
9481 _next_ordinal_to_read += 1;
9482 if next_offset >= end_offset {
9483 return Ok(());
9484 }
9485
9486 while _next_ordinal_to_read < 9 {
9488 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9489 _next_ordinal_to_read += 1;
9490 next_offset += envelope_size;
9491 }
9492
9493 let next_out_of_line = decoder.next_out_of_line();
9494 let handles_before = decoder.remaining_handles();
9495 if let Some((inlined, num_bytes, num_handles)) =
9496 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9497 {
9498 let member_inline_size =
9499 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9500 if inlined != (member_inline_size <= 4) {
9501 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9502 }
9503 let inner_offset;
9504 let mut inner_depth = depth.clone();
9505 if inlined {
9506 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9507 inner_offset = next_offset;
9508 } else {
9509 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9510 inner_depth.increment()?;
9511 }
9512 let val_ref =
9513 self.max_probes_per_channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
9514 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
9515 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9516 {
9517 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9518 }
9519 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9520 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9521 }
9522 }
9523
9524 next_offset += envelope_size;
9525
9526 while next_offset < end_offset {
9528 _next_ordinal_to_read += 1;
9529 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9530 next_offset += envelope_size;
9531 }
9532
9533 Ok(())
9534 }
9535 }
9536
9537 impl WlanTxTransferRequest {
9538 #[inline(always)]
9539 fn max_ordinal_present(&self) -> u64 {
9540 if let Some(_) = self.arena {
9541 return 5;
9542 }
9543 if let Some(_) = self.async_id {
9544 return 4;
9545 }
9546 if let Some(_) = self.packet_info {
9547 return 3;
9548 }
9549 if let Some(_) = self.packet_size {
9550 return 2;
9551 }
9552 if let Some(_) = self.packet_address {
9553 return 1;
9554 }
9555 0
9556 }
9557 }
9558
9559 impl fidl::encoding::ValueTypeMarker for WlanTxTransferRequest {
9560 type Borrowed<'a> = &'a Self;
9561 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9562 value
9563 }
9564 }
9565
9566 unsafe impl fidl::encoding::TypeMarker for WlanTxTransferRequest {
9567 type Owned = Self;
9568
9569 #[inline(always)]
9570 fn inline_align(_context: fidl::encoding::Context) -> usize {
9571 8
9572 }
9573
9574 #[inline(always)]
9575 fn inline_size(_context: fidl::encoding::Context) -> usize {
9576 16
9577 }
9578 }
9579
9580 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxTransferRequest, D>
9581 for &WlanTxTransferRequest
9582 {
9583 unsafe fn encode(
9584 self,
9585 encoder: &mut fidl::encoding::Encoder<'_, D>,
9586 offset: usize,
9587 mut depth: fidl::encoding::Depth,
9588 ) -> fidl::Result<()> {
9589 encoder.debug_check_bounds::<WlanTxTransferRequest>(offset);
9590 let max_ordinal: u64 = self.max_ordinal_present();
9592 encoder.write_num(max_ordinal, offset);
9593 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9594 if max_ordinal == 0 {
9596 return Ok(());
9597 }
9598 depth.increment()?;
9599 let envelope_size = 8;
9600 let bytes_len = max_ordinal as usize * envelope_size;
9601 #[allow(unused_variables)]
9602 let offset = encoder.out_of_line_offset(bytes_len);
9603 let mut _prev_end_offset: usize = 0;
9604 if 1 > max_ordinal {
9605 return Ok(());
9606 }
9607
9608 let cur_offset: usize = (1 - 1) * envelope_size;
9611
9612 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9614
9615 fidl::encoding::encode_in_envelope_optional::<u64, D>(
9620 self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9621 encoder,
9622 offset + cur_offset,
9623 depth,
9624 )?;
9625
9626 _prev_end_offset = cur_offset + envelope_size;
9627 if 2 > max_ordinal {
9628 return Ok(());
9629 }
9630
9631 let cur_offset: usize = (2 - 1) * envelope_size;
9634
9635 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9637
9638 fidl::encoding::encode_in_envelope_optional::<u64, D>(
9643 self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9644 encoder,
9645 offset + cur_offset,
9646 depth,
9647 )?;
9648
9649 _prev_end_offset = cur_offset + envelope_size;
9650 if 3 > max_ordinal {
9651 return Ok(());
9652 }
9653
9654 let cur_offset: usize = (3 - 1) * envelope_size;
9657
9658 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9660
9661 fidl::encoding::encode_in_envelope_optional::<WlanTxInfo, D>(
9666 self.packet_info
9667 .as_ref()
9668 .map(<WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow),
9669 encoder,
9670 offset + cur_offset,
9671 depth,
9672 )?;
9673
9674 _prev_end_offset = cur_offset + envelope_size;
9675 if 4 > max_ordinal {
9676 return Ok(());
9677 }
9678
9679 let cur_offset: usize = (4 - 1) * envelope_size;
9682
9683 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9685
9686 fidl::encoding::encode_in_envelope_optional::<u64, D>(
9691 self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9692 encoder,
9693 offset + cur_offset,
9694 depth,
9695 )?;
9696
9697 _prev_end_offset = cur_offset + envelope_size;
9698 if 5 > max_ordinal {
9699 return Ok(());
9700 }
9701
9702 let cur_offset: usize = (5 - 1) * envelope_size;
9705
9706 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9708
9709 fidl::encoding::encode_in_envelope_optional::<u64, D>(
9714 self.arena.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9715 encoder,
9716 offset + cur_offset,
9717 depth,
9718 )?;
9719
9720 _prev_end_offset = cur_offset + envelope_size;
9721
9722 Ok(())
9723 }
9724 }
9725
9726 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxTransferRequest {
9727 #[inline(always)]
9728 fn new_empty() -> Self {
9729 Self::default()
9730 }
9731
9732 unsafe fn decode(
9733 &mut self,
9734 decoder: &mut fidl::encoding::Decoder<'_, D>,
9735 offset: usize,
9736 mut depth: fidl::encoding::Depth,
9737 ) -> fidl::Result<()> {
9738 decoder.debug_check_bounds::<Self>(offset);
9739 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9740 None => return Err(fidl::Error::NotNullable),
9741 Some(len) => len,
9742 };
9743 if len == 0 {
9745 return Ok(());
9746 };
9747 depth.increment()?;
9748 let envelope_size = 8;
9749 let bytes_len = len * envelope_size;
9750 let offset = decoder.out_of_line_offset(bytes_len)?;
9751 let mut _next_ordinal_to_read = 0;
9753 let mut next_offset = offset;
9754 let end_offset = offset + bytes_len;
9755 _next_ordinal_to_read += 1;
9756 if next_offset >= end_offset {
9757 return Ok(());
9758 }
9759
9760 while _next_ordinal_to_read < 1 {
9762 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9763 _next_ordinal_to_read += 1;
9764 next_offset += envelope_size;
9765 }
9766
9767 let next_out_of_line = decoder.next_out_of_line();
9768 let handles_before = decoder.remaining_handles();
9769 if let Some((inlined, num_bytes, num_handles)) =
9770 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9771 {
9772 let member_inline_size =
9773 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9774 if inlined != (member_inline_size <= 4) {
9775 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9776 }
9777 let inner_offset;
9778 let mut inner_depth = depth.clone();
9779 if inlined {
9780 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9781 inner_offset = next_offset;
9782 } else {
9783 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9784 inner_depth.increment()?;
9785 }
9786 let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
9787 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9788 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9789 {
9790 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9791 }
9792 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9793 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9794 }
9795 }
9796
9797 next_offset += envelope_size;
9798 _next_ordinal_to_read += 1;
9799 if next_offset >= end_offset {
9800 return Ok(());
9801 }
9802
9803 while _next_ordinal_to_read < 2 {
9805 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9806 _next_ordinal_to_read += 1;
9807 next_offset += envelope_size;
9808 }
9809
9810 let next_out_of_line = decoder.next_out_of_line();
9811 let handles_before = decoder.remaining_handles();
9812 if let Some((inlined, num_bytes, num_handles)) =
9813 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9814 {
9815 let member_inline_size =
9816 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9817 if inlined != (member_inline_size <= 4) {
9818 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9819 }
9820 let inner_offset;
9821 let mut inner_depth = depth.clone();
9822 if inlined {
9823 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9824 inner_offset = next_offset;
9825 } else {
9826 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9827 inner_depth.increment()?;
9828 }
9829 let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
9830 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9831 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9832 {
9833 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9834 }
9835 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9836 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9837 }
9838 }
9839
9840 next_offset += envelope_size;
9841 _next_ordinal_to_read += 1;
9842 if next_offset >= end_offset {
9843 return Ok(());
9844 }
9845
9846 while _next_ordinal_to_read < 3 {
9848 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9849 _next_ordinal_to_read += 1;
9850 next_offset += envelope_size;
9851 }
9852
9853 let next_out_of_line = decoder.next_out_of_line();
9854 let handles_before = decoder.remaining_handles();
9855 if let Some((inlined, num_bytes, num_handles)) =
9856 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9857 {
9858 let member_inline_size =
9859 <WlanTxInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9860 if inlined != (member_inline_size <= 4) {
9861 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9862 }
9863 let inner_offset;
9864 let mut inner_depth = depth.clone();
9865 if inlined {
9866 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9867 inner_offset = next_offset;
9868 } else {
9869 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9870 inner_depth.increment()?;
9871 }
9872 let val_ref =
9873 self.packet_info.get_or_insert_with(|| fidl::new_empty!(WlanTxInfo, D));
9874 fidl::decode!(WlanTxInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
9875 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9876 {
9877 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9878 }
9879 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9880 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9881 }
9882 }
9883
9884 next_offset += envelope_size;
9885 _next_ordinal_to_read += 1;
9886 if next_offset >= end_offset {
9887 return Ok(());
9888 }
9889
9890 while _next_ordinal_to_read < 4 {
9892 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9893 _next_ordinal_to_read += 1;
9894 next_offset += envelope_size;
9895 }
9896
9897 let next_out_of_line = decoder.next_out_of_line();
9898 let handles_before = decoder.remaining_handles();
9899 if let Some((inlined, num_bytes, num_handles)) =
9900 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9901 {
9902 let member_inline_size =
9903 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9904 if inlined != (member_inline_size <= 4) {
9905 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9906 }
9907 let inner_offset;
9908 let mut inner_depth = depth.clone();
9909 if inlined {
9910 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9911 inner_offset = next_offset;
9912 } else {
9913 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9914 inner_depth.increment()?;
9915 }
9916 let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
9917 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9918 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9919 {
9920 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9921 }
9922 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9923 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9924 }
9925 }
9926
9927 next_offset += envelope_size;
9928 _next_ordinal_to_read += 1;
9929 if next_offset >= end_offset {
9930 return Ok(());
9931 }
9932
9933 while _next_ordinal_to_read < 5 {
9935 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9936 _next_ordinal_to_read += 1;
9937 next_offset += envelope_size;
9938 }
9939
9940 let next_out_of_line = decoder.next_out_of_line();
9941 let handles_before = decoder.remaining_handles();
9942 if let Some((inlined, num_bytes, num_handles)) =
9943 fidl::encoding::decode_envelope_header(decoder, next_offset)?
9944 {
9945 let member_inline_size =
9946 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9947 if inlined != (member_inline_size <= 4) {
9948 return Err(fidl::Error::InvalidInlineBitInEnvelope);
9949 }
9950 let inner_offset;
9951 let mut inner_depth = depth.clone();
9952 if inlined {
9953 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9954 inner_offset = next_offset;
9955 } else {
9956 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9957 inner_depth.increment()?;
9958 }
9959 let val_ref = self.arena.get_or_insert_with(|| fidl::new_empty!(u64, D));
9960 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9961 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9962 {
9963 return Err(fidl::Error::InvalidNumBytesInEnvelope);
9964 }
9965 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9966 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9967 }
9968 }
9969
9970 next_offset += envelope_size;
9971
9972 while next_offset < end_offset {
9974 _next_ordinal_to_read += 1;
9975 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9976 next_offset += envelope_size;
9977 }
9978
9979 Ok(())
9980 }
9981 }
9982}