Loading system/gd/rust/linux/client/src/command_handler.rs +22 −2 Original line number Diff line number Diff line Loading @@ -595,7 +595,16 @@ impl CommandHandler { name: String::from("Classic Device"), }; let (name, alias, device_type, class, bonded, connection_state, uuids) = { let ( name, alias, device_type, class, appearance, bonded, connection_state, uuids, ) = { let ctx = self.context.lock().unwrap(); let adapter = ctx.adapter_dbus.as_ref().unwrap(); Loading @@ -603,6 +612,7 @@ impl CommandHandler { let device_type = adapter.get_remote_type(device.clone()); let alias = adapter.get_remote_alias(device.clone()); let class = adapter.get_remote_class(device.clone()); let appearance = adapter.get_remote_appearance(device.clone()); let bonded = adapter.get_bond_state(device.clone()); let connection_state = match adapter.get_connection_state(device.clone()) { BtConnectionState::NotConnected => "Not Connected", Loading @@ -611,7 +621,16 @@ impl CommandHandler { }; let uuids = adapter.get_remote_uuids(device.clone()); (name, alias, device_type, class, bonded, connection_state, uuids) ( name, alias, device_type, class, appearance, bonded, connection_state, uuids, ) }; let uuid_helper = UuidHelper::new(); Loading @@ -620,6 +639,7 @@ impl CommandHandler { print_info!("Alias: {}", alias); print_info!("Type: {:?}", device_type); print_info!("Class: {}", class); print_info!("Appearance: {}", appearance); print_info!("Bond State: {:?}", bonded); print_info!("Connection State: {}", connection_state); print_info!( Loading system/gd/rust/linux/client/src/dbus_iface.rs +5 −0 Original line number Diff line number Diff line Loading @@ -538,6 +538,11 @@ impl IBluetooth for BluetoothDBus { dbus_generated!() } #[dbus_method("GetRemoteAppearance")] fn get_remote_appearance(&self, device: BluetoothDevice) -> u16 { dbus_generated!() } #[dbus_method("GetRemoteConnected")] fn get_remote_connected(&self, device: BluetoothDevice) -> bool { dbus_generated!() Loading system/gd/rust/linux/service/src/iface_bluetooth.rs +5 −0 Original line number Diff line number Diff line Loading @@ -316,6 +316,11 @@ impl IBluetooth for IBluetoothDBus { dbus_generated!() } #[dbus_method("GetRemoteAppearance")] fn get_remote_appearance(&self, _device: BluetoothDevice) -> u16 { dbus_generated!() } #[dbus_method("GetRemoteConnected")] fn get_remote_connected(&self, _device: BluetoothDevice) -> bool { dbus_generated!() Loading system/gd/rust/linux/stack/src/bluetooth.rs +10 −0 Original line number Diff line number Diff line Loading @@ -156,6 +156,9 @@ pub trait IBluetooth { /// Gets the class of the remote device. fn get_remote_class(&self, device: BluetoothDevice) -> u32; /// Gets the appearance of the remote device. fn get_remote_appearance(&self, device: BluetoothDevice) -> u16; /// Gets whether the remote device is connected. fn get_remote_connected(&self, device: BluetoothDevice) -> bool; Loading Loading @@ -1417,6 +1420,13 @@ impl IBluetooth for Bluetooth { } } fn get_remote_appearance(&self, device: BluetoothDevice) -> u16 { match self.get_remote_device_property(&device, &BtPropertyType::Appearance) { Some(BluetoothProperty::Appearance(appearance)) => appearance, _ => 0, } } fn get_remote_connected(&self, device: BluetoothDevice) -> bool { self.get_connection_state(device) != BtConnectionState::NotConnected } Loading Loading
system/gd/rust/linux/client/src/command_handler.rs +22 −2 Original line number Diff line number Diff line Loading @@ -595,7 +595,16 @@ impl CommandHandler { name: String::from("Classic Device"), }; let (name, alias, device_type, class, bonded, connection_state, uuids) = { let ( name, alias, device_type, class, appearance, bonded, connection_state, uuids, ) = { let ctx = self.context.lock().unwrap(); let adapter = ctx.adapter_dbus.as_ref().unwrap(); Loading @@ -603,6 +612,7 @@ impl CommandHandler { let device_type = adapter.get_remote_type(device.clone()); let alias = adapter.get_remote_alias(device.clone()); let class = adapter.get_remote_class(device.clone()); let appearance = adapter.get_remote_appearance(device.clone()); let bonded = adapter.get_bond_state(device.clone()); let connection_state = match adapter.get_connection_state(device.clone()) { BtConnectionState::NotConnected => "Not Connected", Loading @@ -611,7 +621,16 @@ impl CommandHandler { }; let uuids = adapter.get_remote_uuids(device.clone()); (name, alias, device_type, class, bonded, connection_state, uuids) ( name, alias, device_type, class, appearance, bonded, connection_state, uuids, ) }; let uuid_helper = UuidHelper::new(); Loading @@ -620,6 +639,7 @@ impl CommandHandler { print_info!("Alias: {}", alias); print_info!("Type: {:?}", device_type); print_info!("Class: {}", class); print_info!("Appearance: {}", appearance); print_info!("Bond State: {:?}", bonded); print_info!("Connection State: {}", connection_state); print_info!( Loading
system/gd/rust/linux/client/src/dbus_iface.rs +5 −0 Original line number Diff line number Diff line Loading @@ -538,6 +538,11 @@ impl IBluetooth for BluetoothDBus { dbus_generated!() } #[dbus_method("GetRemoteAppearance")] fn get_remote_appearance(&self, device: BluetoothDevice) -> u16 { dbus_generated!() } #[dbus_method("GetRemoteConnected")] fn get_remote_connected(&self, device: BluetoothDevice) -> bool { dbus_generated!() Loading
system/gd/rust/linux/service/src/iface_bluetooth.rs +5 −0 Original line number Diff line number Diff line Loading @@ -316,6 +316,11 @@ impl IBluetooth for IBluetoothDBus { dbus_generated!() } #[dbus_method("GetRemoteAppearance")] fn get_remote_appearance(&self, _device: BluetoothDevice) -> u16 { dbus_generated!() } #[dbus_method("GetRemoteConnected")] fn get_remote_connected(&self, _device: BluetoothDevice) -> bool { dbus_generated!() Loading
system/gd/rust/linux/stack/src/bluetooth.rs +10 −0 Original line number Diff line number Diff line Loading @@ -156,6 +156,9 @@ pub trait IBluetooth { /// Gets the class of the remote device. fn get_remote_class(&self, device: BluetoothDevice) -> u32; /// Gets the appearance of the remote device. fn get_remote_appearance(&self, device: BluetoothDevice) -> u16; /// Gets whether the remote device is connected. fn get_remote_connected(&self, device: BluetoothDevice) -> bool; Loading Loading @@ -1417,6 +1420,13 @@ impl IBluetooth for Bluetooth { } } fn get_remote_appearance(&self, device: BluetoothDevice) -> u16 { match self.get_remote_device_property(&device, &BtPropertyType::Appearance) { Some(BluetoothProperty::Appearance(appearance)) => appearance, _ => 0, } } fn get_remote_connected(&self, device: BluetoothDevice) -> bool { self.get_connection_state(device) != BtConnectionState::NotConnected } Loading