mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[bluetooth.bluez] Fix the unpairing of all devices on binding disposal (#9011)
Signed-off-by: Benjamin Lafois <benjamin.lafois@gmail.com>
This commit is contained in:
parent
821a84067a
commit
2730bc8a2e
@ -120,6 +120,10 @@ public class BlueZBluetoothDevice extends BaseBluetoothDevice implements BlueZEv
|
||||
public void dispose() {
|
||||
BluetoothDevice dev = device;
|
||||
if (dev != null) {
|
||||
if (Boolean.TRUE.equals(dev.isPaired())) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
dev.getAdapter().removeDevice(dev.getRawDevice());
|
||||
} catch (DBusException ex) {
|
||||
@ -359,8 +363,10 @@ public class BlueZBluetoothDevice extends BaseBluetoothDevice implements BlueZEv
|
||||
}
|
||||
BluetoothCharacteristic c = getCharacteristic(UUID.fromString(characteristic.getUuid()));
|
||||
if (c != null) {
|
||||
c.setValue(event.getData());
|
||||
notifyListeners(BluetoothEventType.CHARACTERISTIC_UPDATED, c, BluetoothCompletionStatus.SUCCESS);
|
||||
synchronized (c) {
|
||||
c.setValue(event.getData());
|
||||
notifyListeners(BluetoothEventType.CHARACTERISTIC_UPDATED, c, BluetoothCompletionStatus.SUCCESS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user