public interface BleLockScanner
TapkeyServiceFactory
to retrieve an instance of BleLockScanner.Modifier and Type | Method and Description |
---|---|
BleLock |
getLock(byte[] physicalLockId)
Returns the BLE lock representation of the lock with the specified lock ID.
|
BleLock |
getLock(String physicalLockId)
Returns the BLE lock representation of the lock with the specified lock ID.
|
Map<String,BleLock> |
getLocks()
Returns a list of nearby locks along with their Bluetooth address.
|
Observable<Map<String,BleLock>> |
getLocksChangedObservable()
Returns an Observable of a list of nearby locks along with their Bluetooth address.
|
boolean |
isLockNearby(byte[] physicalLockId)
Returns whether the Tapkey lock with the specified physical lock ID is nearby.
|
boolean |
isLockNearby(byte[] physicalLockId,
int rssiThreshold)
Same as
isLockNearby(byte[]) , but with configurable RSSI threshold. |
boolean |
isLockNearby(String physicalLockId)
Returns whether the Tapkey lock with the specified physical lock ID is nearby.
|
boolean |
isLockNearby(String physicalLockId,
int rssiThreshold)
Same as
isLockNearby(String) , but with configurable RSSI threshold. |
ObserverRegistration |
startForegroundScan()
Starts scanning for nearby Tapkey locks.
|
ObserverRegistration startForegroundScan()
getLocks()
and getLocksChangedObservable()
.Map<String,BleLock> getLocks()
BleLock
BleLock getLock(String physicalLockId)
physicalLockId
- the lock's physical lock ID.BleLock getLock(byte[] physicalLockId)
physicalLockId
- the lock's physical lock ID.boolean isLockNearby(String physicalLockId)
physicalLockId
- the lock's physical lock ID.boolean isLockNearby(byte[] physicalLockId)
physicalLockId
- the lock's physical lock ID.boolean isLockNearby(String physicalLockId, int rssiThreshold)
isLockNearby(String)
, but with configurable RSSI threshold.
If the specified lock is discovered with an RSSI below rssiThreshold, it will not be reported
as nearby. This method can be used to filter out locks with weak signal strength.physicalLockId
- the lock's physical lock ID.rssiThreshold
- the RSSI threshold for discovered locks to be reported as nearby.
The valid range is [-127, 126] but the actual RSSI range as reported by
the OS depends on the respective hardware and Bluetooth stack.isLockNearby(String)
boolean isLockNearby(byte[] physicalLockId, int rssiThreshold)
isLockNearby(byte[])
, but with configurable RSSI threshold.
If the specified lock is discovered with an RSSI below rssiThreshold, it will not be reported
as nearby. This method can be used to filter out locks with weak signal strength.physicalLockId
- the lock's physical lock ID.rssiThreshold
- the RSSI threshold for discovered locks to be reported as nearby.
The valid range is [-127, 126] but the actual RSSI range as reported by
the OS depends on the respective hardware and Bluetooth stack.isLockNearby(byte[])
Observable<Map<String,BleLock>> getLocksChangedObservable()