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