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