Loading system/gd/rust/linux/client/src/command_handler.rs +18 −10 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ use bt_topshim::btif::{BtConnectionState, BtDiscMode, BtStatus, BtTransport}; use bt_topshim::profiles::hid_host::BthhReportType; use bt_topshim::profiles::sdp::{BtSdpMpsRecord, BtSdpRecord}; use bt_topshim::profiles::{gatt::LePhy, ProfileConnectionState}; use btstack::bluetooth::{BluetoothDevice, IBluetooth, IBluetoothQA}; use btstack::bluetooth::{BluetoothDevice, IBluetooth, IBluetoothQALegacy}; use btstack::bluetooth_gatt::{GattWriteType, IBluetoothGatt, ScanSettings, ScanType}; use btstack::bluetooth_media::IBluetoothTelephony; use btstack::socket_manager::{IBluetoothSocketManager, SocketResult}; Loading Loading @@ -462,13 +462,13 @@ impl CommandHandler { }; let context = self.lock_context(); let adapter_dbus = context.adapter_dbus.as_ref().unwrap(); let qa_dbus = context.qa_dbus.as_ref().unwrap(); let qa_legacy_dbus = context.qa_legacy_dbus.as_ref().unwrap(); let name = adapter_dbus.get_name(); let uuids = adapter_dbus.get_uuids(); let is_discoverable = adapter_dbus.get_discoverable(); let is_connectable = qa_dbus.get_connectable(); let alias = qa_dbus.get_alias(); let modalias = qa_dbus.get_modalias(); let is_connectable = qa_legacy_dbus.get_connectable(); let alias = qa_legacy_dbus.get_alias(); let modalias = qa_legacy_dbus.get_modalias(); let discoverable_timeout = adapter_dbus.get_discoverable_timeout(); let cod = adapter_dbus.get_bluetooth_class(); let multi_adv_supported = adapter_dbus.is_multi_advertisement_supported(); Loading Loading @@ -560,11 +560,13 @@ impl CommandHandler { }, "connectable" => match &get_arg(args, 1)?[..] { "on" => { let ret = self.lock_context().qa_dbus.as_mut().unwrap().set_connectable(true); let ret = self.lock_context().qa_legacy_dbus.as_mut().unwrap().set_connectable(true); print_info!("Set connectable on {}", if ret { "succeeded" } else { "failed" }); } "off" => { let ret = self.lock_context().qa_dbus.as_mut().unwrap().set_connectable(false); let ret = self.lock_context().qa_legacy_dbus.as_mut().unwrap().set_connectable(false); print_info!("Set connectable off {}", if ret { "succeeded" } else { "failed" }); } other => println!("Invalid argument for adapter connectable '{}'", other), Loading Loading @@ -1573,7 +1575,7 @@ impl CommandHandler { .parse::<u8>() .or(Err("Failed parsing report_id"))?; self.context.lock().unwrap().qa_dbus.as_mut().unwrap().get_hid_report( self.context.lock().unwrap().qa_legacy_dbus.as_mut().unwrap().get_hid_report( addr, report_type, report_id, Loading @@ -1591,7 +1593,7 @@ impl CommandHandler { }; let report_value = String::from(get_arg(args, 3)?); self.context.lock().unwrap().qa_dbus.as_mut().unwrap().set_hid_report( self.context.lock().unwrap().qa_legacy_dbus.as_mut().unwrap().set_hid_report( addr, report_type, report_value, Loading @@ -1601,7 +1603,13 @@ impl CommandHandler { let addr = String::from(get_arg(args, 1)?); let data = String::from(get_arg(args, 2)?); self.context.lock().unwrap().qa_dbus.as_mut().unwrap().send_hid_data(addr, data); self.context .lock() .unwrap() .qa_legacy_dbus .as_mut() .unwrap() .send_hid_data(addr, data); } _ => return Err(CommandError::InvalidArgs), }; Loading system/gd/rust/linux/client/src/dbus_iface.rs +8 −7 Original line number Diff line number Diff line Loading @@ -15,7 +15,8 @@ use bt_topshim::profiles::socket::SocketType; use bt_topshim::profiles::ProfileConnectionState; use btstack::bluetooth::{ BluetoothDevice, IBluetooth, IBluetoothCallback, IBluetoothConnectionCallback, IBluetoothQA, BluetoothDevice, IBluetooth, IBluetoothCallback, IBluetoothConnectionCallback, IBluetoothQALegacy, }; use btstack::bluetooth_admin::{IBluetoothAdmin, IBluetoothAdminPolicyCallback, PolicyEffect}; use btstack::bluetooth_adv::{ Loading Loading @@ -872,25 +873,25 @@ impl IBluetooth for BluetoothDBus { } } pub(crate) struct BluetoothQADBus { pub(crate) struct BluetoothQALegacyDBus { client_proxy: ClientDBusProxy, } impl BluetoothQADBus { pub(crate) fn new(conn: Arc<SyncConnection>, index: i32) -> BluetoothQADBus { BluetoothQADBus { impl BluetoothQALegacyDBus { pub(crate) fn new(conn: Arc<SyncConnection>, index: i32) -> BluetoothQALegacyDBus { BluetoothQALegacyDBus { client_proxy: ClientDBusProxy::new( conn.clone(), String::from("org.chromium.bluetooth"), make_object_path(index, "adapter"), String::from("org.chromium.bluetooth.BluetoothQA"), String::from("org.chromium.bluetooth.BluetoothQALegacy"), ), } } } #[generate_dbus_interface_client] impl IBluetoothQA for BluetoothQADBus { impl IBluetoothQALegacy for BluetoothQALegacyDBus { #[dbus_method("GetConnectable")] fn get_connectable(&self) -> bool { dbus_generated!() Loading system/gd/rust/linux/client/src/main.rs +6 −6 Original line number Diff line number Diff line Loading @@ -17,8 +17,8 @@ use crate::callbacks::{ }; use crate::command_handler::{CommandHandler, SocketSchedule}; use crate::dbus_iface::{ BluetoothAdminDBus, BluetoothDBus, BluetoothGattDBus, BluetoothManagerDBus, BluetoothQADBus, BluetoothSocketManagerDBus, BluetoothTelephonyDBus, SuspendDBus, BluetoothAdminDBus, BluetoothDBus, BluetoothGattDBus, BluetoothManagerDBus, BluetoothQALegacyDBus, BluetoothSocketManagerDBus, BluetoothTelephonyDBus, SuspendDBus, }; use crate::editor::AsyncEditor; use bt_topshim::topstack; Loading Loading @@ -74,8 +74,8 @@ pub(crate) struct ClientContext { /// Proxy for adapter interface. Only exists when the default adapter is enabled. pub(crate) adapter_dbus: Option<BluetoothDBus>, /// Proxy for adapter QA interface. Only exists when the default adapter is enabled. pub(crate) qa_dbus: Option<BluetoothQADBus>, /// Proxy for adapter QA Legacy interface. Only exists when the default adapter is enabled. pub(crate) qa_legacy_dbus: Option<BluetoothQALegacyDBus>, /// Proxy for GATT interface. pub(crate) gatt_dbus: Option<BluetoothGattDBus>, Loading Loading @@ -155,7 +155,7 @@ impl ClientContext { bonded_devices: HashMap::new(), manager_dbus, adapter_dbus: None, qa_dbus: None, qa_legacy_dbus: None, gatt_dbus: None, admin_dbus: None, suspend_dbus: None, Loading Loading @@ -204,7 +204,7 @@ impl ClientContext { let dbus = BluetoothDBus::new(conn.clone(), idx); self.adapter_dbus = Some(dbus); self.qa_dbus = Some(BluetoothQADBus::new(conn.clone(), idx)); self.qa_legacy_dbus = Some(BluetoothQALegacyDBus::new(conn.clone(), idx)); let gatt_dbus = BluetoothGattDBus::new(conn.clone(), idx); self.gatt_dbus = Some(gatt_dbus); Loading system/gd/rust/linux/service/src/iface_bluetooth.rs +5 −5 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ use bt_topshim::profiles::sdp::{ use btstack::bluetooth::{ Bluetooth, BluetoothDevice, IBluetooth, IBluetoothCallback, IBluetoothConnectionCallback, IBluetoothQA, IBluetoothQALegacy, }; use btstack::socket_manager::{ BluetoothServerSocket, BluetoothSocket, BluetoothSocketManager, CallbackId, Loading Loading @@ -898,15 +898,15 @@ impl ISuspendCallback for SuspendCallbackDBus { impl_dbus_arg_enum!(BthhReportType); #[allow(dead_code)] struct IBluetoothQADBus {} struct IBluetoothQALegacyDBus {} #[generate_dbus_exporter( export_bluetooth_qa_dbus_intf, "org.chromium.bluetooth.BluetoothQA", export_bluetooth_qa_legacy_dbus_intf, "org.chromium.bluetooth.BluetoothQALegacy", BluetoothMixin, qa )] impl IBluetoothQA for IBluetoothQADBus { impl IBluetoothQALegacy for IBluetoothQALegacyDBus { #[dbus_method("GetConnectable")] fn get_connectable(&self) -> bool { dbus_generated!() Loading system/gd/rust/linux/service/src/main.rs +2 −2 Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ fn main() -> Result<(), Box<dyn Error>> { &mut cr.lock().unwrap(), disconnect_watcher.clone(), ); let qa_iface = iface_bluetooth::export_bluetooth_qa_dbus_intf( let qa_legacy_iface = iface_bluetooth::export_bluetooth_qa_legacy_dbus_intf( conn.clone(), &mut cr.lock().unwrap(), disconnect_watcher.clone(), Loading Loading @@ -305,7 +305,7 @@ fn main() -> Result<(), Box<dyn Error>> { cr.lock().unwrap().insert( make_object_name(adapter_index, "adapter"), &[adapter_iface, qa_iface, socket_mgr_iface, suspend_iface], &[adapter_iface, qa_legacy_iface, socket_mgr_iface, suspend_iface], mixin, ); Loading Loading
system/gd/rust/linux/client/src/command_handler.rs +18 −10 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ use bt_topshim::btif::{BtConnectionState, BtDiscMode, BtStatus, BtTransport}; use bt_topshim::profiles::hid_host::BthhReportType; use bt_topshim::profiles::sdp::{BtSdpMpsRecord, BtSdpRecord}; use bt_topshim::profiles::{gatt::LePhy, ProfileConnectionState}; use btstack::bluetooth::{BluetoothDevice, IBluetooth, IBluetoothQA}; use btstack::bluetooth::{BluetoothDevice, IBluetooth, IBluetoothQALegacy}; use btstack::bluetooth_gatt::{GattWriteType, IBluetoothGatt, ScanSettings, ScanType}; use btstack::bluetooth_media::IBluetoothTelephony; use btstack::socket_manager::{IBluetoothSocketManager, SocketResult}; Loading Loading @@ -462,13 +462,13 @@ impl CommandHandler { }; let context = self.lock_context(); let adapter_dbus = context.adapter_dbus.as_ref().unwrap(); let qa_dbus = context.qa_dbus.as_ref().unwrap(); let qa_legacy_dbus = context.qa_legacy_dbus.as_ref().unwrap(); let name = adapter_dbus.get_name(); let uuids = adapter_dbus.get_uuids(); let is_discoverable = adapter_dbus.get_discoverable(); let is_connectable = qa_dbus.get_connectable(); let alias = qa_dbus.get_alias(); let modalias = qa_dbus.get_modalias(); let is_connectable = qa_legacy_dbus.get_connectable(); let alias = qa_legacy_dbus.get_alias(); let modalias = qa_legacy_dbus.get_modalias(); let discoverable_timeout = adapter_dbus.get_discoverable_timeout(); let cod = adapter_dbus.get_bluetooth_class(); let multi_adv_supported = adapter_dbus.is_multi_advertisement_supported(); Loading Loading @@ -560,11 +560,13 @@ impl CommandHandler { }, "connectable" => match &get_arg(args, 1)?[..] { "on" => { let ret = self.lock_context().qa_dbus.as_mut().unwrap().set_connectable(true); let ret = self.lock_context().qa_legacy_dbus.as_mut().unwrap().set_connectable(true); print_info!("Set connectable on {}", if ret { "succeeded" } else { "failed" }); } "off" => { let ret = self.lock_context().qa_dbus.as_mut().unwrap().set_connectable(false); let ret = self.lock_context().qa_legacy_dbus.as_mut().unwrap().set_connectable(false); print_info!("Set connectable off {}", if ret { "succeeded" } else { "failed" }); } other => println!("Invalid argument for adapter connectable '{}'", other), Loading Loading @@ -1573,7 +1575,7 @@ impl CommandHandler { .parse::<u8>() .or(Err("Failed parsing report_id"))?; self.context.lock().unwrap().qa_dbus.as_mut().unwrap().get_hid_report( self.context.lock().unwrap().qa_legacy_dbus.as_mut().unwrap().get_hid_report( addr, report_type, report_id, Loading @@ -1591,7 +1593,7 @@ impl CommandHandler { }; let report_value = String::from(get_arg(args, 3)?); self.context.lock().unwrap().qa_dbus.as_mut().unwrap().set_hid_report( self.context.lock().unwrap().qa_legacy_dbus.as_mut().unwrap().set_hid_report( addr, report_type, report_value, Loading @@ -1601,7 +1603,13 @@ impl CommandHandler { let addr = String::from(get_arg(args, 1)?); let data = String::from(get_arg(args, 2)?); self.context.lock().unwrap().qa_dbus.as_mut().unwrap().send_hid_data(addr, data); self.context .lock() .unwrap() .qa_legacy_dbus .as_mut() .unwrap() .send_hid_data(addr, data); } _ => return Err(CommandError::InvalidArgs), }; Loading
system/gd/rust/linux/client/src/dbus_iface.rs +8 −7 Original line number Diff line number Diff line Loading @@ -15,7 +15,8 @@ use bt_topshim::profiles::socket::SocketType; use bt_topshim::profiles::ProfileConnectionState; use btstack::bluetooth::{ BluetoothDevice, IBluetooth, IBluetoothCallback, IBluetoothConnectionCallback, IBluetoothQA, BluetoothDevice, IBluetooth, IBluetoothCallback, IBluetoothConnectionCallback, IBluetoothQALegacy, }; use btstack::bluetooth_admin::{IBluetoothAdmin, IBluetoothAdminPolicyCallback, PolicyEffect}; use btstack::bluetooth_adv::{ Loading Loading @@ -872,25 +873,25 @@ impl IBluetooth for BluetoothDBus { } } pub(crate) struct BluetoothQADBus { pub(crate) struct BluetoothQALegacyDBus { client_proxy: ClientDBusProxy, } impl BluetoothQADBus { pub(crate) fn new(conn: Arc<SyncConnection>, index: i32) -> BluetoothQADBus { BluetoothQADBus { impl BluetoothQALegacyDBus { pub(crate) fn new(conn: Arc<SyncConnection>, index: i32) -> BluetoothQALegacyDBus { BluetoothQALegacyDBus { client_proxy: ClientDBusProxy::new( conn.clone(), String::from("org.chromium.bluetooth"), make_object_path(index, "adapter"), String::from("org.chromium.bluetooth.BluetoothQA"), String::from("org.chromium.bluetooth.BluetoothQALegacy"), ), } } } #[generate_dbus_interface_client] impl IBluetoothQA for BluetoothQADBus { impl IBluetoothQALegacy for BluetoothQALegacyDBus { #[dbus_method("GetConnectable")] fn get_connectable(&self) -> bool { dbus_generated!() Loading
system/gd/rust/linux/client/src/main.rs +6 −6 Original line number Diff line number Diff line Loading @@ -17,8 +17,8 @@ use crate::callbacks::{ }; use crate::command_handler::{CommandHandler, SocketSchedule}; use crate::dbus_iface::{ BluetoothAdminDBus, BluetoothDBus, BluetoothGattDBus, BluetoothManagerDBus, BluetoothQADBus, BluetoothSocketManagerDBus, BluetoothTelephonyDBus, SuspendDBus, BluetoothAdminDBus, BluetoothDBus, BluetoothGattDBus, BluetoothManagerDBus, BluetoothQALegacyDBus, BluetoothSocketManagerDBus, BluetoothTelephonyDBus, SuspendDBus, }; use crate::editor::AsyncEditor; use bt_topshim::topstack; Loading Loading @@ -74,8 +74,8 @@ pub(crate) struct ClientContext { /// Proxy for adapter interface. Only exists when the default adapter is enabled. pub(crate) adapter_dbus: Option<BluetoothDBus>, /// Proxy for adapter QA interface. Only exists when the default adapter is enabled. pub(crate) qa_dbus: Option<BluetoothQADBus>, /// Proxy for adapter QA Legacy interface. Only exists when the default adapter is enabled. pub(crate) qa_legacy_dbus: Option<BluetoothQALegacyDBus>, /// Proxy for GATT interface. pub(crate) gatt_dbus: Option<BluetoothGattDBus>, Loading Loading @@ -155,7 +155,7 @@ impl ClientContext { bonded_devices: HashMap::new(), manager_dbus, adapter_dbus: None, qa_dbus: None, qa_legacy_dbus: None, gatt_dbus: None, admin_dbus: None, suspend_dbus: None, Loading Loading @@ -204,7 +204,7 @@ impl ClientContext { let dbus = BluetoothDBus::new(conn.clone(), idx); self.adapter_dbus = Some(dbus); self.qa_dbus = Some(BluetoothQADBus::new(conn.clone(), idx)); self.qa_legacy_dbus = Some(BluetoothQALegacyDBus::new(conn.clone(), idx)); let gatt_dbus = BluetoothGattDBus::new(conn.clone(), idx); self.gatt_dbus = Some(gatt_dbus); Loading
system/gd/rust/linux/service/src/iface_bluetooth.rs +5 −5 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ use bt_topshim::profiles::sdp::{ use btstack::bluetooth::{ Bluetooth, BluetoothDevice, IBluetooth, IBluetoothCallback, IBluetoothConnectionCallback, IBluetoothQA, IBluetoothQALegacy, }; use btstack::socket_manager::{ BluetoothServerSocket, BluetoothSocket, BluetoothSocketManager, CallbackId, Loading Loading @@ -898,15 +898,15 @@ impl ISuspendCallback for SuspendCallbackDBus { impl_dbus_arg_enum!(BthhReportType); #[allow(dead_code)] struct IBluetoothQADBus {} struct IBluetoothQALegacyDBus {} #[generate_dbus_exporter( export_bluetooth_qa_dbus_intf, "org.chromium.bluetooth.BluetoothQA", export_bluetooth_qa_legacy_dbus_intf, "org.chromium.bluetooth.BluetoothQALegacy", BluetoothMixin, qa )] impl IBluetoothQA for IBluetoothQADBus { impl IBluetoothQALegacy for IBluetoothQALegacyDBus { #[dbus_method("GetConnectable")] fn get_connectable(&self) -> bool { dbus_generated!() Loading
system/gd/rust/linux/service/src/main.rs +2 −2 Original line number Diff line number Diff line Loading @@ -236,7 +236,7 @@ fn main() -> Result<(), Box<dyn Error>> { &mut cr.lock().unwrap(), disconnect_watcher.clone(), ); let qa_iface = iface_bluetooth::export_bluetooth_qa_dbus_intf( let qa_legacy_iface = iface_bluetooth::export_bluetooth_qa_legacy_dbus_intf( conn.clone(), &mut cr.lock().unwrap(), disconnect_watcher.clone(), Loading Loading @@ -305,7 +305,7 @@ fn main() -> Result<(), Box<dyn Error>> { cr.lock().unwrap().insert( make_object_name(adapter_index, "adapter"), &[adapter_iface, qa_iface, socket_mgr_iface, suspend_iface], &[adapter_iface, qa_legacy_iface, socket_mgr_iface, suspend_iface], mixin, ); Loading