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 MAX_ASSOC_BASIC_RATES: u8 = 14;
12
13#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
14#[repr(u32)]
15pub enum BtCoexistenceMode {
16 ModeAuto = 1,
17 ModeOff = 2,
18}
19
20impl BtCoexistenceMode {
21 #[inline]
22 pub fn from_primitive(prim: u32) -> Option<Self> {
23 match prim {
24 1 => Some(Self::ModeAuto),
25 2 => Some(Self::ModeOff),
26 _ => None,
27 }
28 }
29
30 #[inline]
31 pub const fn into_primitive(self) -> u32 {
32 self as u32
33 }
34}
35
36#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
38pub enum TxPowerScenario {
39 Default,
40 VoiceCall,
41 HeadCellOff,
42 HeadCellOn,
43 BodyCellOff,
44 BodyCellOn,
45 BodyBtActive,
46 #[doc(hidden)]
47 __SourceBreaking {
48 unknown_ordinal: u32,
49 },
50}
51
52#[macro_export]
54macro_rules! TxPowerScenarioUnknown {
55 () => {
56 _
57 };
58}
59
60impl TxPowerScenario {
61 #[inline]
62 pub fn from_primitive(prim: u32) -> Option<Self> {
63 match prim {
64 0 => Some(Self::Default),
65 1 => Some(Self::VoiceCall),
66 2 => Some(Self::HeadCellOff),
67 3 => Some(Self::HeadCellOn),
68 4 => Some(Self::BodyCellOff),
69 5 => Some(Self::BodyCellOn),
70 6 => Some(Self::BodyBtActive),
71 _ => None,
72 }
73 }
74
75 #[inline]
76 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
77 match prim {
78 0 => Self::Default,
79 1 => Self::VoiceCall,
80 2 => Self::HeadCellOff,
81 3 => Self::HeadCellOn,
82 4 => Self::BodyCellOff,
83 5 => Self::BodyCellOn,
84 6 => Self::BodyBtActive,
85 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
86 }
87 }
88
89 #[inline]
90 pub fn unknown() -> Self {
91 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
92 }
93
94 #[inline]
95 pub const fn into_primitive(self) -> u32 {
96 match self {
97 Self::Default => 0,
98 Self::VoiceCall => 1,
99 Self::HeadCellOff => 2,
100 Self::HeadCellOn => 3,
101 Self::BodyCellOff => 4,
102 Self::BodyCellOn => 5,
103 Self::BodyBtActive => 6,
104 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
105 }
106 }
107
108 #[inline]
109 pub fn is_unknown(&self) -> bool {
110 match self {
111 Self::__SourceBreaking { unknown_ordinal: _ } => true,
112 _ => false,
113 }
114 }
115}
116
117#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
118#[repr(C)]
119pub struct ChannelSwitchInfo {
120 pub new_channel: u8,
121}
122
123impl fidl::Persistable for ChannelSwitchInfo {}
124
125#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
126pub struct OwePublicKey {
127 pub group: u16,
128 pub key: Vec<u8>,
129}
130
131impl fidl::Persistable for OwePublicKey {}
132
133#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
134#[repr(C)]
135pub struct SignalReportIndication {
136 pub rssi_dbm: i8,
137 pub snr_db: i8,
138}
139
140impl fidl::Persistable for SignalReportIndication {}
141
142#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
144pub struct WmmAcParams {
145 pub ecw_min: u8,
149 pub ecw_max: u8,
153 pub aifsn: u8,
155 pub txop_limit: u16,
157 pub acm: bool,
159}
160
161impl fidl::Persistable for WmmAcParams {}
162
163#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
164pub struct WmmStatusResponse {
165 pub apsd: bool,
166 pub ac_be_params: WmmAcParams,
167 pub ac_bk_params: WmmAcParams,
168 pub ac_vi_params: WmmAcParams,
169 pub ac_vo_params: WmmAcParams,
170}
171
172impl fidl::Persistable for WmmStatusResponse {}
173
174mod internal {
175 use super::*;
176 unsafe impl fidl::encoding::TypeMarker for BtCoexistenceMode {
177 type Owned = Self;
178
179 #[inline(always)]
180 fn inline_align(_context: fidl::encoding::Context) -> usize {
181 std::mem::align_of::<u32>()
182 }
183
184 #[inline(always)]
185 fn inline_size(_context: fidl::encoding::Context) -> usize {
186 std::mem::size_of::<u32>()
187 }
188
189 #[inline(always)]
190 fn encode_is_copy() -> bool {
191 true
192 }
193
194 #[inline(always)]
195 fn decode_is_copy() -> bool {
196 false
197 }
198 }
199
200 impl fidl::encoding::ValueTypeMarker for BtCoexistenceMode {
201 type Borrowed<'a> = Self;
202 #[inline(always)]
203 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
204 *value
205 }
206 }
207
208 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
209 for BtCoexistenceMode
210 {
211 #[inline]
212 unsafe fn encode(
213 self,
214 encoder: &mut fidl::encoding::Encoder<'_, D>,
215 offset: usize,
216 _depth: fidl::encoding::Depth,
217 ) -> fidl::Result<()> {
218 encoder.debug_check_bounds::<Self>(offset);
219 encoder.write_num(self.into_primitive(), offset);
220 Ok(())
221 }
222 }
223
224 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BtCoexistenceMode {
225 #[inline(always)]
226 fn new_empty() -> Self {
227 Self::ModeAuto
228 }
229
230 #[inline]
231 unsafe fn decode(
232 &mut self,
233 decoder: &mut fidl::encoding::Decoder<'_, D>,
234 offset: usize,
235 _depth: fidl::encoding::Depth,
236 ) -> fidl::Result<()> {
237 decoder.debug_check_bounds::<Self>(offset);
238 let prim = decoder.read_num::<u32>(offset);
239
240 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
241 Ok(())
242 }
243 }
244 unsafe impl fidl::encoding::TypeMarker for TxPowerScenario {
245 type Owned = Self;
246
247 #[inline(always)]
248 fn inline_align(_context: fidl::encoding::Context) -> usize {
249 std::mem::align_of::<u32>()
250 }
251
252 #[inline(always)]
253 fn inline_size(_context: fidl::encoding::Context) -> usize {
254 std::mem::size_of::<u32>()
255 }
256
257 #[inline(always)]
258 fn encode_is_copy() -> bool {
259 false
260 }
261
262 #[inline(always)]
263 fn decode_is_copy() -> bool {
264 false
265 }
266 }
267
268 impl fidl::encoding::ValueTypeMarker for TxPowerScenario {
269 type Borrowed<'a> = Self;
270 #[inline(always)]
271 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
272 *value
273 }
274 }
275
276 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
277 for TxPowerScenario
278 {
279 #[inline]
280 unsafe fn encode(
281 self,
282 encoder: &mut fidl::encoding::Encoder<'_, D>,
283 offset: usize,
284 _depth: fidl::encoding::Depth,
285 ) -> fidl::Result<()> {
286 encoder.debug_check_bounds::<Self>(offset);
287 encoder.write_num(self.into_primitive(), offset);
288 Ok(())
289 }
290 }
291
292 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TxPowerScenario {
293 #[inline(always)]
294 fn new_empty() -> Self {
295 Self::unknown()
296 }
297
298 #[inline]
299 unsafe fn decode(
300 &mut self,
301 decoder: &mut fidl::encoding::Decoder<'_, D>,
302 offset: usize,
303 _depth: fidl::encoding::Depth,
304 ) -> fidl::Result<()> {
305 decoder.debug_check_bounds::<Self>(offset);
306 let prim = decoder.read_num::<u32>(offset);
307
308 *self = Self::from_primitive_allow_unknown(prim);
309 Ok(())
310 }
311 }
312
313 impl fidl::encoding::ValueTypeMarker for ChannelSwitchInfo {
314 type Borrowed<'a> = &'a Self;
315 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
316 value
317 }
318 }
319
320 unsafe impl fidl::encoding::TypeMarker for ChannelSwitchInfo {
321 type Owned = Self;
322
323 #[inline(always)]
324 fn inline_align(_context: fidl::encoding::Context) -> usize {
325 1
326 }
327
328 #[inline(always)]
329 fn inline_size(_context: fidl::encoding::Context) -> usize {
330 1
331 }
332 #[inline(always)]
333 fn encode_is_copy() -> bool {
334 true
335 }
336
337 #[inline(always)]
338 fn decode_is_copy() -> bool {
339 true
340 }
341 }
342
343 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ChannelSwitchInfo, D>
344 for &ChannelSwitchInfo
345 {
346 #[inline]
347 unsafe fn encode(
348 self,
349 encoder: &mut fidl::encoding::Encoder<'_, D>,
350 offset: usize,
351 _depth: fidl::encoding::Depth,
352 ) -> fidl::Result<()> {
353 encoder.debug_check_bounds::<ChannelSwitchInfo>(offset);
354 unsafe {
355 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
357 (buf_ptr as *mut ChannelSwitchInfo)
358 .write_unaligned((self as *const ChannelSwitchInfo).read());
359 }
362 Ok(())
363 }
364 }
365 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
366 fidl::encoding::Encode<ChannelSwitchInfo, D> for (T0,)
367 {
368 #[inline]
369 unsafe fn encode(
370 self,
371 encoder: &mut fidl::encoding::Encoder<'_, D>,
372 offset: usize,
373 depth: fidl::encoding::Depth,
374 ) -> fidl::Result<()> {
375 encoder.debug_check_bounds::<ChannelSwitchInfo>(offset);
376 self.0.encode(encoder, offset + 0, depth)?;
380 Ok(())
381 }
382 }
383
384 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChannelSwitchInfo {
385 #[inline(always)]
386 fn new_empty() -> Self {
387 Self { new_channel: fidl::new_empty!(u8, D) }
388 }
389
390 #[inline]
391 unsafe fn decode(
392 &mut self,
393 decoder: &mut fidl::encoding::Decoder<'_, D>,
394 offset: usize,
395 _depth: fidl::encoding::Depth,
396 ) -> fidl::Result<()> {
397 decoder.debug_check_bounds::<Self>(offset);
398 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
399 unsafe {
402 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
403 }
404 Ok(())
405 }
406 }
407
408 impl fidl::encoding::ValueTypeMarker for OwePublicKey {
409 type Borrowed<'a> = &'a Self;
410 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
411 value
412 }
413 }
414
415 unsafe impl fidl::encoding::TypeMarker for OwePublicKey {
416 type Owned = Self;
417
418 #[inline(always)]
419 fn inline_align(_context: fidl::encoding::Context) -> usize {
420 8
421 }
422
423 #[inline(always)]
424 fn inline_size(_context: fidl::encoding::Context) -> usize {
425 24
426 }
427 }
428
429 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<OwePublicKey, D>
430 for &OwePublicKey
431 {
432 #[inline]
433 unsafe fn encode(
434 self,
435 encoder: &mut fidl::encoding::Encoder<'_, D>,
436 offset: usize,
437 _depth: fidl::encoding::Depth,
438 ) -> fidl::Result<()> {
439 encoder.debug_check_bounds::<OwePublicKey>(offset);
440 fidl::encoding::Encode::<OwePublicKey, D>::encode(
442 (
443 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.group),
444 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
445 ),
446 encoder, offset, _depth
447 )
448 }
449 }
450 unsafe impl<
451 D: fidl::encoding::ResourceDialect,
452 T0: fidl::encoding::Encode<u16, D>,
453 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
454 > fidl::encoding::Encode<OwePublicKey, D> for (T0, T1)
455 {
456 #[inline]
457 unsafe fn encode(
458 self,
459 encoder: &mut fidl::encoding::Encoder<'_, D>,
460 offset: usize,
461 depth: fidl::encoding::Depth,
462 ) -> fidl::Result<()> {
463 encoder.debug_check_bounds::<OwePublicKey>(offset);
464 unsafe {
467 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
468 (ptr as *mut u64).write_unaligned(0);
469 }
470 self.0.encode(encoder, offset + 0, depth)?;
472 self.1.encode(encoder, offset + 8, depth)?;
473 Ok(())
474 }
475 }
476
477 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for OwePublicKey {
478 #[inline(always)]
479 fn new_empty() -> Self {
480 Self {
481 group: fidl::new_empty!(u16, D),
482 key: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
483 }
484 }
485
486 #[inline]
487 unsafe fn decode(
488 &mut self,
489 decoder: &mut fidl::encoding::Decoder<'_, D>,
490 offset: usize,
491 _depth: fidl::encoding::Depth,
492 ) -> fidl::Result<()> {
493 decoder.debug_check_bounds::<Self>(offset);
494 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
496 let padval = unsafe { (ptr as *const u64).read_unaligned() };
497 let mask = 0xffffffffffff0000u64;
498 let maskedval = padval & mask;
499 if maskedval != 0 {
500 return Err(fidl::Error::NonZeroPadding {
501 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
502 });
503 }
504 fidl::decode!(u16, D, &mut self.group, decoder, offset + 0, _depth)?;
505 fidl::decode!(
506 fidl::encoding::UnboundedVector<u8>,
507 D,
508 &mut self.key,
509 decoder,
510 offset + 8,
511 _depth
512 )?;
513 Ok(())
514 }
515 }
516
517 impl fidl::encoding::ValueTypeMarker for SignalReportIndication {
518 type Borrowed<'a> = &'a Self;
519 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
520 value
521 }
522 }
523
524 unsafe impl fidl::encoding::TypeMarker for SignalReportIndication {
525 type Owned = Self;
526
527 #[inline(always)]
528 fn inline_align(_context: fidl::encoding::Context) -> usize {
529 1
530 }
531
532 #[inline(always)]
533 fn inline_size(_context: fidl::encoding::Context) -> usize {
534 2
535 }
536 #[inline(always)]
537 fn encode_is_copy() -> bool {
538 true
539 }
540
541 #[inline(always)]
542 fn decode_is_copy() -> bool {
543 true
544 }
545 }
546
547 unsafe impl<D: fidl::encoding::ResourceDialect>
548 fidl::encoding::Encode<SignalReportIndication, D> for &SignalReportIndication
549 {
550 #[inline]
551 unsafe fn encode(
552 self,
553 encoder: &mut fidl::encoding::Encoder<'_, D>,
554 offset: usize,
555 _depth: fidl::encoding::Depth,
556 ) -> fidl::Result<()> {
557 encoder.debug_check_bounds::<SignalReportIndication>(offset);
558 unsafe {
559 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
561 (buf_ptr as *mut SignalReportIndication)
562 .write_unaligned((self as *const SignalReportIndication).read());
563 }
566 Ok(())
567 }
568 }
569 unsafe impl<
570 D: fidl::encoding::ResourceDialect,
571 T0: fidl::encoding::Encode<i8, D>,
572 T1: fidl::encoding::Encode<i8, D>,
573 > fidl::encoding::Encode<SignalReportIndication, D> for (T0, T1)
574 {
575 #[inline]
576 unsafe fn encode(
577 self,
578 encoder: &mut fidl::encoding::Encoder<'_, D>,
579 offset: usize,
580 depth: fidl::encoding::Depth,
581 ) -> fidl::Result<()> {
582 encoder.debug_check_bounds::<SignalReportIndication>(offset);
583 self.0.encode(encoder, offset + 0, depth)?;
587 self.1.encode(encoder, offset + 1, depth)?;
588 Ok(())
589 }
590 }
591
592 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
593 for SignalReportIndication
594 {
595 #[inline(always)]
596 fn new_empty() -> Self {
597 Self { rssi_dbm: fidl::new_empty!(i8, D), snr_db: fidl::new_empty!(i8, D) }
598 }
599
600 #[inline]
601 unsafe fn decode(
602 &mut self,
603 decoder: &mut fidl::encoding::Decoder<'_, D>,
604 offset: usize,
605 _depth: fidl::encoding::Depth,
606 ) -> fidl::Result<()> {
607 decoder.debug_check_bounds::<Self>(offset);
608 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
609 unsafe {
612 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
613 }
614 Ok(())
615 }
616 }
617
618 impl fidl::encoding::ValueTypeMarker for WmmAcParams {
619 type Borrowed<'a> = &'a Self;
620 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
621 value
622 }
623 }
624
625 unsafe impl fidl::encoding::TypeMarker for WmmAcParams {
626 type Owned = Self;
627
628 #[inline(always)]
629 fn inline_align(_context: fidl::encoding::Context) -> usize {
630 2
631 }
632
633 #[inline(always)]
634 fn inline_size(_context: fidl::encoding::Context) -> usize {
635 8
636 }
637 }
638
639 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WmmAcParams, D>
640 for &WmmAcParams
641 {
642 #[inline]
643 unsafe fn encode(
644 self,
645 encoder: &mut fidl::encoding::Encoder<'_, D>,
646 offset: usize,
647 _depth: fidl::encoding::Depth,
648 ) -> fidl::Result<()> {
649 encoder.debug_check_bounds::<WmmAcParams>(offset);
650 fidl::encoding::Encode::<WmmAcParams, D>::encode(
652 (
653 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.ecw_min),
654 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.ecw_max),
655 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.aifsn),
656 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.txop_limit),
657 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.acm),
658 ),
659 encoder,
660 offset,
661 _depth,
662 )
663 }
664 }
665 unsafe impl<
666 D: fidl::encoding::ResourceDialect,
667 T0: fidl::encoding::Encode<u8, D>,
668 T1: fidl::encoding::Encode<u8, D>,
669 T2: fidl::encoding::Encode<u8, D>,
670 T3: fidl::encoding::Encode<u16, D>,
671 T4: fidl::encoding::Encode<bool, D>,
672 > fidl::encoding::Encode<WmmAcParams, D> for (T0, T1, T2, T3, T4)
673 {
674 #[inline]
675 unsafe fn encode(
676 self,
677 encoder: &mut fidl::encoding::Encoder<'_, D>,
678 offset: usize,
679 depth: fidl::encoding::Depth,
680 ) -> fidl::Result<()> {
681 encoder.debug_check_bounds::<WmmAcParams>(offset);
682 unsafe {
685 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(2);
686 (ptr as *mut u16).write_unaligned(0);
687 }
688 unsafe {
689 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(6);
690 (ptr as *mut u16).write_unaligned(0);
691 }
692 self.0.encode(encoder, offset + 0, depth)?;
694 self.1.encode(encoder, offset + 1, depth)?;
695 self.2.encode(encoder, offset + 2, depth)?;
696 self.3.encode(encoder, offset + 4, depth)?;
697 self.4.encode(encoder, offset + 6, depth)?;
698 Ok(())
699 }
700 }
701
702 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WmmAcParams {
703 #[inline(always)]
704 fn new_empty() -> Self {
705 Self {
706 ecw_min: fidl::new_empty!(u8, D),
707 ecw_max: fidl::new_empty!(u8, D),
708 aifsn: fidl::new_empty!(u8, D),
709 txop_limit: fidl::new_empty!(u16, D),
710 acm: fidl::new_empty!(bool, D),
711 }
712 }
713
714 #[inline]
715 unsafe fn decode(
716 &mut self,
717 decoder: &mut fidl::encoding::Decoder<'_, D>,
718 offset: usize,
719 _depth: fidl::encoding::Depth,
720 ) -> fidl::Result<()> {
721 decoder.debug_check_bounds::<Self>(offset);
722 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(2) };
724 let padval = unsafe { (ptr as *const u16).read_unaligned() };
725 let mask = 0xff00u16;
726 let maskedval = padval & mask;
727 if maskedval != 0 {
728 return Err(fidl::Error::NonZeroPadding {
729 padding_start: offset + 2 + ((mask as u64).trailing_zeros() / 8) as usize,
730 });
731 }
732 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(6) };
733 let padval = unsafe { (ptr as *const u16).read_unaligned() };
734 let mask = 0xff00u16;
735 let maskedval = padval & mask;
736 if maskedval != 0 {
737 return Err(fidl::Error::NonZeroPadding {
738 padding_start: offset + 6 + ((mask as u64).trailing_zeros() / 8) as usize,
739 });
740 }
741 fidl::decode!(u8, D, &mut self.ecw_min, decoder, offset + 0, _depth)?;
742 fidl::decode!(u8, D, &mut self.ecw_max, decoder, offset + 1, _depth)?;
743 fidl::decode!(u8, D, &mut self.aifsn, decoder, offset + 2, _depth)?;
744 fidl::decode!(u16, D, &mut self.txop_limit, decoder, offset + 4, _depth)?;
745 fidl::decode!(bool, D, &mut self.acm, decoder, offset + 6, _depth)?;
746 Ok(())
747 }
748 }
749
750 impl fidl::encoding::ValueTypeMarker for WmmStatusResponse {
751 type Borrowed<'a> = &'a Self;
752 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
753 value
754 }
755 }
756
757 unsafe impl fidl::encoding::TypeMarker for WmmStatusResponse {
758 type Owned = Self;
759
760 #[inline(always)]
761 fn inline_align(_context: fidl::encoding::Context) -> usize {
762 2
763 }
764
765 #[inline(always)]
766 fn inline_size(_context: fidl::encoding::Context) -> usize {
767 34
768 }
769 }
770
771 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WmmStatusResponse, D>
772 for &WmmStatusResponse
773 {
774 #[inline]
775 unsafe fn encode(
776 self,
777 encoder: &mut fidl::encoding::Encoder<'_, D>,
778 offset: usize,
779 _depth: fidl::encoding::Depth,
780 ) -> fidl::Result<()> {
781 encoder.debug_check_bounds::<WmmStatusResponse>(offset);
782 fidl::encoding::Encode::<WmmStatusResponse, D>::encode(
784 (
785 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.apsd),
786 <WmmAcParams as fidl::encoding::ValueTypeMarker>::borrow(&self.ac_be_params),
787 <WmmAcParams as fidl::encoding::ValueTypeMarker>::borrow(&self.ac_bk_params),
788 <WmmAcParams as fidl::encoding::ValueTypeMarker>::borrow(&self.ac_vi_params),
789 <WmmAcParams as fidl::encoding::ValueTypeMarker>::borrow(&self.ac_vo_params),
790 ),
791 encoder,
792 offset,
793 _depth,
794 )
795 }
796 }
797 unsafe impl<
798 D: fidl::encoding::ResourceDialect,
799 T0: fidl::encoding::Encode<bool, D>,
800 T1: fidl::encoding::Encode<WmmAcParams, D>,
801 T2: fidl::encoding::Encode<WmmAcParams, D>,
802 T3: fidl::encoding::Encode<WmmAcParams, D>,
803 T4: fidl::encoding::Encode<WmmAcParams, D>,
804 > fidl::encoding::Encode<WmmStatusResponse, D> for (T0, T1, T2, T3, T4)
805 {
806 #[inline]
807 unsafe fn encode(
808 self,
809 encoder: &mut fidl::encoding::Encoder<'_, D>,
810 offset: usize,
811 depth: fidl::encoding::Depth,
812 ) -> fidl::Result<()> {
813 encoder.debug_check_bounds::<WmmStatusResponse>(offset);
814 unsafe {
817 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
818 (ptr as *mut u16).write_unaligned(0);
819 }
820 self.0.encode(encoder, offset + 0, depth)?;
822 self.1.encode(encoder, offset + 2, depth)?;
823 self.2.encode(encoder, offset + 10, depth)?;
824 self.3.encode(encoder, offset + 18, depth)?;
825 self.4.encode(encoder, offset + 26, depth)?;
826 Ok(())
827 }
828 }
829
830 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WmmStatusResponse {
831 #[inline(always)]
832 fn new_empty() -> Self {
833 Self {
834 apsd: fidl::new_empty!(bool, D),
835 ac_be_params: fidl::new_empty!(WmmAcParams, D),
836 ac_bk_params: fidl::new_empty!(WmmAcParams, D),
837 ac_vi_params: fidl::new_empty!(WmmAcParams, D),
838 ac_vo_params: fidl::new_empty!(WmmAcParams, D),
839 }
840 }
841
842 #[inline]
843 unsafe fn decode(
844 &mut self,
845 decoder: &mut fidl::encoding::Decoder<'_, D>,
846 offset: usize,
847 _depth: fidl::encoding::Depth,
848 ) -> fidl::Result<()> {
849 decoder.debug_check_bounds::<Self>(offset);
850 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
852 let padval = unsafe { (ptr as *const u16).read_unaligned() };
853 let mask = 0xff00u16;
854 let maskedval = padval & mask;
855 if maskedval != 0 {
856 return Err(fidl::Error::NonZeroPadding {
857 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
858 });
859 }
860 fidl::decode!(bool, D, &mut self.apsd, decoder, offset + 0, _depth)?;
861 fidl::decode!(WmmAcParams, D, &mut self.ac_be_params, decoder, offset + 2, _depth)?;
862 fidl::decode!(WmmAcParams, D, &mut self.ac_bk_params, decoder, offset + 10, _depth)?;
863 fidl::decode!(WmmAcParams, D, &mut self.ac_vi_params, decoder, offset + 18, _depth)?;
864 fidl::decode!(WmmAcParams, D, &mut self.ac_vo_params, decoder, offset + 26, _depth)?;
865 Ok(())
866 }
867 }
868}