We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4930ae8 + 6b520fe commit f1cda82Copy full SHA for f1cda82
bluez-async/CHANGELOG.md
@@ -1,5 +1,11 @@
1
# Changelog
2
3
+## Unreleased
4
+
5
+### New features
6
7
+- Added `set_powered` to `BluetoothSession`.
8
9
## 0.8.1
10
11
### New features
bluez-async/src/lib.rs
@@ -296,6 +296,16 @@ impl BluetoothSession {
296
Ok((dbus_handle.map(|res| res?), BluetoothSession { connection }))
297
}
298
299
+ /// Powers the given adapter on or off.
300
+ pub async fn set_powered(
301
+ &self,
302
+ adapter_id: &AdapterId,
303
+ powered: bool,
304
+ ) -> Result<(), BluetoothError> {
305
+ self.adapter(adapter_id).set_powered(powered).await?;
306
+ Ok(())
307
+ }
308
309
/// Power on all Bluetooth adapters, remove any discovery filter, and then start scanning for
310
/// devices.
311
///
0 commit comments