Interface BleLockCommunicator

  • public interface BleLockCommunicator
    The BLE (Bluetooth Low Energy) lock communicator provides means to communicate with Tapkey locks via BLE. It can be used to send commands to locks. Use TapkeyServiceFactory to retrieve an instance of BleLockCommunicator.
    • Method Detail

      • executeCommandAsync

        <TOut> Promise<TOut> executeCommandAsync​(String bluetoothAddress,
                                                 String physicalLockId,
                                                 Func1<TlcpConnection,​Promise<TOut>,​RuntimeException> commandFunc,
                                                 CancellationToken cancellationToken)
        Executes a command on the specified lock. This method takes a command function that uses the CommandExecutionFacade and executes it on the Tapkey lock with the specified Bluetooth address. To ensure that the device at the specified Bluetooth address is the intended Tapkey lock, the lock's physical lock ID can be passed and will be validated before executing the command. In case verification fails, the returned Promise will resolve to null. Verifying the lock's ID does not impose a runtime penalty.
        Type Parameters:
        TOut - the command result's type.
        bluetoothAddress - the Bluetooth address of the lock to execute the command on.
        physicalLockId - an optional parameter to verify that the device at bluetoothAddress is a Tapkey lock with the given physical lock ID. Set to null if verification is not required.
        commandFunc - the command to execute on the lock. Usually implemented using CommandExecutionFacade.
        cancellationToken - a cancellation token to be used for cancellation. The token should be forwarded to CommandExecutionFacade.
        a Promise that resolves to the command's result, or null if a physical lock ID was passed and verification failed.