Loading system/gd/rust/linux/client/src/dbus_iface.rs +14 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ use bt_topshim::btif::{ BtBondState, BtConnectionState, BtDeviceType, BtDiscMode, BtPropertyType, BtSspVariant, BtStatus, BtTransport, Uuid, Uuid128Bit, BtStatus, BtTransport, BtVendorProductInfo, Uuid, Uuid128Bit, }; use bt_topshim::profiles::gatt::{AdvertisingStatus, GattStatus, LePhy}; use bt_topshim::profiles::hid_host::BthhReportType; Loading Loading @@ -195,6 +195,14 @@ pub struct BtSdpMpsRecordDBus { supported_dependencies: SupportedDependencies, } #[dbus_propmap(BtVendorProductInfo)] pub struct BtVendorProductInfoDBus { vendor_id_src: u8, vendor_id: u16, product_id: u16, version: u16, } fn read_propmap_value<T: 'static + DirectDBus>( propmap: &dbus::arg::PropMap, key: &str, Loading Loading @@ -821,6 +829,11 @@ impl IBluetooth for BluetoothDBus { dbus_generated!() } #[dbus_method("GetRemoteVendorProductInfo")] fn get_remote_vendor_product_info(&self, _device: BluetoothDevice) -> BtVendorProductInfo { dbus_generated!() } #[dbus_method("GetConnectedDevices")] fn get_connected_devices(&self) -> Vec<BluetoothDevice> { dbus_generated!() Loading system/gd/rust/linux/service/src/iface_bluetooth.rs +14 −1 Original line number Diff line number Diff line use bt_topshim::btif::{ BtBondState, BtConnectionState, BtDeviceType, BtDiscMode, BtPropertyType, BtSspVariant, BtStatus, BtTransport, Uuid, Uuid128Bit, BtStatus, BtTransport, BtVendorProductInfo, Uuid, Uuid128Bit, }; use bt_topshim::profiles::socket::SocketType; use bt_topshim::profiles::ProfileConnectionState; Loading Loading @@ -244,6 +244,14 @@ pub struct BtSdpMpsRecordDBus { supported_dependencies: SupportedDependencies, } #[dbus_propmap(BtVendorProductInfo)] pub struct BtVendorProductInfoDBus { vendor_id_src: u8, vendor_id: u16, product_id: u16, version: u16, } fn read_propmap_value<T: 'static + DirectDBus>( propmap: &dbus::arg::PropMap, key: &str, Loading Loading @@ -585,6 +593,11 @@ impl IBluetooth for IBluetoothDBus { dbus_generated!() } #[dbus_method("GetRemoteVendorProductInfo")] fn get_remote_vendor_product_info(&self, _device: BluetoothDevice) -> BtVendorProductInfo { dbus_generated!() } #[dbus_method("GetConnectedDevices")] fn get_connected_devices(&self) -> Vec<BluetoothDevice> { dbus_generated!() Loading system/gd/rust/linux/stack/src/bluetooth.rs +10 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,9 @@ pub trait IBluetooth { /// Gets whether the remote device can wake the system. fn get_remote_wake_allowed(&self, device: BluetoothDevice) -> bool; /// Gets the vendor and product information of the remote device. fn get_remote_vendor_product_info(&self, device: BluetoothDevice) -> BtVendorProductInfo; /// Returns a list of connected devices. fn get_connected_devices(&self) -> Vec<BluetoothDevice>; Loading Loading @@ -2169,6 +2172,13 @@ impl IBluetooth for Bluetooth { } } fn get_remote_vendor_product_info(&self, device: BluetoothDevice) -> BtVendorProductInfo { match self.get_remote_device_property(&device, &BtPropertyType::VendorProductInfo) { Some(BluetoothProperty::VendorProductInfo(p)) => p.clone(), _ => BtVendorProductInfo { vendor_id_src: 0, vendor_id: 0, product_id: 0, version: 0 }, } } fn get_connected_devices(&self) -> Vec<BluetoothDevice> { let bonded_connected: HashMap<String, BluetoothDevice> = self .bonded_devices Loading Loading
system/gd/rust/linux/client/src/dbus_iface.rs +14 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ use bt_topshim::btif::{ BtBondState, BtConnectionState, BtDeviceType, BtDiscMode, BtPropertyType, BtSspVariant, BtStatus, BtTransport, Uuid, Uuid128Bit, BtStatus, BtTransport, BtVendorProductInfo, Uuid, Uuid128Bit, }; use bt_topshim::profiles::gatt::{AdvertisingStatus, GattStatus, LePhy}; use bt_topshim::profiles::hid_host::BthhReportType; Loading Loading @@ -195,6 +195,14 @@ pub struct BtSdpMpsRecordDBus { supported_dependencies: SupportedDependencies, } #[dbus_propmap(BtVendorProductInfo)] pub struct BtVendorProductInfoDBus { vendor_id_src: u8, vendor_id: u16, product_id: u16, version: u16, } fn read_propmap_value<T: 'static + DirectDBus>( propmap: &dbus::arg::PropMap, key: &str, Loading Loading @@ -821,6 +829,11 @@ impl IBluetooth for BluetoothDBus { dbus_generated!() } #[dbus_method("GetRemoteVendorProductInfo")] fn get_remote_vendor_product_info(&self, _device: BluetoothDevice) -> BtVendorProductInfo { dbus_generated!() } #[dbus_method("GetConnectedDevices")] fn get_connected_devices(&self) -> Vec<BluetoothDevice> { dbus_generated!() Loading
system/gd/rust/linux/service/src/iface_bluetooth.rs +14 −1 Original line number Diff line number Diff line use bt_topshim::btif::{ BtBondState, BtConnectionState, BtDeviceType, BtDiscMode, BtPropertyType, BtSspVariant, BtStatus, BtTransport, Uuid, Uuid128Bit, BtStatus, BtTransport, BtVendorProductInfo, Uuid, Uuid128Bit, }; use bt_topshim::profiles::socket::SocketType; use bt_topshim::profiles::ProfileConnectionState; Loading Loading @@ -244,6 +244,14 @@ pub struct BtSdpMpsRecordDBus { supported_dependencies: SupportedDependencies, } #[dbus_propmap(BtVendorProductInfo)] pub struct BtVendorProductInfoDBus { vendor_id_src: u8, vendor_id: u16, product_id: u16, version: u16, } fn read_propmap_value<T: 'static + DirectDBus>( propmap: &dbus::arg::PropMap, key: &str, Loading Loading @@ -585,6 +593,11 @@ impl IBluetooth for IBluetoothDBus { dbus_generated!() } #[dbus_method("GetRemoteVendorProductInfo")] fn get_remote_vendor_product_info(&self, _device: BluetoothDevice) -> BtVendorProductInfo { dbus_generated!() } #[dbus_method("GetConnectedDevices")] fn get_connected_devices(&self) -> Vec<BluetoothDevice> { dbus_generated!() Loading
system/gd/rust/linux/stack/src/bluetooth.rs +10 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,9 @@ pub trait IBluetooth { /// Gets whether the remote device can wake the system. fn get_remote_wake_allowed(&self, device: BluetoothDevice) -> bool; /// Gets the vendor and product information of the remote device. fn get_remote_vendor_product_info(&self, device: BluetoothDevice) -> BtVendorProductInfo; /// Returns a list of connected devices. fn get_connected_devices(&self) -> Vec<BluetoothDevice>; Loading Loading @@ -2169,6 +2172,13 @@ impl IBluetooth for Bluetooth { } } fn get_remote_vendor_product_info(&self, device: BluetoothDevice) -> BtVendorProductInfo { match self.get_remote_device_property(&device, &BtPropertyType::VendorProductInfo) { Some(BluetoothProperty::VendorProductInfo(p)) => p.clone(), _ => BtVendorProductInfo { vendor_id_src: 0, vendor_id: 0, product_id: 0, version: 0 }, } } fn get_connected_devices(&self) -> Vec<BluetoothDevice> { let bonded_connected: HashMap<String, BluetoothDevice> = self .bonded_devices Loading