Skip to content

Commit 78ea590

Browse files
committed
wip
1 parent 0bc98b4 commit 78ea590

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

.direnv/flake-profile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
flake-profile-10-link
1+
flake-profile-11-link

.direnv/flake-profile-10-link

Lines changed: 0 additions & 1 deletion
This file was deleted.

.direnv/flake-profile-11-link

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/nix/store/j92xpjbmjdd47wpd4z7zpqbx8kkw3ynq-nix-shell-env

src/bluetooth/bluetooth_manager_dbus.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@ pub fn setup_bluetooth_manager(cross: &mut Crossroads) -> dbus_crossroads::Iface
2727
c.method_with_cr_async("StartBluetoothScan", (), (), move |mut ctx, cross, ()| {
2828
let data: &mut DaemonData = cross.data_mut(ctx.path()).unwrap();
2929
data.bluetooth_scan_request.store(1, Ordering::SeqCst);
30-
data.b_interface
31-
.start_bluetooth_discovery(data.bluetooth_scan_active.clone());
30+
if !data.bluetooth_listener_active.load(Ordering::SeqCst) {
31+
data.b_interface
32+
.start_bluetooth_discovery(data.bluetooth_scan_active.clone());
33+
}
3234
async move { ctx.reply(Ok(())) }
3335
});
3436
c.method_with_cr_async("StopBluetoothScan", (), (), move |mut ctx, cross, ()| {
3537
let data: &mut DaemonData = cross.data_mut(ctx.path()).unwrap();
3638
data.bluetooth_scan_request.store(2, Ordering::SeqCst);
37-
data.b_interface
38-
.stop_bluetooth_discovery(data.bluetooth_scan_active.clone());
39+
if !data.bluetooth_listener_active.load(Ordering::SeqCst) {
40+
data.b_interface
41+
.stop_bluetooth_discovery(data.bluetooth_scan_active.clone());
42+
}
3943
async move { ctx.reply(Ok(())) }
4044
});
4145
c.method_with_cr_async(

0 commit comments

Comments
 (0)