TKMCommandExecutionFacade
Offers commands to be executed on Tapkey locks. Methods of this class expect a TLCP connection to a Tapkey lock and take a cancellation token for execution control.
The example below outlines a
possible usage of triggerLockAsync(lock:cancellationToken:)
. In the present
example, the required TLCP connection is established using the
TKMBleLockCommunicator
.
// The Bluetooth Communicator establishes a connection to the Tapkey lock via Bluetooth and lets
// the CommandExecutionFacade use this connection to execute a TriggerLock command.
return bleLockCommunicator.executeCommandAsync(bluetoothAddress, physicalLockId, { tlcpConnection in
// Now, with the TlcpConnection to the lock available, the TKMCommandExecutionFacade
// asynchronously executes the trigger lock command.
return commandExecutionFacade.triggerLockAsync(tlcpConnection, cancellationToken: ct)
}, ct).continueOnUi { commandResult -> Bool in
switch (commandResult.code) {
case Ok:
return true
// Handle error results.
...
}
return false
}.catchOnUi { e -> Bool in
Log.e(TAG, "Could not execute trigger lock command.", e)
if (!ct.isCancellationRequested()) {
// Handle any exceptions and let the user know, something went wrong.
}
return false
}
-
Executes a standard command like a TriggerLockCommand. Standard commands are signed using the signed in user’s keys.
See also
TKMCommandResult.code
-
Triggers the lock. The method internally uses the
CompatTriggerLockCommandBuilder
, which derives the action to be taken from the user’s permissions. Takes a TlcpConnection to a Tapkey lock and a cancellation token for execution control. The returned command result’s code must be inspected and checked against errors.See also
TKMCommandResult.code
-
Reserved for internal use.
-
Synchronizes the lock. Collects log entries and uploads them to the Tapkey Trust Service. Updates the revocation list on the lock with the latest version from the Tapkey Trust Service.
-
Reserved for internal use.
-
Reserved for internal use.
-
Reserved for internal use.
-
Reserved for internal use.
-
Reserved for internal use.
-
Reserved for internal use.
-
Reserved for internal use.
-
Reserved for internal use.
-
Reserved for internal use.
-
executeCustomCommandAsync(_:asUnauthenticatedCommand:manufacturerId:customCommandId:data:cancellationToken:)
Reserved for internal use.