Skip to content

Commit 28fb6cc

Browse files
Hojjatmmstick
authored andcommitted
fix(bluetooth): call pair() for unpaired devices before connecting
1 parent 243d302 commit 28fb6cc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

subscriptions/bluetooth/src/device.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ pub async fn connect_device(connection: zbus::Connection, device_path: OwnedObje
240240
let result = async {
241241
if proxy.device.connected().await? {
242242
Ok(())
243+
} else if !proxy.device.paired().await.unwrap_or(false) {
244+
proxy.device.pair().await
243245
} else {
244246
proxy.device.connect().await
245247
}

0 commit comments

Comments
 (0)