diff options
Diffstat (limited to 'system/gd/rust/linux/stack/src/bluetooth.rs')
-rw-r--r-- | system/gd/rust/linux/stack/src/bluetooth.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/system/gd/rust/linux/stack/src/bluetooth.rs b/system/gd/rust/linux/stack/src/bluetooth.rs index ef9ea31ae9..550de70517 100644 --- a/system/gd/rust/linux/stack/src/bluetooth.rs +++ b/system/gd/rust/linux/stack/src/bluetooth.rs @@ -73,6 +73,9 @@ pub trait IBluetooth { /// Returns whether the adapter is discoverable. fn get_discoverable(&self) -> bool; + /// Returns the adapter discoverable timeout. + fn get_discoverable_timeout(&self) -> u32; + /// Sets discoverability. If discoverable, limits the duration with given value. fn set_discoverable(&self, mode: bool, duration: u32) -> bool; @@ -856,6 +859,16 @@ impl IBluetooth for Bluetooth { } } + fn get_discoverable_timeout(&self) -> u32 { + match self.properties.get(&BtPropertyType::AdapterDiscoverableTimeout) { + Some(prop) => match prop { + BluetoothProperty::AdapterDiscoverableTimeout(timeout) => timeout.clone(), + _ => 0, + }, + _ => 0, + } + } + fn set_discoverable(&self, mode: bool, duration: u32) -> bool { self.intf .lock() |