1 use bt_topshim::btif::{
2     BtAddrType, BtBondState, BtConnectionState, BtDeviceType, BtDiscMode, BtPropertyType,
3     BtSspVariant, BtStatus, BtTransport, BtVendorProductInfo, DisplayAddress, DisplayUuid,
4     RawAddress, Uuid,
5 };
6 use bt_topshim::profiles::socket::SocketType;
7 use bt_topshim::profiles::ProfileConnectionState;
8 
9 use bt_topshim::profiles::hfp::EscoCodingFormat;
10 
11 use bt_topshim::profiles::hid_host::BthhReportType;
12 
13 use bt_topshim::profiles::sdp::{
14     BtSdpDipRecord, BtSdpHeaderOverlay, BtSdpMasRecord, BtSdpMnsRecord, BtSdpMpsRecord,
15     BtSdpOpsRecord, BtSdpPceRecord, BtSdpPseRecord, BtSdpRecord, BtSdpSapRecord, BtSdpType,
16     SupportedDependencies, SupportedFormatsList, SupportedScenarios,
17 };
18 
19 use btstack::bluetooth::{
20     Bluetooth, BluetoothDevice, BtAdapterRole, IBluetooth, IBluetoothCallback,
21     IBluetoothConnectionCallback, IBluetoothQALegacy,
22 };
23 use btstack::socket_manager::{
24     BluetoothServerSocket, BluetoothSocket, BluetoothSocketManager, CallbackId,
25     IBluetoothSocketManager, IBluetoothSocketManagerCallbacks, SocketId, SocketResult,
26 };
27 use btstack::suspend::{ISuspend, ISuspendCallback, Suspend, SuspendType};
28 use btstack::RPCProxy;
29 
30 use dbus::arg::RefArg;
31 use dbus::nonblock::SyncConnection;
32 use dbus::strings::Path;
33 use dbus_macros::{dbus_method, dbus_propmap, dbus_proxy_obj, generate_dbus_exporter};
34 
35 use dbus_projection::prelude::*;
36 
37 use num_traits::cast::{FromPrimitive, ToPrimitive};
38 
39 use std::convert::{TryFrom, TryInto};
40 use std::sync::{Arc, Mutex};
41 
42 use crate::dbus_arg::{DBusArg, DBusArgError, DirectDBus, RefArgToRust};
43 
44 // Represents Uuid as an array in D-Bus.
45 impl DBusArg for Uuid {
46     type DBusType = Vec<u8>;
from_dbus( data: Vec<u8>, _conn: Option<Arc<SyncConnection>>, _remote: Option<dbus::strings::BusName<'static>>, _disconnect_watcher: Option<Arc<Mutex<dbus_projection::DisconnectWatcher>>>, ) -> Result<Uuid, Box<dyn std::error::Error>>47     fn from_dbus(
48         data: Vec<u8>,
49         _conn: Option<Arc<SyncConnection>>,
50         _remote: Option<dbus::strings::BusName<'static>>,
51         _disconnect_watcher: Option<Arc<Mutex<dbus_projection::DisconnectWatcher>>>,
52     ) -> Result<Uuid, Box<dyn std::error::Error>> {
53         Ok(Uuid::try_from(data.clone()).map_err(|_| {
54             format!("Invalid Uuid: first 4 bytes={:?}", data.iter().take(4).collect::<Vec<_>>())
55         })?)
56     }
57 
to_dbus(data: Uuid) -> Result<Vec<u8>, Box<dyn std::error::Error>>58     fn to_dbus(data: Uuid) -> Result<Vec<u8>, Box<dyn std::error::Error>> {
59         Ok(data.try_into()?)
60     }
61 
log(data: &Uuid) -> String62     fn log(data: &Uuid) -> String {
63         format!("{}", DisplayUuid(data))
64     }
65 }
66 
67 impl_dbus_arg_from_into!(BtStatus, u32);
68 
69 /// A mixin of the several interfaces. The naming of the fields in the mixin must match
70 /// what is listed in the `generate_dbus_exporter` invocation.
71 #[derive(Clone)]
72 pub struct BluetoothMixin {
73     pub adapter: Arc<Mutex<Box<Bluetooth>>>,
74     pub qa: Arc<Mutex<Box<Bluetooth>>>,
75     pub suspend: Arc<Mutex<Box<Suspend>>>,
76     pub socket_mgr: Arc<Mutex<Box<BluetoothSocketManager>>>,
77 }
78 
79 #[dbus_propmap(BluetoothDevice)]
80 pub struct BluetoothDeviceDBus {
81     address: RawAddress,
82     name: String,
83 }
84 
85 #[allow(dead_code)]
86 struct BluetoothCallbackDBus {}
87 
88 #[dbus_proxy_obj(BluetoothCallback, "org.chromium.bluetooth.BluetoothCallback")]
89 impl IBluetoothCallback for BluetoothCallbackDBus {
90     #[dbus_method("OnAdapterPropertyChanged")]
on_adapter_property_changed(&mut self, prop: BtPropertyType)91     fn on_adapter_property_changed(&mut self, prop: BtPropertyType) {
92         dbus_generated!()
93     }
94     #[dbus_method("OnDevicePropertiesChanged")]
on_device_properties_changed( &mut self, remote_device: BluetoothDevice, props: Vec<BtPropertyType>, )95     fn on_device_properties_changed(
96         &mut self,
97         remote_device: BluetoothDevice,
98         props: Vec<BtPropertyType>,
99     ) {
100         dbus_generated!()
101     }
102     #[dbus_method("OnAddressChanged")]
on_address_changed(&mut self, addr: RawAddress)103     fn on_address_changed(&mut self, addr: RawAddress) {
104         dbus_generated!()
105     }
106     #[dbus_method("OnNameChanged")]
on_name_changed(&mut self, name: String)107     fn on_name_changed(&mut self, name: String) {
108         dbus_generated!()
109     }
110     #[dbus_method("OnDiscoverableChanged")]
on_discoverable_changed(&mut self, discoverable: bool)111     fn on_discoverable_changed(&mut self, discoverable: bool) {
112         dbus_generated!()
113     }
114     #[dbus_method("OnDeviceFound")]
on_device_found(&mut self, remote_device: BluetoothDevice)115     fn on_device_found(&mut self, remote_device: BluetoothDevice) {
116         dbus_generated!()
117     }
118     #[dbus_method("OnDeviceCleared")]
on_device_cleared(&mut self, remote_device: BluetoothDevice)119     fn on_device_cleared(&mut self, remote_device: BluetoothDevice) {
120         dbus_generated!()
121     }
122     #[dbus_method("OnDiscoveringChanged")]
on_discovering_changed(&mut self, discovering: bool)123     fn on_discovering_changed(&mut self, discovering: bool) {
124         dbus_generated!()
125     }
126     #[dbus_method(
127         "OnSspRequest",
128         DBusLog::Enable(DBusLogOptions::LogAll, DBusLogVerbosity::Verbose)
129     )]
on_ssp_request( &mut self, remote_device: BluetoothDevice, cod: u32, variant: BtSspVariant, passkey: u32, )130     fn on_ssp_request(
131         &mut self,
132         remote_device: BluetoothDevice,
133         cod: u32,
134         variant: BtSspVariant,
135         passkey: u32,
136     ) {
137         dbus_generated!()
138     }
139     #[dbus_method("OnPinRequest")]
on_pin_request(&mut self, remote_device: BluetoothDevice, cod: u32, min_16_digit: bool)140     fn on_pin_request(&mut self, remote_device: BluetoothDevice, cod: u32, min_16_digit: bool) {
141         dbus_generated!()
142     }
143     #[dbus_method("OnPinDisplay")]
on_pin_display(&mut self, remote_device: BluetoothDevice, pincode: String)144     fn on_pin_display(&mut self, remote_device: BluetoothDevice, pincode: String) {
145         dbus_generated!()
146     }
147     #[dbus_method(
148         "OnBondStateChanged",
149         DBusLog::Enable(DBusLogOptions::LogAll, DBusLogVerbosity::Verbose)
150     )]
on_bond_state_changed(&mut self, status: u32, address: RawAddress, state: u32)151     fn on_bond_state_changed(&mut self, status: u32, address: RawAddress, state: u32) {
152         dbus_generated!()
153     }
154     #[dbus_method("OnSdpSearchComplete")]
on_sdp_search_complete( &mut self, remote_device: BluetoothDevice, searched_uuid: Uuid, sdp_records: Vec<BtSdpRecord>, )155     fn on_sdp_search_complete(
156         &mut self,
157         remote_device: BluetoothDevice,
158         searched_uuid: Uuid,
159         sdp_records: Vec<BtSdpRecord>,
160     ) {
161         dbus_generated!()
162     }
163     #[dbus_method("OnSdpRecordCreated")]
on_sdp_record_created(&mut self, record: BtSdpRecord, handle: i32)164     fn on_sdp_record_created(&mut self, record: BtSdpRecord, handle: i32) {
165         dbus_generated!()
166     }
167 }
168 
169 impl_dbus_arg_enum!(BtBondState);
170 impl_dbus_arg_enum!(BtConnectionState);
171 impl_dbus_arg_enum!(BtDeviceType);
172 impl_dbus_arg_enum!(BtAddrType);
173 impl_dbus_arg_enum!(BtPropertyType);
174 impl_dbus_arg_enum!(BtSspVariant);
175 impl_dbus_arg_enum!(BtTransport);
176 impl_dbus_arg_enum!(ProfileConnectionState);
177 impl_dbus_arg_enum!(BtAdapterRole);
178 
179 #[allow(dead_code)]
180 struct BluetoothConnectionCallbackDBus {}
181 
182 #[dbus_proxy_obj(BluetoothConnectionCallback, "org.chromium.bluetooth.BluetoothConnectionCallback")]
183 impl IBluetoothConnectionCallback for BluetoothConnectionCallbackDBus {
184     #[dbus_method(
185         "OnDeviceConnected",
186         DBusLog::Enable(DBusLogOptions::LogAll, DBusLogVerbosity::Verbose)
187     )]
on_device_connected(&mut self, remote_device: BluetoothDevice)188     fn on_device_connected(&mut self, remote_device: BluetoothDevice) {
189         dbus_generated!()
190     }
191 
192     #[dbus_method(
193         "OnDeviceDisconnected",
194         DBusLog::Enable(DBusLogOptions::LogAll, DBusLogVerbosity::Verbose)
195     )]
on_device_disconnected(&mut self, remote_device: BluetoothDevice)196     fn on_device_disconnected(&mut self, remote_device: BluetoothDevice) {
197         dbus_generated!()
198     }
199 
200     #[dbus_method(
201         "OnDeviceConnectionFailed",
202         DBusLog::Enable(DBusLogOptions::LogAll, DBusLogVerbosity::Verbose)
203     )]
on_device_connection_failed(&mut self, remote_device: BluetoothDevice, status: BtStatus)204     fn on_device_connection_failed(&mut self, remote_device: BluetoothDevice, status: BtStatus) {
205         dbus_generated!()
206     }
207 }
208 
209 impl_dbus_arg_enum!(BtSdpType);
210 
211 #[dbus_propmap(BtSdpHeaderOverlay)]
212 struct BtSdpHeaderOverlayDBus {
213     sdp_type: BtSdpType,
214     uuid: Uuid,
215     service_name_length: u32,
216     service_name: String,
217     rfcomm_channel_number: i32,
218     l2cap_psm: i32,
219     profile_version: i32,
220 
221     user1_len: i32,
222     user1_data: Vec<u8>,
223     user2_len: i32,
224     user2_data: Vec<u8>,
225 }
226 
227 #[dbus_propmap(BtSdpMasRecord)]
228 struct BtSdpMasRecordDBus {
229     hdr: BtSdpHeaderOverlay,
230     mas_instance_id: u32,
231     supported_features: u32,
232     supported_message_types: u32,
233 }
234 
235 #[dbus_propmap(BtSdpMnsRecord)]
236 struct BtSdpMnsRecordDBus {
237     hdr: BtSdpHeaderOverlay,
238     supported_features: u32,
239 }
240 
241 #[dbus_propmap(BtSdpPseRecord)]
242 struct BtSdpPseRecordDBus {
243     hdr: BtSdpHeaderOverlay,
244     supported_features: u32,
245     supported_repositories: u32,
246 }
247 
248 #[dbus_propmap(BtSdpPceRecord)]
249 struct BtSdpPceRecordDBus {
250     hdr: BtSdpHeaderOverlay,
251 }
252 
253 impl_dbus_arg_from_into!(SupportedFormatsList, Vec<u8>);
254 
255 #[dbus_propmap(BtSdpOpsRecord)]
256 struct BtSdpOpsRecordDBus {
257     hdr: BtSdpHeaderOverlay,
258     supported_formats_list_len: i32,
259     supported_formats_list: SupportedFormatsList,
260 }
261 
262 #[dbus_propmap(BtSdpSapRecord)]
263 struct BtSdpSapRecordDBus {
264     hdr: BtSdpHeaderOverlay,
265 }
266 
267 #[dbus_propmap(BtSdpDipRecord)]
268 struct BtSdpDipRecordDBus {
269     hdr: BtSdpHeaderOverlay,
270     spec_id: u16,
271     vendor: u16,
272     vendor_id_source: u16,
273     product: u16,
274     version: u16,
275     primary_record: bool,
276 }
277 
278 impl_dbus_arg_from_into!(SupportedScenarios, Vec<u8>);
279 impl_dbus_arg_from_into!(SupportedDependencies, Vec<u8>);
280 
281 #[dbus_propmap(BtSdpMpsRecord)]
282 pub struct BtSdpMpsRecordDBus {
283     hdr: BtSdpHeaderOverlay,
284     supported_scenarios_mpsd: SupportedScenarios,
285     supported_scenarios_mpmd: SupportedScenarios,
286     supported_dependencies: SupportedDependencies,
287 }
288 
289 #[dbus_propmap(BtVendorProductInfo)]
290 pub struct BtVendorProductInfoDBus {
291     vendor_id_src: u8,
292     vendor_id: u16,
293     product_id: u16,
294     version: u16,
295 }
296 
read_propmap_value<T: 'static + DirectDBus>( propmap: &dbus::arg::PropMap, key: &str, ) -> Result<T, Box<dyn std::error::Error>>297 fn read_propmap_value<T: 'static + DirectDBus>(
298     propmap: &dbus::arg::PropMap,
299     key: &str,
300 ) -> Result<T, Box<dyn std::error::Error>> {
301     let output = propmap
302         .get(key)
303         .ok_or(Box::new(DBusArgError::new(format!("Key {} does not exist", key,))))?;
304     let output = <T as RefArgToRust>::ref_arg_to_rust(
305         output.as_static_inner(0).ok_or(Box::new(DBusArgError::new(format!(
306             "Unable to convert propmap[\"{}\"] to {}",
307             key,
308             stringify!(T),
309         ))))?,
310         String::from(stringify!(T)),
311     )?;
312     Ok(output)
313 }
314 
parse_propmap_value<T: DBusArg>( propmap: &dbus::arg::PropMap, key: &str, ) -> Result<T, Box<dyn std::error::Error>> where <T as DBusArg>::DBusType: RefArgToRust<RustType = <T as DBusArg>::DBusType>,315 fn parse_propmap_value<T: DBusArg>(
316     propmap: &dbus::arg::PropMap,
317     key: &str,
318 ) -> Result<T, Box<dyn std::error::Error>>
319 where
320     <T as DBusArg>::DBusType: RefArgToRust<RustType = <T as DBusArg>::DBusType>,
321 {
322     let output = propmap
323         .get(key)
324         .ok_or(Box::new(DBusArgError::new(format!("Key {} does not exist", key,))))?;
325     let output = <<T as DBusArg>::DBusType as RefArgToRust>::ref_arg_to_rust(
326         output.as_static_inner(0).ok_or(Box::new(DBusArgError::new(format!(
327             "Unable to convert propmap[\"{}\"] to {}",
328             key,
329             stringify!(T),
330         ))))?,
331         stringify!(T).to_string(),
332     )?;
333     let output = T::from_dbus(output, None, None, None)?;
334     Ok(output)
335 }
336 
write_propmap_value<T: DBusArg>( propmap: &mut dbus::arg::PropMap, value: T, key: &str, ) -> Result<(), Box<dyn std::error::Error>> where T::DBusType: 'static + dbus::arg::RefArg,337 fn write_propmap_value<T: DBusArg>(
338     propmap: &mut dbus::arg::PropMap,
339     value: T,
340     key: &str,
341 ) -> Result<(), Box<dyn std::error::Error>>
342 where
343     T::DBusType: 'static + dbus::arg::RefArg,
344 {
345     propmap.insert(String::from(key), dbus::arg::Variant(Box::new(DBusArg::to_dbus(value)?)));
346     Ok(())
347 }
348 
349 impl DBusArg for BtSdpRecord {
350     type DBusType = dbus::arg::PropMap;
from_dbus( data: dbus::arg::PropMap, _conn: Option<std::sync::Arc<dbus::nonblock::SyncConnection>>, _remote: Option<dbus::strings::BusName<'static>>, _disconnect_watcher: Option< std::sync::Arc<std::sync::Mutex<dbus_projection::DisconnectWatcher>>, >, ) -> Result<BtSdpRecord, Box<dyn std::error::Error>>351     fn from_dbus(
352         data: dbus::arg::PropMap,
353         _conn: Option<std::sync::Arc<dbus::nonblock::SyncConnection>>,
354         _remote: Option<dbus::strings::BusName<'static>>,
355         _disconnect_watcher: Option<
356             std::sync::Arc<std::sync::Mutex<dbus_projection::DisconnectWatcher>>,
357         >,
358     ) -> Result<BtSdpRecord, Box<dyn std::error::Error>> {
359         let sdp_type = read_propmap_value::<u32>(&data, &String::from("type"))?;
360         let sdp_type = BtSdpType::from(sdp_type);
361         let record = match sdp_type {
362             BtSdpType::Raw => {
363                 let arg_0 = parse_propmap_value::<BtSdpHeaderOverlay>(&data, "0")?;
364                 BtSdpRecord::HeaderOverlay(arg_0)
365             }
366             BtSdpType::MapMas => {
367                 let arg_0 = parse_propmap_value::<BtSdpMasRecord>(&data, "0")?;
368                 BtSdpRecord::MapMas(arg_0)
369             }
370             BtSdpType::MapMns => {
371                 let arg_0 = parse_propmap_value::<BtSdpMnsRecord>(&data, "0")?;
372                 BtSdpRecord::MapMns(arg_0)
373             }
374             BtSdpType::PbapPse => {
375                 let arg_0 = parse_propmap_value::<BtSdpPseRecord>(&data, "0")?;
376                 BtSdpRecord::PbapPse(arg_0)
377             }
378             BtSdpType::PbapPce => {
379                 let arg_0 = parse_propmap_value::<BtSdpPceRecord>(&data, "0")?;
380                 BtSdpRecord::PbapPce(arg_0)
381             }
382             BtSdpType::OppServer => {
383                 let arg_0 = parse_propmap_value::<BtSdpOpsRecord>(&data, "0")?;
384                 BtSdpRecord::OppServer(arg_0)
385             }
386             BtSdpType::SapServer => {
387                 let arg_0 = parse_propmap_value::<BtSdpSapRecord>(&data, "0")?;
388                 BtSdpRecord::SapServer(arg_0)
389             }
390             BtSdpType::Dip => {
391                 let arg_0 = parse_propmap_value::<BtSdpDipRecord>(&data, "0")?;
392                 BtSdpRecord::Dip(arg_0)
393             }
394             BtSdpType::Mps => {
395                 let arg_0 = parse_propmap_value::<BtSdpMpsRecord>(&data, "0")?;
396                 BtSdpRecord::Mps(arg_0)
397             }
398         };
399         Ok(record)
400     }
401 
to_dbus(record: BtSdpRecord) -> Result<dbus::arg::PropMap, Box<dyn std::error::Error>>402     fn to_dbus(record: BtSdpRecord) -> Result<dbus::arg::PropMap, Box<dyn std::error::Error>> {
403         let mut map: dbus::arg::PropMap = std::collections::HashMap::new();
404         write_propmap_value::<u32>(
405             &mut map,
406             BtSdpType::from(&record) as u32,
407             &String::from("type"),
408         )?;
409         match record {
410             BtSdpRecord::HeaderOverlay(header) => {
411                 write_propmap_value::<BtSdpHeaderOverlay>(&mut map, header, &String::from("0"))?
412             }
413             BtSdpRecord::MapMas(mas_record) => {
414                 write_propmap_value::<BtSdpMasRecord>(&mut map, mas_record, &String::from("0"))?
415             }
416             BtSdpRecord::MapMns(mns_record) => {
417                 write_propmap_value::<BtSdpMnsRecord>(&mut map, mns_record, &String::from("0"))?
418             }
419             BtSdpRecord::PbapPse(pse_record) => {
420                 write_propmap_value::<BtSdpPseRecord>(&mut map, pse_record, &String::from("0"))?
421             }
422             BtSdpRecord::PbapPce(pce_record) => {
423                 write_propmap_value::<BtSdpPceRecord>(&mut map, pce_record, &String::from("0"))?
424             }
425             BtSdpRecord::OppServer(ops_record) => {
426                 write_propmap_value::<BtSdpOpsRecord>(&mut map, ops_record, &String::from("0"))?
427             }
428             BtSdpRecord::SapServer(sap_record) => {
429                 write_propmap_value::<BtSdpSapRecord>(&mut map, sap_record, &String::from("0"))?
430             }
431             BtSdpRecord::Dip(dip_record) => {
432                 write_propmap_value::<BtSdpDipRecord>(&mut map, dip_record, &String::from("0"))?
433             }
434             BtSdpRecord::Mps(mps_record) => {
435                 write_propmap_value::<BtSdpMpsRecord>(&mut map, mps_record, &String::from("0"))?
436             }
437         }
438         Ok(map)
439     }
440 
log(record: &BtSdpRecord) -> String441     fn log(record: &BtSdpRecord) -> String {
442         format!("{:?}", record)
443     }
444 }
445 
446 impl DBusArg for RawAddress {
447     type DBusType = String;
from_dbus( data: String, _conn: Option<std::sync::Arc<dbus::nonblock::SyncConnection>>, _remote: Option<dbus::strings::BusName<'static>>, _disconnect_watcher: Option< std::sync::Arc<std::sync::Mutex<dbus_projection::DisconnectWatcher>>, >, ) -> Result<RawAddress, Box<dyn std::error::Error>>448     fn from_dbus(
449         data: String,
450         _conn: Option<std::sync::Arc<dbus::nonblock::SyncConnection>>,
451         _remote: Option<dbus::strings::BusName<'static>>,
452         _disconnect_watcher: Option<
453             std::sync::Arc<std::sync::Mutex<dbus_projection::DisconnectWatcher>>,
454         >,
455     ) -> Result<RawAddress, Box<dyn std::error::Error>> {
456         Ok(RawAddress::from_string(data.clone()).ok_or_else(|| {
457             format!(
458                 "Invalid Address: last 6 chars=\"{}\"",
459                 data.chars().rev().take(6).collect::<String>().chars().rev().collect::<String>()
460             )
461         })?)
462     }
463 
to_dbus(addr: RawAddress) -> Result<String, Box<dyn std::error::Error>>464     fn to_dbus(addr: RawAddress) -> Result<String, Box<dyn std::error::Error>> {
465         Ok(addr.to_string())
466     }
467 
log(addr: &RawAddress) -> String468     fn log(addr: &RawAddress) -> String {
469         format!("{}", DisplayAddress(addr))
470     }
471 }
472 
473 impl_dbus_arg_enum!(BtDiscMode);
474 impl_dbus_arg_from_into!(EscoCodingFormat, u8);
475 
476 #[allow(dead_code)]
477 struct IBluetoothDBus {}
478 
479 #[generate_dbus_exporter(
480     export_bluetooth_dbus_intf,
481     "org.chromium.bluetooth.Bluetooth",
482     BluetoothMixin,
483     adapter
484 )]
485 impl IBluetooth for IBluetoothDBus {
486     #[dbus_method("RegisterCallback")]
register_callback(&mut self, callback: Box<dyn IBluetoothCallback + Send>) -> u32487     fn register_callback(&mut self, callback: Box<dyn IBluetoothCallback + Send>) -> u32 {
488         dbus_generated!()
489     }
490 
491     #[dbus_method("UnregisterCallback")]
unregister_callback(&mut self, id: u32) -> bool492     fn unregister_callback(&mut self, id: u32) -> bool {
493         dbus_generated!()
494     }
495 
496     #[dbus_method("RegisterConnectionCallback")]
register_connection_callback( &mut self, callback: Box<dyn IBluetoothConnectionCallback + Send>, ) -> u32497     fn register_connection_callback(
498         &mut self,
499         callback: Box<dyn IBluetoothConnectionCallback + Send>,
500     ) -> u32 {
501         dbus_generated!()
502     }
503 
504     #[dbus_method("UnregisterConnectionCallback")]
unregister_connection_callback(&mut self, id: u32) -> bool505     fn unregister_connection_callback(&mut self, id: u32) -> bool {
506         dbus_generated!()
507     }
508 
509     // Not exposed over D-Bus. The stack is automatically initialized when the daemon starts.
init(&mut self, _hci_index: i32) -> bool510     fn init(&mut self, _hci_index: i32) -> bool {
511         dbus_generated!()
512     }
513 
514     // Not exposed over D-Bus. The stack is automatically enabled when the daemon starts.
enable(&mut self) -> bool515     fn enable(&mut self) -> bool {
516         dbus_generated!()
517     }
518 
519     // Not exposed over D-Bus. The stack is automatically disabled when the daemon exits.
disable(&mut self) -> bool520     fn disable(&mut self) -> bool {
521         dbus_generated!()
522     }
523 
524     // Not exposed over D-Bus. The stack is automatically cleaned up when the daemon exits.
cleanup(&mut self)525     fn cleanup(&mut self) {
526         dbus_generated!()
527     }
528 
529     #[dbus_method("GetAddress", DBusLog::Disable)]
get_address(&self) -> RawAddress530     fn get_address(&self) -> RawAddress {
531         dbus_generated!()
532     }
533 
534     #[dbus_method("GetUuids", DBusLog::Disable)]
get_uuids(&self) -> Vec<Uuid>535     fn get_uuids(&self) -> Vec<Uuid> {
536         dbus_generated!()
537     }
538 
539     #[dbus_method("GetName", DBusLog::Disable)]
get_name(&self) -> String540     fn get_name(&self) -> String {
541         dbus_generated!()
542     }
543 
544     #[dbus_method("SetName")]
set_name(&self, name: String) -> bool545     fn set_name(&self, name: String) -> bool {
546         dbus_generated!()
547     }
548 
549     #[dbus_method("GetBluetoothClass", DBusLog::Disable)]
get_bluetooth_class(&self) -> u32550     fn get_bluetooth_class(&self) -> u32 {
551         dbus_generated!()
552     }
553 
554     #[dbus_method("SetBluetoothClass")]
set_bluetooth_class(&self, cod: u32) -> bool555     fn set_bluetooth_class(&self, cod: u32) -> bool {
556         dbus_generated!()
557     }
558 
559     #[dbus_method("GetDiscoverable", DBusLog::Disable)]
get_discoverable(&self) -> bool560     fn get_discoverable(&self) -> bool {
561         dbus_generated!()
562     }
563 
564     #[dbus_method("GetDiscoverableTimeout", DBusLog::Disable)]
get_discoverable_timeout(&self) -> u32565     fn get_discoverable_timeout(&self) -> u32 {
566         dbus_generated!()
567     }
568 
569     #[dbus_method("SetDiscoverable")]
set_discoverable(&mut self, mode: BtDiscMode, duration: u32) -> bool570     fn set_discoverable(&mut self, mode: BtDiscMode, duration: u32) -> bool {
571         dbus_generated!()
572     }
573 
574     #[dbus_method("IsMultiAdvertisementSupported", DBusLog::Disable)]
is_multi_advertisement_supported(&self) -> bool575     fn is_multi_advertisement_supported(&self) -> bool {
576         dbus_generated!()
577     }
578 
579     #[dbus_method("IsLeExtendedAdvertisingSupported", DBusLog::Disable)]
is_le_extended_advertising_supported(&self) -> bool580     fn is_le_extended_advertising_supported(&self) -> bool {
581         dbus_generated!()
582     }
583 
584     #[dbus_method("StartDiscovery")]
start_discovery(&mut self) -> bool585     fn start_discovery(&mut self) -> bool {
586         dbus_generated!()
587     }
588 
589     #[dbus_method("CancelDiscovery")]
cancel_discovery(&mut self) -> bool590     fn cancel_discovery(&mut self) -> bool {
591         dbus_generated!()
592     }
593 
594     #[dbus_method("IsDiscovering", DBusLog::Disable)]
is_discovering(&self) -> bool595     fn is_discovering(&self) -> bool {
596         dbus_generated!()
597     }
598 
599     #[dbus_method("GetDiscoveryEndMillis", DBusLog::Disable)]
get_discovery_end_millis(&self) -> u64600     fn get_discovery_end_millis(&self) -> u64 {
601         dbus_generated!()
602     }
603 
604     #[dbus_method("CreateBond")]
create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> BtStatus605     fn create_bond(&mut self, device: BluetoothDevice, transport: BtTransport) -> BtStatus {
606         dbus_generated!()
607     }
608 
609     #[dbus_method("CancelBondProcess")]
cancel_bond_process(&mut self, device: BluetoothDevice) -> bool610     fn cancel_bond_process(&mut self, device: BluetoothDevice) -> bool {
611         dbus_generated!()
612     }
613 
614     #[dbus_method("RemoveBond")]
remove_bond(&mut self, device: BluetoothDevice) -> bool615     fn remove_bond(&mut self, device: BluetoothDevice) -> bool {
616         dbus_generated!()
617     }
618 
619     #[dbus_method("GetBondedDevices", DBusLog::Disable)]
get_bonded_devices(&self) -> Vec<BluetoothDevice>620     fn get_bonded_devices(&self) -> Vec<BluetoothDevice> {
621         dbus_generated!()
622     }
623 
624     #[dbus_method("GetBondState", DBusLog::Disable)]
get_bond_state(&self, device: BluetoothDevice) -> BtBondState625     fn get_bond_state(&self, device: BluetoothDevice) -> BtBondState {
626         dbus_generated!()
627     }
628 
629     #[dbus_method("SetPin")]
set_pin(&self, device: BluetoothDevice, accept: bool, pin_code: Vec<u8>) -> bool630     fn set_pin(&self, device: BluetoothDevice, accept: bool, pin_code: Vec<u8>) -> bool {
631         dbus_generated!()
632     }
633 
634     #[dbus_method("SetPasskey")]
set_passkey(&self, device: BluetoothDevice, accept: bool, passkey: Vec<u8>) -> bool635     fn set_passkey(&self, device: BluetoothDevice, accept: bool, passkey: Vec<u8>) -> bool {
636         dbus_generated!()
637     }
638 
639     #[dbus_method("SetPairingConfirmation")]
set_pairing_confirmation(&self, device: BluetoothDevice, accept: bool) -> bool640     fn set_pairing_confirmation(&self, device: BluetoothDevice, accept: bool) -> bool {
641         dbus_generated!()
642     }
643 
644     #[dbus_method("GetRemoteName", DBusLog::Disable)]
get_remote_name(&self, _device: BluetoothDevice) -> String645     fn get_remote_name(&self, _device: BluetoothDevice) -> String {
646         dbus_generated!()
647     }
648 
649     #[dbus_method("GetRemoteType", DBusLog::Disable)]
get_remote_type(&self, _device: BluetoothDevice) -> BtDeviceType650     fn get_remote_type(&self, _device: BluetoothDevice) -> BtDeviceType {
651         dbus_generated!()
652     }
653 
654     #[dbus_method("GetRemoteAlias", DBusLog::Disable)]
get_remote_alias(&self, _device: BluetoothDevice) -> String655     fn get_remote_alias(&self, _device: BluetoothDevice) -> String {
656         dbus_generated!()
657     }
658 
659     #[dbus_method("SetRemoteAlias")]
set_remote_alias(&mut self, _device: BluetoothDevice, new_alias: String)660     fn set_remote_alias(&mut self, _device: BluetoothDevice, new_alias: String) {
661         dbus_generated!()
662     }
663 
664     #[dbus_method("GetRemoteClass", DBusLog::Disable)]
get_remote_class(&self, _device: BluetoothDevice) -> u32665     fn get_remote_class(&self, _device: BluetoothDevice) -> u32 {
666         dbus_generated!()
667     }
668 
669     #[dbus_method("GetRemoteAppearance", DBusLog::Disable)]
get_remote_appearance(&self, _device: BluetoothDevice) -> u16670     fn get_remote_appearance(&self, _device: BluetoothDevice) -> u16 {
671         dbus_generated!()
672     }
673 
674     #[dbus_method("GetRemoteConnected", DBusLog::Disable)]
get_remote_connected(&self, _device: BluetoothDevice) -> bool675     fn get_remote_connected(&self, _device: BluetoothDevice) -> bool {
676         dbus_generated!()
677     }
678 
679     #[dbus_method("GetRemoteWakeAllowed", DBusLog::Disable)]
get_remote_wake_allowed(&self, _device: BluetoothDevice) -> bool680     fn get_remote_wake_allowed(&self, _device: BluetoothDevice) -> bool {
681         dbus_generated!()
682     }
683 
684     #[dbus_method("GetRemoteVendorProductInfo", DBusLog::Disable)]
get_remote_vendor_product_info(&self, _device: BluetoothDevice) -> BtVendorProductInfo685     fn get_remote_vendor_product_info(&self, _device: BluetoothDevice) -> BtVendorProductInfo {
686         dbus_generated!()
687     }
688 
689     #[dbus_method("GetRemoteAddressType", DBusLog::Disable)]
get_remote_address_type(&self, device: BluetoothDevice) -> BtAddrType690     fn get_remote_address_type(&self, device: BluetoothDevice) -> BtAddrType {
691         dbus_generated!()
692     }
693 
694     #[dbus_method("GetRemoteRSSI", DBusLog::Disable)]
get_remote_rssi(&self, device: BluetoothDevice) -> i8695     fn get_remote_rssi(&self, device: BluetoothDevice) -> i8 {
696         dbus_generated!()
697     }
698 
699     #[dbus_method("GetConnectedDevices", DBusLog::Disable)]
get_connected_devices(&self) -> Vec<BluetoothDevice>700     fn get_connected_devices(&self) -> Vec<BluetoothDevice> {
701         dbus_generated!()
702     }
703 
704     #[dbus_method("GetConnectionState", DBusLog::Disable)]
get_connection_state(&self, device: BluetoothDevice) -> BtConnectionState705     fn get_connection_state(&self, device: BluetoothDevice) -> BtConnectionState {
706         dbus_generated!()
707     }
708 
709     #[dbus_method("GetProfileConnectionState", DBusLog::Disable)]
get_profile_connection_state(&self, profile: Uuid) -> ProfileConnectionState710     fn get_profile_connection_state(&self, profile: Uuid) -> ProfileConnectionState {
711         dbus_generated!()
712     }
713 
714     #[dbus_method("GetRemoteUuids", DBusLog::Disable)]
get_remote_uuids(&self, device: BluetoothDevice) -> Vec<Uuid>715     fn get_remote_uuids(&self, device: BluetoothDevice) -> Vec<Uuid> {
716         dbus_generated!()
717     }
718 
719     #[dbus_method("FetchRemoteUuids", DBusLog::Disable)]
fetch_remote_uuids(&self, device: BluetoothDevice) -> bool720     fn fetch_remote_uuids(&self, device: BluetoothDevice) -> bool {
721         dbus_generated!()
722     }
723 
724     #[dbus_method("SdpSearch")]
sdp_search(&self, device: BluetoothDevice, uuid: Uuid) -> bool725     fn sdp_search(&self, device: BluetoothDevice, uuid: Uuid) -> bool {
726         dbus_generated!()
727     }
728 
729     #[dbus_method("CreateSdpRecord")]
create_sdp_record(&mut self, sdp_record: BtSdpRecord) -> bool730     fn create_sdp_record(&mut self, sdp_record: BtSdpRecord) -> bool {
731         dbus_generated!()
732     }
733 
734     #[dbus_method("RemoveSdpRecord")]
remove_sdp_record(&self, handle: i32) -> bool735     fn remove_sdp_record(&self, handle: i32) -> bool {
736         dbus_generated!()
737     }
738 
739     #[dbus_method("ConnectAllEnabledProfiles")]
connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> BtStatus740     fn connect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> BtStatus {
741         dbus_generated!()
742     }
743 
744     #[dbus_method("DisconnectAllEnabledProfiles")]
disconnect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool745     fn disconnect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool {
746         dbus_generated!()
747     }
748 
749     #[dbus_method("IsWbsSupported", DBusLog::Disable)]
is_wbs_supported(&self) -> bool750     fn is_wbs_supported(&self) -> bool {
751         dbus_generated!()
752     }
753 
754     #[dbus_method("IsSwbSupported", DBusLog::Disable)]
is_swb_supported(&self) -> bool755     fn is_swb_supported(&self) -> bool {
756         dbus_generated!()
757     }
758 
759     #[dbus_method("GetSupportedRoles", DBusLog::Disable)]
get_supported_roles(&self) -> Vec<BtAdapterRole>760     fn get_supported_roles(&self) -> Vec<BtAdapterRole> {
761         dbus_generated!()
762     }
763 
764     #[dbus_method("IsCodingFormatSupported", DBusLog::Disable)]
is_coding_format_supported(&self, coding_format: EscoCodingFormat) -> bool765     fn is_coding_format_supported(&self, coding_format: EscoCodingFormat) -> bool {
766         dbus_generated!()
767     }
768 
769     #[dbus_method("IsLEAudioSupported", DBusLog::Disable)]
is_le_audio_supported(&self) -> bool770     fn is_le_audio_supported(&self) -> bool {
771         dbus_generated!()
772     }
773 
774     #[dbus_method("IsDualModeAudioSinkDevice", DBusLog::Disable)]
is_dual_mode_audio_sink_device(&self, device: BluetoothDevice) -> bool775     fn is_dual_mode_audio_sink_device(&self, device: BluetoothDevice) -> bool {
776         dbus_generated!()
777     }
778 
779     #[dbus_method("GetDumpsys", DBusLog::Disable)]
get_dumpsys(&self) -> String780     fn get_dumpsys(&self) -> String {
781         dbus_generated!()
782     }
783 }
784 
785 impl_dbus_arg_enum!(SocketType);
786 
787 #[dbus_propmap(BluetoothServerSocket)]
788 pub struct BluetoothServerSocketDBus {
789     id: SocketId,
790     sock_type: SocketType,
791     flags: i32,
792     psm: Option<i32>,
793     channel: Option<i32>,
794     name: Option<String>,
795     uuid: Option<Uuid>,
796 }
797 
798 #[dbus_propmap(BluetoothSocket)]
799 pub struct BluetoothSocketDBus {
800     id: SocketId,
801     remote_device: BluetoothDevice,
802     sock_type: SocketType,
803     flags: i32,
804     fd: Option<std::fs::File>,
805     port: i32,
806     uuid: Option<Uuid>,
807     max_rx_size: i32,
808     max_tx_size: i32,
809 }
810 
811 #[dbus_propmap(SocketResult)]
812 pub struct SocketResultDBus {
813     status: BtStatus,
814     id: u64,
815 }
816 
817 #[allow(dead_code)]
818 struct IBluetoothSocketManagerCallbacksDBus {}
819 
820 #[dbus_proxy_obj(BluetoothSocketCallback, "org.chromium.bluetooth.SocketManagerCallback")]
821 impl IBluetoothSocketManagerCallbacks for IBluetoothSocketManagerCallbacksDBus {
822     #[dbus_method("OnIncomingSocketReady")]
on_incoming_socket_ready(&mut self, socket: BluetoothServerSocket, status: BtStatus)823     fn on_incoming_socket_ready(&mut self, socket: BluetoothServerSocket, status: BtStatus) {
824         dbus_generated!()
825     }
826 
827     #[dbus_method("OnIncomingSocketClosed")]
on_incoming_socket_closed(&mut self, listener_id: SocketId, reason: BtStatus)828     fn on_incoming_socket_closed(&mut self, listener_id: SocketId, reason: BtStatus) {
829         dbus_generated!()
830     }
831 
832     #[dbus_method("OnHandleIncomingConnection")]
on_handle_incoming_connection( &mut self, listener_id: SocketId, connection: BluetoothSocket, )833     fn on_handle_incoming_connection(
834         &mut self,
835         listener_id: SocketId,
836         connection: BluetoothSocket,
837     ) {
838         dbus_generated!()
839     }
840 
841     #[dbus_method("OnOutgoingConnectionResult")]
on_outgoing_connection_result( &mut self, connecting_id: SocketId, result: BtStatus, socket: Option<BluetoothSocket>, )842     fn on_outgoing_connection_result(
843         &mut self,
844         connecting_id: SocketId,
845         result: BtStatus,
846         socket: Option<BluetoothSocket>,
847     ) {
848         dbus_generated!()
849     }
850 }
851 
852 #[allow(dead_code)]
853 struct IBluetoothSocketManagerDBus {}
854 
855 #[generate_dbus_exporter(
856     export_socket_mgr_intf,
857     "org.chromium.bluetooth.SocketManager",
858     BluetoothMixin,
859     socket_mgr
860 )]
861 impl IBluetoothSocketManager for IBluetoothSocketManagerDBus {
862     #[dbus_method("RegisterCallback")]
register_callback( &mut self, callback: Box<dyn IBluetoothSocketManagerCallbacks + Send>, ) -> CallbackId863     fn register_callback(
864         &mut self,
865         callback: Box<dyn IBluetoothSocketManagerCallbacks + Send>,
866     ) -> CallbackId {
867         dbus_generated!()
868     }
869 
870     #[dbus_method("UnregisterCallback")]
unregister_callback(&mut self, callback: CallbackId) -> bool871     fn unregister_callback(&mut self, callback: CallbackId) -> bool {
872         dbus_generated!()
873     }
874 
875     #[dbus_method("ListenUsingInsecureL2capChannel")]
listen_using_insecure_l2cap_channel(&mut self, callback: CallbackId) -> SocketResult876     fn listen_using_insecure_l2cap_channel(&mut self, callback: CallbackId) -> SocketResult {
877         dbus_generated!()
878     }
879 
880     #[dbus_method("ListenUsingInsecureL2capLeChannel")]
listen_using_insecure_l2cap_le_channel(&mut self, callback: CallbackId) -> SocketResult881     fn listen_using_insecure_l2cap_le_channel(&mut self, callback: CallbackId) -> SocketResult {
882         dbus_generated!()
883     }
884 
885     #[dbus_method("ListenUsingL2capChannel")]
listen_using_l2cap_channel(&mut self, callback: CallbackId) -> SocketResult886     fn listen_using_l2cap_channel(&mut self, callback: CallbackId) -> SocketResult {
887         dbus_generated!()
888     }
889 
890     #[dbus_method("ListenUsingL2capLeChannel")]
listen_using_l2cap_le_channel(&mut self, callback: CallbackId) -> SocketResult891     fn listen_using_l2cap_le_channel(&mut self, callback: CallbackId) -> SocketResult {
892         dbus_generated!()
893     }
894 
895     #[dbus_method("ListenUsingInsecureRfcommWithServiceRecord")]
listen_using_insecure_rfcomm_with_service_record( &mut self, callback: CallbackId, name: String, uuid: Uuid, ) -> SocketResult896     fn listen_using_insecure_rfcomm_with_service_record(
897         &mut self,
898         callback: CallbackId,
899         name: String,
900         uuid: Uuid,
901     ) -> SocketResult {
902         dbus_generated!()
903     }
904 
905     #[dbus_method("ListenUsingRfcomm")]
listen_using_rfcomm( &mut self, callback: CallbackId, channel: Option<i32>, application_uuid: Option<Uuid>, name: Option<String>, flags: Option<i32>, ) -> SocketResult906     fn listen_using_rfcomm(
907         &mut self,
908         callback: CallbackId,
909         channel: Option<i32>,
910         application_uuid: Option<Uuid>,
911         name: Option<String>,
912         flags: Option<i32>,
913     ) -> SocketResult {
914         dbus_generated!()
915     }
916 
917     #[dbus_method("ListenUsingRfcommWithServiceRecord")]
listen_using_rfcomm_with_service_record( &mut self, callback: CallbackId, name: String, uuid: Uuid, ) -> SocketResult918     fn listen_using_rfcomm_with_service_record(
919         &mut self,
920         callback: CallbackId,
921         name: String,
922         uuid: Uuid,
923     ) -> SocketResult {
924         dbus_generated!()
925     }
926 
927     #[dbus_method("CreateInsecureL2capChannel")]
create_insecure_l2cap_channel( &mut self, callback: CallbackId, device: BluetoothDevice, psm: i32, ) -> SocketResult928     fn create_insecure_l2cap_channel(
929         &mut self,
930         callback: CallbackId,
931         device: BluetoothDevice,
932         psm: i32,
933     ) -> SocketResult {
934         dbus_generated!()
935     }
936 
937     #[dbus_method("CreateInsecureL2capLeChannel")]
create_insecure_l2cap_le_channel( &mut self, callback: CallbackId, device: BluetoothDevice, psm: i32, ) -> SocketResult938     fn create_insecure_l2cap_le_channel(
939         &mut self,
940         callback: CallbackId,
941         device: BluetoothDevice,
942         psm: i32,
943     ) -> SocketResult {
944         dbus_generated!()
945     }
946 
947     #[dbus_method("CreateL2capChannel")]
create_l2cap_channel( &mut self, callback: CallbackId, device: BluetoothDevice, psm: i32, ) -> SocketResult948     fn create_l2cap_channel(
949         &mut self,
950         callback: CallbackId,
951         device: BluetoothDevice,
952         psm: i32,
953     ) -> SocketResult {
954         dbus_generated!()
955     }
956 
957     #[dbus_method("CreateL2capLeChannel")]
create_l2cap_le_channel( &mut self, callback: CallbackId, device: BluetoothDevice, psm: i32, ) -> SocketResult958     fn create_l2cap_le_channel(
959         &mut self,
960         callback: CallbackId,
961         device: BluetoothDevice,
962         psm: i32,
963     ) -> SocketResult {
964         dbus_generated!()
965     }
966 
967     #[dbus_method("CreateInsecureRfcommSocketToServiceRecord")]
create_insecure_rfcomm_socket_to_service_record( &mut self, callback: CallbackId, device: BluetoothDevice, uuid: Uuid, ) -> SocketResult968     fn create_insecure_rfcomm_socket_to_service_record(
969         &mut self,
970         callback: CallbackId,
971         device: BluetoothDevice,
972         uuid: Uuid,
973     ) -> SocketResult {
974         dbus_generated!()
975     }
976 
977     #[dbus_method("CreateRfcommSocketToServiceRecord")]
create_rfcomm_socket_to_service_record( &mut self, callback: CallbackId, device: BluetoothDevice, uuid: Uuid, ) -> SocketResult978     fn create_rfcomm_socket_to_service_record(
979         &mut self,
980         callback: CallbackId,
981         device: BluetoothDevice,
982         uuid: Uuid,
983     ) -> SocketResult {
984         dbus_generated!()
985     }
986 
987     #[dbus_method("Accept")]
accept(&mut self, callback: CallbackId, id: SocketId, timeout_ms: Option<u32>) -> BtStatus988     fn accept(&mut self, callback: CallbackId, id: SocketId, timeout_ms: Option<u32>) -> BtStatus {
989         dbus_generated!()
990     }
991 
992     #[dbus_method("Close")]
close(&mut self, callback: CallbackId, id: SocketId) -> BtStatus993     fn close(&mut self, callback: CallbackId, id: SocketId) -> BtStatus {
994         dbus_generated!()
995     }
996 }
997 
998 impl_dbus_arg_enum!(SuspendType);
999 
1000 #[allow(dead_code)]
1001 struct ISuspendDBus {}
1002 
1003 #[generate_dbus_exporter(
1004     export_suspend_dbus_intf,
1005     "org.chromium.bluetooth.Suspend",
1006     BluetoothMixin,
1007     suspend
1008 )]
1009 impl ISuspend for ISuspendDBus {
1010     #[dbus_method("RegisterCallback")]
register_callback(&mut self, callback: Box<dyn ISuspendCallback + Send>) -> bool1011     fn register_callback(&mut self, callback: Box<dyn ISuspendCallback + Send>) -> bool {
1012         dbus_generated!()
1013     }
1014 
1015     #[dbus_method("UnregisterCallback")]
unregister_callback(&mut self, callback_id: u32) -> bool1016     fn unregister_callback(&mut self, callback_id: u32) -> bool {
1017         dbus_generated!()
1018     }
1019 
1020     #[dbus_method("Suspend")]
suspend(&mut self, suspend_type: SuspendType, suspend_id: i32)1021     fn suspend(&mut self, suspend_type: SuspendType, suspend_id: i32) {
1022         dbus_generated!()
1023     }
1024 
1025     #[dbus_method("Resume")]
resume(&mut self) -> bool1026     fn resume(&mut self) -> bool {
1027         dbus_generated!()
1028     }
1029 }
1030 
1031 #[allow(dead_code)]
1032 struct SuspendCallbackDBus {}
1033 
1034 #[dbus_proxy_obj(SuspendCallback, "org.chromium.bluetooth.SuspendCallback")]
1035 impl ISuspendCallback for SuspendCallbackDBus {
1036     #[dbus_method("OnCallbackRegistered")]
on_callback_registered(&mut self, callback_id: u32)1037     fn on_callback_registered(&mut self, callback_id: u32) {
1038         dbus_generated!()
1039     }
1040     #[dbus_method("OnSuspendReady")]
on_suspend_ready(&mut self, suspend_id: i32)1041     fn on_suspend_ready(&mut self, suspend_id: i32) {
1042         dbus_generated!()
1043     }
1044     #[dbus_method("OnResumed")]
on_resumed(&mut self, suspend_id: i32)1045     fn on_resumed(&mut self, suspend_id: i32) {
1046         dbus_generated!()
1047     }
1048 }
1049 
1050 impl_dbus_arg_enum!(BthhReportType);
1051 
1052 #[allow(dead_code)]
1053 struct IBluetoothQALegacyDBus {}
1054 
1055 #[generate_dbus_exporter(
1056     export_bluetooth_qa_legacy_dbus_intf,
1057     "org.chromium.bluetooth.BluetoothQALegacy",
1058     BluetoothMixin,
1059     qa
1060 )]
1061 impl IBluetoothQALegacy for IBluetoothQALegacyDBus {
1062     #[dbus_method("GetConnectable")]
get_connectable(&self) -> bool1063     fn get_connectable(&self) -> bool {
1064         dbus_generated!()
1065     }
1066 
1067     #[dbus_method("SetConnectable")]
set_connectable(&mut self, mode: bool) -> bool1068     fn set_connectable(&mut self, mode: bool) -> bool {
1069         dbus_generated!()
1070     }
1071 
1072     #[dbus_method("GetAlias")]
get_alias(&self) -> String1073     fn get_alias(&self) -> String {
1074         dbus_generated!()
1075     }
1076 
1077     #[dbus_method("GetModalias")]
get_modalias(&self) -> String1078     fn get_modalias(&self) -> String {
1079         dbus_generated!()
1080     }
1081 
1082     #[dbus_method("GetHIDReport")]
get_hid_report( &mut self, addr: RawAddress, report_type: BthhReportType, report_id: u8, ) -> BtStatus1083     fn get_hid_report(
1084         &mut self,
1085         addr: RawAddress,
1086         report_type: BthhReportType,
1087         report_id: u8,
1088     ) -> BtStatus {
1089         dbus_generated!()
1090     }
1091 
1092     #[dbus_method("SetHIDReport")]
set_hid_report( &mut self, addr: RawAddress, report_type: BthhReportType, report: String, ) -> BtStatus1093     fn set_hid_report(
1094         &mut self,
1095         addr: RawAddress,
1096         report_type: BthhReportType,
1097         report: String,
1098     ) -> BtStatus {
1099         dbus_generated!()
1100     }
1101 
1102     #[dbus_method("SendHIDData")]
send_hid_data(&mut self, addr: RawAddress, data: String) -> BtStatus1103     fn send_hid_data(&mut self, addr: RawAddress, data: String) -> BtStatus {
1104         dbus_generated!()
1105     }
1106 }
1107