waitForLockStatusChange

open suspend override fun waitForLockStatusChange(lockState: Byte, timeoutInSeconds: Long)

Waits for lock state change.

This method is used to wait for full lock state change, e.g to be sure the lock was opened or closed.

try {
closeLock()
waitForLockStatusChange(BluetoothConstants.LOCK_CLOSED)
openLock()
waitForLockStatusChange(BluetoothConstants.LOCK_OPENED)
} catch (e: Exception) {
uiSetupHelper.onFailureRequest(e)
}

Parameters

lockState

The lock state, e.g. BluetoothConstants.LOCK_OPENED, BluetoothConstants.LOCK_CLOSED.

timeoutInSeconds

Timeout of waiting in seconds.