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