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) {
}
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);
+ }
}
}