mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[bluetooth.bluegiga] Fix broken device discovery (#8906)
Signed-off-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com>
This commit is contained in:
parent
7bff7f1bf3
commit
d83dbb408f
@ -127,6 +127,10 @@ public class BlueGigaBluetoothDevice extends BaseBluetoothDevice implements Blue
|
||||
updateLastSeenTime();
|
||||
}
|
||||
|
||||
public void setAddressType(BluetoothAddressType addressType) {
|
||||
this.addressType = addressType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean connect() {
|
||||
if (connection != -1) {
|
||||
|
@ -141,10 +141,6 @@ public class BlueGigaBridgeHandler extends AbstractBluetoothBridgeHandler<BlueGi
|
||||
// Our BT address
|
||||
private @Nullable BluetoothAddress address;
|
||||
|
||||
// Map of Bluetooth devices known to this bridge.
|
||||
// This is all devices we have heard on the network - not just things bound to the bridge
|
||||
private final Map<BluetoothAddress, BlueGigaBluetoothDevice> devices = new ConcurrentHashMap<>();
|
||||
|
||||
// Map of open connections
|
||||
private final Map<Integer, BluetoothAddress> connections = new ConcurrentHashMap<>();
|
||||
|
||||
@ -707,14 +703,9 @@ public class BlueGigaBridgeHandler extends AbstractBluetoothBridgeHandler<BlueGi
|
||||
// We use the scan event to add any devices we hear to the devices list
|
||||
// The device gets created, and then manages itself for discovery etc.
|
||||
BluetoothAddress sender = new BluetoothAddress(scanEvent.getSender());
|
||||
if (!devices.containsKey(sender)) {
|
||||
BlueGigaBluetoothDevice device;
|
||||
logger.debug("BlueGiga adding new device to adaptor {}: {}", address, sender);
|
||||
device = new BlueGigaBluetoothDevice(this, new BluetoothAddress(scanEvent.getSender()),
|
||||
scanEvent.getAddressType());
|
||||
devices.put(sender, device);
|
||||
deviceDiscovered(device);
|
||||
}
|
||||
BlueGigaBluetoothDevice device = getDevice(sender);
|
||||
device.setAddressType(scanEvent.getAddressType());
|
||||
deviceDiscovered(device);
|
||||
} else {
|
||||
logger.trace("Ignore BlueGigaScanResponseEvent as initialization is not complete");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user