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_service_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct DeviceMonitorGetApSmeRequest {
16 pub iface_id: u16,
17 pub sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for DeviceMonitorGetApSmeRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct DeviceMonitorGetClientSmeRequest {
27 pub iface_id: u16,
28 pub sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
32 for DeviceMonitorGetClientSmeRequest
33{
34}
35
36#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
37pub struct DeviceMonitorGetSmeTelemetryRequest {
38 pub iface_id: u16,
39 pub telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43 for DeviceMonitorGetSmeTelemetryRequest
44{
45}
46
47#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
48pub struct DeviceMonitorWatchDevicesRequest {
49 pub watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
50}
51
52impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
53 for DeviceMonitorWatchDevicesRequest
54{
55}
56
57#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
58pub struct DeviceMonitorMarker;
59
60impl fidl::endpoints::ProtocolMarker for DeviceMonitorMarker {
61 type Proxy = DeviceMonitorProxy;
62 type RequestStream = DeviceMonitorRequestStream;
63 #[cfg(target_os = "fuchsia")]
64 type SynchronousProxy = DeviceMonitorSynchronousProxy;
65
66 const DEBUG_NAME: &'static str = "fuchsia.wlan.device.service.DeviceMonitor";
67}
68impl fidl::endpoints::DiscoverableProtocolMarker for DeviceMonitorMarker {}
69pub type DeviceMonitorGetSupportedMacRolesResult =
70 Result<Vec<fidl_fuchsia_wlan_common::WlanMacRole>, i32>;
71pub type DeviceMonitorGetCountryResult = Result<GetCountryResponse, i32>;
72pub type DeviceMonitorGetPowerSaveModeResult = Result<GetPowerSaveModeResponse, i32>;
73pub type DeviceMonitorCreateIfaceResult =
74 Result<DeviceMonitorCreateIfaceResponse, DeviceMonitorError>;
75pub type DeviceMonitorQueryIfaceResult = Result<QueryIfaceResponse, i32>;
76pub type DeviceMonitorGetClientSmeResult = Result<(), i32>;
77pub type DeviceMonitorGetApSmeResult = Result<(), i32>;
78pub type DeviceMonitorGetSmeTelemetryResult = Result<(), i32>;
79
80pub trait DeviceMonitorProxyInterface: Send + Sync {
81 type ListPhysResponseFut: std::future::Future<Output = Result<Vec<u16>, fidl::Error>> + Send;
82 fn r#list_phys(&self) -> Self::ListPhysResponseFut;
83 type ListIfacesResponseFut: std::future::Future<Output = Result<Vec<u16>, fidl::Error>> + Send;
84 fn r#list_ifaces(&self) -> Self::ListIfacesResponseFut;
85 type GetDevPathResponseFut: std::future::Future<Output = Result<Option<String>, fidl::Error>>
86 + Send;
87 fn r#get_dev_path(&self, phy_id: u16) -> Self::GetDevPathResponseFut;
88 type GetSupportedMacRolesResponseFut: std::future::Future<Output = Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error>>
89 + Send;
90 fn r#get_supported_mac_roles(&self, phy_id: u16) -> Self::GetSupportedMacRolesResponseFut;
91 fn r#watch_devices(
92 &self,
93 watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
94 ) -> Result<(), fidl::Error>;
95 type GetCountryResponseFut: std::future::Future<Output = Result<DeviceMonitorGetCountryResult, fidl::Error>>
96 + Send;
97 fn r#get_country(&self, phy_id: u16) -> Self::GetCountryResponseFut;
98 type SetCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
99 fn r#set_country(&self, req: &SetCountryRequest) -> Self::SetCountryResponseFut;
100 type ClearCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
101 fn r#clear_country(&self, req: &ClearCountryRequest) -> Self::ClearCountryResponseFut;
102 type SetPowerSaveModeResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
103 fn r#set_power_save_mode(
104 &self,
105 req: &SetPowerSaveModeRequest,
106 ) -> Self::SetPowerSaveModeResponseFut;
107 type GetPowerSaveModeResponseFut: std::future::Future<Output = Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error>>
108 + Send;
109 fn r#get_power_save_mode(&self, phy_id: u16) -> Self::GetPowerSaveModeResponseFut;
110 type CreateIfaceResponseFut: std::future::Future<Output = Result<DeviceMonitorCreateIfaceResult, fidl::Error>>
111 + Send;
112 fn r#create_iface(
113 &self,
114 payload: &DeviceMonitorCreateIfaceRequest,
115 ) -> Self::CreateIfaceResponseFut;
116 type QueryIfaceResponseFut: std::future::Future<Output = Result<DeviceMonitorQueryIfaceResult, fidl::Error>>
117 + Send;
118 fn r#query_iface(&self, iface_id: u16) -> Self::QueryIfaceResponseFut;
119 type DestroyIfaceResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
120 fn r#destroy_iface(&self, req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut;
121 type GetClientSmeResponseFut: std::future::Future<Output = Result<DeviceMonitorGetClientSmeResult, fidl::Error>>
122 + Send;
123 fn r#get_client_sme(
124 &self,
125 iface_id: u16,
126 sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
127 ) -> Self::GetClientSmeResponseFut;
128 type GetApSmeResponseFut: std::future::Future<Output = Result<DeviceMonitorGetApSmeResult, fidl::Error>>
129 + Send;
130 fn r#get_ap_sme(
131 &self,
132 iface_id: u16,
133 sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
134 ) -> Self::GetApSmeResponseFut;
135 type GetSmeTelemetryResponseFut: std::future::Future<Output = Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error>>
136 + Send;
137 fn r#get_sme_telemetry(
138 &self,
139 iface_id: u16,
140 telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
141 ) -> Self::GetSmeTelemetryResponseFut;
142}
143#[derive(Debug)]
144#[cfg(target_os = "fuchsia")]
145pub struct DeviceMonitorSynchronousProxy {
146 client: fidl::client::sync::Client,
147}
148
149#[cfg(target_os = "fuchsia")]
150impl fidl::endpoints::SynchronousProxy for DeviceMonitorSynchronousProxy {
151 type Proxy = DeviceMonitorProxy;
152 type Protocol = DeviceMonitorMarker;
153
154 fn from_channel(inner: fidl::Channel) -> Self {
155 Self::new(inner)
156 }
157
158 fn into_channel(self) -> fidl::Channel {
159 self.client.into_channel()
160 }
161
162 fn as_channel(&self) -> &fidl::Channel {
163 self.client.as_channel()
164 }
165}
166
167#[cfg(target_os = "fuchsia")]
168impl DeviceMonitorSynchronousProxy {
169 pub fn new(channel: fidl::Channel) -> Self {
170 let protocol_name = <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
171 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
172 }
173
174 pub fn into_channel(self) -> fidl::Channel {
175 self.client.into_channel()
176 }
177
178 pub fn wait_for_event(
181 &self,
182 deadline: zx::MonotonicInstant,
183 ) -> Result<DeviceMonitorEvent, fidl::Error> {
184 DeviceMonitorEvent::decode(self.client.wait_for_event(deadline)?)
185 }
186
187 pub fn r#list_phys(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u16>, fidl::Error> {
188 let _response =
189 self.client.send_query::<fidl::encoding::EmptyPayload, DeviceMonitorListPhysResponse>(
190 (),
191 0x3a08518874196aab,
192 fidl::encoding::DynamicFlags::empty(),
193 ___deadline,
194 )?;
195 Ok(_response.phy_list)
196 }
197
198 pub fn r#list_ifaces(
199 &self,
200 ___deadline: zx::MonotonicInstant,
201 ) -> Result<Vec<u16>, fidl::Error> {
202 let _response = self
203 .client
204 .send_query::<fidl::encoding::EmptyPayload, DeviceMonitorListIfacesResponse>(
205 (),
206 0x129e758fb8e0b113,
207 fidl::encoding::DynamicFlags::empty(),
208 ___deadline,
209 )?;
210 Ok(_response.iface_list)
211 }
212
213 pub fn r#get_dev_path(
214 &self,
215 mut phy_id: u16,
216 ___deadline: zx::MonotonicInstant,
217 ) -> Result<Option<String>, fidl::Error> {
218 let _response = self
219 .client
220 .send_query::<DeviceMonitorGetDevPathRequest, DeviceMonitorGetDevPathResponse>(
221 (phy_id,),
222 0x4aa489b57113bccf,
223 fidl::encoding::DynamicFlags::empty(),
224 ___deadline,
225 )?;
226 Ok(_response.dev_path)
227 }
228
229 pub fn r#get_supported_mac_roles(
230 &self,
231 mut phy_id: u16,
232 ___deadline: zx::MonotonicInstant,
233 ) -> Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error> {
234 let _response = self.client.send_query::<
235 DeviceMonitorGetSupportedMacRolesRequest,
236 fidl::encoding::ResultType<DeviceMonitorGetSupportedMacRolesResponse, i32>,
237 >(
238 (phy_id,),
239 0x172b3d2eabd5a14e,
240 fidl::encoding::DynamicFlags::empty(),
241 ___deadline,
242 )?;
243 Ok(_response.map(|x| x.supported_mac_roles))
244 }
245
246 pub fn r#watch_devices(
247 &self,
248 mut watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
249 ) -> Result<(), fidl::Error> {
250 self.client.send::<DeviceMonitorWatchDevicesRequest>(
251 (watcher,),
252 0x4615941e67e31b8e,
253 fidl::encoding::DynamicFlags::empty(),
254 )
255 }
256
257 pub fn r#get_country(
258 &self,
259 mut phy_id: u16,
260 ___deadline: zx::MonotonicInstant,
261 ) -> Result<DeviceMonitorGetCountryResult, fidl::Error> {
262 let _response = self.client.send_query::<
263 DeviceMonitorGetCountryRequest,
264 fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>,
265 >(
266 (phy_id,),
267 0x6f1040bd81bde90e,
268 fidl::encoding::DynamicFlags::empty(),
269 ___deadline,
270 )?;
271 Ok(_response.map(|x| x.resp))
272 }
273
274 pub fn r#set_country(
275 &self,
276 mut req: &SetCountryRequest,
277 ___deadline: zx::MonotonicInstant,
278 ) -> Result<i32, fidl::Error> {
279 let _response = self
280 .client
281 .send_query::<DeviceMonitorSetCountryRequest, DeviceMonitorSetCountryResponse>(
282 (req,),
283 0xdaa7b77a5a6e71b,
284 fidl::encoding::DynamicFlags::empty(),
285 ___deadline,
286 )?;
287 Ok(_response.status)
288 }
289
290 pub fn r#clear_country(
291 &self,
292 mut req: &ClearCountryRequest,
293 ___deadline: zx::MonotonicInstant,
294 ) -> Result<i32, fidl::Error> {
295 let _response = self
296 .client
297 .send_query::<DeviceMonitorClearCountryRequest, DeviceMonitorClearCountryResponse>(
298 (req,),
299 0x66714d61103120e9,
300 fidl::encoding::DynamicFlags::empty(),
301 ___deadline,
302 )?;
303 Ok(_response.status)
304 }
305
306 pub fn r#set_power_save_mode(
307 &self,
308 mut req: &SetPowerSaveModeRequest,
309 ___deadline: zx::MonotonicInstant,
310 ) -> Result<i32, fidl::Error> {
311 let _response = self.client.send_query::<
312 DeviceMonitorSetPowerSaveModeRequest,
313 DeviceMonitorSetPowerSaveModeResponse,
314 >(
315 (req,),
316 0x62202b4d360533bc,
317 fidl::encoding::DynamicFlags::empty(),
318 ___deadline,
319 )?;
320 Ok(_response.status)
321 }
322
323 pub fn r#get_power_save_mode(
324 &self,
325 mut phy_id: u16,
326 ___deadline: zx::MonotonicInstant,
327 ) -> Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error> {
328 let _response = self.client.send_query::<
329 DeviceMonitorGetPowerSaveModeRequest,
330 fidl::encoding::ResultType<DeviceMonitorGetPowerSaveModeResponse, i32>,
331 >(
332 (phy_id,),
333 0x14304d406ada8693,
334 fidl::encoding::DynamicFlags::empty(),
335 ___deadline,
336 )?;
337 Ok(_response.map(|x| x.resp))
338 }
339
340 pub fn r#create_iface(
341 &self,
342 mut payload: &DeviceMonitorCreateIfaceRequest,
343 ___deadline: zx::MonotonicInstant,
344 ) -> Result<DeviceMonitorCreateIfaceResult, fidl::Error> {
345 let _response =
346 self.client.send_query::<DeviceMonitorCreateIfaceRequest, fidl::encoding::ResultType<
347 DeviceMonitorCreateIfaceResponse,
348 DeviceMonitorError,
349 >>(
350 payload,
351 0x1e1d30c24c0ec144,
352 fidl::encoding::DynamicFlags::empty(),
353 ___deadline,
354 )?;
355 Ok(_response.map(|x| x))
356 }
357
358 pub fn r#query_iface(
359 &self,
360 mut iface_id: u16,
361 ___deadline: zx::MonotonicInstant,
362 ) -> Result<DeviceMonitorQueryIfaceResult, fidl::Error> {
363 let _response = self.client.send_query::<
364 DeviceMonitorQueryIfaceRequest,
365 fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>,
366 >(
367 (iface_id,),
368 0x1a48c4a2b86259ef,
369 fidl::encoding::DynamicFlags::empty(),
370 ___deadline,
371 )?;
372 Ok(_response.map(|x| x.resp))
373 }
374
375 pub fn r#destroy_iface(
376 &self,
377 mut req: &DestroyIfaceRequest,
378 ___deadline: zx::MonotonicInstant,
379 ) -> Result<i32, fidl::Error> {
380 let _response = self
381 .client
382 .send_query::<DeviceMonitorDestroyIfaceRequest, DeviceMonitorDestroyIfaceResponse>(
383 (req,),
384 0x4c77982c1616a3b0,
385 fidl::encoding::DynamicFlags::empty(),
386 ___deadline,
387 )?;
388 Ok(_response.status)
389 }
390
391 pub fn r#get_client_sme(
399 &self,
400 mut iface_id: u16,
401 mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
402 ___deadline: zx::MonotonicInstant,
403 ) -> Result<DeviceMonitorGetClientSmeResult, fidl::Error> {
404 let _response = self.client.send_query::<
405 DeviceMonitorGetClientSmeRequest,
406 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
407 >(
408 (iface_id, sme_server,),
409 0x1b056c379ca98273,
410 fidl::encoding::DynamicFlags::empty(),
411 ___deadline,
412 )?;
413 Ok(_response.map(|x| x))
414 }
415
416 pub fn r#get_ap_sme(
424 &self,
425 mut iface_id: u16,
426 mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
427 ___deadline: zx::MonotonicInstant,
428 ) -> Result<DeviceMonitorGetApSmeResult, fidl::Error> {
429 let _response = self.client.send_query::<
430 DeviceMonitorGetApSmeRequest,
431 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
432 >(
433 (iface_id, sme_server,),
434 0x754de680c4318c52,
435 fidl::encoding::DynamicFlags::empty(),
436 ___deadline,
437 )?;
438 Ok(_response.map(|x| x))
439 }
440
441 pub fn r#get_sme_telemetry(
449 &self,
450 mut iface_id: u16,
451 mut telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
452 ___deadline: zx::MonotonicInstant,
453 ) -> Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error> {
454 let _response = self.client.send_query::<
455 DeviceMonitorGetSmeTelemetryRequest,
456 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
457 >(
458 (iface_id, telemetry_server,),
459 0x1baf42b003f7452a,
460 fidl::encoding::DynamicFlags::empty(),
461 ___deadline,
462 )?;
463 Ok(_response.map(|x| x))
464 }
465}
466
467#[cfg(target_os = "fuchsia")]
468impl From<DeviceMonitorSynchronousProxy> for zx::Handle {
469 fn from(value: DeviceMonitorSynchronousProxy) -> Self {
470 value.into_channel().into()
471 }
472}
473
474#[cfg(target_os = "fuchsia")]
475impl From<fidl::Channel> for DeviceMonitorSynchronousProxy {
476 fn from(value: fidl::Channel) -> Self {
477 Self::new(value)
478 }
479}
480
481#[derive(Debug, Clone)]
482pub struct DeviceMonitorProxy {
483 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
484}
485
486impl fidl::endpoints::Proxy for DeviceMonitorProxy {
487 type Protocol = DeviceMonitorMarker;
488
489 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
490 Self::new(inner)
491 }
492
493 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
494 self.client.into_channel().map_err(|client| Self { client })
495 }
496
497 fn as_channel(&self) -> &::fidl::AsyncChannel {
498 self.client.as_channel()
499 }
500}
501
502impl DeviceMonitorProxy {
503 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
505 let protocol_name = <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
506 Self { client: fidl::client::Client::new(channel, protocol_name) }
507 }
508
509 pub fn take_event_stream(&self) -> DeviceMonitorEventStream {
515 DeviceMonitorEventStream { event_receiver: self.client.take_event_receiver() }
516 }
517
518 pub fn r#list_phys(
519 &self,
520 ) -> fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>
521 {
522 DeviceMonitorProxyInterface::r#list_phys(self)
523 }
524
525 pub fn r#list_ifaces(
526 &self,
527 ) -> fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>
528 {
529 DeviceMonitorProxyInterface::r#list_ifaces(self)
530 }
531
532 pub fn r#get_dev_path(
533 &self,
534 mut phy_id: u16,
535 ) -> fidl::client::QueryResponseFut<Option<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
536 {
537 DeviceMonitorProxyInterface::r#get_dev_path(self, phy_id)
538 }
539
540 pub fn r#get_supported_mac_roles(
541 &self,
542 mut phy_id: u16,
543 ) -> fidl::client::QueryResponseFut<
544 DeviceMonitorGetSupportedMacRolesResult,
545 fidl::encoding::DefaultFuchsiaResourceDialect,
546 > {
547 DeviceMonitorProxyInterface::r#get_supported_mac_roles(self, phy_id)
548 }
549
550 pub fn r#watch_devices(
551 &self,
552 mut watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
553 ) -> Result<(), fidl::Error> {
554 DeviceMonitorProxyInterface::r#watch_devices(self, watcher)
555 }
556
557 pub fn r#get_country(
558 &self,
559 mut phy_id: u16,
560 ) -> fidl::client::QueryResponseFut<
561 DeviceMonitorGetCountryResult,
562 fidl::encoding::DefaultFuchsiaResourceDialect,
563 > {
564 DeviceMonitorProxyInterface::r#get_country(self, phy_id)
565 }
566
567 pub fn r#set_country(
568 &self,
569 mut req: &SetCountryRequest,
570 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
571 DeviceMonitorProxyInterface::r#set_country(self, req)
572 }
573
574 pub fn r#clear_country(
575 &self,
576 mut req: &ClearCountryRequest,
577 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
578 DeviceMonitorProxyInterface::r#clear_country(self, req)
579 }
580
581 pub fn r#set_power_save_mode(
582 &self,
583 mut req: &SetPowerSaveModeRequest,
584 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
585 DeviceMonitorProxyInterface::r#set_power_save_mode(self, req)
586 }
587
588 pub fn r#get_power_save_mode(
589 &self,
590 mut phy_id: u16,
591 ) -> fidl::client::QueryResponseFut<
592 DeviceMonitorGetPowerSaveModeResult,
593 fidl::encoding::DefaultFuchsiaResourceDialect,
594 > {
595 DeviceMonitorProxyInterface::r#get_power_save_mode(self, phy_id)
596 }
597
598 pub fn r#create_iface(
599 &self,
600 mut payload: &DeviceMonitorCreateIfaceRequest,
601 ) -> fidl::client::QueryResponseFut<
602 DeviceMonitorCreateIfaceResult,
603 fidl::encoding::DefaultFuchsiaResourceDialect,
604 > {
605 DeviceMonitorProxyInterface::r#create_iface(self, payload)
606 }
607
608 pub fn r#query_iface(
609 &self,
610 mut iface_id: u16,
611 ) -> fidl::client::QueryResponseFut<
612 DeviceMonitorQueryIfaceResult,
613 fidl::encoding::DefaultFuchsiaResourceDialect,
614 > {
615 DeviceMonitorProxyInterface::r#query_iface(self, iface_id)
616 }
617
618 pub fn r#destroy_iface(
619 &self,
620 mut req: &DestroyIfaceRequest,
621 ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
622 DeviceMonitorProxyInterface::r#destroy_iface(self, req)
623 }
624
625 pub fn r#get_client_sme(
633 &self,
634 mut iface_id: u16,
635 mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
636 ) -> fidl::client::QueryResponseFut<
637 DeviceMonitorGetClientSmeResult,
638 fidl::encoding::DefaultFuchsiaResourceDialect,
639 > {
640 DeviceMonitorProxyInterface::r#get_client_sme(self, iface_id, sme_server)
641 }
642
643 pub fn r#get_ap_sme(
651 &self,
652 mut iface_id: u16,
653 mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
654 ) -> fidl::client::QueryResponseFut<
655 DeviceMonitorGetApSmeResult,
656 fidl::encoding::DefaultFuchsiaResourceDialect,
657 > {
658 DeviceMonitorProxyInterface::r#get_ap_sme(self, iface_id, sme_server)
659 }
660
661 pub fn r#get_sme_telemetry(
669 &self,
670 mut iface_id: u16,
671 mut telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
672 ) -> fidl::client::QueryResponseFut<
673 DeviceMonitorGetSmeTelemetryResult,
674 fidl::encoding::DefaultFuchsiaResourceDialect,
675 > {
676 DeviceMonitorProxyInterface::r#get_sme_telemetry(self, iface_id, telemetry_server)
677 }
678}
679
680impl DeviceMonitorProxyInterface for DeviceMonitorProxy {
681 type ListPhysResponseFut =
682 fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>;
683 fn r#list_phys(&self) -> Self::ListPhysResponseFut {
684 fn _decode(
685 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
686 ) -> Result<Vec<u16>, fidl::Error> {
687 let _response = fidl::client::decode_transaction_body::<
688 DeviceMonitorListPhysResponse,
689 fidl::encoding::DefaultFuchsiaResourceDialect,
690 0x3a08518874196aab,
691 >(_buf?)?;
692 Ok(_response.phy_list)
693 }
694 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u16>>(
695 (),
696 0x3a08518874196aab,
697 fidl::encoding::DynamicFlags::empty(),
698 _decode,
699 )
700 }
701
702 type ListIfacesResponseFut =
703 fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>;
704 fn r#list_ifaces(&self) -> Self::ListIfacesResponseFut {
705 fn _decode(
706 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
707 ) -> Result<Vec<u16>, fidl::Error> {
708 let _response = fidl::client::decode_transaction_body::<
709 DeviceMonitorListIfacesResponse,
710 fidl::encoding::DefaultFuchsiaResourceDialect,
711 0x129e758fb8e0b113,
712 >(_buf?)?;
713 Ok(_response.iface_list)
714 }
715 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u16>>(
716 (),
717 0x129e758fb8e0b113,
718 fidl::encoding::DynamicFlags::empty(),
719 _decode,
720 )
721 }
722
723 type GetDevPathResponseFut = fidl::client::QueryResponseFut<
724 Option<String>,
725 fidl::encoding::DefaultFuchsiaResourceDialect,
726 >;
727 fn r#get_dev_path(&self, mut phy_id: u16) -> Self::GetDevPathResponseFut {
728 fn _decode(
729 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
730 ) -> Result<Option<String>, fidl::Error> {
731 let _response = fidl::client::decode_transaction_body::<
732 DeviceMonitorGetDevPathResponse,
733 fidl::encoding::DefaultFuchsiaResourceDialect,
734 0x4aa489b57113bccf,
735 >(_buf?)?;
736 Ok(_response.dev_path)
737 }
738 self.client.send_query_and_decode::<DeviceMonitorGetDevPathRequest, Option<String>>(
739 (phy_id,),
740 0x4aa489b57113bccf,
741 fidl::encoding::DynamicFlags::empty(),
742 _decode,
743 )
744 }
745
746 type GetSupportedMacRolesResponseFut = fidl::client::QueryResponseFut<
747 DeviceMonitorGetSupportedMacRolesResult,
748 fidl::encoding::DefaultFuchsiaResourceDialect,
749 >;
750 fn r#get_supported_mac_roles(&self, mut phy_id: u16) -> Self::GetSupportedMacRolesResponseFut {
751 fn _decode(
752 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
753 ) -> Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error> {
754 let _response = fidl::client::decode_transaction_body::<
755 fidl::encoding::ResultType<DeviceMonitorGetSupportedMacRolesResponse, i32>,
756 fidl::encoding::DefaultFuchsiaResourceDialect,
757 0x172b3d2eabd5a14e,
758 >(_buf?)?;
759 Ok(_response.map(|x| x.supported_mac_roles))
760 }
761 self.client.send_query_and_decode::<
762 DeviceMonitorGetSupportedMacRolesRequest,
763 DeviceMonitorGetSupportedMacRolesResult,
764 >(
765 (phy_id,),
766 0x172b3d2eabd5a14e,
767 fidl::encoding::DynamicFlags::empty(),
768 _decode,
769 )
770 }
771
772 fn r#watch_devices(
773 &self,
774 mut watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
775 ) -> Result<(), fidl::Error> {
776 self.client.send::<DeviceMonitorWatchDevicesRequest>(
777 (watcher,),
778 0x4615941e67e31b8e,
779 fidl::encoding::DynamicFlags::empty(),
780 )
781 }
782
783 type GetCountryResponseFut = fidl::client::QueryResponseFut<
784 DeviceMonitorGetCountryResult,
785 fidl::encoding::DefaultFuchsiaResourceDialect,
786 >;
787 fn r#get_country(&self, mut phy_id: u16) -> Self::GetCountryResponseFut {
788 fn _decode(
789 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
790 ) -> Result<DeviceMonitorGetCountryResult, fidl::Error> {
791 let _response = fidl::client::decode_transaction_body::<
792 fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>,
793 fidl::encoding::DefaultFuchsiaResourceDialect,
794 0x6f1040bd81bde90e,
795 >(_buf?)?;
796 Ok(_response.map(|x| x.resp))
797 }
798 self.client
799 .send_query_and_decode::<DeviceMonitorGetCountryRequest, DeviceMonitorGetCountryResult>(
800 (phy_id,),
801 0x6f1040bd81bde90e,
802 fidl::encoding::DynamicFlags::empty(),
803 _decode,
804 )
805 }
806
807 type SetCountryResponseFut =
808 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
809 fn r#set_country(&self, mut req: &SetCountryRequest) -> Self::SetCountryResponseFut {
810 fn _decode(
811 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
812 ) -> Result<i32, fidl::Error> {
813 let _response = fidl::client::decode_transaction_body::<
814 DeviceMonitorSetCountryResponse,
815 fidl::encoding::DefaultFuchsiaResourceDialect,
816 0xdaa7b77a5a6e71b,
817 >(_buf?)?;
818 Ok(_response.status)
819 }
820 self.client.send_query_and_decode::<DeviceMonitorSetCountryRequest, i32>(
821 (req,),
822 0xdaa7b77a5a6e71b,
823 fidl::encoding::DynamicFlags::empty(),
824 _decode,
825 )
826 }
827
828 type ClearCountryResponseFut =
829 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
830 fn r#clear_country(&self, mut req: &ClearCountryRequest) -> Self::ClearCountryResponseFut {
831 fn _decode(
832 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
833 ) -> Result<i32, fidl::Error> {
834 let _response = fidl::client::decode_transaction_body::<
835 DeviceMonitorClearCountryResponse,
836 fidl::encoding::DefaultFuchsiaResourceDialect,
837 0x66714d61103120e9,
838 >(_buf?)?;
839 Ok(_response.status)
840 }
841 self.client.send_query_and_decode::<DeviceMonitorClearCountryRequest, i32>(
842 (req,),
843 0x66714d61103120e9,
844 fidl::encoding::DynamicFlags::empty(),
845 _decode,
846 )
847 }
848
849 type SetPowerSaveModeResponseFut =
850 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
851 fn r#set_power_save_mode(
852 &self,
853 mut req: &SetPowerSaveModeRequest,
854 ) -> Self::SetPowerSaveModeResponseFut {
855 fn _decode(
856 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
857 ) -> Result<i32, fidl::Error> {
858 let _response = fidl::client::decode_transaction_body::<
859 DeviceMonitorSetPowerSaveModeResponse,
860 fidl::encoding::DefaultFuchsiaResourceDialect,
861 0x62202b4d360533bc,
862 >(_buf?)?;
863 Ok(_response.status)
864 }
865 self.client.send_query_and_decode::<DeviceMonitorSetPowerSaveModeRequest, i32>(
866 (req,),
867 0x62202b4d360533bc,
868 fidl::encoding::DynamicFlags::empty(),
869 _decode,
870 )
871 }
872
873 type GetPowerSaveModeResponseFut = fidl::client::QueryResponseFut<
874 DeviceMonitorGetPowerSaveModeResult,
875 fidl::encoding::DefaultFuchsiaResourceDialect,
876 >;
877 fn r#get_power_save_mode(&self, mut phy_id: u16) -> Self::GetPowerSaveModeResponseFut {
878 fn _decode(
879 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
880 ) -> Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error> {
881 let _response = fidl::client::decode_transaction_body::<
882 fidl::encoding::ResultType<DeviceMonitorGetPowerSaveModeResponse, i32>,
883 fidl::encoding::DefaultFuchsiaResourceDialect,
884 0x14304d406ada8693,
885 >(_buf?)?;
886 Ok(_response.map(|x| x.resp))
887 }
888 self.client.send_query_and_decode::<
889 DeviceMonitorGetPowerSaveModeRequest,
890 DeviceMonitorGetPowerSaveModeResult,
891 >(
892 (phy_id,),
893 0x14304d406ada8693,
894 fidl::encoding::DynamicFlags::empty(),
895 _decode,
896 )
897 }
898
899 type CreateIfaceResponseFut = fidl::client::QueryResponseFut<
900 DeviceMonitorCreateIfaceResult,
901 fidl::encoding::DefaultFuchsiaResourceDialect,
902 >;
903 fn r#create_iface(
904 &self,
905 mut payload: &DeviceMonitorCreateIfaceRequest,
906 ) -> Self::CreateIfaceResponseFut {
907 fn _decode(
908 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
909 ) -> Result<DeviceMonitorCreateIfaceResult, fidl::Error> {
910 let _response = fidl::client::decode_transaction_body::<
911 fidl::encoding::ResultType<DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
912 fidl::encoding::DefaultFuchsiaResourceDialect,
913 0x1e1d30c24c0ec144,
914 >(_buf?)?;
915 Ok(_response.map(|x| x))
916 }
917 self.client.send_query_and_decode::<
918 DeviceMonitorCreateIfaceRequest,
919 DeviceMonitorCreateIfaceResult,
920 >(
921 payload,
922 0x1e1d30c24c0ec144,
923 fidl::encoding::DynamicFlags::empty(),
924 _decode,
925 )
926 }
927
928 type QueryIfaceResponseFut = fidl::client::QueryResponseFut<
929 DeviceMonitorQueryIfaceResult,
930 fidl::encoding::DefaultFuchsiaResourceDialect,
931 >;
932 fn r#query_iface(&self, mut iface_id: u16) -> Self::QueryIfaceResponseFut {
933 fn _decode(
934 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
935 ) -> Result<DeviceMonitorQueryIfaceResult, fidl::Error> {
936 let _response = fidl::client::decode_transaction_body::<
937 fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>,
938 fidl::encoding::DefaultFuchsiaResourceDialect,
939 0x1a48c4a2b86259ef,
940 >(_buf?)?;
941 Ok(_response.map(|x| x.resp))
942 }
943 self.client
944 .send_query_and_decode::<DeviceMonitorQueryIfaceRequest, DeviceMonitorQueryIfaceResult>(
945 (iface_id,),
946 0x1a48c4a2b86259ef,
947 fidl::encoding::DynamicFlags::empty(),
948 _decode,
949 )
950 }
951
952 type DestroyIfaceResponseFut =
953 fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
954 fn r#destroy_iface(&self, mut req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut {
955 fn _decode(
956 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
957 ) -> Result<i32, fidl::Error> {
958 let _response = fidl::client::decode_transaction_body::<
959 DeviceMonitorDestroyIfaceResponse,
960 fidl::encoding::DefaultFuchsiaResourceDialect,
961 0x4c77982c1616a3b0,
962 >(_buf?)?;
963 Ok(_response.status)
964 }
965 self.client.send_query_and_decode::<DeviceMonitorDestroyIfaceRequest, i32>(
966 (req,),
967 0x4c77982c1616a3b0,
968 fidl::encoding::DynamicFlags::empty(),
969 _decode,
970 )
971 }
972
973 type GetClientSmeResponseFut = fidl::client::QueryResponseFut<
974 DeviceMonitorGetClientSmeResult,
975 fidl::encoding::DefaultFuchsiaResourceDialect,
976 >;
977 fn r#get_client_sme(
978 &self,
979 mut iface_id: u16,
980 mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
981 ) -> Self::GetClientSmeResponseFut {
982 fn _decode(
983 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
984 ) -> Result<DeviceMonitorGetClientSmeResult, fidl::Error> {
985 let _response = fidl::client::decode_transaction_body::<
986 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
987 fidl::encoding::DefaultFuchsiaResourceDialect,
988 0x1b056c379ca98273,
989 >(_buf?)?;
990 Ok(_response.map(|x| x))
991 }
992 self.client.send_query_and_decode::<
993 DeviceMonitorGetClientSmeRequest,
994 DeviceMonitorGetClientSmeResult,
995 >(
996 (iface_id, sme_server,),
997 0x1b056c379ca98273,
998 fidl::encoding::DynamicFlags::empty(),
999 _decode,
1000 )
1001 }
1002
1003 type GetApSmeResponseFut = fidl::client::QueryResponseFut<
1004 DeviceMonitorGetApSmeResult,
1005 fidl::encoding::DefaultFuchsiaResourceDialect,
1006 >;
1007 fn r#get_ap_sme(
1008 &self,
1009 mut iface_id: u16,
1010 mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
1011 ) -> Self::GetApSmeResponseFut {
1012 fn _decode(
1013 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1014 ) -> Result<DeviceMonitorGetApSmeResult, fidl::Error> {
1015 let _response = fidl::client::decode_transaction_body::<
1016 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1017 fidl::encoding::DefaultFuchsiaResourceDialect,
1018 0x754de680c4318c52,
1019 >(_buf?)?;
1020 Ok(_response.map(|x| x))
1021 }
1022 self.client
1023 .send_query_and_decode::<DeviceMonitorGetApSmeRequest, DeviceMonitorGetApSmeResult>(
1024 (iface_id, sme_server),
1025 0x754de680c4318c52,
1026 fidl::encoding::DynamicFlags::empty(),
1027 _decode,
1028 )
1029 }
1030
1031 type GetSmeTelemetryResponseFut = fidl::client::QueryResponseFut<
1032 DeviceMonitorGetSmeTelemetryResult,
1033 fidl::encoding::DefaultFuchsiaResourceDialect,
1034 >;
1035 fn r#get_sme_telemetry(
1036 &self,
1037 mut iface_id: u16,
1038 mut telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
1039 ) -> Self::GetSmeTelemetryResponseFut {
1040 fn _decode(
1041 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1042 ) -> Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error> {
1043 let _response = fidl::client::decode_transaction_body::<
1044 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1045 fidl::encoding::DefaultFuchsiaResourceDialect,
1046 0x1baf42b003f7452a,
1047 >(_buf?)?;
1048 Ok(_response.map(|x| x))
1049 }
1050 self.client.send_query_and_decode::<
1051 DeviceMonitorGetSmeTelemetryRequest,
1052 DeviceMonitorGetSmeTelemetryResult,
1053 >(
1054 (iface_id, telemetry_server,),
1055 0x1baf42b003f7452a,
1056 fidl::encoding::DynamicFlags::empty(),
1057 _decode,
1058 )
1059 }
1060}
1061
1062pub struct DeviceMonitorEventStream {
1063 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1064}
1065
1066impl std::marker::Unpin for DeviceMonitorEventStream {}
1067
1068impl futures::stream::FusedStream for DeviceMonitorEventStream {
1069 fn is_terminated(&self) -> bool {
1070 self.event_receiver.is_terminated()
1071 }
1072}
1073
1074impl futures::Stream for DeviceMonitorEventStream {
1075 type Item = Result<DeviceMonitorEvent, fidl::Error>;
1076
1077 fn poll_next(
1078 mut self: std::pin::Pin<&mut Self>,
1079 cx: &mut std::task::Context<'_>,
1080 ) -> std::task::Poll<Option<Self::Item>> {
1081 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1082 &mut self.event_receiver,
1083 cx
1084 )?) {
1085 Some(buf) => std::task::Poll::Ready(Some(DeviceMonitorEvent::decode(buf))),
1086 None => std::task::Poll::Ready(None),
1087 }
1088 }
1089}
1090
1091#[derive(Debug)]
1092pub enum DeviceMonitorEvent {}
1093
1094impl DeviceMonitorEvent {
1095 fn decode(
1097 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1098 ) -> Result<DeviceMonitorEvent, fidl::Error> {
1099 let (bytes, _handles) = buf.split_mut();
1100 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1101 debug_assert_eq!(tx_header.tx_id, 0);
1102 match tx_header.ordinal {
1103 _ => Err(fidl::Error::UnknownOrdinal {
1104 ordinal: tx_header.ordinal,
1105 protocol_name: <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1106 }),
1107 }
1108 }
1109}
1110
1111pub struct DeviceMonitorRequestStream {
1113 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1114 is_terminated: bool,
1115}
1116
1117impl std::marker::Unpin for DeviceMonitorRequestStream {}
1118
1119impl futures::stream::FusedStream for DeviceMonitorRequestStream {
1120 fn is_terminated(&self) -> bool {
1121 self.is_terminated
1122 }
1123}
1124
1125impl fidl::endpoints::RequestStream for DeviceMonitorRequestStream {
1126 type Protocol = DeviceMonitorMarker;
1127 type ControlHandle = DeviceMonitorControlHandle;
1128
1129 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1130 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1131 }
1132
1133 fn control_handle(&self) -> Self::ControlHandle {
1134 DeviceMonitorControlHandle { inner: self.inner.clone() }
1135 }
1136
1137 fn into_inner(
1138 self,
1139 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1140 {
1141 (self.inner, self.is_terminated)
1142 }
1143
1144 fn from_inner(
1145 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1146 is_terminated: bool,
1147 ) -> Self {
1148 Self { inner, is_terminated }
1149 }
1150}
1151
1152impl futures::Stream for DeviceMonitorRequestStream {
1153 type Item = Result<DeviceMonitorRequest, fidl::Error>;
1154
1155 fn poll_next(
1156 mut self: std::pin::Pin<&mut Self>,
1157 cx: &mut std::task::Context<'_>,
1158 ) -> std::task::Poll<Option<Self::Item>> {
1159 let this = &mut *self;
1160 if this.inner.check_shutdown(cx) {
1161 this.is_terminated = true;
1162 return std::task::Poll::Ready(None);
1163 }
1164 if this.is_terminated {
1165 panic!("polled DeviceMonitorRequestStream after completion");
1166 }
1167 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1168 |bytes, handles| {
1169 match this.inner.channel().read_etc(cx, bytes, handles) {
1170 std::task::Poll::Ready(Ok(())) => {}
1171 std::task::Poll::Pending => return std::task::Poll::Pending,
1172 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1173 this.is_terminated = true;
1174 return std::task::Poll::Ready(None);
1175 }
1176 std::task::Poll::Ready(Err(e)) => {
1177 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1178 e.into(),
1179 ))))
1180 }
1181 }
1182
1183 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1185
1186 std::task::Poll::Ready(Some(match header.ordinal {
1187 0x3a08518874196aab => {
1188 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1189 let mut req = fidl::new_empty!(
1190 fidl::encoding::EmptyPayload,
1191 fidl::encoding::DefaultFuchsiaResourceDialect
1192 );
1193 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1194 let control_handle =
1195 DeviceMonitorControlHandle { inner: this.inner.clone() };
1196 Ok(DeviceMonitorRequest::ListPhys {
1197 responder: DeviceMonitorListPhysResponder {
1198 control_handle: std::mem::ManuallyDrop::new(control_handle),
1199 tx_id: header.tx_id,
1200 },
1201 })
1202 }
1203 0x129e758fb8e0b113 => {
1204 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1205 let mut req = fidl::new_empty!(
1206 fidl::encoding::EmptyPayload,
1207 fidl::encoding::DefaultFuchsiaResourceDialect
1208 );
1209 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1210 let control_handle =
1211 DeviceMonitorControlHandle { inner: this.inner.clone() };
1212 Ok(DeviceMonitorRequest::ListIfaces {
1213 responder: DeviceMonitorListIfacesResponder {
1214 control_handle: std::mem::ManuallyDrop::new(control_handle),
1215 tx_id: header.tx_id,
1216 },
1217 })
1218 }
1219 0x4aa489b57113bccf => {
1220 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1221 let mut req = fidl::new_empty!(
1222 DeviceMonitorGetDevPathRequest,
1223 fidl::encoding::DefaultFuchsiaResourceDialect
1224 );
1225 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetDevPathRequest>(&header, _body_bytes, handles, &mut req)?;
1226 let control_handle =
1227 DeviceMonitorControlHandle { inner: this.inner.clone() };
1228 Ok(DeviceMonitorRequest::GetDevPath {
1229 phy_id: req.phy_id,
1230
1231 responder: DeviceMonitorGetDevPathResponder {
1232 control_handle: std::mem::ManuallyDrop::new(control_handle),
1233 tx_id: header.tx_id,
1234 },
1235 })
1236 }
1237 0x172b3d2eabd5a14e => {
1238 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1239 let mut req = fidl::new_empty!(
1240 DeviceMonitorGetSupportedMacRolesRequest,
1241 fidl::encoding::DefaultFuchsiaResourceDialect
1242 );
1243 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetSupportedMacRolesRequest>(&header, _body_bytes, handles, &mut req)?;
1244 let control_handle =
1245 DeviceMonitorControlHandle { inner: this.inner.clone() };
1246 Ok(DeviceMonitorRequest::GetSupportedMacRoles {
1247 phy_id: req.phy_id,
1248
1249 responder: DeviceMonitorGetSupportedMacRolesResponder {
1250 control_handle: std::mem::ManuallyDrop::new(control_handle),
1251 tx_id: header.tx_id,
1252 },
1253 })
1254 }
1255 0x4615941e67e31b8e => {
1256 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1257 let mut req = fidl::new_empty!(
1258 DeviceMonitorWatchDevicesRequest,
1259 fidl::encoding::DefaultFuchsiaResourceDialect
1260 );
1261 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorWatchDevicesRequest>(&header, _body_bytes, handles, &mut req)?;
1262 let control_handle =
1263 DeviceMonitorControlHandle { inner: this.inner.clone() };
1264 Ok(DeviceMonitorRequest::WatchDevices {
1265 watcher: req.watcher,
1266
1267 control_handle,
1268 })
1269 }
1270 0x6f1040bd81bde90e => {
1271 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1272 let mut req = fidl::new_empty!(
1273 DeviceMonitorGetCountryRequest,
1274 fidl::encoding::DefaultFuchsiaResourceDialect
1275 );
1276 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetCountryRequest>(&header, _body_bytes, handles, &mut req)?;
1277 let control_handle =
1278 DeviceMonitorControlHandle { inner: this.inner.clone() };
1279 Ok(DeviceMonitorRequest::GetCountry {
1280 phy_id: req.phy_id,
1281
1282 responder: DeviceMonitorGetCountryResponder {
1283 control_handle: std::mem::ManuallyDrop::new(control_handle),
1284 tx_id: header.tx_id,
1285 },
1286 })
1287 }
1288 0xdaa7b77a5a6e71b => {
1289 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1290 let mut req = fidl::new_empty!(
1291 DeviceMonitorSetCountryRequest,
1292 fidl::encoding::DefaultFuchsiaResourceDialect
1293 );
1294 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorSetCountryRequest>(&header, _body_bytes, handles, &mut req)?;
1295 let control_handle =
1296 DeviceMonitorControlHandle { inner: this.inner.clone() };
1297 Ok(DeviceMonitorRequest::SetCountry {
1298 req: req.req,
1299
1300 responder: DeviceMonitorSetCountryResponder {
1301 control_handle: std::mem::ManuallyDrop::new(control_handle),
1302 tx_id: header.tx_id,
1303 },
1304 })
1305 }
1306 0x66714d61103120e9 => {
1307 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1308 let mut req = fidl::new_empty!(
1309 DeviceMonitorClearCountryRequest,
1310 fidl::encoding::DefaultFuchsiaResourceDialect
1311 );
1312 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorClearCountryRequest>(&header, _body_bytes, handles, &mut req)?;
1313 let control_handle =
1314 DeviceMonitorControlHandle { inner: this.inner.clone() };
1315 Ok(DeviceMonitorRequest::ClearCountry {
1316 req: req.req,
1317
1318 responder: DeviceMonitorClearCountryResponder {
1319 control_handle: std::mem::ManuallyDrop::new(control_handle),
1320 tx_id: header.tx_id,
1321 },
1322 })
1323 }
1324 0x62202b4d360533bc => {
1325 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1326 let mut req = fidl::new_empty!(
1327 DeviceMonitorSetPowerSaveModeRequest,
1328 fidl::encoding::DefaultFuchsiaResourceDialect
1329 );
1330 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorSetPowerSaveModeRequest>(&header, _body_bytes, handles, &mut req)?;
1331 let control_handle =
1332 DeviceMonitorControlHandle { inner: this.inner.clone() };
1333 Ok(DeviceMonitorRequest::SetPowerSaveMode {
1334 req: req.req,
1335
1336 responder: DeviceMonitorSetPowerSaveModeResponder {
1337 control_handle: std::mem::ManuallyDrop::new(control_handle),
1338 tx_id: header.tx_id,
1339 },
1340 })
1341 }
1342 0x14304d406ada8693 => {
1343 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1344 let mut req = fidl::new_empty!(
1345 DeviceMonitorGetPowerSaveModeRequest,
1346 fidl::encoding::DefaultFuchsiaResourceDialect
1347 );
1348 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetPowerSaveModeRequest>(&header, _body_bytes, handles, &mut req)?;
1349 let control_handle =
1350 DeviceMonitorControlHandle { inner: this.inner.clone() };
1351 Ok(DeviceMonitorRequest::GetPowerSaveMode {
1352 phy_id: req.phy_id,
1353
1354 responder: DeviceMonitorGetPowerSaveModeResponder {
1355 control_handle: std::mem::ManuallyDrop::new(control_handle),
1356 tx_id: header.tx_id,
1357 },
1358 })
1359 }
1360 0x1e1d30c24c0ec144 => {
1361 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1362 let mut req = fidl::new_empty!(
1363 DeviceMonitorCreateIfaceRequest,
1364 fidl::encoding::DefaultFuchsiaResourceDialect
1365 );
1366 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorCreateIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1367 let control_handle =
1368 DeviceMonitorControlHandle { inner: this.inner.clone() };
1369 Ok(DeviceMonitorRequest::CreateIface {
1370 payload: req,
1371 responder: DeviceMonitorCreateIfaceResponder {
1372 control_handle: std::mem::ManuallyDrop::new(control_handle),
1373 tx_id: header.tx_id,
1374 },
1375 })
1376 }
1377 0x1a48c4a2b86259ef => {
1378 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1379 let mut req = fidl::new_empty!(
1380 DeviceMonitorQueryIfaceRequest,
1381 fidl::encoding::DefaultFuchsiaResourceDialect
1382 );
1383 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorQueryIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1384 let control_handle =
1385 DeviceMonitorControlHandle { inner: this.inner.clone() };
1386 Ok(DeviceMonitorRequest::QueryIface {
1387 iface_id: req.iface_id,
1388
1389 responder: DeviceMonitorQueryIfaceResponder {
1390 control_handle: std::mem::ManuallyDrop::new(control_handle),
1391 tx_id: header.tx_id,
1392 },
1393 })
1394 }
1395 0x4c77982c1616a3b0 => {
1396 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1397 let mut req = fidl::new_empty!(
1398 DeviceMonitorDestroyIfaceRequest,
1399 fidl::encoding::DefaultFuchsiaResourceDialect
1400 );
1401 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorDestroyIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
1402 let control_handle =
1403 DeviceMonitorControlHandle { inner: this.inner.clone() };
1404 Ok(DeviceMonitorRequest::DestroyIface {
1405 req: req.req,
1406
1407 responder: DeviceMonitorDestroyIfaceResponder {
1408 control_handle: std::mem::ManuallyDrop::new(control_handle),
1409 tx_id: header.tx_id,
1410 },
1411 })
1412 }
1413 0x1b056c379ca98273 => {
1414 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1415 let mut req = fidl::new_empty!(
1416 DeviceMonitorGetClientSmeRequest,
1417 fidl::encoding::DefaultFuchsiaResourceDialect
1418 );
1419 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetClientSmeRequest>(&header, _body_bytes, handles, &mut req)?;
1420 let control_handle =
1421 DeviceMonitorControlHandle { inner: this.inner.clone() };
1422 Ok(DeviceMonitorRequest::GetClientSme {
1423 iface_id: req.iface_id,
1424 sme_server: req.sme_server,
1425
1426 responder: DeviceMonitorGetClientSmeResponder {
1427 control_handle: std::mem::ManuallyDrop::new(control_handle),
1428 tx_id: header.tx_id,
1429 },
1430 })
1431 }
1432 0x754de680c4318c52 => {
1433 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1434 let mut req = fidl::new_empty!(
1435 DeviceMonitorGetApSmeRequest,
1436 fidl::encoding::DefaultFuchsiaResourceDialect
1437 );
1438 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetApSmeRequest>(&header, _body_bytes, handles, &mut req)?;
1439 let control_handle =
1440 DeviceMonitorControlHandle { inner: this.inner.clone() };
1441 Ok(DeviceMonitorRequest::GetApSme {
1442 iface_id: req.iface_id,
1443 sme_server: req.sme_server,
1444
1445 responder: DeviceMonitorGetApSmeResponder {
1446 control_handle: std::mem::ManuallyDrop::new(control_handle),
1447 tx_id: header.tx_id,
1448 },
1449 })
1450 }
1451 0x1baf42b003f7452a => {
1452 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1453 let mut req = fidl::new_empty!(
1454 DeviceMonitorGetSmeTelemetryRequest,
1455 fidl::encoding::DefaultFuchsiaResourceDialect
1456 );
1457 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetSmeTelemetryRequest>(&header, _body_bytes, handles, &mut req)?;
1458 let control_handle =
1459 DeviceMonitorControlHandle { inner: this.inner.clone() };
1460 Ok(DeviceMonitorRequest::GetSmeTelemetry {
1461 iface_id: req.iface_id,
1462 telemetry_server: req.telemetry_server,
1463
1464 responder: DeviceMonitorGetSmeTelemetryResponder {
1465 control_handle: std::mem::ManuallyDrop::new(control_handle),
1466 tx_id: header.tx_id,
1467 },
1468 })
1469 }
1470 _ => Err(fidl::Error::UnknownOrdinal {
1471 ordinal: header.ordinal,
1472 protocol_name:
1473 <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1474 }),
1475 }))
1476 },
1477 )
1478 }
1479}
1480
1481#[derive(Debug)]
1482pub enum DeviceMonitorRequest {
1483 ListPhys {
1484 responder: DeviceMonitorListPhysResponder,
1485 },
1486 ListIfaces {
1487 responder: DeviceMonitorListIfacesResponder,
1488 },
1489 GetDevPath {
1490 phy_id: u16,
1491 responder: DeviceMonitorGetDevPathResponder,
1492 },
1493 GetSupportedMacRoles {
1494 phy_id: u16,
1495 responder: DeviceMonitorGetSupportedMacRolesResponder,
1496 },
1497 WatchDevices {
1498 watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
1499 control_handle: DeviceMonitorControlHandle,
1500 },
1501 GetCountry {
1502 phy_id: u16,
1503 responder: DeviceMonitorGetCountryResponder,
1504 },
1505 SetCountry {
1506 req: SetCountryRequest,
1507 responder: DeviceMonitorSetCountryResponder,
1508 },
1509 ClearCountry {
1510 req: ClearCountryRequest,
1511 responder: DeviceMonitorClearCountryResponder,
1512 },
1513 SetPowerSaveMode {
1514 req: SetPowerSaveModeRequest,
1515 responder: DeviceMonitorSetPowerSaveModeResponder,
1516 },
1517 GetPowerSaveMode {
1518 phy_id: u16,
1519 responder: DeviceMonitorGetPowerSaveModeResponder,
1520 },
1521 CreateIface {
1522 payload: DeviceMonitorCreateIfaceRequest,
1523 responder: DeviceMonitorCreateIfaceResponder,
1524 },
1525 QueryIface {
1526 iface_id: u16,
1527 responder: DeviceMonitorQueryIfaceResponder,
1528 },
1529 DestroyIface {
1530 req: DestroyIfaceRequest,
1531 responder: DeviceMonitorDestroyIfaceResponder,
1532 },
1533 GetClientSme {
1541 iface_id: u16,
1542 sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
1543 responder: DeviceMonitorGetClientSmeResponder,
1544 },
1545 GetApSme {
1553 iface_id: u16,
1554 sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
1555 responder: DeviceMonitorGetApSmeResponder,
1556 },
1557 GetSmeTelemetry {
1565 iface_id: u16,
1566 telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
1567 responder: DeviceMonitorGetSmeTelemetryResponder,
1568 },
1569}
1570
1571impl DeviceMonitorRequest {
1572 #[allow(irrefutable_let_patterns)]
1573 pub fn into_list_phys(self) -> Option<(DeviceMonitorListPhysResponder)> {
1574 if let DeviceMonitorRequest::ListPhys { responder } = self {
1575 Some((responder))
1576 } else {
1577 None
1578 }
1579 }
1580
1581 #[allow(irrefutable_let_patterns)]
1582 pub fn into_list_ifaces(self) -> Option<(DeviceMonitorListIfacesResponder)> {
1583 if let DeviceMonitorRequest::ListIfaces { responder } = self {
1584 Some((responder))
1585 } else {
1586 None
1587 }
1588 }
1589
1590 #[allow(irrefutable_let_patterns)]
1591 pub fn into_get_dev_path(self) -> Option<(u16, DeviceMonitorGetDevPathResponder)> {
1592 if let DeviceMonitorRequest::GetDevPath { phy_id, responder } = self {
1593 Some((phy_id, responder))
1594 } else {
1595 None
1596 }
1597 }
1598
1599 #[allow(irrefutable_let_patterns)]
1600 pub fn into_get_supported_mac_roles(
1601 self,
1602 ) -> Option<(u16, DeviceMonitorGetSupportedMacRolesResponder)> {
1603 if let DeviceMonitorRequest::GetSupportedMacRoles { phy_id, responder } = self {
1604 Some((phy_id, responder))
1605 } else {
1606 None
1607 }
1608 }
1609
1610 #[allow(irrefutable_let_patterns)]
1611 pub fn into_watch_devices(
1612 self,
1613 ) -> Option<(fidl::endpoints::ServerEnd<DeviceWatcherMarker>, DeviceMonitorControlHandle)> {
1614 if let DeviceMonitorRequest::WatchDevices { watcher, control_handle } = self {
1615 Some((watcher, control_handle))
1616 } else {
1617 None
1618 }
1619 }
1620
1621 #[allow(irrefutable_let_patterns)]
1622 pub fn into_get_country(self) -> Option<(u16, DeviceMonitorGetCountryResponder)> {
1623 if let DeviceMonitorRequest::GetCountry { phy_id, responder } = self {
1624 Some((phy_id, responder))
1625 } else {
1626 None
1627 }
1628 }
1629
1630 #[allow(irrefutable_let_patterns)]
1631 pub fn into_set_country(self) -> Option<(SetCountryRequest, DeviceMonitorSetCountryResponder)> {
1632 if let DeviceMonitorRequest::SetCountry { req, responder } = self {
1633 Some((req, responder))
1634 } else {
1635 None
1636 }
1637 }
1638
1639 #[allow(irrefutable_let_patterns)]
1640 pub fn into_clear_country(
1641 self,
1642 ) -> Option<(ClearCountryRequest, DeviceMonitorClearCountryResponder)> {
1643 if let DeviceMonitorRequest::ClearCountry { req, responder } = self {
1644 Some((req, responder))
1645 } else {
1646 None
1647 }
1648 }
1649
1650 #[allow(irrefutable_let_patterns)]
1651 pub fn into_set_power_save_mode(
1652 self,
1653 ) -> Option<(SetPowerSaveModeRequest, DeviceMonitorSetPowerSaveModeResponder)> {
1654 if let DeviceMonitorRequest::SetPowerSaveMode { req, responder } = self {
1655 Some((req, responder))
1656 } else {
1657 None
1658 }
1659 }
1660
1661 #[allow(irrefutable_let_patterns)]
1662 pub fn into_get_power_save_mode(self) -> Option<(u16, DeviceMonitorGetPowerSaveModeResponder)> {
1663 if let DeviceMonitorRequest::GetPowerSaveMode { phy_id, responder } = self {
1664 Some((phy_id, responder))
1665 } else {
1666 None
1667 }
1668 }
1669
1670 #[allow(irrefutable_let_patterns)]
1671 pub fn into_create_iface(
1672 self,
1673 ) -> Option<(DeviceMonitorCreateIfaceRequest, DeviceMonitorCreateIfaceResponder)> {
1674 if let DeviceMonitorRequest::CreateIface { payload, responder } = self {
1675 Some((payload, responder))
1676 } else {
1677 None
1678 }
1679 }
1680
1681 #[allow(irrefutable_let_patterns)]
1682 pub fn into_query_iface(self) -> Option<(u16, DeviceMonitorQueryIfaceResponder)> {
1683 if let DeviceMonitorRequest::QueryIface { iface_id, responder } = self {
1684 Some((iface_id, responder))
1685 } else {
1686 None
1687 }
1688 }
1689
1690 #[allow(irrefutable_let_patterns)]
1691 pub fn into_destroy_iface(
1692 self,
1693 ) -> Option<(DestroyIfaceRequest, DeviceMonitorDestroyIfaceResponder)> {
1694 if let DeviceMonitorRequest::DestroyIface { req, responder } = self {
1695 Some((req, responder))
1696 } else {
1697 None
1698 }
1699 }
1700
1701 #[allow(irrefutable_let_patterns)]
1702 pub fn into_get_client_sme(
1703 self,
1704 ) -> Option<(
1705 u16,
1706 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
1707 DeviceMonitorGetClientSmeResponder,
1708 )> {
1709 if let DeviceMonitorRequest::GetClientSme { iface_id, sme_server, responder } = self {
1710 Some((iface_id, sme_server, responder))
1711 } else {
1712 None
1713 }
1714 }
1715
1716 #[allow(irrefutable_let_patterns)]
1717 pub fn into_get_ap_sme(
1718 self,
1719 ) -> Option<(
1720 u16,
1721 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
1722 DeviceMonitorGetApSmeResponder,
1723 )> {
1724 if let DeviceMonitorRequest::GetApSme { iface_id, sme_server, responder } = self {
1725 Some((iface_id, sme_server, responder))
1726 } else {
1727 None
1728 }
1729 }
1730
1731 #[allow(irrefutable_let_patterns)]
1732 pub fn into_get_sme_telemetry(
1733 self,
1734 ) -> Option<(
1735 u16,
1736 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
1737 DeviceMonitorGetSmeTelemetryResponder,
1738 )> {
1739 if let DeviceMonitorRequest::GetSmeTelemetry { iface_id, telemetry_server, responder } =
1740 self
1741 {
1742 Some((iface_id, telemetry_server, responder))
1743 } else {
1744 None
1745 }
1746 }
1747
1748 pub fn method_name(&self) -> &'static str {
1750 match *self {
1751 DeviceMonitorRequest::ListPhys { .. } => "list_phys",
1752 DeviceMonitorRequest::ListIfaces { .. } => "list_ifaces",
1753 DeviceMonitorRequest::GetDevPath { .. } => "get_dev_path",
1754 DeviceMonitorRequest::GetSupportedMacRoles { .. } => "get_supported_mac_roles",
1755 DeviceMonitorRequest::WatchDevices { .. } => "watch_devices",
1756 DeviceMonitorRequest::GetCountry { .. } => "get_country",
1757 DeviceMonitorRequest::SetCountry { .. } => "set_country",
1758 DeviceMonitorRequest::ClearCountry { .. } => "clear_country",
1759 DeviceMonitorRequest::SetPowerSaveMode { .. } => "set_power_save_mode",
1760 DeviceMonitorRequest::GetPowerSaveMode { .. } => "get_power_save_mode",
1761 DeviceMonitorRequest::CreateIface { .. } => "create_iface",
1762 DeviceMonitorRequest::QueryIface { .. } => "query_iface",
1763 DeviceMonitorRequest::DestroyIface { .. } => "destroy_iface",
1764 DeviceMonitorRequest::GetClientSme { .. } => "get_client_sme",
1765 DeviceMonitorRequest::GetApSme { .. } => "get_ap_sme",
1766 DeviceMonitorRequest::GetSmeTelemetry { .. } => "get_sme_telemetry",
1767 }
1768 }
1769}
1770
1771#[derive(Debug, Clone)]
1772pub struct DeviceMonitorControlHandle {
1773 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1774}
1775
1776impl fidl::endpoints::ControlHandle for DeviceMonitorControlHandle {
1777 fn shutdown(&self) {
1778 self.inner.shutdown()
1779 }
1780 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1781 self.inner.shutdown_with_epitaph(status)
1782 }
1783
1784 fn is_closed(&self) -> bool {
1785 self.inner.channel().is_closed()
1786 }
1787 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1788 self.inner.channel().on_closed()
1789 }
1790
1791 #[cfg(target_os = "fuchsia")]
1792 fn signal_peer(
1793 &self,
1794 clear_mask: zx::Signals,
1795 set_mask: zx::Signals,
1796 ) -> Result<(), zx_status::Status> {
1797 use fidl::Peered;
1798 self.inner.channel().signal_peer(clear_mask, set_mask)
1799 }
1800}
1801
1802impl DeviceMonitorControlHandle {}
1803
1804#[must_use = "FIDL methods require a response to be sent"]
1805#[derive(Debug)]
1806pub struct DeviceMonitorListPhysResponder {
1807 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
1808 tx_id: u32,
1809}
1810
1811impl std::ops::Drop for DeviceMonitorListPhysResponder {
1815 fn drop(&mut self) {
1816 self.control_handle.shutdown();
1817 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1819 }
1820}
1821
1822impl fidl::endpoints::Responder for DeviceMonitorListPhysResponder {
1823 type ControlHandle = DeviceMonitorControlHandle;
1824
1825 fn control_handle(&self) -> &DeviceMonitorControlHandle {
1826 &self.control_handle
1827 }
1828
1829 fn drop_without_shutdown(mut self) {
1830 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1832 std::mem::forget(self);
1834 }
1835}
1836
1837impl DeviceMonitorListPhysResponder {
1838 pub fn send(self, mut phy_list: &[u16]) -> Result<(), fidl::Error> {
1842 let _result = self.send_raw(phy_list);
1843 if _result.is_err() {
1844 self.control_handle.shutdown();
1845 }
1846 self.drop_without_shutdown();
1847 _result
1848 }
1849
1850 pub fn send_no_shutdown_on_err(self, mut phy_list: &[u16]) -> Result<(), fidl::Error> {
1852 let _result = self.send_raw(phy_list);
1853 self.drop_without_shutdown();
1854 _result
1855 }
1856
1857 fn send_raw(&self, mut phy_list: &[u16]) -> Result<(), fidl::Error> {
1858 self.control_handle.inner.send::<DeviceMonitorListPhysResponse>(
1859 (phy_list,),
1860 self.tx_id,
1861 0x3a08518874196aab,
1862 fidl::encoding::DynamicFlags::empty(),
1863 )
1864 }
1865}
1866
1867#[must_use = "FIDL methods require a response to be sent"]
1868#[derive(Debug)]
1869pub struct DeviceMonitorListIfacesResponder {
1870 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
1871 tx_id: u32,
1872}
1873
1874impl std::ops::Drop for DeviceMonitorListIfacesResponder {
1878 fn drop(&mut self) {
1879 self.control_handle.shutdown();
1880 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1882 }
1883}
1884
1885impl fidl::endpoints::Responder for DeviceMonitorListIfacesResponder {
1886 type ControlHandle = DeviceMonitorControlHandle;
1887
1888 fn control_handle(&self) -> &DeviceMonitorControlHandle {
1889 &self.control_handle
1890 }
1891
1892 fn drop_without_shutdown(mut self) {
1893 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1895 std::mem::forget(self);
1897 }
1898}
1899
1900impl DeviceMonitorListIfacesResponder {
1901 pub fn send(self, mut iface_list: &[u16]) -> Result<(), fidl::Error> {
1905 let _result = self.send_raw(iface_list);
1906 if _result.is_err() {
1907 self.control_handle.shutdown();
1908 }
1909 self.drop_without_shutdown();
1910 _result
1911 }
1912
1913 pub fn send_no_shutdown_on_err(self, mut iface_list: &[u16]) -> Result<(), fidl::Error> {
1915 let _result = self.send_raw(iface_list);
1916 self.drop_without_shutdown();
1917 _result
1918 }
1919
1920 fn send_raw(&self, mut iface_list: &[u16]) -> Result<(), fidl::Error> {
1921 self.control_handle.inner.send::<DeviceMonitorListIfacesResponse>(
1922 (iface_list,),
1923 self.tx_id,
1924 0x129e758fb8e0b113,
1925 fidl::encoding::DynamicFlags::empty(),
1926 )
1927 }
1928}
1929
1930#[must_use = "FIDL methods require a response to be sent"]
1931#[derive(Debug)]
1932pub struct DeviceMonitorGetDevPathResponder {
1933 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
1934 tx_id: u32,
1935}
1936
1937impl std::ops::Drop for DeviceMonitorGetDevPathResponder {
1941 fn drop(&mut self) {
1942 self.control_handle.shutdown();
1943 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1945 }
1946}
1947
1948impl fidl::endpoints::Responder for DeviceMonitorGetDevPathResponder {
1949 type ControlHandle = DeviceMonitorControlHandle;
1950
1951 fn control_handle(&self) -> &DeviceMonitorControlHandle {
1952 &self.control_handle
1953 }
1954
1955 fn drop_without_shutdown(mut self) {
1956 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1958 std::mem::forget(self);
1960 }
1961}
1962
1963impl DeviceMonitorGetDevPathResponder {
1964 pub fn send(self, mut dev_path: Option<&str>) -> Result<(), fidl::Error> {
1968 let _result = self.send_raw(dev_path);
1969 if _result.is_err() {
1970 self.control_handle.shutdown();
1971 }
1972 self.drop_without_shutdown();
1973 _result
1974 }
1975
1976 pub fn send_no_shutdown_on_err(self, mut dev_path: Option<&str>) -> Result<(), fidl::Error> {
1978 let _result = self.send_raw(dev_path);
1979 self.drop_without_shutdown();
1980 _result
1981 }
1982
1983 fn send_raw(&self, mut dev_path: Option<&str>) -> Result<(), fidl::Error> {
1984 self.control_handle.inner.send::<DeviceMonitorGetDevPathResponse>(
1985 (dev_path,),
1986 self.tx_id,
1987 0x4aa489b57113bccf,
1988 fidl::encoding::DynamicFlags::empty(),
1989 )
1990 }
1991}
1992
1993#[must_use = "FIDL methods require a response to be sent"]
1994#[derive(Debug)]
1995pub struct DeviceMonitorGetSupportedMacRolesResponder {
1996 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
1997 tx_id: u32,
1998}
1999
2000impl std::ops::Drop for DeviceMonitorGetSupportedMacRolesResponder {
2004 fn drop(&mut self) {
2005 self.control_handle.shutdown();
2006 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2008 }
2009}
2010
2011impl fidl::endpoints::Responder for DeviceMonitorGetSupportedMacRolesResponder {
2012 type ControlHandle = DeviceMonitorControlHandle;
2013
2014 fn control_handle(&self) -> &DeviceMonitorControlHandle {
2015 &self.control_handle
2016 }
2017
2018 fn drop_without_shutdown(mut self) {
2019 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2021 std::mem::forget(self);
2023 }
2024}
2025
2026impl DeviceMonitorGetSupportedMacRolesResponder {
2027 pub fn send(
2031 self,
2032 mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
2033 ) -> Result<(), fidl::Error> {
2034 let _result = self.send_raw(result);
2035 if _result.is_err() {
2036 self.control_handle.shutdown();
2037 }
2038 self.drop_without_shutdown();
2039 _result
2040 }
2041
2042 pub fn send_no_shutdown_on_err(
2044 self,
2045 mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
2046 ) -> Result<(), fidl::Error> {
2047 let _result = self.send_raw(result);
2048 self.drop_without_shutdown();
2049 _result
2050 }
2051
2052 fn send_raw(
2053 &self,
2054 mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
2055 ) -> Result<(), fidl::Error> {
2056 self.control_handle.inner.send::<fidl::encoding::ResultType<
2057 DeviceMonitorGetSupportedMacRolesResponse,
2058 i32,
2059 >>(
2060 result.map(|supported_mac_roles| (supported_mac_roles,)),
2061 self.tx_id,
2062 0x172b3d2eabd5a14e,
2063 fidl::encoding::DynamicFlags::empty(),
2064 )
2065 }
2066}
2067
2068#[must_use = "FIDL methods require a response to be sent"]
2069#[derive(Debug)]
2070pub struct DeviceMonitorGetCountryResponder {
2071 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2072 tx_id: u32,
2073}
2074
2075impl std::ops::Drop for DeviceMonitorGetCountryResponder {
2079 fn drop(&mut self) {
2080 self.control_handle.shutdown();
2081 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2083 }
2084}
2085
2086impl fidl::endpoints::Responder for DeviceMonitorGetCountryResponder {
2087 type ControlHandle = DeviceMonitorControlHandle;
2088
2089 fn control_handle(&self) -> &DeviceMonitorControlHandle {
2090 &self.control_handle
2091 }
2092
2093 fn drop_without_shutdown(mut self) {
2094 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2096 std::mem::forget(self);
2098 }
2099}
2100
2101impl DeviceMonitorGetCountryResponder {
2102 pub fn send(self, mut result: Result<&GetCountryResponse, i32>) -> Result<(), fidl::Error> {
2106 let _result = self.send_raw(result);
2107 if _result.is_err() {
2108 self.control_handle.shutdown();
2109 }
2110 self.drop_without_shutdown();
2111 _result
2112 }
2113
2114 pub fn send_no_shutdown_on_err(
2116 self,
2117 mut result: Result<&GetCountryResponse, i32>,
2118 ) -> Result<(), fidl::Error> {
2119 let _result = self.send_raw(result);
2120 self.drop_without_shutdown();
2121 _result
2122 }
2123
2124 fn send_raw(&self, mut result: Result<&GetCountryResponse, i32>) -> Result<(), fidl::Error> {
2125 self.control_handle
2126 .inner
2127 .send::<fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>>(
2128 result.map(|resp| (resp,)),
2129 self.tx_id,
2130 0x6f1040bd81bde90e,
2131 fidl::encoding::DynamicFlags::empty(),
2132 )
2133 }
2134}
2135
2136#[must_use = "FIDL methods require a response to be sent"]
2137#[derive(Debug)]
2138pub struct DeviceMonitorSetCountryResponder {
2139 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2140 tx_id: u32,
2141}
2142
2143impl std::ops::Drop for DeviceMonitorSetCountryResponder {
2147 fn drop(&mut self) {
2148 self.control_handle.shutdown();
2149 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2151 }
2152}
2153
2154impl fidl::endpoints::Responder for DeviceMonitorSetCountryResponder {
2155 type ControlHandle = DeviceMonitorControlHandle;
2156
2157 fn control_handle(&self) -> &DeviceMonitorControlHandle {
2158 &self.control_handle
2159 }
2160
2161 fn drop_without_shutdown(mut self) {
2162 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2164 std::mem::forget(self);
2166 }
2167}
2168
2169impl DeviceMonitorSetCountryResponder {
2170 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2174 let _result = self.send_raw(status);
2175 if _result.is_err() {
2176 self.control_handle.shutdown();
2177 }
2178 self.drop_without_shutdown();
2179 _result
2180 }
2181
2182 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2184 let _result = self.send_raw(status);
2185 self.drop_without_shutdown();
2186 _result
2187 }
2188
2189 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2190 self.control_handle.inner.send::<DeviceMonitorSetCountryResponse>(
2191 (status,),
2192 self.tx_id,
2193 0xdaa7b77a5a6e71b,
2194 fidl::encoding::DynamicFlags::empty(),
2195 )
2196 }
2197}
2198
2199#[must_use = "FIDL methods require a response to be sent"]
2200#[derive(Debug)]
2201pub struct DeviceMonitorClearCountryResponder {
2202 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2203 tx_id: u32,
2204}
2205
2206impl std::ops::Drop for DeviceMonitorClearCountryResponder {
2210 fn drop(&mut self) {
2211 self.control_handle.shutdown();
2212 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2214 }
2215}
2216
2217impl fidl::endpoints::Responder for DeviceMonitorClearCountryResponder {
2218 type ControlHandle = DeviceMonitorControlHandle;
2219
2220 fn control_handle(&self) -> &DeviceMonitorControlHandle {
2221 &self.control_handle
2222 }
2223
2224 fn drop_without_shutdown(mut self) {
2225 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2227 std::mem::forget(self);
2229 }
2230}
2231
2232impl DeviceMonitorClearCountryResponder {
2233 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2237 let _result = self.send_raw(status);
2238 if _result.is_err() {
2239 self.control_handle.shutdown();
2240 }
2241 self.drop_without_shutdown();
2242 _result
2243 }
2244
2245 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2247 let _result = self.send_raw(status);
2248 self.drop_without_shutdown();
2249 _result
2250 }
2251
2252 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2253 self.control_handle.inner.send::<DeviceMonitorClearCountryResponse>(
2254 (status,),
2255 self.tx_id,
2256 0x66714d61103120e9,
2257 fidl::encoding::DynamicFlags::empty(),
2258 )
2259 }
2260}
2261
2262#[must_use = "FIDL methods require a response to be sent"]
2263#[derive(Debug)]
2264pub struct DeviceMonitorSetPowerSaveModeResponder {
2265 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2266 tx_id: u32,
2267}
2268
2269impl std::ops::Drop for DeviceMonitorSetPowerSaveModeResponder {
2273 fn drop(&mut self) {
2274 self.control_handle.shutdown();
2275 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2277 }
2278}
2279
2280impl fidl::endpoints::Responder for DeviceMonitorSetPowerSaveModeResponder {
2281 type ControlHandle = DeviceMonitorControlHandle;
2282
2283 fn control_handle(&self) -> &DeviceMonitorControlHandle {
2284 &self.control_handle
2285 }
2286
2287 fn drop_without_shutdown(mut self) {
2288 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2290 std::mem::forget(self);
2292 }
2293}
2294
2295impl DeviceMonitorSetPowerSaveModeResponder {
2296 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2300 let _result = self.send_raw(status);
2301 if _result.is_err() {
2302 self.control_handle.shutdown();
2303 }
2304 self.drop_without_shutdown();
2305 _result
2306 }
2307
2308 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2310 let _result = self.send_raw(status);
2311 self.drop_without_shutdown();
2312 _result
2313 }
2314
2315 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2316 self.control_handle.inner.send::<DeviceMonitorSetPowerSaveModeResponse>(
2317 (status,),
2318 self.tx_id,
2319 0x62202b4d360533bc,
2320 fidl::encoding::DynamicFlags::empty(),
2321 )
2322 }
2323}
2324
2325#[must_use = "FIDL methods require a response to be sent"]
2326#[derive(Debug)]
2327pub struct DeviceMonitorGetPowerSaveModeResponder {
2328 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2329 tx_id: u32,
2330}
2331
2332impl std::ops::Drop for DeviceMonitorGetPowerSaveModeResponder {
2336 fn drop(&mut self) {
2337 self.control_handle.shutdown();
2338 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2340 }
2341}
2342
2343impl fidl::endpoints::Responder for DeviceMonitorGetPowerSaveModeResponder {
2344 type ControlHandle = DeviceMonitorControlHandle;
2345
2346 fn control_handle(&self) -> &DeviceMonitorControlHandle {
2347 &self.control_handle
2348 }
2349
2350 fn drop_without_shutdown(mut self) {
2351 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2353 std::mem::forget(self);
2355 }
2356}
2357
2358impl DeviceMonitorGetPowerSaveModeResponder {
2359 pub fn send(
2363 self,
2364 mut result: Result<&GetPowerSaveModeResponse, i32>,
2365 ) -> Result<(), fidl::Error> {
2366 let _result = self.send_raw(result);
2367 if _result.is_err() {
2368 self.control_handle.shutdown();
2369 }
2370 self.drop_without_shutdown();
2371 _result
2372 }
2373
2374 pub fn send_no_shutdown_on_err(
2376 self,
2377 mut result: Result<&GetPowerSaveModeResponse, i32>,
2378 ) -> Result<(), fidl::Error> {
2379 let _result = self.send_raw(result);
2380 self.drop_without_shutdown();
2381 _result
2382 }
2383
2384 fn send_raw(
2385 &self,
2386 mut result: Result<&GetPowerSaveModeResponse, i32>,
2387 ) -> Result<(), fidl::Error> {
2388 self.control_handle.inner.send::<fidl::encoding::ResultType<
2389 DeviceMonitorGetPowerSaveModeResponse,
2390 i32,
2391 >>(
2392 result.map(|resp| (resp,)),
2393 self.tx_id,
2394 0x14304d406ada8693,
2395 fidl::encoding::DynamicFlags::empty(),
2396 )
2397 }
2398}
2399
2400#[must_use = "FIDL methods require a response to be sent"]
2401#[derive(Debug)]
2402pub struct DeviceMonitorCreateIfaceResponder {
2403 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2404 tx_id: u32,
2405}
2406
2407impl std::ops::Drop for DeviceMonitorCreateIfaceResponder {
2411 fn drop(&mut self) {
2412 self.control_handle.shutdown();
2413 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2415 }
2416}
2417
2418impl fidl::endpoints::Responder for DeviceMonitorCreateIfaceResponder {
2419 type ControlHandle = DeviceMonitorControlHandle;
2420
2421 fn control_handle(&self) -> &DeviceMonitorControlHandle {
2422 &self.control_handle
2423 }
2424
2425 fn drop_without_shutdown(mut self) {
2426 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2428 std::mem::forget(self);
2430 }
2431}
2432
2433impl DeviceMonitorCreateIfaceResponder {
2434 pub fn send(
2438 self,
2439 mut result: Result<&DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
2440 ) -> Result<(), fidl::Error> {
2441 let _result = self.send_raw(result);
2442 if _result.is_err() {
2443 self.control_handle.shutdown();
2444 }
2445 self.drop_without_shutdown();
2446 _result
2447 }
2448
2449 pub fn send_no_shutdown_on_err(
2451 self,
2452 mut result: Result<&DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
2453 ) -> Result<(), fidl::Error> {
2454 let _result = self.send_raw(result);
2455 self.drop_without_shutdown();
2456 _result
2457 }
2458
2459 fn send_raw(
2460 &self,
2461 mut result: Result<&DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
2462 ) -> Result<(), fidl::Error> {
2463 self.control_handle.inner.send::<fidl::encoding::ResultType<
2464 DeviceMonitorCreateIfaceResponse,
2465 DeviceMonitorError,
2466 >>(
2467 result,
2468 self.tx_id,
2469 0x1e1d30c24c0ec144,
2470 fidl::encoding::DynamicFlags::empty(),
2471 )
2472 }
2473}
2474
2475#[must_use = "FIDL methods require a response to be sent"]
2476#[derive(Debug)]
2477pub struct DeviceMonitorQueryIfaceResponder {
2478 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2479 tx_id: u32,
2480}
2481
2482impl std::ops::Drop for DeviceMonitorQueryIfaceResponder {
2486 fn drop(&mut self) {
2487 self.control_handle.shutdown();
2488 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2490 }
2491}
2492
2493impl fidl::endpoints::Responder for DeviceMonitorQueryIfaceResponder {
2494 type ControlHandle = DeviceMonitorControlHandle;
2495
2496 fn control_handle(&self) -> &DeviceMonitorControlHandle {
2497 &self.control_handle
2498 }
2499
2500 fn drop_without_shutdown(mut self) {
2501 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2503 std::mem::forget(self);
2505 }
2506}
2507
2508impl DeviceMonitorQueryIfaceResponder {
2509 pub fn send(self, mut result: Result<&QueryIfaceResponse, i32>) -> Result<(), fidl::Error> {
2513 let _result = self.send_raw(result);
2514 if _result.is_err() {
2515 self.control_handle.shutdown();
2516 }
2517 self.drop_without_shutdown();
2518 _result
2519 }
2520
2521 pub fn send_no_shutdown_on_err(
2523 self,
2524 mut result: Result<&QueryIfaceResponse, i32>,
2525 ) -> Result<(), fidl::Error> {
2526 let _result = self.send_raw(result);
2527 self.drop_without_shutdown();
2528 _result
2529 }
2530
2531 fn send_raw(&self, mut result: Result<&QueryIfaceResponse, i32>) -> Result<(), fidl::Error> {
2532 self.control_handle
2533 .inner
2534 .send::<fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>>(
2535 result.map(|resp| (resp,)),
2536 self.tx_id,
2537 0x1a48c4a2b86259ef,
2538 fidl::encoding::DynamicFlags::empty(),
2539 )
2540 }
2541}
2542
2543#[must_use = "FIDL methods require a response to be sent"]
2544#[derive(Debug)]
2545pub struct DeviceMonitorDestroyIfaceResponder {
2546 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2547 tx_id: u32,
2548}
2549
2550impl std::ops::Drop for DeviceMonitorDestroyIfaceResponder {
2554 fn drop(&mut self) {
2555 self.control_handle.shutdown();
2556 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2558 }
2559}
2560
2561impl fidl::endpoints::Responder for DeviceMonitorDestroyIfaceResponder {
2562 type ControlHandle = DeviceMonitorControlHandle;
2563
2564 fn control_handle(&self) -> &DeviceMonitorControlHandle {
2565 &self.control_handle
2566 }
2567
2568 fn drop_without_shutdown(mut self) {
2569 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2571 std::mem::forget(self);
2573 }
2574}
2575
2576impl DeviceMonitorDestroyIfaceResponder {
2577 pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
2581 let _result = self.send_raw(status);
2582 if _result.is_err() {
2583 self.control_handle.shutdown();
2584 }
2585 self.drop_without_shutdown();
2586 _result
2587 }
2588
2589 pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
2591 let _result = self.send_raw(status);
2592 self.drop_without_shutdown();
2593 _result
2594 }
2595
2596 fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
2597 self.control_handle.inner.send::<DeviceMonitorDestroyIfaceResponse>(
2598 (status,),
2599 self.tx_id,
2600 0x4c77982c1616a3b0,
2601 fidl::encoding::DynamicFlags::empty(),
2602 )
2603 }
2604}
2605
2606#[must_use = "FIDL methods require a response to be sent"]
2607#[derive(Debug)]
2608pub struct DeviceMonitorGetClientSmeResponder {
2609 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2610 tx_id: u32,
2611}
2612
2613impl std::ops::Drop for DeviceMonitorGetClientSmeResponder {
2617 fn drop(&mut self) {
2618 self.control_handle.shutdown();
2619 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2621 }
2622}
2623
2624impl fidl::endpoints::Responder for DeviceMonitorGetClientSmeResponder {
2625 type ControlHandle = DeviceMonitorControlHandle;
2626
2627 fn control_handle(&self) -> &DeviceMonitorControlHandle {
2628 &self.control_handle
2629 }
2630
2631 fn drop_without_shutdown(mut self) {
2632 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2634 std::mem::forget(self);
2636 }
2637}
2638
2639impl DeviceMonitorGetClientSmeResponder {
2640 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2644 let _result = self.send_raw(result);
2645 if _result.is_err() {
2646 self.control_handle.shutdown();
2647 }
2648 self.drop_without_shutdown();
2649 _result
2650 }
2651
2652 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2654 let _result = self.send_raw(result);
2655 self.drop_without_shutdown();
2656 _result
2657 }
2658
2659 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2660 self.control_handle
2661 .inner
2662 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2663 result,
2664 self.tx_id,
2665 0x1b056c379ca98273,
2666 fidl::encoding::DynamicFlags::empty(),
2667 )
2668 }
2669}
2670
2671#[must_use = "FIDL methods require a response to be sent"]
2672#[derive(Debug)]
2673pub struct DeviceMonitorGetApSmeResponder {
2674 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2675 tx_id: u32,
2676}
2677
2678impl std::ops::Drop for DeviceMonitorGetApSmeResponder {
2682 fn drop(&mut self) {
2683 self.control_handle.shutdown();
2684 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2686 }
2687}
2688
2689impl fidl::endpoints::Responder for DeviceMonitorGetApSmeResponder {
2690 type ControlHandle = DeviceMonitorControlHandle;
2691
2692 fn control_handle(&self) -> &DeviceMonitorControlHandle {
2693 &self.control_handle
2694 }
2695
2696 fn drop_without_shutdown(mut self) {
2697 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2699 std::mem::forget(self);
2701 }
2702}
2703
2704impl DeviceMonitorGetApSmeResponder {
2705 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2709 let _result = self.send_raw(result);
2710 if _result.is_err() {
2711 self.control_handle.shutdown();
2712 }
2713 self.drop_without_shutdown();
2714 _result
2715 }
2716
2717 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2719 let _result = self.send_raw(result);
2720 self.drop_without_shutdown();
2721 _result
2722 }
2723
2724 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2725 self.control_handle
2726 .inner
2727 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2728 result,
2729 self.tx_id,
2730 0x754de680c4318c52,
2731 fidl::encoding::DynamicFlags::empty(),
2732 )
2733 }
2734}
2735
2736#[must_use = "FIDL methods require a response to be sent"]
2737#[derive(Debug)]
2738pub struct DeviceMonitorGetSmeTelemetryResponder {
2739 control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2740 tx_id: u32,
2741}
2742
2743impl std::ops::Drop for DeviceMonitorGetSmeTelemetryResponder {
2747 fn drop(&mut self) {
2748 self.control_handle.shutdown();
2749 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2751 }
2752}
2753
2754impl fidl::endpoints::Responder for DeviceMonitorGetSmeTelemetryResponder {
2755 type ControlHandle = DeviceMonitorControlHandle;
2756
2757 fn control_handle(&self) -> &DeviceMonitorControlHandle {
2758 &self.control_handle
2759 }
2760
2761 fn drop_without_shutdown(mut self) {
2762 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2764 std::mem::forget(self);
2766 }
2767}
2768
2769impl DeviceMonitorGetSmeTelemetryResponder {
2770 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2774 let _result = self.send_raw(result);
2775 if _result.is_err() {
2776 self.control_handle.shutdown();
2777 }
2778 self.drop_without_shutdown();
2779 _result
2780 }
2781
2782 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2784 let _result = self.send_raw(result);
2785 self.drop_without_shutdown();
2786 _result
2787 }
2788
2789 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2790 self.control_handle
2791 .inner
2792 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2793 result,
2794 self.tx_id,
2795 0x1baf42b003f7452a,
2796 fidl::encoding::DynamicFlags::empty(),
2797 )
2798 }
2799}
2800
2801#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2802pub struct DeviceWatcherMarker;
2803
2804impl fidl::endpoints::ProtocolMarker for DeviceWatcherMarker {
2805 type Proxy = DeviceWatcherProxy;
2806 type RequestStream = DeviceWatcherRequestStream;
2807 #[cfg(target_os = "fuchsia")]
2808 type SynchronousProxy = DeviceWatcherSynchronousProxy;
2809
2810 const DEBUG_NAME: &'static str = "(anonymous) DeviceWatcher";
2811}
2812
2813pub trait DeviceWatcherProxyInterface: Send + Sync {}
2814#[derive(Debug)]
2815#[cfg(target_os = "fuchsia")]
2816pub struct DeviceWatcherSynchronousProxy {
2817 client: fidl::client::sync::Client,
2818}
2819
2820#[cfg(target_os = "fuchsia")]
2821impl fidl::endpoints::SynchronousProxy for DeviceWatcherSynchronousProxy {
2822 type Proxy = DeviceWatcherProxy;
2823 type Protocol = DeviceWatcherMarker;
2824
2825 fn from_channel(inner: fidl::Channel) -> Self {
2826 Self::new(inner)
2827 }
2828
2829 fn into_channel(self) -> fidl::Channel {
2830 self.client.into_channel()
2831 }
2832
2833 fn as_channel(&self) -> &fidl::Channel {
2834 self.client.as_channel()
2835 }
2836}
2837
2838#[cfg(target_os = "fuchsia")]
2839impl DeviceWatcherSynchronousProxy {
2840 pub fn new(channel: fidl::Channel) -> Self {
2841 let protocol_name = <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2842 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2843 }
2844
2845 pub fn into_channel(self) -> fidl::Channel {
2846 self.client.into_channel()
2847 }
2848
2849 pub fn wait_for_event(
2852 &self,
2853 deadline: zx::MonotonicInstant,
2854 ) -> Result<DeviceWatcherEvent, fidl::Error> {
2855 DeviceWatcherEvent::decode(self.client.wait_for_event(deadline)?)
2856 }
2857}
2858
2859#[cfg(target_os = "fuchsia")]
2860impl From<DeviceWatcherSynchronousProxy> for zx::Handle {
2861 fn from(value: DeviceWatcherSynchronousProxy) -> Self {
2862 value.into_channel().into()
2863 }
2864}
2865
2866#[cfg(target_os = "fuchsia")]
2867impl From<fidl::Channel> for DeviceWatcherSynchronousProxy {
2868 fn from(value: fidl::Channel) -> Self {
2869 Self::new(value)
2870 }
2871}
2872
2873#[derive(Debug, Clone)]
2874pub struct DeviceWatcherProxy {
2875 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2876}
2877
2878impl fidl::endpoints::Proxy for DeviceWatcherProxy {
2879 type Protocol = DeviceWatcherMarker;
2880
2881 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2882 Self::new(inner)
2883 }
2884
2885 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2886 self.client.into_channel().map_err(|client| Self { client })
2887 }
2888
2889 fn as_channel(&self) -> &::fidl::AsyncChannel {
2890 self.client.as_channel()
2891 }
2892}
2893
2894impl DeviceWatcherProxy {
2895 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2897 let protocol_name = <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2898 Self { client: fidl::client::Client::new(channel, protocol_name) }
2899 }
2900
2901 pub fn take_event_stream(&self) -> DeviceWatcherEventStream {
2907 DeviceWatcherEventStream { event_receiver: self.client.take_event_receiver() }
2908 }
2909}
2910
2911impl DeviceWatcherProxyInterface for DeviceWatcherProxy {}
2912
2913pub struct DeviceWatcherEventStream {
2914 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2915}
2916
2917impl std::marker::Unpin for DeviceWatcherEventStream {}
2918
2919impl futures::stream::FusedStream for DeviceWatcherEventStream {
2920 fn is_terminated(&self) -> bool {
2921 self.event_receiver.is_terminated()
2922 }
2923}
2924
2925impl futures::Stream for DeviceWatcherEventStream {
2926 type Item = Result<DeviceWatcherEvent, fidl::Error>;
2927
2928 fn poll_next(
2929 mut self: std::pin::Pin<&mut Self>,
2930 cx: &mut std::task::Context<'_>,
2931 ) -> std::task::Poll<Option<Self::Item>> {
2932 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2933 &mut self.event_receiver,
2934 cx
2935 )?) {
2936 Some(buf) => std::task::Poll::Ready(Some(DeviceWatcherEvent::decode(buf))),
2937 None => std::task::Poll::Ready(None),
2938 }
2939 }
2940}
2941
2942#[derive(Debug)]
2943pub enum DeviceWatcherEvent {
2944 OnPhyAdded { phy_id: u16 },
2945 OnPhyRemoved { phy_id: u16 },
2946 OnIfaceAdded { iface_id: u16 },
2947 OnIfaceRemoved { iface_id: u16 },
2948}
2949
2950impl DeviceWatcherEvent {
2951 #[allow(irrefutable_let_patterns)]
2952 pub fn into_on_phy_added(self) -> Option<u16> {
2953 if let DeviceWatcherEvent::OnPhyAdded { phy_id } = self {
2954 Some((phy_id))
2955 } else {
2956 None
2957 }
2958 }
2959 #[allow(irrefutable_let_patterns)]
2960 pub fn into_on_phy_removed(self) -> Option<u16> {
2961 if let DeviceWatcherEvent::OnPhyRemoved { phy_id } = self {
2962 Some((phy_id))
2963 } else {
2964 None
2965 }
2966 }
2967 #[allow(irrefutable_let_patterns)]
2968 pub fn into_on_iface_added(self) -> Option<u16> {
2969 if let DeviceWatcherEvent::OnIfaceAdded { iface_id } = self {
2970 Some((iface_id))
2971 } else {
2972 None
2973 }
2974 }
2975 #[allow(irrefutable_let_patterns)]
2976 pub fn into_on_iface_removed(self) -> Option<u16> {
2977 if let DeviceWatcherEvent::OnIfaceRemoved { iface_id } = self {
2978 Some((iface_id))
2979 } else {
2980 None
2981 }
2982 }
2983
2984 fn decode(
2986 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2987 ) -> Result<DeviceWatcherEvent, fidl::Error> {
2988 let (bytes, _handles) = buf.split_mut();
2989 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2990 debug_assert_eq!(tx_header.tx_id, 0);
2991 match tx_header.ordinal {
2992 0x771c58e0bd059f86 => {
2993 let mut out = fidl::new_empty!(
2994 DeviceWatcherOnPhyAddedRequest,
2995 fidl::encoding::DefaultFuchsiaResourceDialect
2996 );
2997 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnPhyAddedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
2998 Ok((DeviceWatcherEvent::OnPhyAdded { phy_id: out.phy_id }))
2999 }
3000 0x4ad72b96ccb7cff6 => {
3001 let mut out = fidl::new_empty!(
3002 DeviceWatcherOnPhyRemovedRequest,
3003 fidl::encoding::DefaultFuchsiaResourceDialect
3004 );
3005 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnPhyRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3006 Ok((DeviceWatcherEvent::OnPhyRemoved { phy_id: out.phy_id }))
3007 }
3008 0x6ee685e4aa1f31d8 => {
3009 let mut out = fidl::new_empty!(
3010 DeviceWatcherOnIfaceAddedRequest,
3011 fidl::encoding::DefaultFuchsiaResourceDialect
3012 );
3013 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnIfaceAddedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3014 Ok((DeviceWatcherEvent::OnIfaceAdded { iface_id: out.iface_id }))
3015 }
3016 0x3b771b1fce38c291 => {
3017 let mut out = fidl::new_empty!(
3018 DeviceWatcherOnIfaceRemovedRequest,
3019 fidl::encoding::DefaultFuchsiaResourceDialect
3020 );
3021 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnIfaceRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3022 Ok((DeviceWatcherEvent::OnIfaceRemoved { iface_id: out.iface_id }))
3023 }
3024 _ => Err(fidl::Error::UnknownOrdinal {
3025 ordinal: tx_header.ordinal,
3026 protocol_name: <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3027 }),
3028 }
3029 }
3030}
3031
3032pub struct DeviceWatcherRequestStream {
3034 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3035 is_terminated: bool,
3036}
3037
3038impl std::marker::Unpin for DeviceWatcherRequestStream {}
3039
3040impl futures::stream::FusedStream for DeviceWatcherRequestStream {
3041 fn is_terminated(&self) -> bool {
3042 self.is_terminated
3043 }
3044}
3045
3046impl fidl::endpoints::RequestStream for DeviceWatcherRequestStream {
3047 type Protocol = DeviceWatcherMarker;
3048 type ControlHandle = DeviceWatcherControlHandle;
3049
3050 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3051 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3052 }
3053
3054 fn control_handle(&self) -> Self::ControlHandle {
3055 DeviceWatcherControlHandle { inner: self.inner.clone() }
3056 }
3057
3058 fn into_inner(
3059 self,
3060 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3061 {
3062 (self.inner, self.is_terminated)
3063 }
3064
3065 fn from_inner(
3066 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3067 is_terminated: bool,
3068 ) -> Self {
3069 Self { inner, is_terminated }
3070 }
3071}
3072
3073impl futures::Stream for DeviceWatcherRequestStream {
3074 type Item = Result<DeviceWatcherRequest, fidl::Error>;
3075
3076 fn poll_next(
3077 mut self: std::pin::Pin<&mut Self>,
3078 cx: &mut std::task::Context<'_>,
3079 ) -> std::task::Poll<Option<Self::Item>> {
3080 let this = &mut *self;
3081 if this.inner.check_shutdown(cx) {
3082 this.is_terminated = true;
3083 return std::task::Poll::Ready(None);
3084 }
3085 if this.is_terminated {
3086 panic!("polled DeviceWatcherRequestStream after completion");
3087 }
3088 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3089 |bytes, handles| {
3090 match this.inner.channel().read_etc(cx, bytes, handles) {
3091 std::task::Poll::Ready(Ok(())) => {}
3092 std::task::Poll::Pending => return std::task::Poll::Pending,
3093 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3094 this.is_terminated = true;
3095 return std::task::Poll::Ready(None);
3096 }
3097 std::task::Poll::Ready(Err(e)) => {
3098 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3099 e.into(),
3100 ))))
3101 }
3102 }
3103
3104 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3106
3107 std::task::Poll::Ready(Some(match header.ordinal {
3108 _ => Err(fidl::Error::UnknownOrdinal {
3109 ordinal: header.ordinal,
3110 protocol_name:
3111 <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3112 }),
3113 }))
3114 },
3115 )
3116 }
3117}
3118
3119#[derive(Debug)]
3120pub enum DeviceWatcherRequest {}
3121
3122impl DeviceWatcherRequest {
3123 pub fn method_name(&self) -> &'static str {
3125 match *self {}
3126 }
3127}
3128
3129#[derive(Debug, Clone)]
3130pub struct DeviceWatcherControlHandle {
3131 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3132}
3133
3134impl fidl::endpoints::ControlHandle for DeviceWatcherControlHandle {
3135 fn shutdown(&self) {
3136 self.inner.shutdown()
3137 }
3138 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3139 self.inner.shutdown_with_epitaph(status)
3140 }
3141
3142 fn is_closed(&self) -> bool {
3143 self.inner.channel().is_closed()
3144 }
3145 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3146 self.inner.channel().on_closed()
3147 }
3148
3149 #[cfg(target_os = "fuchsia")]
3150 fn signal_peer(
3151 &self,
3152 clear_mask: zx::Signals,
3153 set_mask: zx::Signals,
3154 ) -> Result<(), zx_status::Status> {
3155 use fidl::Peered;
3156 self.inner.channel().signal_peer(clear_mask, set_mask)
3157 }
3158}
3159
3160impl DeviceWatcherControlHandle {
3161 pub fn send_on_phy_added(&self, mut phy_id: u16) -> Result<(), fidl::Error> {
3162 self.inner.send::<DeviceWatcherOnPhyAddedRequest>(
3163 (phy_id,),
3164 0,
3165 0x771c58e0bd059f86,
3166 fidl::encoding::DynamicFlags::empty(),
3167 )
3168 }
3169
3170 pub fn send_on_phy_removed(&self, mut phy_id: u16) -> Result<(), fidl::Error> {
3171 self.inner.send::<DeviceWatcherOnPhyRemovedRequest>(
3172 (phy_id,),
3173 0,
3174 0x4ad72b96ccb7cff6,
3175 fidl::encoding::DynamicFlags::empty(),
3176 )
3177 }
3178
3179 pub fn send_on_iface_added(&self, mut iface_id: u16) -> Result<(), fidl::Error> {
3180 self.inner.send::<DeviceWatcherOnIfaceAddedRequest>(
3181 (iface_id,),
3182 0,
3183 0x6ee685e4aa1f31d8,
3184 fidl::encoding::DynamicFlags::empty(),
3185 )
3186 }
3187
3188 pub fn send_on_iface_removed(&self, mut iface_id: u16) -> Result<(), fidl::Error> {
3189 self.inner.send::<DeviceWatcherOnIfaceRemovedRequest>(
3190 (iface_id,),
3191 0,
3192 0x3b771b1fce38c291,
3193 fidl::encoding::DynamicFlags::empty(),
3194 )
3195 }
3196}
3197
3198mod internal {
3199 use super::*;
3200
3201 impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetApSmeRequest {
3202 type Borrowed<'a> = &'a mut Self;
3203 fn take_or_borrow<'a>(
3204 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3205 ) -> Self::Borrowed<'a> {
3206 value
3207 }
3208 }
3209
3210 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetApSmeRequest {
3211 type Owned = Self;
3212
3213 #[inline(always)]
3214 fn inline_align(_context: fidl::encoding::Context) -> usize {
3215 4
3216 }
3217
3218 #[inline(always)]
3219 fn inline_size(_context: fidl::encoding::Context) -> usize {
3220 8
3221 }
3222 }
3223
3224 unsafe impl
3225 fidl::encoding::Encode<
3226 DeviceMonitorGetApSmeRequest,
3227 fidl::encoding::DefaultFuchsiaResourceDialect,
3228 > for &mut DeviceMonitorGetApSmeRequest
3229 {
3230 #[inline]
3231 unsafe fn encode(
3232 self,
3233 encoder: &mut fidl::encoding::Encoder<
3234 '_,
3235 fidl::encoding::DefaultFuchsiaResourceDialect,
3236 >,
3237 offset: usize,
3238 _depth: fidl::encoding::Depth,
3239 ) -> fidl::Result<()> {
3240 encoder.debug_check_bounds::<DeviceMonitorGetApSmeRequest>(offset);
3241 fidl::encoding::Encode::<
3243 DeviceMonitorGetApSmeRequest,
3244 fidl::encoding::DefaultFuchsiaResourceDialect,
3245 >::encode(
3246 (
3247 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
3248 <fidl::encoding::Endpoint<
3249 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
3250 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3251 &mut self.sme_server
3252 ),
3253 ),
3254 encoder,
3255 offset,
3256 _depth,
3257 )
3258 }
3259 }
3260 unsafe impl<
3261 T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
3262 T1: fidl::encoding::Encode<
3263 fidl::encoding::Endpoint<
3264 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
3265 >,
3266 fidl::encoding::DefaultFuchsiaResourceDialect,
3267 >,
3268 >
3269 fidl::encoding::Encode<
3270 DeviceMonitorGetApSmeRequest,
3271 fidl::encoding::DefaultFuchsiaResourceDialect,
3272 > for (T0, T1)
3273 {
3274 #[inline]
3275 unsafe fn encode(
3276 self,
3277 encoder: &mut fidl::encoding::Encoder<
3278 '_,
3279 fidl::encoding::DefaultFuchsiaResourceDialect,
3280 >,
3281 offset: usize,
3282 depth: fidl::encoding::Depth,
3283 ) -> fidl::Result<()> {
3284 encoder.debug_check_bounds::<DeviceMonitorGetApSmeRequest>(offset);
3285 unsafe {
3288 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3289 (ptr as *mut u32).write_unaligned(0);
3290 }
3291 self.0.encode(encoder, offset + 0, depth)?;
3293 self.1.encode(encoder, offset + 4, depth)?;
3294 Ok(())
3295 }
3296 }
3297
3298 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3299 for DeviceMonitorGetApSmeRequest
3300 {
3301 #[inline(always)]
3302 fn new_empty() -> Self {
3303 Self {
3304 iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
3305 sme_server: fidl::new_empty!(
3306 fidl::encoding::Endpoint<
3307 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
3308 >,
3309 fidl::encoding::DefaultFuchsiaResourceDialect
3310 ),
3311 }
3312 }
3313
3314 #[inline]
3315 unsafe fn decode(
3316 &mut self,
3317 decoder: &mut fidl::encoding::Decoder<
3318 '_,
3319 fidl::encoding::DefaultFuchsiaResourceDialect,
3320 >,
3321 offset: usize,
3322 _depth: fidl::encoding::Depth,
3323 ) -> fidl::Result<()> {
3324 decoder.debug_check_bounds::<Self>(offset);
3325 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3327 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3328 let mask = 0xffff0000u32;
3329 let maskedval = padval & mask;
3330 if maskedval != 0 {
3331 return Err(fidl::Error::NonZeroPadding {
3332 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3333 });
3334 }
3335 fidl::decode!(
3336 u16,
3337 fidl::encoding::DefaultFuchsiaResourceDialect,
3338 &mut self.iface_id,
3339 decoder,
3340 offset + 0,
3341 _depth
3342 )?;
3343 fidl::decode!(
3344 fidl::encoding::Endpoint<
3345 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
3346 >,
3347 fidl::encoding::DefaultFuchsiaResourceDialect,
3348 &mut self.sme_server,
3349 decoder,
3350 offset + 4,
3351 _depth
3352 )?;
3353 Ok(())
3354 }
3355 }
3356
3357 impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetClientSmeRequest {
3358 type Borrowed<'a> = &'a mut Self;
3359 fn take_or_borrow<'a>(
3360 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3361 ) -> Self::Borrowed<'a> {
3362 value
3363 }
3364 }
3365
3366 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetClientSmeRequest {
3367 type Owned = Self;
3368
3369 #[inline(always)]
3370 fn inline_align(_context: fidl::encoding::Context) -> usize {
3371 4
3372 }
3373
3374 #[inline(always)]
3375 fn inline_size(_context: fidl::encoding::Context) -> usize {
3376 8
3377 }
3378 }
3379
3380 unsafe impl
3381 fidl::encoding::Encode<
3382 DeviceMonitorGetClientSmeRequest,
3383 fidl::encoding::DefaultFuchsiaResourceDialect,
3384 > for &mut DeviceMonitorGetClientSmeRequest
3385 {
3386 #[inline]
3387 unsafe fn encode(
3388 self,
3389 encoder: &mut fidl::encoding::Encoder<
3390 '_,
3391 fidl::encoding::DefaultFuchsiaResourceDialect,
3392 >,
3393 offset: usize,
3394 _depth: fidl::encoding::Depth,
3395 ) -> fidl::Result<()> {
3396 encoder.debug_check_bounds::<DeviceMonitorGetClientSmeRequest>(offset);
3397 fidl::encoding::Encode::<
3399 DeviceMonitorGetClientSmeRequest,
3400 fidl::encoding::DefaultFuchsiaResourceDialect,
3401 >::encode(
3402 (
3403 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
3404 <fidl::encoding::Endpoint<
3405 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
3406 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3407 &mut self.sme_server
3408 ),
3409 ),
3410 encoder,
3411 offset,
3412 _depth,
3413 )
3414 }
3415 }
3416 unsafe impl<
3417 T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
3418 T1: fidl::encoding::Encode<
3419 fidl::encoding::Endpoint<
3420 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
3421 >,
3422 fidl::encoding::DefaultFuchsiaResourceDialect,
3423 >,
3424 >
3425 fidl::encoding::Encode<
3426 DeviceMonitorGetClientSmeRequest,
3427 fidl::encoding::DefaultFuchsiaResourceDialect,
3428 > for (T0, T1)
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::<DeviceMonitorGetClientSmeRequest>(offset);
3441 unsafe {
3444 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3445 (ptr as *mut u32).write_unaligned(0);
3446 }
3447 self.0.encode(encoder, offset + 0, depth)?;
3449 self.1.encode(encoder, offset + 4, depth)?;
3450 Ok(())
3451 }
3452 }
3453
3454 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3455 for DeviceMonitorGetClientSmeRequest
3456 {
3457 #[inline(always)]
3458 fn new_empty() -> Self {
3459 Self {
3460 iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
3461 sme_server: fidl::new_empty!(
3462 fidl::encoding::Endpoint<
3463 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
3464 >,
3465 fidl::encoding::DefaultFuchsiaResourceDialect
3466 ),
3467 }
3468 }
3469
3470 #[inline]
3471 unsafe fn decode(
3472 &mut self,
3473 decoder: &mut fidl::encoding::Decoder<
3474 '_,
3475 fidl::encoding::DefaultFuchsiaResourceDialect,
3476 >,
3477 offset: usize,
3478 _depth: fidl::encoding::Depth,
3479 ) -> fidl::Result<()> {
3480 decoder.debug_check_bounds::<Self>(offset);
3481 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3483 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3484 let mask = 0xffff0000u32;
3485 let maskedval = padval & mask;
3486 if maskedval != 0 {
3487 return Err(fidl::Error::NonZeroPadding {
3488 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3489 });
3490 }
3491 fidl::decode!(
3492 u16,
3493 fidl::encoding::DefaultFuchsiaResourceDialect,
3494 &mut self.iface_id,
3495 decoder,
3496 offset + 0,
3497 _depth
3498 )?;
3499 fidl::decode!(
3500 fidl::encoding::Endpoint<
3501 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
3502 >,
3503 fidl::encoding::DefaultFuchsiaResourceDialect,
3504 &mut self.sme_server,
3505 decoder,
3506 offset + 4,
3507 _depth
3508 )?;
3509 Ok(())
3510 }
3511 }
3512
3513 impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetSmeTelemetryRequest {
3514 type Borrowed<'a> = &'a mut Self;
3515 fn take_or_borrow<'a>(
3516 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3517 ) -> Self::Borrowed<'a> {
3518 value
3519 }
3520 }
3521
3522 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetSmeTelemetryRequest {
3523 type Owned = Self;
3524
3525 #[inline(always)]
3526 fn inline_align(_context: fidl::encoding::Context) -> usize {
3527 4
3528 }
3529
3530 #[inline(always)]
3531 fn inline_size(_context: fidl::encoding::Context) -> usize {
3532 8
3533 }
3534 }
3535
3536 unsafe impl
3537 fidl::encoding::Encode<
3538 DeviceMonitorGetSmeTelemetryRequest,
3539 fidl::encoding::DefaultFuchsiaResourceDialect,
3540 > for &mut DeviceMonitorGetSmeTelemetryRequest
3541 {
3542 #[inline]
3543 unsafe fn encode(
3544 self,
3545 encoder: &mut fidl::encoding::Encoder<
3546 '_,
3547 fidl::encoding::DefaultFuchsiaResourceDialect,
3548 >,
3549 offset: usize,
3550 _depth: fidl::encoding::Depth,
3551 ) -> fidl::Result<()> {
3552 encoder.debug_check_bounds::<DeviceMonitorGetSmeTelemetryRequest>(offset);
3553 fidl::encoding::Encode::<
3555 DeviceMonitorGetSmeTelemetryRequest,
3556 fidl::encoding::DefaultFuchsiaResourceDialect,
3557 >::encode(
3558 (
3559 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
3560 <fidl::encoding::Endpoint<
3561 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
3562 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3563 &mut self.telemetry_server,
3564 ),
3565 ),
3566 encoder,
3567 offset,
3568 _depth,
3569 )
3570 }
3571 }
3572 unsafe impl<
3573 T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
3574 T1: fidl::encoding::Encode<
3575 fidl::encoding::Endpoint<
3576 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
3577 >,
3578 fidl::encoding::DefaultFuchsiaResourceDialect,
3579 >,
3580 >
3581 fidl::encoding::Encode<
3582 DeviceMonitorGetSmeTelemetryRequest,
3583 fidl::encoding::DefaultFuchsiaResourceDialect,
3584 > for (T0, T1)
3585 {
3586 #[inline]
3587 unsafe fn encode(
3588 self,
3589 encoder: &mut fidl::encoding::Encoder<
3590 '_,
3591 fidl::encoding::DefaultFuchsiaResourceDialect,
3592 >,
3593 offset: usize,
3594 depth: fidl::encoding::Depth,
3595 ) -> fidl::Result<()> {
3596 encoder.debug_check_bounds::<DeviceMonitorGetSmeTelemetryRequest>(offset);
3597 unsafe {
3600 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3601 (ptr as *mut u32).write_unaligned(0);
3602 }
3603 self.0.encode(encoder, offset + 0, depth)?;
3605 self.1.encode(encoder, offset + 4, depth)?;
3606 Ok(())
3607 }
3608 }
3609
3610 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3611 for DeviceMonitorGetSmeTelemetryRequest
3612 {
3613 #[inline(always)]
3614 fn new_empty() -> Self {
3615 Self {
3616 iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
3617 telemetry_server: fidl::new_empty!(
3618 fidl::encoding::Endpoint<
3619 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
3620 >,
3621 fidl::encoding::DefaultFuchsiaResourceDialect
3622 ),
3623 }
3624 }
3625
3626 #[inline]
3627 unsafe fn decode(
3628 &mut self,
3629 decoder: &mut fidl::encoding::Decoder<
3630 '_,
3631 fidl::encoding::DefaultFuchsiaResourceDialect,
3632 >,
3633 offset: usize,
3634 _depth: fidl::encoding::Depth,
3635 ) -> fidl::Result<()> {
3636 decoder.debug_check_bounds::<Self>(offset);
3637 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3639 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3640 let mask = 0xffff0000u32;
3641 let maskedval = padval & mask;
3642 if maskedval != 0 {
3643 return Err(fidl::Error::NonZeroPadding {
3644 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3645 });
3646 }
3647 fidl::decode!(
3648 u16,
3649 fidl::encoding::DefaultFuchsiaResourceDialect,
3650 &mut self.iface_id,
3651 decoder,
3652 offset + 0,
3653 _depth
3654 )?;
3655 fidl::decode!(
3656 fidl::encoding::Endpoint<
3657 fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
3658 >,
3659 fidl::encoding::DefaultFuchsiaResourceDialect,
3660 &mut self.telemetry_server,
3661 decoder,
3662 offset + 4,
3663 _depth
3664 )?;
3665 Ok(())
3666 }
3667 }
3668
3669 impl fidl::encoding::ResourceTypeMarker for DeviceMonitorWatchDevicesRequest {
3670 type Borrowed<'a> = &'a mut Self;
3671 fn take_or_borrow<'a>(
3672 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3673 ) -> Self::Borrowed<'a> {
3674 value
3675 }
3676 }
3677
3678 unsafe impl fidl::encoding::TypeMarker for DeviceMonitorWatchDevicesRequest {
3679 type Owned = Self;
3680
3681 #[inline(always)]
3682 fn inline_align(_context: fidl::encoding::Context) -> usize {
3683 4
3684 }
3685
3686 #[inline(always)]
3687 fn inline_size(_context: fidl::encoding::Context) -> usize {
3688 4
3689 }
3690 }
3691
3692 unsafe impl
3693 fidl::encoding::Encode<
3694 DeviceMonitorWatchDevicesRequest,
3695 fidl::encoding::DefaultFuchsiaResourceDialect,
3696 > for &mut DeviceMonitorWatchDevicesRequest
3697 {
3698 #[inline]
3699 unsafe fn encode(
3700 self,
3701 encoder: &mut fidl::encoding::Encoder<
3702 '_,
3703 fidl::encoding::DefaultFuchsiaResourceDialect,
3704 >,
3705 offset: usize,
3706 _depth: fidl::encoding::Depth,
3707 ) -> fidl::Result<()> {
3708 encoder.debug_check_bounds::<DeviceMonitorWatchDevicesRequest>(offset);
3709 fidl::encoding::Encode::<DeviceMonitorWatchDevicesRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3711 (
3712 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
3713 ),
3714 encoder, offset, _depth
3715 )
3716 }
3717 }
3718 unsafe impl<
3719 T0: fidl::encoding::Encode<
3720 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
3721 fidl::encoding::DefaultFuchsiaResourceDialect,
3722 >,
3723 >
3724 fidl::encoding::Encode<
3725 DeviceMonitorWatchDevicesRequest,
3726 fidl::encoding::DefaultFuchsiaResourceDialect,
3727 > for (T0,)
3728 {
3729 #[inline]
3730 unsafe fn encode(
3731 self,
3732 encoder: &mut fidl::encoding::Encoder<
3733 '_,
3734 fidl::encoding::DefaultFuchsiaResourceDialect,
3735 >,
3736 offset: usize,
3737 depth: fidl::encoding::Depth,
3738 ) -> fidl::Result<()> {
3739 encoder.debug_check_bounds::<DeviceMonitorWatchDevicesRequest>(offset);
3740 self.0.encode(encoder, offset + 0, depth)?;
3744 Ok(())
3745 }
3746 }
3747
3748 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3749 for DeviceMonitorWatchDevicesRequest
3750 {
3751 #[inline(always)]
3752 fn new_empty() -> Self {
3753 Self {
3754 watcher: fidl::new_empty!(
3755 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
3756 fidl::encoding::DefaultFuchsiaResourceDialect
3757 ),
3758 }
3759 }
3760
3761 #[inline]
3762 unsafe fn decode(
3763 &mut self,
3764 decoder: &mut fidl::encoding::Decoder<
3765 '_,
3766 fidl::encoding::DefaultFuchsiaResourceDialect,
3767 >,
3768 offset: usize,
3769 _depth: fidl::encoding::Depth,
3770 ) -> fidl::Result<()> {
3771 decoder.debug_check_bounds::<Self>(offset);
3772 fidl::decode!(
3774 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
3775 fidl::encoding::DefaultFuchsiaResourceDialect,
3776 &mut self.watcher,
3777 decoder,
3778 offset + 0,
3779 _depth
3780 )?;
3781 Ok(())
3782 }
3783 }
3784}