1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_wlan_device__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct ConnectorConnectRequest {
16 pub request: fidl::endpoints::ServerEnd<PhyMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ConnectorConnectRequest {}
20
21#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22pub struct CreateIfaceRequest {
23 pub role: fidl_fuchsia_wlan_common::WlanMacRole,
24 pub mlme_channel: Option<fidl::Channel>,
25 pub init_sta_addr: [u8; 6],
26}
27
28impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CreateIfaceRequest {}
29
30#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31pub struct PhyCreateIfaceRequest {
32 pub req: CreateIfaceRequest,
33}
34
35impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for PhyCreateIfaceRequest {}
36
37#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
38pub struct ConnectorMarker;
39
40impl fidl::endpoints::ProtocolMarker for ConnectorMarker {
41 type Proxy = ConnectorProxy;
42 type RequestStream = ConnectorRequestStream;
43 #[cfg(target_os = "fuchsia")]
44 type SynchronousProxy = ConnectorSynchronousProxy;
45
46 const DEBUG_NAME: &'static str = "(anonymous) Connector";
47}
48
49pub trait ConnectorProxyInterface: Send + Sync {
50 fn r#connect(&self, request: fidl::endpoints::ServerEnd<PhyMarker>) -> Result<(), fidl::Error>;
51}
52#[derive(Debug)]
53#[cfg(target_os = "fuchsia")]
54pub struct ConnectorSynchronousProxy {
55 client: fidl::client::sync::Client,
56}
57
58#[cfg(target_os = "fuchsia")]
59impl fidl::endpoints::SynchronousProxy for ConnectorSynchronousProxy {
60 type Proxy = ConnectorProxy;
61 type Protocol = ConnectorMarker;
62
63 fn from_channel(inner: fidl::Channel) -> Self {
64 Self::new(inner)
65 }
66
67 fn into_channel(self) -> fidl::Channel {
68 self.client.into_channel()
69 }
70
71 fn as_channel(&self) -> &fidl::Channel {
72 self.client.as_channel()
73 }
74}
75
76#[cfg(target_os = "fuchsia")]
77impl ConnectorSynchronousProxy {
78 pub fn new(channel: fidl::Channel) -> Self {
79 let protocol_name = <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
80 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
81 }
82
83 pub fn into_channel(self) -> fidl::Channel {
84 self.client.into_channel()
85 }
86
87 pub fn wait_for_event(
90 &self,
91 deadline: zx::MonotonicInstant,
92 ) -> Result<ConnectorEvent, fidl::Error> {
93 ConnectorEvent::decode(self.client.wait_for_event(deadline)?)
94 }
95
96 pub fn r#connect(
97 &self,
98 mut request: fidl::endpoints::ServerEnd<PhyMarker>,
99 ) -> Result<(), fidl::Error> {
100 self.client.send::<ConnectorConnectRequest>(
101 (request,),
102 0x2dd039e4ba3a4d26,
103 fidl::encoding::DynamicFlags::empty(),
104 )
105 }
106}
107
108#[cfg(target_os = "fuchsia")]
109impl From<ConnectorSynchronousProxy> for zx::NullableHandle {
110 fn from(value: ConnectorSynchronousProxy) -> Self {
111 value.into_channel().into()
112 }
113}
114
115#[cfg(target_os = "fuchsia")]
116impl From<fidl::Channel> for ConnectorSynchronousProxy {
117 fn from(value: fidl::Channel) -> Self {
118 Self::new(value)
119 }
120}
121
122#[cfg(target_os = "fuchsia")]
123impl fidl::endpoints::FromClient for ConnectorSynchronousProxy {
124 type Protocol = ConnectorMarker;
125
126 fn from_client(value: fidl::endpoints::ClientEnd<ConnectorMarker>) -> Self {
127 Self::new(value.into_channel())
128 }
129}
130
131#[derive(Debug, Clone)]
132pub struct ConnectorProxy {
133 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
134}
135
136impl fidl::endpoints::Proxy for ConnectorProxy {
137 type Protocol = ConnectorMarker;
138
139 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
140 Self::new(inner)
141 }
142
143 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
144 self.client.into_channel().map_err(|client| Self { client })
145 }
146
147 fn as_channel(&self) -> &::fidl::AsyncChannel {
148 self.client.as_channel()
149 }
150}
151
152impl ConnectorProxy {
153 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
155 let protocol_name = <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
156 Self { client: fidl::client::Client::new(channel, protocol_name) }
157 }
158
159 pub fn take_event_stream(&self) -> ConnectorEventStream {
165 ConnectorEventStream { event_receiver: self.client.take_event_receiver() }
166 }
167
168 pub fn r#connect(
169 &self,
170 mut request: fidl::endpoints::ServerEnd<PhyMarker>,
171 ) -> Result<(), fidl::Error> {
172 ConnectorProxyInterface::r#connect(self, request)
173 }
174}
175
176impl ConnectorProxyInterface for ConnectorProxy {
177 fn r#connect(
178 &self,
179 mut request: fidl::endpoints::ServerEnd<PhyMarker>,
180 ) -> Result<(), fidl::Error> {
181 self.client.send::<ConnectorConnectRequest>(
182 (request,),
183 0x2dd039e4ba3a4d26,
184 fidl::encoding::DynamicFlags::empty(),
185 )
186 }
187}
188
189pub struct ConnectorEventStream {
190 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
191}
192
193impl std::marker::Unpin for ConnectorEventStream {}
194
195impl futures::stream::FusedStream for ConnectorEventStream {
196 fn is_terminated(&self) -> bool {
197 self.event_receiver.is_terminated()
198 }
199}
200
201impl futures::Stream for ConnectorEventStream {
202 type Item = Result<ConnectorEvent, fidl::Error>;
203
204 fn poll_next(
205 mut self: std::pin::Pin<&mut Self>,
206 cx: &mut std::task::Context<'_>,
207 ) -> std::task::Poll<Option<Self::Item>> {
208 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
209 &mut self.event_receiver,
210 cx
211 )?) {
212 Some(buf) => std::task::Poll::Ready(Some(ConnectorEvent::decode(buf))),
213 None => std::task::Poll::Ready(None),
214 }
215 }
216}
217
218#[derive(Debug)]
219pub enum ConnectorEvent {}
220
221impl ConnectorEvent {
222 fn decode(
224 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
225 ) -> Result<ConnectorEvent, fidl::Error> {
226 let (bytes, _handles) = buf.split_mut();
227 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
228 debug_assert_eq!(tx_header.tx_id, 0);
229 match tx_header.ordinal {
230 _ => Err(fidl::Error::UnknownOrdinal {
231 ordinal: tx_header.ordinal,
232 protocol_name: <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
233 }),
234 }
235 }
236}
237
238pub struct ConnectorRequestStream {
240 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
241 is_terminated: bool,
242}
243
244impl std::marker::Unpin for ConnectorRequestStream {}
245
246impl futures::stream::FusedStream for ConnectorRequestStream {
247 fn is_terminated(&self) -> bool {
248 self.is_terminated
249 }
250}
251
252impl fidl::endpoints::RequestStream for ConnectorRequestStream {
253 type Protocol = ConnectorMarker;
254 type ControlHandle = ConnectorControlHandle;
255
256 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
257 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
258 }
259
260 fn control_handle(&self) -> Self::ControlHandle {
261 ConnectorControlHandle { inner: self.inner.clone() }
262 }
263
264 fn into_inner(
265 self,
266 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
267 {
268 (self.inner, self.is_terminated)
269 }
270
271 fn from_inner(
272 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
273 is_terminated: bool,
274 ) -> Self {
275 Self { inner, is_terminated }
276 }
277}
278
279impl futures::Stream for ConnectorRequestStream {
280 type Item = Result<ConnectorRequest, fidl::Error>;
281
282 fn poll_next(
283 mut self: std::pin::Pin<&mut Self>,
284 cx: &mut std::task::Context<'_>,
285 ) -> std::task::Poll<Option<Self::Item>> {
286 let this = &mut *self;
287 if this.inner.check_shutdown(cx) {
288 this.is_terminated = true;
289 return std::task::Poll::Ready(None);
290 }
291 if this.is_terminated {
292 panic!("polled ConnectorRequestStream after completion");
293 }
294 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
295 |bytes, handles| {
296 match this.inner.channel().read_etc(cx, bytes, handles) {
297 std::task::Poll::Ready(Ok(())) => {}
298 std::task::Poll::Pending => return std::task::Poll::Pending,
299 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
300 this.is_terminated = true;
301 return std::task::Poll::Ready(None);
302 }
303 std::task::Poll::Ready(Err(e)) => {
304 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
305 e.into(),
306 ))));
307 }
308 }
309
310 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
312
313 std::task::Poll::Ready(Some(match header.ordinal {
314 0x2dd039e4ba3a4d26 => {
315 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
316 let mut req = fidl::new_empty!(
317 ConnectorConnectRequest,
318 fidl::encoding::DefaultFuchsiaResourceDialect
319 );
320 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
321 let control_handle = ConnectorControlHandle { inner: this.inner.clone() };
322 Ok(ConnectorRequest::Connect { request: req.request, control_handle })
323 }
324 _ => Err(fidl::Error::UnknownOrdinal {
325 ordinal: header.ordinal,
326 protocol_name:
327 <ConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
328 }),
329 }))
330 },
331 )
332 }
333}
334
335#[derive(Debug)]
337pub enum ConnectorRequest {
338 Connect {
339 request: fidl::endpoints::ServerEnd<PhyMarker>,
340 control_handle: ConnectorControlHandle,
341 },
342}
343
344impl ConnectorRequest {
345 #[allow(irrefutable_let_patterns)]
346 pub fn into_connect(
347 self,
348 ) -> Option<(fidl::endpoints::ServerEnd<PhyMarker>, ConnectorControlHandle)> {
349 if let ConnectorRequest::Connect { request, control_handle } = self {
350 Some((request, control_handle))
351 } else {
352 None
353 }
354 }
355
356 pub fn method_name(&self) -> &'static str {
358 match *self {
359 ConnectorRequest::Connect { .. } => "connect",
360 }
361 }
362}
363
364#[derive(Debug, Clone)]
365pub struct ConnectorControlHandle {
366 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
367}
368
369impl fidl::endpoints::ControlHandle for ConnectorControlHandle {
370 fn shutdown(&self) {
371 self.inner.shutdown()
372 }
373
374 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
375 self.inner.shutdown_with_epitaph(status)
376 }
377
378 fn is_closed(&self) -> bool {
379 self.inner.channel().is_closed()
380 }
381 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
382 self.inner.channel().on_closed()
383 }
384
385 #[cfg(target_os = "fuchsia")]
386 fn signal_peer(
387 &self,
388 clear_mask: zx::Signals,
389 set_mask: zx::Signals,
390 ) -> Result<(), zx_status::Status> {
391 use fidl::Peered;
392 self.inner.channel().signal_peer(clear_mask, set_mask)
393 }
394}
395
396impl ConnectorControlHandle {}
397
398#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
399pub struct PhyMarker;
400
401impl fidl::endpoints::ProtocolMarker for PhyMarker {
402 type Proxy = PhyProxy;
403 type RequestStream = PhyRequestStream;
404 #[cfg(target_os = "fuchsia")]
405 type SynchronousProxy = PhySynchronousProxy;
406
407 const DEBUG_NAME: &'static str = "(anonymous) Phy";
408}
409pub type PhyGetSupportedMacRolesResult = Result<Vec<fidl_fuchsia_wlan_common::WlanMacRole>, i32>;
410pub type PhyCreateIfaceResult = Result<u16, i32>;
411pub type PhyDestroyIfaceResult = Result<(), i32>;
412pub type PhyGetCountryResult = Result<CountryCode, i32>;
413pub type PhyGetPowerSaveModeResult = Result<fidl_fuchsia_wlan_common::PowerSaveType, i32>;
414pub type PhyPowerDownResult = Result<(), i32>;
415pub type PhyPowerUpResult = Result<(), i32>;
416pub type PhyResetResult = Result<(), i32>;
417pub type PhyGetPowerStateResult = Result<bool, i32>;
418pub type PhySetBtCoexistenceModeResult = Result<(), i32>;
419pub type PhySetTxPowerScenarioResult = Result<(), i32>;
420pub type PhyResetTxPowerScenarioResult = Result<(), i32>;
421pub type PhyGetTxPowerScenarioResult = Result<fidl_fuchsia_wlan_internal::TxPowerScenario, i32>;
422
423pub trait PhyProxyInterface: Send + Sync {
424 type GetSupportedMacRolesResponseFut: std::future::Future<Output = Result<PhyGetSupportedMacRolesResult, fidl::Error>>
425 + Send;
426 fn r#get_supported_mac_roles(&self) -> Self::GetSupportedMacRolesResponseFut;
427 type CreateIfaceResponseFut: std::future::Future<Output = Result<PhyCreateIfaceResult, fidl::Error>>
428 + Send;
429 fn r#create_iface(&self, req: CreateIfaceRequest) -> Self::CreateIfaceResponseFut;
430 type DestroyIfaceResponseFut: std::future::Future<Output = Result<PhyDestroyIfaceResult, fidl::Error>>
431 + Send;
432 fn r#destroy_iface(&self, req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut;
433 type SetCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
434 fn r#set_country(&self, req: &CountryCode) -> Self::SetCountryResponseFut;
435 type GetCountryResponseFut: std::future::Future<Output = Result<PhyGetCountryResult, fidl::Error>>
436 + Send;
437 fn r#get_country(&self) -> Self::GetCountryResponseFut;
438 type ClearCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
439 fn r#clear_country(&self) -> Self::ClearCountryResponseFut;
440 type SetPowerSaveModeResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
441 fn r#set_power_save_mode(
442 &self,
443 req: fidl_fuchsia_wlan_common::PowerSaveType,
444 ) -> Self::SetPowerSaveModeResponseFut;
445 type GetPowerSaveModeResponseFut: std::future::Future<Output = Result<PhyGetPowerSaveModeResult, fidl::Error>>
446 + Send;
447 fn r#get_power_save_mode(&self) -> Self::GetPowerSaveModeResponseFut;
448 type PowerDownResponseFut: std::future::Future<Output = Result<PhyPowerDownResult, fidl::Error>>
449 + Send;
450 fn r#power_down(&self) -> Self::PowerDownResponseFut;
451 type PowerUpResponseFut: std::future::Future<Output = Result<PhyPowerUpResult, fidl::Error>>
452 + Send;
453 fn r#power_up(&self) -> Self::PowerUpResponseFut;
454 type ResetResponseFut: std::future::Future<Output = Result<PhyResetResult, fidl::Error>> + Send;
455 fn r#reset(&self) -> Self::ResetResponseFut;
456 type GetPowerStateResponseFut: std::future::Future<Output = Result<PhyGetPowerStateResult, fidl::Error>>
457 + Send;
458 fn r#get_power_state(&self) -> Self::GetPowerStateResponseFut;
459 type SetBtCoexistenceModeResponseFut: std::future::Future<Output = Result<PhySetBtCoexistenceModeResult, fidl::Error>>
460 + Send;
461 fn r#set_bt_coexistence_mode(
462 &self,
463 mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
464 ) -> Self::SetBtCoexistenceModeResponseFut;
465 type SetTxPowerScenarioResponseFut: std::future::Future<Output = Result<PhySetTxPowerScenarioResult, fidl::Error>>
466 + Send;
467 fn r#set_tx_power_scenario(
468 &self,
469 scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
470 ) -> Self::SetTxPowerScenarioResponseFut;
471 type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<PhyResetTxPowerScenarioResult, fidl::Error>>
472 + Send;
473 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut;
474 type GetTxPowerScenarioResponseFut: std::future::Future<Output = Result<PhyGetTxPowerScenarioResult, fidl::Error>>
475 + Send;
476 fn r#get_tx_power_scenario(&self) -> Self::GetTxPowerScenarioResponseFut;
477}
478#[derive(Debug)]
479#[cfg(target_os = "fuchsia")]
480pub struct PhySynchronousProxy {
481 client: fidl::client::sync::Client,
482}
483
484#[cfg(target_os = "fuchsia")]
485impl fidl::endpoints::SynchronousProxy for PhySynchronousProxy {
486 type Proxy = PhyProxy;
487 type Protocol = PhyMarker;
488
489 fn from_channel(inner: fidl::Channel) -> Self {
490 Self::new(inner)
491 }
492
493 fn into_channel(self) -> fidl::Channel {
494 self.client.into_channel()
495 }
496
497 fn as_channel(&self) -> &fidl::Channel {
498 self.client.as_channel()
499 }
500}
501
502#[cfg(target_os = "fuchsia")]
503impl PhySynchronousProxy {
504 pub fn new(channel: fidl::Channel) -> Self {
505 let protocol_name = <PhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
506 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
507 }
508
509 pub fn into_channel(self) -> fidl::Channel {
510 self.client.into_channel()
511 }
512
513 pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<PhyEvent, fidl::Error> {
516 PhyEvent::decode(self.client.wait_for_event(deadline)?)
517 }
518
519 pub fn r#get_supported_mac_roles(
520 &self,
521 ___deadline: zx::MonotonicInstant,
522 ) -> Result<PhyGetSupportedMacRolesResult, fidl::Error> {
523 let _response = self.client.send_query::<
524 fidl::encoding::EmptyPayload,
525 fidl::encoding::ResultType<PhyGetSupportedMacRolesResponse, i32>,
526 >(
527 (),
528 0x18f6b9091aa8a44,
529 fidl::encoding::DynamicFlags::empty(),
530 ___deadline,
531 )?;
532 Ok(_response.map(|x| x.supported_mac_roles))
533 }
534
535 pub fn r#create_iface(
536 &self,
537 mut req: CreateIfaceRequest,
538 ___deadline: zx::MonotonicInstant,
539 ) -> Result<PhyCreateIfaceResult, fidl::Error> {
540 let _response = self.client.send_query::<
541 PhyCreateIfaceRequest,
542 fidl::encoding::ResultType<PhyCreateIfaceResponse, i32>,
543 >(
544 (&mut req,),
545 0x665940c7aa4b9785,
546 fidl::encoding::DynamicFlags::empty(),
547 ___deadline,
548 )?;
549 Ok(_response.map(|x| x.iface_id))
550 }
551
552 pub fn r#destroy_iface(
553 &self,
554 mut req: &DestroyIfaceRequest,
555 ___deadline: zx::MonotonicInstant,
556 ) -> Result<PhyDestroyIfaceResult, fidl::Error> {
557 let _response = self.client.send_query::<
558 PhyDestroyIfaceRequest,
559 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
560 >(
561 (req,),
562 0x75a3048ae01942e8,
563 fidl::encoding::DynamicFlags::empty(),
564 ___deadline,
565 )?;
566 Ok(_response.map(|x| x))
567 }
568
569 pub fn r#set_country(
570 &self,
571 mut req: &CountryCode,
572 ___deadline: zx::MonotonicInstant,
573 ) -> Result<i32, fidl::Error> {
574 let _response = self.client.send_query::<PhySetCountryRequest, PhySetCountryResponse>(
575 (req,),
576 0x1367e9997ba00806,
577 fidl::encoding::DynamicFlags::empty(),
578 ___deadline,
579 )?;
580 Ok(_response.status)
581 }
582
583 pub fn r#get_country(
584 &self,
585 ___deadline: zx::MonotonicInstant,
586 ) -> Result<PhyGetCountryResult, fidl::Error> {
587 let _response = self.client.send_query::<
588 fidl::encoding::EmptyPayload,
589 fidl::encoding::ResultType<PhyGetCountryResponse, i32>,
590 >(
591 (),
592 0x3ed3281ce6feab3e,
593 fidl::encoding::DynamicFlags::empty(),
594 ___deadline,
595 )?;
596 Ok(_response.map(|x| x.resp))
597 }
598
599 pub fn r#clear_country(&self, ___deadline: zx::MonotonicInstant) -> Result<i32, fidl::Error> {
600 let _response =
601 self.client.send_query::<fidl::encoding::EmptyPayload, PhyClearCountryResponse>(
602 (),
603 0x4ea9b83a9c494c95,
604 fidl::encoding::DynamicFlags::empty(),
605 ___deadline,
606 )?;
607 Ok(_response.status)
608 }
609
610 pub fn r#set_power_save_mode(
611 &self,
612 mut req: fidl_fuchsia_wlan_common::PowerSaveType,
613 ___deadline: zx::MonotonicInstant,
614 ) -> Result<i32, fidl::Error> {
615 let _response =
616 self.client.send_query::<PhySetPowerSaveModeRequest, PhySetPowerSaveModeResponse>(
617 (req,),
618 0x56be34b2f3abe17f,
619 fidl::encoding::DynamicFlags::empty(),
620 ___deadline,
621 )?;
622 Ok(_response.status)
623 }
624
625 pub fn r#get_power_save_mode(
626 &self,
627 ___deadline: zx::MonotonicInstant,
628 ) -> Result<PhyGetPowerSaveModeResult, fidl::Error> {
629 let _response = self.client.send_query::<
630 fidl::encoding::EmptyPayload,
631 fidl::encoding::ResultType<PhyGetPowerSaveModeResponse, i32>,
632 >(
633 (),
634 0x3f7019c3672bc798,
635 fidl::encoding::DynamicFlags::empty(),
636 ___deadline,
637 )?;
638 Ok(_response.map(|x| x.resp))
639 }
640
641 pub fn r#power_down(
642 &self,
643 ___deadline: zx::MonotonicInstant,
644 ) -> Result<PhyPowerDownResult, fidl::Error> {
645 let _response = self.client.send_query::<
646 fidl::encoding::EmptyPayload,
647 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
648 >(
649 (),
650 0x56bcae4b27a564d2,
651 fidl::encoding::DynamicFlags::empty(),
652 ___deadline,
653 )?;
654 Ok(_response.map(|x| x))
655 }
656
657 pub fn r#power_up(
658 &self,
659 ___deadline: zx::MonotonicInstant,
660 ) -> Result<PhyPowerUpResult, fidl::Error> {
661 let _response = self.client.send_query::<
662 fidl::encoding::EmptyPayload,
663 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
664 >(
665 (),
666 0x7aad8e525738b946,
667 fidl::encoding::DynamicFlags::empty(),
668 ___deadline,
669 )?;
670 Ok(_response.map(|x| x))
671 }
672
673 pub fn r#reset(
674 &self,
675 ___deadline: zx::MonotonicInstant,
676 ) -> Result<PhyResetResult, fidl::Error> {
677 let _response = self.client.send_query::<
678 fidl::encoding::EmptyPayload,
679 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
680 >(
681 (),
682 0x647cdcc9def3db87,
683 fidl::encoding::DynamicFlags::empty(),
684 ___deadline,
685 )?;
686 Ok(_response.map(|x| x))
687 }
688
689 pub fn r#get_power_state(
690 &self,
691 ___deadline: zx::MonotonicInstant,
692 ) -> Result<PhyGetPowerStateResult, fidl::Error> {
693 let _response = self.client.send_query::<
694 fidl::encoding::EmptyPayload,
695 fidl::encoding::ResultType<PhyGetPowerStateResponse, i32>,
696 >(
697 (),
698 0xcddef2b16c7f00f,
699 fidl::encoding::DynamicFlags::empty(),
700 ___deadline,
701 )?;
702 Ok(_response.map(|x| x.power_on))
703 }
704
705 pub fn r#set_bt_coexistence_mode(
706 &self,
707 mut mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
708 ___deadline: zx::MonotonicInstant,
709 ) -> Result<PhySetBtCoexistenceModeResult, fidl::Error> {
710 let _response = self.client.send_query::<
711 PhySetBtCoexistenceModeRequest,
712 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
713 >(
714 (mode,),
715 0x76c66d8313e73996,
716 fidl::encoding::DynamicFlags::empty(),
717 ___deadline,
718 )?;
719 Ok(_response.map(|x| x))
720 }
721
722 pub fn r#set_tx_power_scenario(
723 &self,
724 mut scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
725 ___deadline: zx::MonotonicInstant,
726 ) -> Result<PhySetTxPowerScenarioResult, fidl::Error> {
727 let _response = self.client.send_query::<
728 PhySetTxPowerScenarioRequest,
729 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
730 >(
731 (scenario,),
732 0x22748ccac6d497df,
733 fidl::encoding::DynamicFlags::empty(),
734 ___deadline,
735 )?;
736 Ok(_response.map(|x| x))
737 }
738
739 pub fn r#reset_tx_power_scenario(
740 &self,
741 ___deadline: zx::MonotonicInstant,
742 ) -> Result<PhyResetTxPowerScenarioResult, fidl::Error> {
743 let _response = self.client.send_query::<
744 fidl::encoding::EmptyPayload,
745 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
746 >(
747 (),
748 0x4f9b16347768b8dd,
749 fidl::encoding::DynamicFlags::empty(),
750 ___deadline,
751 )?;
752 Ok(_response.map(|x| x))
753 }
754
755 pub fn r#get_tx_power_scenario(
756 &self,
757 ___deadline: zx::MonotonicInstant,
758 ) -> Result<PhyGetTxPowerScenarioResult, fidl::Error> {
759 let _response = self.client.send_query::<
760 fidl::encoding::EmptyPayload,
761 fidl::encoding::ResultType<PhyGetTxPowerScenarioResponse, i32>,
762 >(
763 (),
764 0x3f6681e6458c14c2,
765 fidl::encoding::DynamicFlags::empty(),
766 ___deadline,
767 )?;
768 Ok(_response.map(|x| x.scenario))
769 }
770}
771
772#[cfg(target_os = "fuchsia")]
773impl From<PhySynchronousProxy> for zx::NullableHandle {
774 fn from(value: PhySynchronousProxy) -> Self {
775 value.into_channel().into()
776 }
777}
778
779#[cfg(target_os = "fuchsia")]
780impl From<fidl::Channel> for PhySynchronousProxy {
781 fn from(value: fidl::Channel) -> Self {
782 Self::new(value)
783 }
784}
785
786#[cfg(target_os = "fuchsia")]
787impl fidl::endpoints::FromClient for PhySynchronousProxy {
788 type Protocol = PhyMarker;
789
790 fn from_client(value: fidl::endpoints::ClientEnd<PhyMarker>) -> Self {
791 Self::new(value.into_channel())
792 }
793}
794
795#[derive(Debug, Clone)]
796pub struct PhyProxy {
797 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
798}
799
800impl fidl::endpoints::Proxy for PhyProxy {
801 type Protocol = PhyMarker;
802
803 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
804 Self::new(inner)
805 }
806
807 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
808 self.client.into_channel().map_err(|client| Self { client })
809 }
810
811 fn as_channel(&self) -> &::fidl::AsyncChannel {
812 self.client.as_channel()
813 }
814}
815
816impl PhyProxy {
817 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
819 let protocol_name = <PhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
820 Self { client: fidl::client::Client::new(channel, protocol_name) }
821 }
822
823 pub fn take_event_stream(&self) -> PhyEventStream {
829 PhyEventStream { event_receiver: self.client.take_event_receiver() }
830 }
831
832 pub fn r#get_supported_mac_roles(
833 &self,
834 ) -> fidl::client::QueryResponseFut<
835 PhyGetSupportedMacRolesResult,
836 fidl::encoding::DefaultFuchsiaResourceDialect,
837 > {
838 PhyProxyInterface::r#get_supported_mac_roles(self)
839 }
840
841 pub fn r#create_iface(
842 &self,
843 mut req: CreateIfaceRequest,
844 ) -> fidl::client::QueryResponseFut<
845 PhyCreateIfaceResult,
846 fidl::encoding::DefaultFuchsiaResourceDialect,
847 > {
848 PhyProxyInterface::r#create_iface(self, req)
849 }
850
851 pub fn r#destroy_iface(
852 &self,
853 mut req: &DestroyIfaceRequest,
854 ) -> fidl::client::QueryResponseFut<
855 PhyDestroyIfaceResult,
856 fidl::encoding::DefaultFuchsiaResourceDialect,
857 > {
858 PhyProxyInterface::r#destroy_iface(self, req)
859 }
860
861 pub fn r#set_country(
862 &self,
863 mut req: &CountryCode,
864 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
865 PhyProxyInterface::r#set_country(self, req)
866 }
867
868 pub fn r#get_country(
869 &self,
870 ) -> fidl::client::QueryResponseFut<
871 PhyGetCountryResult,
872 fidl::encoding::DefaultFuchsiaResourceDialect,
873 > {
874 PhyProxyInterface::r#get_country(self)
875 }
876
877 pub fn r#clear_country(
878 &self,
879 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
880 PhyProxyInterface::r#clear_country(self)
881 }
882
883 pub fn r#set_power_save_mode(
884 &self,
885 mut req: fidl_fuchsia_wlan_common::PowerSaveType,
886 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
887 PhyProxyInterface::r#set_power_save_mode(self, req)
888 }
889
890 pub fn r#get_power_save_mode(
891 &self,
892 ) -> fidl::client::QueryResponseFut<
893 PhyGetPowerSaveModeResult,
894 fidl::encoding::DefaultFuchsiaResourceDialect,
895 > {
896 PhyProxyInterface::r#get_power_save_mode(self)
897 }
898
899 pub fn r#power_down(
900 &self,
901 ) -> fidl::client::QueryResponseFut<
902 PhyPowerDownResult,
903 fidl::encoding::DefaultFuchsiaResourceDialect,
904 > {
905 PhyProxyInterface::r#power_down(self)
906 }
907
908 pub fn r#power_up(
909 &self,
910 ) -> fidl::client::QueryResponseFut<
911 PhyPowerUpResult,
912 fidl::encoding::DefaultFuchsiaResourceDialect,
913 > {
914 PhyProxyInterface::r#power_up(self)
915 }
916
917 pub fn r#reset(
918 &self,
919 ) -> fidl::client::QueryResponseFut<PhyResetResult, fidl::encoding::DefaultFuchsiaResourceDialect>
920 {
921 PhyProxyInterface::r#reset(self)
922 }
923
924 pub fn r#get_power_state(
925 &self,
926 ) -> fidl::client::QueryResponseFut<
927 PhyGetPowerStateResult,
928 fidl::encoding::DefaultFuchsiaResourceDialect,
929 > {
930 PhyProxyInterface::r#get_power_state(self)
931 }
932
933 pub fn r#set_bt_coexistence_mode(
934 &self,
935 mut mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
936 ) -> fidl::client::QueryResponseFut<
937 PhySetBtCoexistenceModeResult,
938 fidl::encoding::DefaultFuchsiaResourceDialect,
939 > {
940 PhyProxyInterface::r#set_bt_coexistence_mode(self, mode)
941 }
942
943 pub fn r#set_tx_power_scenario(
944 &self,
945 mut scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
946 ) -> fidl::client::QueryResponseFut<
947 PhySetTxPowerScenarioResult,
948 fidl::encoding::DefaultFuchsiaResourceDialect,
949 > {
950 PhyProxyInterface::r#set_tx_power_scenario(self, scenario)
951 }
952
953 pub fn r#reset_tx_power_scenario(
954 &self,
955 ) -> fidl::client::QueryResponseFut<
956 PhyResetTxPowerScenarioResult,
957 fidl::encoding::DefaultFuchsiaResourceDialect,
958 > {
959 PhyProxyInterface::r#reset_tx_power_scenario(self)
960 }
961
962 pub fn r#get_tx_power_scenario(
963 &self,
964 ) -> fidl::client::QueryResponseFut<
965 PhyGetTxPowerScenarioResult,
966 fidl::encoding::DefaultFuchsiaResourceDialect,
967 > {
968 PhyProxyInterface::r#get_tx_power_scenario(self)
969 }
970}
971
972impl PhyProxyInterface for PhyProxy {
973 type GetSupportedMacRolesResponseFut = fidl::client::QueryResponseFut<
974 PhyGetSupportedMacRolesResult,
975 fidl::encoding::DefaultFuchsiaResourceDialect,
976 >;
977 fn r#get_supported_mac_roles(&self) -> Self::GetSupportedMacRolesResponseFut {
978 fn _decode(
979 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
980 ) -> Result<PhyGetSupportedMacRolesResult, fidl::Error> {
981 let _response = fidl::client::decode_transaction_body::<
982 fidl::encoding::ResultType<PhyGetSupportedMacRolesResponse, i32>,
983 fidl::encoding::DefaultFuchsiaResourceDialect,
984 0x18f6b9091aa8a44,
985 >(_buf?)?;
986 Ok(_response.map(|x| x.supported_mac_roles))
987 }
988 self.client
989 .send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetSupportedMacRolesResult>(
990 (),
991 0x18f6b9091aa8a44,
992 fidl::encoding::DynamicFlags::empty(),
993 _decode,
994 )
995 }
996
997 type CreateIfaceResponseFut = fidl::client::QueryResponseFut<
998 PhyCreateIfaceResult,
999 fidl::encoding::DefaultFuchsiaResourceDialect,
1000 >;
1001 fn r#create_iface(&self, mut req: CreateIfaceRequest) -> Self::CreateIfaceResponseFut {
1002 fn _decode(
1003 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1004 ) -> Result<PhyCreateIfaceResult, fidl::Error> {
1005 let _response = fidl::client::decode_transaction_body::<
1006 fidl::encoding::ResultType<PhyCreateIfaceResponse, i32>,
1007 fidl::encoding::DefaultFuchsiaResourceDialect,
1008 0x665940c7aa4b9785,
1009 >(_buf?)?;
1010 Ok(_response.map(|x| x.iface_id))
1011 }
1012 self.client.send_query_and_decode::<PhyCreateIfaceRequest, PhyCreateIfaceResult>(
1013 (&mut req,),
1014 0x665940c7aa4b9785,
1015 fidl::encoding::DynamicFlags::empty(),
1016 _decode,
1017 )
1018 }
1019
1020 type DestroyIfaceResponseFut = fidl::client::QueryResponseFut<
1021 PhyDestroyIfaceResult,
1022 fidl::encoding::DefaultFuchsiaResourceDialect,
1023 >;
1024 fn r#destroy_iface(&self, mut req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut {
1025 fn _decode(
1026 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1027 ) -> Result<PhyDestroyIfaceResult, fidl::Error> {
1028 let _response = fidl::client::decode_transaction_body::<
1029 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1030 fidl::encoding::DefaultFuchsiaResourceDialect,
1031 0x75a3048ae01942e8,
1032 >(_buf?)?;
1033 Ok(_response.map(|x| x))
1034 }
1035 self.client.send_query_and_decode::<PhyDestroyIfaceRequest, PhyDestroyIfaceResult>(
1036 (req,),
1037 0x75a3048ae01942e8,
1038 fidl::encoding::DynamicFlags::empty(),
1039 _decode,
1040 )
1041 }
1042
1043 type SetCountryResponseFut =
1044 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1045 fn r#set_country(&self, mut req: &CountryCode) -> Self::SetCountryResponseFut {
1046 fn _decode(
1047 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1048 ) -> Result<i32, fidl::Error> {
1049 let _response = fidl::client::decode_transaction_body::<
1050 PhySetCountryResponse,
1051 fidl::encoding::DefaultFuchsiaResourceDialect,
1052 0x1367e9997ba00806,
1053 >(_buf?)?;
1054 Ok(_response.status)
1055 }
1056 self.client.send_query_and_decode::<PhySetCountryRequest, i32>(
1057 (req,),
1058 0x1367e9997ba00806,
1059 fidl::encoding::DynamicFlags::empty(),
1060 _decode,
1061 )
1062 }
1063
1064 type GetCountryResponseFut = fidl::client::QueryResponseFut<
1065 PhyGetCountryResult,
1066 fidl::encoding::DefaultFuchsiaResourceDialect,
1067 >;
1068 fn r#get_country(&self) -> Self::GetCountryResponseFut {
1069 fn _decode(
1070 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1071 ) -> Result<PhyGetCountryResult, fidl::Error> {
1072 let _response = fidl::client::decode_transaction_body::<
1073 fidl::encoding::ResultType<PhyGetCountryResponse, i32>,
1074 fidl::encoding::DefaultFuchsiaResourceDialect,
1075 0x3ed3281ce6feab3e,
1076 >(_buf?)?;
1077 Ok(_response.map(|x| x.resp))
1078 }
1079 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetCountryResult>(
1080 (),
1081 0x3ed3281ce6feab3e,
1082 fidl::encoding::DynamicFlags::empty(),
1083 _decode,
1084 )
1085 }
1086
1087 type ClearCountryResponseFut =
1088 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1089 fn r#clear_country(&self) -> Self::ClearCountryResponseFut {
1090 fn _decode(
1091 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1092 ) -> Result<i32, fidl::Error> {
1093 let _response = fidl::client::decode_transaction_body::<
1094 PhyClearCountryResponse,
1095 fidl::encoding::DefaultFuchsiaResourceDialect,
1096 0x4ea9b83a9c494c95,
1097 >(_buf?)?;
1098 Ok(_response.status)
1099 }
1100 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i32>(
1101 (),
1102 0x4ea9b83a9c494c95,
1103 fidl::encoding::DynamicFlags::empty(),
1104 _decode,
1105 )
1106 }
1107
1108 type SetPowerSaveModeResponseFut =
1109 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1110 fn r#set_power_save_mode(
1111 &self,
1112 mut req: fidl_fuchsia_wlan_common::PowerSaveType,
1113 ) -> Self::SetPowerSaveModeResponseFut {
1114 fn _decode(
1115 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1116 ) -> Result<i32, fidl::Error> {
1117 let _response = fidl::client::decode_transaction_body::<
1118 PhySetPowerSaveModeResponse,
1119 fidl::encoding::DefaultFuchsiaResourceDialect,
1120 0x56be34b2f3abe17f,
1121 >(_buf?)?;
1122 Ok(_response.status)
1123 }
1124 self.client.send_query_and_decode::<PhySetPowerSaveModeRequest, i32>(
1125 (req,),
1126 0x56be34b2f3abe17f,
1127 fidl::encoding::DynamicFlags::empty(),
1128 _decode,
1129 )
1130 }
1131
1132 type GetPowerSaveModeResponseFut = fidl::client::QueryResponseFut<
1133 PhyGetPowerSaveModeResult,
1134 fidl::encoding::DefaultFuchsiaResourceDialect,
1135 >;
1136 fn r#get_power_save_mode(&self) -> Self::GetPowerSaveModeResponseFut {
1137 fn _decode(
1138 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1139 ) -> Result<PhyGetPowerSaveModeResult, fidl::Error> {
1140 let _response = fidl::client::decode_transaction_body::<
1141 fidl::encoding::ResultType<PhyGetPowerSaveModeResponse, i32>,
1142 fidl::encoding::DefaultFuchsiaResourceDialect,
1143 0x3f7019c3672bc798,
1144 >(_buf?)?;
1145 Ok(_response.map(|x| x.resp))
1146 }
1147 self.client
1148 .send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetPowerSaveModeResult>(
1149 (),
1150 0x3f7019c3672bc798,
1151 fidl::encoding::DynamicFlags::empty(),
1152 _decode,
1153 )
1154 }
1155
1156 type PowerDownResponseFut = fidl::client::QueryResponseFut<
1157 PhyPowerDownResult,
1158 fidl::encoding::DefaultFuchsiaResourceDialect,
1159 >;
1160 fn r#power_down(&self) -> Self::PowerDownResponseFut {
1161 fn _decode(
1162 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1163 ) -> Result<PhyPowerDownResult, fidl::Error> {
1164 let _response = fidl::client::decode_transaction_body::<
1165 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1166 fidl::encoding::DefaultFuchsiaResourceDialect,
1167 0x56bcae4b27a564d2,
1168 >(_buf?)?;
1169 Ok(_response.map(|x| x))
1170 }
1171 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PhyPowerDownResult>(
1172 (),
1173 0x56bcae4b27a564d2,
1174 fidl::encoding::DynamicFlags::empty(),
1175 _decode,
1176 )
1177 }
1178
1179 type PowerUpResponseFut = fidl::client::QueryResponseFut<
1180 PhyPowerUpResult,
1181 fidl::encoding::DefaultFuchsiaResourceDialect,
1182 >;
1183 fn r#power_up(&self) -> Self::PowerUpResponseFut {
1184 fn _decode(
1185 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1186 ) -> Result<PhyPowerUpResult, fidl::Error> {
1187 let _response = fidl::client::decode_transaction_body::<
1188 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1189 fidl::encoding::DefaultFuchsiaResourceDialect,
1190 0x7aad8e525738b946,
1191 >(_buf?)?;
1192 Ok(_response.map(|x| x))
1193 }
1194 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PhyPowerUpResult>(
1195 (),
1196 0x7aad8e525738b946,
1197 fidl::encoding::DynamicFlags::empty(),
1198 _decode,
1199 )
1200 }
1201
1202 type ResetResponseFut = fidl::client::QueryResponseFut<
1203 PhyResetResult,
1204 fidl::encoding::DefaultFuchsiaResourceDialect,
1205 >;
1206 fn r#reset(&self) -> Self::ResetResponseFut {
1207 fn _decode(
1208 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1209 ) -> Result<PhyResetResult, fidl::Error> {
1210 let _response = fidl::client::decode_transaction_body::<
1211 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1212 fidl::encoding::DefaultFuchsiaResourceDialect,
1213 0x647cdcc9def3db87,
1214 >(_buf?)?;
1215 Ok(_response.map(|x| x))
1216 }
1217 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PhyResetResult>(
1218 (),
1219 0x647cdcc9def3db87,
1220 fidl::encoding::DynamicFlags::empty(),
1221 _decode,
1222 )
1223 }
1224
1225 type GetPowerStateResponseFut = fidl::client::QueryResponseFut<
1226 PhyGetPowerStateResult,
1227 fidl::encoding::DefaultFuchsiaResourceDialect,
1228 >;
1229 fn r#get_power_state(&self) -> Self::GetPowerStateResponseFut {
1230 fn _decode(
1231 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1232 ) -> Result<PhyGetPowerStateResult, fidl::Error> {
1233 let _response = fidl::client::decode_transaction_body::<
1234 fidl::encoding::ResultType<PhyGetPowerStateResponse, i32>,
1235 fidl::encoding::DefaultFuchsiaResourceDialect,
1236 0xcddef2b16c7f00f,
1237 >(_buf?)?;
1238 Ok(_response.map(|x| x.power_on))
1239 }
1240 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetPowerStateResult>(
1241 (),
1242 0xcddef2b16c7f00f,
1243 fidl::encoding::DynamicFlags::empty(),
1244 _decode,
1245 )
1246 }
1247
1248 type SetBtCoexistenceModeResponseFut = fidl::client::QueryResponseFut<
1249 PhySetBtCoexistenceModeResult,
1250 fidl::encoding::DefaultFuchsiaResourceDialect,
1251 >;
1252 fn r#set_bt_coexistence_mode(
1253 &self,
1254 mut mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
1255 ) -> Self::SetBtCoexistenceModeResponseFut {
1256 fn _decode(
1257 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1258 ) -> Result<PhySetBtCoexistenceModeResult, fidl::Error> {
1259 let _response = fidl::client::decode_transaction_body::<
1260 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1261 fidl::encoding::DefaultFuchsiaResourceDialect,
1262 0x76c66d8313e73996,
1263 >(_buf?)?;
1264 Ok(_response.map(|x| x))
1265 }
1266 self.client
1267 .send_query_and_decode::<PhySetBtCoexistenceModeRequest, PhySetBtCoexistenceModeResult>(
1268 (mode,),
1269 0x76c66d8313e73996,
1270 fidl::encoding::DynamicFlags::empty(),
1271 _decode,
1272 )
1273 }
1274
1275 type SetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
1276 PhySetTxPowerScenarioResult,
1277 fidl::encoding::DefaultFuchsiaResourceDialect,
1278 >;
1279 fn r#set_tx_power_scenario(
1280 &self,
1281 mut scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
1282 ) -> Self::SetTxPowerScenarioResponseFut {
1283 fn _decode(
1284 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1285 ) -> Result<PhySetTxPowerScenarioResult, fidl::Error> {
1286 let _response = fidl::client::decode_transaction_body::<
1287 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1288 fidl::encoding::DefaultFuchsiaResourceDialect,
1289 0x22748ccac6d497df,
1290 >(_buf?)?;
1291 Ok(_response.map(|x| x))
1292 }
1293 self.client
1294 .send_query_and_decode::<PhySetTxPowerScenarioRequest, PhySetTxPowerScenarioResult>(
1295 (scenario,),
1296 0x22748ccac6d497df,
1297 fidl::encoding::DynamicFlags::empty(),
1298 _decode,
1299 )
1300 }
1301
1302 type ResetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
1303 PhyResetTxPowerScenarioResult,
1304 fidl::encoding::DefaultFuchsiaResourceDialect,
1305 >;
1306 fn r#reset_tx_power_scenario(&self) -> Self::ResetTxPowerScenarioResponseFut {
1307 fn _decode(
1308 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1309 ) -> Result<PhyResetTxPowerScenarioResult, fidl::Error> {
1310 let _response = fidl::client::decode_transaction_body::<
1311 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1312 fidl::encoding::DefaultFuchsiaResourceDialect,
1313 0x4f9b16347768b8dd,
1314 >(_buf?)?;
1315 Ok(_response.map(|x| x))
1316 }
1317 self.client
1318 .send_query_and_decode::<fidl::encoding::EmptyPayload, PhyResetTxPowerScenarioResult>(
1319 (),
1320 0x4f9b16347768b8dd,
1321 fidl::encoding::DynamicFlags::empty(),
1322 _decode,
1323 )
1324 }
1325
1326 type GetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
1327 PhyGetTxPowerScenarioResult,
1328 fidl::encoding::DefaultFuchsiaResourceDialect,
1329 >;
1330 fn r#get_tx_power_scenario(&self) -> Self::GetTxPowerScenarioResponseFut {
1331 fn _decode(
1332 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1333 ) -> Result<PhyGetTxPowerScenarioResult, fidl::Error> {
1334 let _response = fidl::client::decode_transaction_body::<
1335 fidl::encoding::ResultType<PhyGetTxPowerScenarioResponse, i32>,
1336 fidl::encoding::DefaultFuchsiaResourceDialect,
1337 0x3f6681e6458c14c2,
1338 >(_buf?)?;
1339 Ok(_response.map(|x| x.scenario))
1340 }
1341 self.client
1342 .send_query_and_decode::<fidl::encoding::EmptyPayload, PhyGetTxPowerScenarioResult>(
1343 (),
1344 0x3f6681e6458c14c2,
1345 fidl::encoding::DynamicFlags::empty(),
1346 _decode,
1347 )
1348 }
1349}
1350
1351pub struct PhyEventStream {
1352 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1353}
1354
1355impl std::marker::Unpin for PhyEventStream {}
1356
1357impl futures::stream::FusedStream for PhyEventStream {
1358 fn is_terminated(&self) -> bool {
1359 self.event_receiver.is_terminated()
1360 }
1361}
1362
1363impl futures::Stream for PhyEventStream {
1364 type Item = Result<PhyEvent, fidl::Error>;
1365
1366 fn poll_next(
1367 mut self: std::pin::Pin<&mut Self>,
1368 cx: &mut std::task::Context<'_>,
1369 ) -> std::task::Poll<Option<Self::Item>> {
1370 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1371 &mut self.event_receiver,
1372 cx
1373 )?) {
1374 Some(buf) => std::task::Poll::Ready(Some(PhyEvent::decode(buf))),
1375 None => std::task::Poll::Ready(None),
1376 }
1377 }
1378}
1379
1380#[derive(Debug)]
1381pub enum PhyEvent {
1382 OnCriticalError { reason_code: CriticalErrorReason },
1383 OnCountryCodeChange { ind: CountryCode },
1384}
1385
1386impl PhyEvent {
1387 #[allow(irrefutable_let_patterns)]
1388 pub fn into_on_critical_error(self) -> Option<CriticalErrorReason> {
1389 if let PhyEvent::OnCriticalError { reason_code } = self {
1390 Some((reason_code))
1391 } else {
1392 None
1393 }
1394 }
1395 #[allow(irrefutable_let_patterns)]
1396 pub fn into_on_country_code_change(self) -> Option<CountryCode> {
1397 if let PhyEvent::OnCountryCodeChange { ind } = self { Some((ind)) } else { None }
1398 }
1399
1400 fn decode(
1402 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1403 ) -> Result<PhyEvent, fidl::Error> {
1404 let (bytes, _handles) = buf.split_mut();
1405 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1406 debug_assert_eq!(tx_header.tx_id, 0);
1407 match tx_header.ordinal {
1408 0x7c82e274966111ab => {
1409 let mut out = fidl::new_empty!(
1410 PhyOnCriticalErrorRequest,
1411 fidl::encoding::DefaultFuchsiaResourceDialect
1412 );
1413 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhyOnCriticalErrorRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
1414 Ok((PhyEvent::OnCriticalError { reason_code: out.reason_code }))
1415 }
1416 0x270d3151e0ff139f => {
1417 let mut out = fidl::new_empty!(
1418 PhyOnCountryCodeChangeRequest,
1419 fidl::encoding::DefaultFuchsiaResourceDialect
1420 );
1421 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhyOnCountryCodeChangeRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
1422 Ok((PhyEvent::OnCountryCodeChange { ind: out.ind }))
1423 }
1424 _ => Err(fidl::Error::UnknownOrdinal {
1425 ordinal: tx_header.ordinal,
1426 protocol_name: <PhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1427 }),
1428 }
1429 }
1430}
1431
1432pub struct PhyRequestStream {
1434 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1435 is_terminated: bool,
1436}
1437
1438impl std::marker::Unpin for PhyRequestStream {}
1439
1440impl futures::stream::FusedStream for PhyRequestStream {
1441 fn is_terminated(&self) -> bool {
1442 self.is_terminated
1443 }
1444}
1445
1446impl fidl::endpoints::RequestStream for PhyRequestStream {
1447 type Protocol = PhyMarker;
1448 type ControlHandle = PhyControlHandle;
1449
1450 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1451 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1452 }
1453
1454 fn control_handle(&self) -> Self::ControlHandle {
1455 PhyControlHandle { inner: self.inner.clone() }
1456 }
1457
1458 fn into_inner(
1459 self,
1460 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1461 {
1462 (self.inner, self.is_terminated)
1463 }
1464
1465 fn from_inner(
1466 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1467 is_terminated: bool,
1468 ) -> Self {
1469 Self { inner, is_terminated }
1470 }
1471}
1472
1473impl futures::Stream for PhyRequestStream {
1474 type Item = Result<PhyRequest, fidl::Error>;
1475
1476 fn poll_next(
1477 mut self: std::pin::Pin<&mut Self>,
1478 cx: &mut std::task::Context<'_>,
1479 ) -> std::task::Poll<Option<Self::Item>> {
1480 let this = &mut *self;
1481 if this.inner.check_shutdown(cx) {
1482 this.is_terminated = true;
1483 return std::task::Poll::Ready(None);
1484 }
1485 if this.is_terminated {
1486 panic!("polled PhyRequestStream after completion");
1487 }
1488 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1489 |bytes, handles| {
1490 match this.inner.channel().read_etc(cx, bytes, handles) {
1491 std::task::Poll::Ready(Ok(())) => {}
1492 std::task::Poll::Pending => return std::task::Poll::Pending,
1493 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1494 this.is_terminated = true;
1495 return std::task::Poll::Ready(None);
1496 }
1497 std::task::Poll::Ready(Err(e)) => {
1498 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1499 e.into(),
1500 ))));
1501 }
1502 }
1503
1504 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1506
1507 std::task::Poll::Ready(Some(match header.ordinal {
1508 0x18f6b9091aa8a44 => {
1509 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1510 let mut req = fidl::new_empty!(
1511 fidl::encoding::EmptyPayload,
1512 fidl::encoding::DefaultFuchsiaResourceDialect
1513 );
1514 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1515 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1516 Ok(PhyRequest::GetSupportedMacRoles {
1517 responder: PhyGetSupportedMacRolesResponder {
1518 control_handle: std::mem::ManuallyDrop::new(control_handle),
1519 tx_id: header.tx_id,
1520 },
1521 })
1522 }
1523 0x665940c7aa4b9785 => {
1524 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1525 let mut req = fidl::new_empty!(
1526 PhyCreateIfaceRequest,
1527 fidl::encoding::DefaultFuchsiaResourceDialect
1528 );
1529 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhyCreateIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1530 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1531 Ok(PhyRequest::CreateIface {
1532 req: req.req,
1533
1534 responder: PhyCreateIfaceResponder {
1535 control_handle: std::mem::ManuallyDrop::new(control_handle),
1536 tx_id: header.tx_id,
1537 },
1538 })
1539 }
1540 0x75a3048ae01942e8 => {
1541 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1542 let mut req = fidl::new_empty!(
1543 PhyDestroyIfaceRequest,
1544 fidl::encoding::DefaultFuchsiaResourceDialect
1545 );
1546 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhyDestroyIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1547 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1548 Ok(PhyRequest::DestroyIface {
1549 req: req.req,
1550
1551 responder: PhyDestroyIfaceResponder {
1552 control_handle: std::mem::ManuallyDrop::new(control_handle),
1553 tx_id: header.tx_id,
1554 },
1555 })
1556 }
1557 0x1367e9997ba00806 => {
1558 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1559 let mut req = fidl::new_empty!(
1560 PhySetCountryRequest,
1561 fidl::encoding::DefaultFuchsiaResourceDialect
1562 );
1563 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhySetCountryRequest>(&header, _body_bytes, handles, &mut req)?;
1564 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1565 Ok(PhyRequest::SetCountry {
1566 req: req.req,
1567
1568 responder: PhySetCountryResponder {
1569 control_handle: std::mem::ManuallyDrop::new(control_handle),
1570 tx_id: header.tx_id,
1571 },
1572 })
1573 }
1574 0x3ed3281ce6feab3e => {
1575 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1576 let mut req = fidl::new_empty!(
1577 fidl::encoding::EmptyPayload,
1578 fidl::encoding::DefaultFuchsiaResourceDialect
1579 );
1580 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1581 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1582 Ok(PhyRequest::GetCountry {
1583 responder: PhyGetCountryResponder {
1584 control_handle: std::mem::ManuallyDrop::new(control_handle),
1585 tx_id: header.tx_id,
1586 },
1587 })
1588 }
1589 0x4ea9b83a9c494c95 => {
1590 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1591 let mut req = fidl::new_empty!(
1592 fidl::encoding::EmptyPayload,
1593 fidl::encoding::DefaultFuchsiaResourceDialect
1594 );
1595 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1596 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1597 Ok(PhyRequest::ClearCountry {
1598 responder: PhyClearCountryResponder {
1599 control_handle: std::mem::ManuallyDrop::new(control_handle),
1600 tx_id: header.tx_id,
1601 },
1602 })
1603 }
1604 0x56be34b2f3abe17f => {
1605 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1606 let mut req = fidl::new_empty!(
1607 PhySetPowerSaveModeRequest,
1608 fidl::encoding::DefaultFuchsiaResourceDialect
1609 );
1610 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhySetPowerSaveModeRequest>(&header, _body_bytes, handles, &mut req)?;
1611 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1612 Ok(PhyRequest::SetPowerSaveMode {
1613 req: req.req,
1614
1615 responder: PhySetPowerSaveModeResponder {
1616 control_handle: std::mem::ManuallyDrop::new(control_handle),
1617 tx_id: header.tx_id,
1618 },
1619 })
1620 }
1621 0x3f7019c3672bc798 => {
1622 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1623 let mut req = fidl::new_empty!(
1624 fidl::encoding::EmptyPayload,
1625 fidl::encoding::DefaultFuchsiaResourceDialect
1626 );
1627 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1628 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1629 Ok(PhyRequest::GetPowerSaveMode {
1630 responder: PhyGetPowerSaveModeResponder {
1631 control_handle: std::mem::ManuallyDrop::new(control_handle),
1632 tx_id: header.tx_id,
1633 },
1634 })
1635 }
1636 0x56bcae4b27a564d2 => {
1637 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1638 let mut req = fidl::new_empty!(
1639 fidl::encoding::EmptyPayload,
1640 fidl::encoding::DefaultFuchsiaResourceDialect
1641 );
1642 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1643 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1644 Ok(PhyRequest::PowerDown {
1645 responder: PhyPowerDownResponder {
1646 control_handle: std::mem::ManuallyDrop::new(control_handle),
1647 tx_id: header.tx_id,
1648 },
1649 })
1650 }
1651 0x7aad8e525738b946 => {
1652 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1653 let mut req = fidl::new_empty!(
1654 fidl::encoding::EmptyPayload,
1655 fidl::encoding::DefaultFuchsiaResourceDialect
1656 );
1657 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1658 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1659 Ok(PhyRequest::PowerUp {
1660 responder: PhyPowerUpResponder {
1661 control_handle: std::mem::ManuallyDrop::new(control_handle),
1662 tx_id: header.tx_id,
1663 },
1664 })
1665 }
1666 0x647cdcc9def3db87 => {
1667 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1668 let mut req = fidl::new_empty!(
1669 fidl::encoding::EmptyPayload,
1670 fidl::encoding::DefaultFuchsiaResourceDialect
1671 );
1672 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1673 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1674 Ok(PhyRequest::Reset {
1675 responder: PhyResetResponder {
1676 control_handle: std::mem::ManuallyDrop::new(control_handle),
1677 tx_id: header.tx_id,
1678 },
1679 })
1680 }
1681 0xcddef2b16c7f00f => {
1682 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1683 let mut req = fidl::new_empty!(
1684 fidl::encoding::EmptyPayload,
1685 fidl::encoding::DefaultFuchsiaResourceDialect
1686 );
1687 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1688 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1689 Ok(PhyRequest::GetPowerState {
1690 responder: PhyGetPowerStateResponder {
1691 control_handle: std::mem::ManuallyDrop::new(control_handle),
1692 tx_id: header.tx_id,
1693 },
1694 })
1695 }
1696 0x76c66d8313e73996 => {
1697 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1698 let mut req = fidl::new_empty!(
1699 PhySetBtCoexistenceModeRequest,
1700 fidl::encoding::DefaultFuchsiaResourceDialect
1701 );
1702 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhySetBtCoexistenceModeRequest>(&header, _body_bytes, handles, &mut req)?;
1703 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1704 Ok(PhyRequest::SetBtCoexistenceMode {
1705 mode: req.mode,
1706
1707 responder: PhySetBtCoexistenceModeResponder {
1708 control_handle: std::mem::ManuallyDrop::new(control_handle),
1709 tx_id: header.tx_id,
1710 },
1711 })
1712 }
1713 0x22748ccac6d497df => {
1714 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1715 let mut req = fidl::new_empty!(
1716 PhySetTxPowerScenarioRequest,
1717 fidl::encoding::DefaultFuchsiaResourceDialect
1718 );
1719 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhySetTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
1720 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1721 Ok(PhyRequest::SetTxPowerScenario {
1722 scenario: req.scenario,
1723
1724 responder: PhySetTxPowerScenarioResponder {
1725 control_handle: std::mem::ManuallyDrop::new(control_handle),
1726 tx_id: header.tx_id,
1727 },
1728 })
1729 }
1730 0x4f9b16347768b8dd => {
1731 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1732 let mut req = fidl::new_empty!(
1733 fidl::encoding::EmptyPayload,
1734 fidl::encoding::DefaultFuchsiaResourceDialect
1735 );
1736 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1737 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1738 Ok(PhyRequest::ResetTxPowerScenario {
1739 responder: PhyResetTxPowerScenarioResponder {
1740 control_handle: std::mem::ManuallyDrop::new(control_handle),
1741 tx_id: header.tx_id,
1742 },
1743 })
1744 }
1745 0x3f6681e6458c14c2 => {
1746 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1747 let mut req = fidl::new_empty!(
1748 fidl::encoding::EmptyPayload,
1749 fidl::encoding::DefaultFuchsiaResourceDialect
1750 );
1751 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1752 let control_handle = PhyControlHandle { inner: this.inner.clone() };
1753 Ok(PhyRequest::GetTxPowerScenario {
1754 responder: PhyGetTxPowerScenarioResponder {
1755 control_handle: std::mem::ManuallyDrop::new(control_handle),
1756 tx_id: header.tx_id,
1757 },
1758 })
1759 }
1760 _ => Err(fidl::Error::UnknownOrdinal {
1761 ordinal: header.ordinal,
1762 protocol_name: <PhyMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1763 }),
1764 }))
1765 },
1766 )
1767 }
1768}
1769
1770#[derive(Debug)]
1771pub enum PhyRequest {
1772 GetSupportedMacRoles {
1773 responder: PhyGetSupportedMacRolesResponder,
1774 },
1775 CreateIface {
1776 req: CreateIfaceRequest,
1777 responder: PhyCreateIfaceResponder,
1778 },
1779 DestroyIface {
1780 req: DestroyIfaceRequest,
1781 responder: PhyDestroyIfaceResponder,
1782 },
1783 SetCountry {
1784 req: CountryCode,
1785 responder: PhySetCountryResponder,
1786 },
1787 GetCountry {
1788 responder: PhyGetCountryResponder,
1789 },
1790 ClearCountry {
1791 responder: PhyClearCountryResponder,
1792 },
1793 SetPowerSaveMode {
1794 req: fidl_fuchsia_wlan_common::PowerSaveType,
1795 responder: PhySetPowerSaveModeResponder,
1796 },
1797 GetPowerSaveMode {
1798 responder: PhyGetPowerSaveModeResponder,
1799 },
1800 PowerDown {
1801 responder: PhyPowerDownResponder,
1802 },
1803 PowerUp {
1804 responder: PhyPowerUpResponder,
1805 },
1806 Reset {
1807 responder: PhyResetResponder,
1808 },
1809 GetPowerState {
1810 responder: PhyGetPowerStateResponder,
1811 },
1812 SetBtCoexistenceMode {
1813 mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
1814 responder: PhySetBtCoexistenceModeResponder,
1815 },
1816 SetTxPowerScenario {
1817 scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
1818 responder: PhySetTxPowerScenarioResponder,
1819 },
1820 ResetTxPowerScenario {
1821 responder: PhyResetTxPowerScenarioResponder,
1822 },
1823 GetTxPowerScenario {
1824 responder: PhyGetTxPowerScenarioResponder,
1825 },
1826}
1827
1828impl PhyRequest {
1829 #[allow(irrefutable_let_patterns)]
1830 pub fn into_get_supported_mac_roles(self) -> Option<(PhyGetSupportedMacRolesResponder)> {
1831 if let PhyRequest::GetSupportedMacRoles { responder } = self {
1832 Some((responder))
1833 } else {
1834 None
1835 }
1836 }
1837
1838 #[allow(irrefutable_let_patterns)]
1839 pub fn into_create_iface(self) -> Option<(CreateIfaceRequest, PhyCreateIfaceResponder)> {
1840 if let PhyRequest::CreateIface { req, responder } = self {
1841 Some((req, responder))
1842 } else {
1843 None
1844 }
1845 }
1846
1847 #[allow(irrefutable_let_patterns)]
1848 pub fn into_destroy_iface(self) -> Option<(DestroyIfaceRequest, PhyDestroyIfaceResponder)> {
1849 if let PhyRequest::DestroyIface { req, responder } = self {
1850 Some((req, responder))
1851 } else {
1852 None
1853 }
1854 }
1855
1856 #[allow(irrefutable_let_patterns)]
1857 pub fn into_set_country(self) -> Option<(CountryCode, PhySetCountryResponder)> {
1858 if let PhyRequest::SetCountry { req, responder } = self {
1859 Some((req, responder))
1860 } else {
1861 None
1862 }
1863 }
1864
1865 #[allow(irrefutable_let_patterns)]
1866 pub fn into_get_country(self) -> Option<(PhyGetCountryResponder)> {
1867 if let PhyRequest::GetCountry { responder } = self { Some((responder)) } else { None }
1868 }
1869
1870 #[allow(irrefutable_let_patterns)]
1871 pub fn into_clear_country(self) -> Option<(PhyClearCountryResponder)> {
1872 if let PhyRequest::ClearCountry { responder } = self { Some((responder)) } else { None }
1873 }
1874
1875 #[allow(irrefutable_let_patterns)]
1876 pub fn into_set_power_save_mode(
1877 self,
1878 ) -> Option<(fidl_fuchsia_wlan_common::PowerSaveType, PhySetPowerSaveModeResponder)> {
1879 if let PhyRequest::SetPowerSaveMode { req, responder } = self {
1880 Some((req, responder))
1881 } else {
1882 None
1883 }
1884 }
1885
1886 #[allow(irrefutable_let_patterns)]
1887 pub fn into_get_power_save_mode(self) -> Option<(PhyGetPowerSaveModeResponder)> {
1888 if let PhyRequest::GetPowerSaveMode { responder } = self { Some((responder)) } else { None }
1889 }
1890
1891 #[allow(irrefutable_let_patterns)]
1892 pub fn into_power_down(self) -> Option<(PhyPowerDownResponder)> {
1893 if let PhyRequest::PowerDown { responder } = self { Some((responder)) } else { None }
1894 }
1895
1896 #[allow(irrefutable_let_patterns)]
1897 pub fn into_power_up(self) -> Option<(PhyPowerUpResponder)> {
1898 if let PhyRequest::PowerUp { responder } = self { Some((responder)) } else { None }
1899 }
1900
1901 #[allow(irrefutable_let_patterns)]
1902 pub fn into_reset(self) -> Option<(PhyResetResponder)> {
1903 if let PhyRequest::Reset { responder } = self { Some((responder)) } else { None }
1904 }
1905
1906 #[allow(irrefutable_let_patterns)]
1907 pub fn into_get_power_state(self) -> Option<(PhyGetPowerStateResponder)> {
1908 if let PhyRequest::GetPowerState { responder } = self { Some((responder)) } else { None }
1909 }
1910
1911 #[allow(irrefutable_let_patterns)]
1912 pub fn into_set_bt_coexistence_mode(
1913 self,
1914 ) -> Option<(fidl_fuchsia_wlan_internal::BtCoexistenceMode, PhySetBtCoexistenceModeResponder)>
1915 {
1916 if let PhyRequest::SetBtCoexistenceMode { mode, responder } = self {
1917 Some((mode, responder))
1918 } else {
1919 None
1920 }
1921 }
1922
1923 #[allow(irrefutable_let_patterns)]
1924 pub fn into_set_tx_power_scenario(
1925 self,
1926 ) -> Option<(fidl_fuchsia_wlan_internal::TxPowerScenario, PhySetTxPowerScenarioResponder)> {
1927 if let PhyRequest::SetTxPowerScenario { scenario, responder } = self {
1928 Some((scenario, responder))
1929 } else {
1930 None
1931 }
1932 }
1933
1934 #[allow(irrefutable_let_patterns)]
1935 pub fn into_reset_tx_power_scenario(self) -> Option<(PhyResetTxPowerScenarioResponder)> {
1936 if let PhyRequest::ResetTxPowerScenario { responder } = self {
1937 Some((responder))
1938 } else {
1939 None
1940 }
1941 }
1942
1943 #[allow(irrefutable_let_patterns)]
1944 pub fn into_get_tx_power_scenario(self) -> Option<(PhyGetTxPowerScenarioResponder)> {
1945 if let PhyRequest::GetTxPowerScenario { responder } = self {
1946 Some((responder))
1947 } else {
1948 None
1949 }
1950 }
1951
1952 pub fn method_name(&self) -> &'static str {
1954 match *self {
1955 PhyRequest::GetSupportedMacRoles { .. } => "get_supported_mac_roles",
1956 PhyRequest::CreateIface { .. } => "create_iface",
1957 PhyRequest::DestroyIface { .. } => "destroy_iface",
1958 PhyRequest::SetCountry { .. } => "set_country",
1959 PhyRequest::GetCountry { .. } => "get_country",
1960 PhyRequest::ClearCountry { .. } => "clear_country",
1961 PhyRequest::SetPowerSaveMode { .. } => "set_power_save_mode",
1962 PhyRequest::GetPowerSaveMode { .. } => "get_power_save_mode",
1963 PhyRequest::PowerDown { .. } => "power_down",
1964 PhyRequest::PowerUp { .. } => "power_up",
1965 PhyRequest::Reset { .. } => "reset",
1966 PhyRequest::GetPowerState { .. } => "get_power_state",
1967 PhyRequest::SetBtCoexistenceMode { .. } => "set_bt_coexistence_mode",
1968 PhyRequest::SetTxPowerScenario { .. } => "set_tx_power_scenario",
1969 PhyRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
1970 PhyRequest::GetTxPowerScenario { .. } => "get_tx_power_scenario",
1971 }
1972 }
1973}
1974
1975#[derive(Debug, Clone)]
1976pub struct PhyControlHandle {
1977 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1978}
1979
1980impl fidl::endpoints::ControlHandle for PhyControlHandle {
1981 fn shutdown(&self) {
1982 self.inner.shutdown()
1983 }
1984
1985 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1986 self.inner.shutdown_with_epitaph(status)
1987 }
1988
1989 fn is_closed(&self) -> bool {
1990 self.inner.channel().is_closed()
1991 }
1992 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1993 self.inner.channel().on_closed()
1994 }
1995
1996 #[cfg(target_os = "fuchsia")]
1997 fn signal_peer(
1998 &self,
1999 clear_mask: zx::Signals,
2000 set_mask: zx::Signals,
2001 ) -> Result<(), zx_status::Status> {
2002 use fidl::Peered;
2003 self.inner.channel().signal_peer(clear_mask, set_mask)
2004 }
2005}
2006
2007impl PhyControlHandle {
2008 pub fn send_on_critical_error(
2009 &self,
2010 mut reason_code: CriticalErrorReason,
2011 ) -> Result<(), fidl::Error> {
2012 self.inner.send::<PhyOnCriticalErrorRequest>(
2013 (reason_code,),
2014 0,
2015 0x7c82e274966111ab,
2016 fidl::encoding::DynamicFlags::empty(),
2017 )
2018 }
2019
2020 pub fn send_on_country_code_change(&self, mut ind: &CountryCode) -> Result<(), fidl::Error> {
2021 self.inner.send::<PhyOnCountryCodeChangeRequest>(
2022 (ind,),
2023 0,
2024 0x270d3151e0ff139f,
2025 fidl::encoding::DynamicFlags::empty(),
2026 )
2027 }
2028}
2029
2030#[must_use = "FIDL methods require a response to be sent"]
2031#[derive(Debug)]
2032pub struct PhyGetSupportedMacRolesResponder {
2033 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2034 tx_id: u32,
2035}
2036
2037impl std::ops::Drop for PhyGetSupportedMacRolesResponder {
2041 fn drop(&mut self) {
2042 self.control_handle.shutdown();
2043 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2045 }
2046}
2047
2048impl fidl::endpoints::Responder for PhyGetSupportedMacRolesResponder {
2049 type ControlHandle = PhyControlHandle;
2050
2051 fn control_handle(&self) -> &PhyControlHandle {
2052 &self.control_handle
2053 }
2054
2055 fn drop_without_shutdown(mut self) {
2056 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2058 std::mem::forget(self);
2060 }
2061}
2062
2063impl PhyGetSupportedMacRolesResponder {
2064 pub fn send(
2068 self,
2069 mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
2070 ) -> Result<(), fidl::Error> {
2071 let _result = self.send_raw(result);
2072 if _result.is_err() {
2073 self.control_handle.shutdown();
2074 }
2075 self.drop_without_shutdown();
2076 _result
2077 }
2078
2079 pub fn send_no_shutdown_on_err(
2081 self,
2082 mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
2083 ) -> Result<(), fidl::Error> {
2084 let _result = self.send_raw(result);
2085 self.drop_without_shutdown();
2086 _result
2087 }
2088
2089 fn send_raw(
2090 &self,
2091 mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
2092 ) -> Result<(), fidl::Error> {
2093 self.control_handle
2094 .inner
2095 .send::<fidl::encoding::ResultType<PhyGetSupportedMacRolesResponse, i32>>(
2096 result.map(|supported_mac_roles| (supported_mac_roles,)),
2097 self.tx_id,
2098 0x18f6b9091aa8a44,
2099 fidl::encoding::DynamicFlags::empty(),
2100 )
2101 }
2102}
2103
2104#[must_use = "FIDL methods require a response to be sent"]
2105#[derive(Debug)]
2106pub struct PhyCreateIfaceResponder {
2107 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2108 tx_id: u32,
2109}
2110
2111impl std::ops::Drop for PhyCreateIfaceResponder {
2115 fn drop(&mut self) {
2116 self.control_handle.shutdown();
2117 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2119 }
2120}
2121
2122impl fidl::endpoints::Responder for PhyCreateIfaceResponder {
2123 type ControlHandle = PhyControlHandle;
2124
2125 fn control_handle(&self) -> &PhyControlHandle {
2126 &self.control_handle
2127 }
2128
2129 fn drop_without_shutdown(mut self) {
2130 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2132 std::mem::forget(self);
2134 }
2135}
2136
2137impl PhyCreateIfaceResponder {
2138 pub fn send(self, mut result: Result<u16, i32>) -> Result<(), fidl::Error> {
2142 let _result = self.send_raw(result);
2143 if _result.is_err() {
2144 self.control_handle.shutdown();
2145 }
2146 self.drop_without_shutdown();
2147 _result
2148 }
2149
2150 pub fn send_no_shutdown_on_err(self, mut result: Result<u16, i32>) -> Result<(), fidl::Error> {
2152 let _result = self.send_raw(result);
2153 self.drop_without_shutdown();
2154 _result
2155 }
2156
2157 fn send_raw(&self, mut result: Result<u16, i32>) -> Result<(), fidl::Error> {
2158 self.control_handle.inner.send::<fidl::encoding::ResultType<PhyCreateIfaceResponse, i32>>(
2159 result.map(|iface_id| (iface_id,)),
2160 self.tx_id,
2161 0x665940c7aa4b9785,
2162 fidl::encoding::DynamicFlags::empty(),
2163 )
2164 }
2165}
2166
2167#[must_use = "FIDL methods require a response to be sent"]
2168#[derive(Debug)]
2169pub struct PhyDestroyIfaceResponder {
2170 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2171 tx_id: u32,
2172}
2173
2174impl std::ops::Drop for PhyDestroyIfaceResponder {
2178 fn drop(&mut self) {
2179 self.control_handle.shutdown();
2180 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2182 }
2183}
2184
2185impl fidl::endpoints::Responder for PhyDestroyIfaceResponder {
2186 type ControlHandle = PhyControlHandle;
2187
2188 fn control_handle(&self) -> &PhyControlHandle {
2189 &self.control_handle
2190 }
2191
2192 fn drop_without_shutdown(mut self) {
2193 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2195 std::mem::forget(self);
2197 }
2198}
2199
2200impl PhyDestroyIfaceResponder {
2201 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2205 let _result = self.send_raw(result);
2206 if _result.is_err() {
2207 self.control_handle.shutdown();
2208 }
2209 self.drop_without_shutdown();
2210 _result
2211 }
2212
2213 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2215 let _result = self.send_raw(result);
2216 self.drop_without_shutdown();
2217 _result
2218 }
2219
2220 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2221 self.control_handle
2222 .inner
2223 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2224 result,
2225 self.tx_id,
2226 0x75a3048ae01942e8,
2227 fidl::encoding::DynamicFlags::empty(),
2228 )
2229 }
2230}
2231
2232#[must_use = "FIDL methods require a response to be sent"]
2233#[derive(Debug)]
2234pub struct PhySetCountryResponder {
2235 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2236 tx_id: u32,
2237}
2238
2239impl std::ops::Drop for PhySetCountryResponder {
2243 fn drop(&mut self) {
2244 self.control_handle.shutdown();
2245 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2247 }
2248}
2249
2250impl fidl::endpoints::Responder for PhySetCountryResponder {
2251 type ControlHandle = PhyControlHandle;
2252
2253 fn control_handle(&self) -> &PhyControlHandle {
2254 &self.control_handle
2255 }
2256
2257 fn drop_without_shutdown(mut self) {
2258 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2260 std::mem::forget(self);
2262 }
2263}
2264
2265impl PhySetCountryResponder {
2266 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2270 let _result = self.send_raw(status);
2271 if _result.is_err() {
2272 self.control_handle.shutdown();
2273 }
2274 self.drop_without_shutdown();
2275 _result
2276 }
2277
2278 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2280 let _result = self.send_raw(status);
2281 self.drop_without_shutdown();
2282 _result
2283 }
2284
2285 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2286 self.control_handle.inner.send::<PhySetCountryResponse>(
2287 (status,),
2288 self.tx_id,
2289 0x1367e9997ba00806,
2290 fidl::encoding::DynamicFlags::empty(),
2291 )
2292 }
2293}
2294
2295#[must_use = "FIDL methods require a response to be sent"]
2296#[derive(Debug)]
2297pub struct PhyGetCountryResponder {
2298 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2299 tx_id: u32,
2300}
2301
2302impl std::ops::Drop for PhyGetCountryResponder {
2306 fn drop(&mut self) {
2307 self.control_handle.shutdown();
2308 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2310 }
2311}
2312
2313impl fidl::endpoints::Responder for PhyGetCountryResponder {
2314 type ControlHandle = PhyControlHandle;
2315
2316 fn control_handle(&self) -> &PhyControlHandle {
2317 &self.control_handle
2318 }
2319
2320 fn drop_without_shutdown(mut self) {
2321 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2323 std::mem::forget(self);
2325 }
2326}
2327
2328impl PhyGetCountryResponder {
2329 pub fn send(self, mut result: Result<&CountryCode, i32>) -> Result<(), fidl::Error> {
2333 let _result = self.send_raw(result);
2334 if _result.is_err() {
2335 self.control_handle.shutdown();
2336 }
2337 self.drop_without_shutdown();
2338 _result
2339 }
2340
2341 pub fn send_no_shutdown_on_err(
2343 self,
2344 mut result: Result<&CountryCode, i32>,
2345 ) -> Result<(), fidl::Error> {
2346 let _result = self.send_raw(result);
2347 self.drop_without_shutdown();
2348 _result
2349 }
2350
2351 fn send_raw(&self, mut result: Result<&CountryCode, i32>) -> Result<(), fidl::Error> {
2352 self.control_handle.inner.send::<fidl::encoding::ResultType<PhyGetCountryResponse, i32>>(
2353 result.map(|resp| (resp,)),
2354 self.tx_id,
2355 0x3ed3281ce6feab3e,
2356 fidl::encoding::DynamicFlags::empty(),
2357 )
2358 }
2359}
2360
2361#[must_use = "FIDL methods require a response to be sent"]
2362#[derive(Debug)]
2363pub struct PhyClearCountryResponder {
2364 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2365 tx_id: u32,
2366}
2367
2368impl std::ops::Drop for PhyClearCountryResponder {
2372 fn drop(&mut self) {
2373 self.control_handle.shutdown();
2374 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2376 }
2377}
2378
2379impl fidl::endpoints::Responder for PhyClearCountryResponder {
2380 type ControlHandle = PhyControlHandle;
2381
2382 fn control_handle(&self) -> &PhyControlHandle {
2383 &self.control_handle
2384 }
2385
2386 fn drop_without_shutdown(mut self) {
2387 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2389 std::mem::forget(self);
2391 }
2392}
2393
2394impl PhyClearCountryResponder {
2395 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2399 let _result = self.send_raw(status);
2400 if _result.is_err() {
2401 self.control_handle.shutdown();
2402 }
2403 self.drop_without_shutdown();
2404 _result
2405 }
2406
2407 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2409 let _result = self.send_raw(status);
2410 self.drop_without_shutdown();
2411 _result
2412 }
2413
2414 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2415 self.control_handle.inner.send::<PhyClearCountryResponse>(
2416 (status,),
2417 self.tx_id,
2418 0x4ea9b83a9c494c95,
2419 fidl::encoding::DynamicFlags::empty(),
2420 )
2421 }
2422}
2423
2424#[must_use = "FIDL methods require a response to be sent"]
2425#[derive(Debug)]
2426pub struct PhySetPowerSaveModeResponder {
2427 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2428 tx_id: u32,
2429}
2430
2431impl std::ops::Drop for PhySetPowerSaveModeResponder {
2435 fn drop(&mut self) {
2436 self.control_handle.shutdown();
2437 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2439 }
2440}
2441
2442impl fidl::endpoints::Responder for PhySetPowerSaveModeResponder {
2443 type ControlHandle = PhyControlHandle;
2444
2445 fn control_handle(&self) -> &PhyControlHandle {
2446 &self.control_handle
2447 }
2448
2449 fn drop_without_shutdown(mut self) {
2450 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2452 std::mem::forget(self);
2454 }
2455}
2456
2457impl PhySetPowerSaveModeResponder {
2458 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2462 let _result = self.send_raw(status);
2463 if _result.is_err() {
2464 self.control_handle.shutdown();
2465 }
2466 self.drop_without_shutdown();
2467 _result
2468 }
2469
2470 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2472 let _result = self.send_raw(status);
2473 self.drop_without_shutdown();
2474 _result
2475 }
2476
2477 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2478 self.control_handle.inner.send::<PhySetPowerSaveModeResponse>(
2479 (status,),
2480 self.tx_id,
2481 0x56be34b2f3abe17f,
2482 fidl::encoding::DynamicFlags::empty(),
2483 )
2484 }
2485}
2486
2487#[must_use = "FIDL methods require a response to be sent"]
2488#[derive(Debug)]
2489pub struct PhyGetPowerSaveModeResponder {
2490 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2491 tx_id: u32,
2492}
2493
2494impl std::ops::Drop for PhyGetPowerSaveModeResponder {
2498 fn drop(&mut self) {
2499 self.control_handle.shutdown();
2500 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2502 }
2503}
2504
2505impl fidl::endpoints::Responder for PhyGetPowerSaveModeResponder {
2506 type ControlHandle = PhyControlHandle;
2507
2508 fn control_handle(&self) -> &PhyControlHandle {
2509 &self.control_handle
2510 }
2511
2512 fn drop_without_shutdown(mut self) {
2513 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2515 std::mem::forget(self);
2517 }
2518}
2519
2520impl PhyGetPowerSaveModeResponder {
2521 pub fn send(
2525 self,
2526 mut result: Result<fidl_fuchsia_wlan_common::PowerSaveType, i32>,
2527 ) -> Result<(), fidl::Error> {
2528 let _result = self.send_raw(result);
2529 if _result.is_err() {
2530 self.control_handle.shutdown();
2531 }
2532 self.drop_without_shutdown();
2533 _result
2534 }
2535
2536 pub fn send_no_shutdown_on_err(
2538 self,
2539 mut result: Result<fidl_fuchsia_wlan_common::PowerSaveType, i32>,
2540 ) -> Result<(), fidl::Error> {
2541 let _result = self.send_raw(result);
2542 self.drop_without_shutdown();
2543 _result
2544 }
2545
2546 fn send_raw(
2547 &self,
2548 mut result: Result<fidl_fuchsia_wlan_common::PowerSaveType, i32>,
2549 ) -> Result<(), fidl::Error> {
2550 self.control_handle
2551 .inner
2552 .send::<fidl::encoding::ResultType<PhyGetPowerSaveModeResponse, i32>>(
2553 result.map(|resp| (resp,)),
2554 self.tx_id,
2555 0x3f7019c3672bc798,
2556 fidl::encoding::DynamicFlags::empty(),
2557 )
2558 }
2559}
2560
2561#[must_use = "FIDL methods require a response to be sent"]
2562#[derive(Debug)]
2563pub struct PhyPowerDownResponder {
2564 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2565 tx_id: u32,
2566}
2567
2568impl std::ops::Drop for PhyPowerDownResponder {
2572 fn drop(&mut self) {
2573 self.control_handle.shutdown();
2574 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2576 }
2577}
2578
2579impl fidl::endpoints::Responder for PhyPowerDownResponder {
2580 type ControlHandle = PhyControlHandle;
2581
2582 fn control_handle(&self) -> &PhyControlHandle {
2583 &self.control_handle
2584 }
2585
2586 fn drop_without_shutdown(mut self) {
2587 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2589 std::mem::forget(self);
2591 }
2592}
2593
2594impl PhyPowerDownResponder {
2595 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2599 let _result = self.send_raw(result);
2600 if _result.is_err() {
2601 self.control_handle.shutdown();
2602 }
2603 self.drop_without_shutdown();
2604 _result
2605 }
2606
2607 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2609 let _result = self.send_raw(result);
2610 self.drop_without_shutdown();
2611 _result
2612 }
2613
2614 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2615 self.control_handle
2616 .inner
2617 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2618 result,
2619 self.tx_id,
2620 0x56bcae4b27a564d2,
2621 fidl::encoding::DynamicFlags::empty(),
2622 )
2623 }
2624}
2625
2626#[must_use = "FIDL methods require a response to be sent"]
2627#[derive(Debug)]
2628pub struct PhyPowerUpResponder {
2629 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2630 tx_id: u32,
2631}
2632
2633impl std::ops::Drop for PhyPowerUpResponder {
2637 fn drop(&mut self) {
2638 self.control_handle.shutdown();
2639 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2641 }
2642}
2643
2644impl fidl::endpoints::Responder for PhyPowerUpResponder {
2645 type ControlHandle = PhyControlHandle;
2646
2647 fn control_handle(&self) -> &PhyControlHandle {
2648 &self.control_handle
2649 }
2650
2651 fn drop_without_shutdown(mut self) {
2652 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2654 std::mem::forget(self);
2656 }
2657}
2658
2659impl PhyPowerUpResponder {
2660 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2664 let _result = self.send_raw(result);
2665 if _result.is_err() {
2666 self.control_handle.shutdown();
2667 }
2668 self.drop_without_shutdown();
2669 _result
2670 }
2671
2672 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2674 let _result = self.send_raw(result);
2675 self.drop_without_shutdown();
2676 _result
2677 }
2678
2679 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2680 self.control_handle
2681 .inner
2682 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2683 result,
2684 self.tx_id,
2685 0x7aad8e525738b946,
2686 fidl::encoding::DynamicFlags::empty(),
2687 )
2688 }
2689}
2690
2691#[must_use = "FIDL methods require a response to be sent"]
2692#[derive(Debug)]
2693pub struct PhyResetResponder {
2694 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2695 tx_id: u32,
2696}
2697
2698impl std::ops::Drop for PhyResetResponder {
2702 fn drop(&mut self) {
2703 self.control_handle.shutdown();
2704 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2706 }
2707}
2708
2709impl fidl::endpoints::Responder for PhyResetResponder {
2710 type ControlHandle = PhyControlHandle;
2711
2712 fn control_handle(&self) -> &PhyControlHandle {
2713 &self.control_handle
2714 }
2715
2716 fn drop_without_shutdown(mut self) {
2717 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2719 std::mem::forget(self);
2721 }
2722}
2723
2724impl PhyResetResponder {
2725 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2729 let _result = self.send_raw(result);
2730 if _result.is_err() {
2731 self.control_handle.shutdown();
2732 }
2733 self.drop_without_shutdown();
2734 _result
2735 }
2736
2737 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2739 let _result = self.send_raw(result);
2740 self.drop_without_shutdown();
2741 _result
2742 }
2743
2744 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2745 self.control_handle
2746 .inner
2747 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2748 result,
2749 self.tx_id,
2750 0x647cdcc9def3db87,
2751 fidl::encoding::DynamicFlags::empty(),
2752 )
2753 }
2754}
2755
2756#[must_use = "FIDL methods require a response to be sent"]
2757#[derive(Debug)]
2758pub struct PhyGetPowerStateResponder {
2759 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2760 tx_id: u32,
2761}
2762
2763impl std::ops::Drop for PhyGetPowerStateResponder {
2767 fn drop(&mut self) {
2768 self.control_handle.shutdown();
2769 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2771 }
2772}
2773
2774impl fidl::endpoints::Responder for PhyGetPowerStateResponder {
2775 type ControlHandle = PhyControlHandle;
2776
2777 fn control_handle(&self) -> &PhyControlHandle {
2778 &self.control_handle
2779 }
2780
2781 fn drop_without_shutdown(mut self) {
2782 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2784 std::mem::forget(self);
2786 }
2787}
2788
2789impl PhyGetPowerStateResponder {
2790 pub fn send(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
2794 let _result = self.send_raw(result);
2795 if _result.is_err() {
2796 self.control_handle.shutdown();
2797 }
2798 self.drop_without_shutdown();
2799 _result
2800 }
2801
2802 pub fn send_no_shutdown_on_err(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
2804 let _result = self.send_raw(result);
2805 self.drop_without_shutdown();
2806 _result
2807 }
2808
2809 fn send_raw(&self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
2810 self.control_handle.inner.send::<fidl::encoding::ResultType<PhyGetPowerStateResponse, i32>>(
2811 result.map(|power_on| (power_on,)),
2812 self.tx_id,
2813 0xcddef2b16c7f00f,
2814 fidl::encoding::DynamicFlags::empty(),
2815 )
2816 }
2817}
2818
2819#[must_use = "FIDL methods require a response to be sent"]
2820#[derive(Debug)]
2821pub struct PhySetBtCoexistenceModeResponder {
2822 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2823 tx_id: u32,
2824}
2825
2826impl std::ops::Drop for PhySetBtCoexistenceModeResponder {
2830 fn drop(&mut self) {
2831 self.control_handle.shutdown();
2832 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2834 }
2835}
2836
2837impl fidl::endpoints::Responder for PhySetBtCoexistenceModeResponder {
2838 type ControlHandle = PhyControlHandle;
2839
2840 fn control_handle(&self) -> &PhyControlHandle {
2841 &self.control_handle
2842 }
2843
2844 fn drop_without_shutdown(mut self) {
2845 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2847 std::mem::forget(self);
2849 }
2850}
2851
2852impl PhySetBtCoexistenceModeResponder {
2853 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2857 let _result = self.send_raw(result);
2858 if _result.is_err() {
2859 self.control_handle.shutdown();
2860 }
2861 self.drop_without_shutdown();
2862 _result
2863 }
2864
2865 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2867 let _result = self.send_raw(result);
2868 self.drop_without_shutdown();
2869 _result
2870 }
2871
2872 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2873 self.control_handle
2874 .inner
2875 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2876 result,
2877 self.tx_id,
2878 0x76c66d8313e73996,
2879 fidl::encoding::DynamicFlags::empty(),
2880 )
2881 }
2882}
2883
2884#[must_use = "FIDL methods require a response to be sent"]
2885#[derive(Debug)]
2886pub struct PhySetTxPowerScenarioResponder {
2887 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2888 tx_id: u32,
2889}
2890
2891impl std::ops::Drop for PhySetTxPowerScenarioResponder {
2895 fn drop(&mut self) {
2896 self.control_handle.shutdown();
2897 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2899 }
2900}
2901
2902impl fidl::endpoints::Responder for PhySetTxPowerScenarioResponder {
2903 type ControlHandle = PhyControlHandle;
2904
2905 fn control_handle(&self) -> &PhyControlHandle {
2906 &self.control_handle
2907 }
2908
2909 fn drop_without_shutdown(mut self) {
2910 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2912 std::mem::forget(self);
2914 }
2915}
2916
2917impl PhySetTxPowerScenarioResponder {
2918 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2922 let _result = self.send_raw(result);
2923 if _result.is_err() {
2924 self.control_handle.shutdown();
2925 }
2926 self.drop_without_shutdown();
2927 _result
2928 }
2929
2930 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2932 let _result = self.send_raw(result);
2933 self.drop_without_shutdown();
2934 _result
2935 }
2936
2937 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2938 self.control_handle
2939 .inner
2940 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2941 result,
2942 self.tx_id,
2943 0x22748ccac6d497df,
2944 fidl::encoding::DynamicFlags::empty(),
2945 )
2946 }
2947}
2948
2949#[must_use = "FIDL methods require a response to be sent"]
2950#[derive(Debug)]
2951pub struct PhyResetTxPowerScenarioResponder {
2952 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
2953 tx_id: u32,
2954}
2955
2956impl std::ops::Drop for PhyResetTxPowerScenarioResponder {
2960 fn drop(&mut self) {
2961 self.control_handle.shutdown();
2962 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2964 }
2965}
2966
2967impl fidl::endpoints::Responder for PhyResetTxPowerScenarioResponder {
2968 type ControlHandle = PhyControlHandle;
2969
2970 fn control_handle(&self) -> &PhyControlHandle {
2971 &self.control_handle
2972 }
2973
2974 fn drop_without_shutdown(mut self) {
2975 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2977 std::mem::forget(self);
2979 }
2980}
2981
2982impl PhyResetTxPowerScenarioResponder {
2983 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2987 let _result = self.send_raw(result);
2988 if _result.is_err() {
2989 self.control_handle.shutdown();
2990 }
2991 self.drop_without_shutdown();
2992 _result
2993 }
2994
2995 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2997 let _result = self.send_raw(result);
2998 self.drop_without_shutdown();
2999 _result
3000 }
3001
3002 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3003 self.control_handle
3004 .inner
3005 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3006 result,
3007 self.tx_id,
3008 0x4f9b16347768b8dd,
3009 fidl::encoding::DynamicFlags::empty(),
3010 )
3011 }
3012}
3013
3014#[must_use = "FIDL methods require a response to be sent"]
3015#[derive(Debug)]
3016pub struct PhyGetTxPowerScenarioResponder {
3017 control_handle: std::mem::ManuallyDrop<PhyControlHandle>,
3018 tx_id: u32,
3019}
3020
3021impl std::ops::Drop for PhyGetTxPowerScenarioResponder {
3025 fn drop(&mut self) {
3026 self.control_handle.shutdown();
3027 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3029 }
3030}
3031
3032impl fidl::endpoints::Responder for PhyGetTxPowerScenarioResponder {
3033 type ControlHandle = PhyControlHandle;
3034
3035 fn control_handle(&self) -> &PhyControlHandle {
3036 &self.control_handle
3037 }
3038
3039 fn drop_without_shutdown(mut self) {
3040 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3042 std::mem::forget(self);
3044 }
3045}
3046
3047impl PhyGetTxPowerScenarioResponder {
3048 pub fn send(
3052 self,
3053 mut result: Result<fidl_fuchsia_wlan_internal::TxPowerScenario, i32>,
3054 ) -> Result<(), fidl::Error> {
3055 let _result = self.send_raw(result);
3056 if _result.is_err() {
3057 self.control_handle.shutdown();
3058 }
3059 self.drop_without_shutdown();
3060 _result
3061 }
3062
3063 pub fn send_no_shutdown_on_err(
3065 self,
3066 mut result: Result<fidl_fuchsia_wlan_internal::TxPowerScenario, i32>,
3067 ) -> Result<(), fidl::Error> {
3068 let _result = self.send_raw(result);
3069 self.drop_without_shutdown();
3070 _result
3071 }
3072
3073 fn send_raw(
3074 &self,
3075 mut result: Result<fidl_fuchsia_wlan_internal::TxPowerScenario, i32>,
3076 ) -> Result<(), fidl::Error> {
3077 self.control_handle
3078 .inner
3079 .send::<fidl::encoding::ResultType<PhyGetTxPowerScenarioResponse, i32>>(
3080 result.map(|scenario| (scenario,)),
3081 self.tx_id,
3082 0x3f6681e6458c14c2,
3083 fidl::encoding::DynamicFlags::empty(),
3084 )
3085 }
3086}
3087
3088#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3089pub struct ServiceMarker;
3090
3091#[cfg(target_os = "fuchsia")]
3092impl fidl::endpoints::ServiceMarker for ServiceMarker {
3093 type Proxy = ServiceProxy;
3094 type Request = ServiceRequest;
3095 const SERVICE_NAME: &'static str = "fuchsia.wlan.device.Service";
3096}
3097
3098#[cfg(target_os = "fuchsia")]
3101pub enum ServiceRequest {
3102 Device(ConnectorRequestStream),
3103}
3104
3105#[cfg(target_os = "fuchsia")]
3106impl fidl::endpoints::ServiceRequest for ServiceRequest {
3107 type Service = ServiceMarker;
3108
3109 fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
3110 match name {
3111 "device" => Self::Device(
3112 <ConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
3113 ),
3114 _ => panic!("no such member protocol name for service Service"),
3115 }
3116 }
3117
3118 fn member_names() -> &'static [&'static str] {
3119 &["device"]
3120 }
3121}
3122#[cfg(target_os = "fuchsia")]
3123pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
3124
3125#[cfg(target_os = "fuchsia")]
3126impl fidl::endpoints::ServiceProxy for ServiceProxy {
3127 type Service = ServiceMarker;
3128
3129 fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
3130 Self(opener)
3131 }
3132}
3133
3134#[cfg(target_os = "fuchsia")]
3135impl ServiceProxy {
3136 pub fn connect_to_device(&self) -> Result<ConnectorProxy, fidl::Error> {
3137 let (proxy, server_end) = fidl::endpoints::create_proxy::<ConnectorMarker>();
3138 self.connect_channel_to_device(server_end)?;
3139 Ok(proxy)
3140 }
3141
3142 pub fn connect_to_device_sync(&self) -> Result<ConnectorSynchronousProxy, fidl::Error> {
3145 let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<ConnectorMarker>();
3146 self.connect_channel_to_device(server_end)?;
3147 Ok(proxy)
3148 }
3149
3150 pub fn connect_channel_to_device(
3153 &self,
3154 server_end: fidl::endpoints::ServerEnd<ConnectorMarker>,
3155 ) -> Result<(), fidl::Error> {
3156 self.0.open_member("device", server_end.into_channel())
3157 }
3158
3159 pub fn instance_name(&self) -> &str {
3160 self.0.instance_name()
3161 }
3162}
3163
3164mod internal {
3165 use super::*;
3166
3167 impl fidl::encoding::ResourceTypeMarker for ConnectorConnectRequest {
3168 type Borrowed<'a> = &'a mut Self;
3169 fn take_or_borrow<'a>(
3170 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3171 ) -> Self::Borrowed<'a> {
3172 value
3173 }
3174 }
3175
3176 unsafe impl fidl::encoding::TypeMarker for ConnectorConnectRequest {
3177 type Owned = Self;
3178
3179 #[inline(always)]
3180 fn inline_align(_context: fidl::encoding::Context) -> usize {
3181 4
3182 }
3183
3184 #[inline(always)]
3185 fn inline_size(_context: fidl::encoding::Context) -> usize {
3186 4
3187 }
3188 }
3189
3190 unsafe impl
3191 fidl::encoding::Encode<
3192 ConnectorConnectRequest,
3193 fidl::encoding::DefaultFuchsiaResourceDialect,
3194 > for &mut ConnectorConnectRequest
3195 {
3196 #[inline]
3197 unsafe fn encode(
3198 self,
3199 encoder: &mut fidl::encoding::Encoder<
3200 '_,
3201 fidl::encoding::DefaultFuchsiaResourceDialect,
3202 >,
3203 offset: usize,
3204 _depth: fidl::encoding::Depth,
3205 ) -> fidl::Result<()> {
3206 encoder.debug_check_bounds::<ConnectorConnectRequest>(offset);
3207 fidl::encoding::Encode::<ConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3209 (
3210 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
3211 ),
3212 encoder, offset, _depth
3213 )
3214 }
3215 }
3216 unsafe impl<
3217 T0: fidl::encoding::Encode<
3218 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyMarker>>,
3219 fidl::encoding::DefaultFuchsiaResourceDialect,
3220 >,
3221 >
3222 fidl::encoding::Encode<
3223 ConnectorConnectRequest,
3224 fidl::encoding::DefaultFuchsiaResourceDialect,
3225 > for (T0,)
3226 {
3227 #[inline]
3228 unsafe fn encode(
3229 self,
3230 encoder: &mut fidl::encoding::Encoder<
3231 '_,
3232 fidl::encoding::DefaultFuchsiaResourceDialect,
3233 >,
3234 offset: usize,
3235 depth: fidl::encoding::Depth,
3236 ) -> fidl::Result<()> {
3237 encoder.debug_check_bounds::<ConnectorConnectRequest>(offset);
3238 self.0.encode(encoder, offset + 0, depth)?;
3242 Ok(())
3243 }
3244 }
3245
3246 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3247 for ConnectorConnectRequest
3248 {
3249 #[inline(always)]
3250 fn new_empty() -> Self {
3251 Self {
3252 request: fidl::new_empty!(
3253 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyMarker>>,
3254 fidl::encoding::DefaultFuchsiaResourceDialect
3255 ),
3256 }
3257 }
3258
3259 #[inline]
3260 unsafe fn decode(
3261 &mut self,
3262 decoder: &mut fidl::encoding::Decoder<
3263 '_,
3264 fidl::encoding::DefaultFuchsiaResourceDialect,
3265 >,
3266 offset: usize,
3267 _depth: fidl::encoding::Depth,
3268 ) -> fidl::Result<()> {
3269 decoder.debug_check_bounds::<Self>(offset);
3270 fidl::decode!(
3272 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyMarker>>,
3273 fidl::encoding::DefaultFuchsiaResourceDialect,
3274 &mut self.request,
3275 decoder,
3276 offset + 0,
3277 _depth
3278 )?;
3279 Ok(())
3280 }
3281 }
3282
3283 impl fidl::encoding::ResourceTypeMarker for CreateIfaceRequest {
3284 type Borrowed<'a> = &'a mut Self;
3285 fn take_or_borrow<'a>(
3286 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3287 ) -> Self::Borrowed<'a> {
3288 value
3289 }
3290 }
3291
3292 unsafe impl fidl::encoding::TypeMarker for CreateIfaceRequest {
3293 type Owned = Self;
3294
3295 #[inline(always)]
3296 fn inline_align(_context: fidl::encoding::Context) -> usize {
3297 4
3298 }
3299
3300 #[inline(always)]
3301 fn inline_size(_context: fidl::encoding::Context) -> usize {
3302 16
3303 }
3304 }
3305
3306 unsafe impl
3307 fidl::encoding::Encode<CreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3308 for &mut CreateIfaceRequest
3309 {
3310 #[inline]
3311 unsafe fn encode(
3312 self,
3313 encoder: &mut fidl::encoding::Encoder<
3314 '_,
3315 fidl::encoding::DefaultFuchsiaResourceDialect,
3316 >,
3317 offset: usize,
3318 _depth: fidl::encoding::Depth,
3319 ) -> fidl::Result<()> {
3320 encoder.debug_check_bounds::<CreateIfaceRequest>(offset);
3321 fidl::encoding::Encode::<CreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3323 (
3324 <fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow(&self.role),
3325 <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.mlme_channel),
3326 <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.init_sta_addr),
3327 ),
3328 encoder, offset, _depth
3329 )
3330 }
3331 }
3332 unsafe impl<
3333 T0: fidl::encoding::Encode<
3334 fidl_fuchsia_wlan_common::WlanMacRole,
3335 fidl::encoding::DefaultFuchsiaResourceDialect,
3336 >,
3337 T1: fidl::encoding::Encode<
3338 fidl::encoding::Optional<
3339 fidl::encoding::HandleType<
3340 fidl::Channel,
3341 { fidl::ObjectType::CHANNEL.into_raw() },
3342 2147483648,
3343 >,
3344 >,
3345 fidl::encoding::DefaultFuchsiaResourceDialect,
3346 >,
3347 T2: fidl::encoding::Encode<
3348 fidl::encoding::Array<u8, 6>,
3349 fidl::encoding::DefaultFuchsiaResourceDialect,
3350 >,
3351 > fidl::encoding::Encode<CreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3352 for (T0, T1, T2)
3353 {
3354 #[inline]
3355 unsafe fn encode(
3356 self,
3357 encoder: &mut fidl::encoding::Encoder<
3358 '_,
3359 fidl::encoding::DefaultFuchsiaResourceDialect,
3360 >,
3361 offset: usize,
3362 depth: fidl::encoding::Depth,
3363 ) -> fidl::Result<()> {
3364 encoder.debug_check_bounds::<CreateIfaceRequest>(offset);
3365 unsafe {
3368 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(12);
3369 (ptr as *mut u32).write_unaligned(0);
3370 }
3371 self.0.encode(encoder, offset + 0, depth)?;
3373 self.1.encode(encoder, offset + 4, depth)?;
3374 self.2.encode(encoder, offset + 8, depth)?;
3375 Ok(())
3376 }
3377 }
3378
3379 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3380 for CreateIfaceRequest
3381 {
3382 #[inline(always)]
3383 fn new_empty() -> Self {
3384 Self {
3385 role: fidl::new_empty!(
3386 fidl_fuchsia_wlan_common::WlanMacRole,
3387 fidl::encoding::DefaultFuchsiaResourceDialect
3388 ),
3389 mlme_channel: fidl::new_empty!(
3390 fidl::encoding::Optional<
3391 fidl::encoding::HandleType<
3392 fidl::Channel,
3393 { fidl::ObjectType::CHANNEL.into_raw() },
3394 2147483648,
3395 >,
3396 >,
3397 fidl::encoding::DefaultFuchsiaResourceDialect
3398 ),
3399 init_sta_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect),
3400 }
3401 }
3402
3403 #[inline]
3404 unsafe fn decode(
3405 &mut self,
3406 decoder: &mut fidl::encoding::Decoder<
3407 '_,
3408 fidl::encoding::DefaultFuchsiaResourceDialect,
3409 >,
3410 offset: usize,
3411 _depth: fidl::encoding::Depth,
3412 ) -> fidl::Result<()> {
3413 decoder.debug_check_bounds::<Self>(offset);
3414 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(12) };
3416 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3417 let mask = 0xffff0000u32;
3418 let maskedval = padval & mask;
3419 if maskedval != 0 {
3420 return Err(fidl::Error::NonZeroPadding {
3421 padding_start: offset + 12 + ((mask as u64).trailing_zeros() / 8) as usize,
3422 });
3423 }
3424 fidl::decode!(
3425 fidl_fuchsia_wlan_common::WlanMacRole,
3426 fidl::encoding::DefaultFuchsiaResourceDialect,
3427 &mut self.role,
3428 decoder,
3429 offset + 0,
3430 _depth
3431 )?;
3432 fidl::decode!(
3433 fidl::encoding::Optional<
3434 fidl::encoding::HandleType<
3435 fidl::Channel,
3436 { fidl::ObjectType::CHANNEL.into_raw() },
3437 2147483648,
3438 >,
3439 >,
3440 fidl::encoding::DefaultFuchsiaResourceDialect,
3441 &mut self.mlme_channel,
3442 decoder,
3443 offset + 4,
3444 _depth
3445 )?;
3446 fidl::decode!(fidl::encoding::Array<u8, 6>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.init_sta_addr, decoder, offset + 8, _depth)?;
3447 Ok(())
3448 }
3449 }
3450
3451 impl fidl::encoding::ResourceTypeMarker for PhyCreateIfaceRequest {
3452 type Borrowed<'a> = &'a mut Self;
3453 fn take_or_borrow<'a>(
3454 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3455 ) -> Self::Borrowed<'a> {
3456 value
3457 }
3458 }
3459
3460 unsafe impl fidl::encoding::TypeMarker for PhyCreateIfaceRequest {
3461 type Owned = Self;
3462
3463 #[inline(always)]
3464 fn inline_align(_context: fidl::encoding::Context) -> usize {
3465 4
3466 }
3467
3468 #[inline(always)]
3469 fn inline_size(_context: fidl::encoding::Context) -> usize {
3470 16
3471 }
3472 }
3473
3474 unsafe impl
3475 fidl::encoding::Encode<PhyCreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3476 for &mut PhyCreateIfaceRequest
3477 {
3478 #[inline]
3479 unsafe fn encode(
3480 self,
3481 encoder: &mut fidl::encoding::Encoder<
3482 '_,
3483 fidl::encoding::DefaultFuchsiaResourceDialect,
3484 >,
3485 offset: usize,
3486 _depth: fidl::encoding::Depth,
3487 ) -> fidl::Result<()> {
3488 encoder.debug_check_bounds::<PhyCreateIfaceRequest>(offset);
3489 fidl::encoding::Encode::<
3491 PhyCreateIfaceRequest,
3492 fidl::encoding::DefaultFuchsiaResourceDialect,
3493 >::encode(
3494 (<CreateIfaceRequest as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3495 &mut self.req,
3496 ),),
3497 encoder,
3498 offset,
3499 _depth,
3500 )
3501 }
3502 }
3503 unsafe impl<
3504 T0: fidl::encoding::Encode<CreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
3505 >
3506 fidl::encoding::Encode<PhyCreateIfaceRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3507 for (T0,)
3508 {
3509 #[inline]
3510 unsafe fn encode(
3511 self,
3512 encoder: &mut fidl::encoding::Encoder<
3513 '_,
3514 fidl::encoding::DefaultFuchsiaResourceDialect,
3515 >,
3516 offset: usize,
3517 depth: fidl::encoding::Depth,
3518 ) -> fidl::Result<()> {
3519 encoder.debug_check_bounds::<PhyCreateIfaceRequest>(offset);
3520 self.0.encode(encoder, offset + 0, depth)?;
3524 Ok(())
3525 }
3526 }
3527
3528 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3529 for PhyCreateIfaceRequest
3530 {
3531 #[inline(always)]
3532 fn new_empty() -> Self {
3533 Self {
3534 req: fidl::new_empty!(
3535 CreateIfaceRequest,
3536 fidl::encoding::DefaultFuchsiaResourceDialect
3537 ),
3538 }
3539 }
3540
3541 #[inline]
3542 unsafe fn decode(
3543 &mut self,
3544 decoder: &mut fidl::encoding::Decoder<
3545 '_,
3546 fidl::encoding::DefaultFuchsiaResourceDialect,
3547 >,
3548 offset: usize,
3549 _depth: fidl::encoding::Depth,
3550 ) -> fidl::Result<()> {
3551 decoder.debug_check_bounds::<Self>(offset);
3552 fidl::decode!(
3554 CreateIfaceRequest,
3555 fidl::encoding::DefaultFuchsiaResourceDialect,
3556 &mut self.req,
3557 decoder,
3558 offset + 0,
3559 _depth
3560 )?;
3561 Ok(())
3562 }
3563 }
3564}