Skip to content

2.15.3.0 and Later

Locking/Unlocking API changes

The following information is outdated. DefaultTriggerLockCommandBuilder will be replaced by the more generic CompatTriggerLockCommandBuilder in version 2.28.0, and the use of triggerLockAsync will be encouraged, rather than deprecated, where applicable.

New variants of the TriggerLock command have been introduced that allow more finegrained control over the locking/unlocking process. Instead of CommandExecutionFacade.triggerLockAsync(...), the new method CommandExecutionFacade.executeStandardCommandAsync(...) should be used together with the DefaultTriggerLockCommandBuilder class.

CommandExecutionFacade.triggerLockAsync should not be used anymore and might be removed in future versions.

Migration

Search for triggerLockAsync and replace it with executeStandardCommandAsync. For the command argument pass a command object build using the DefaultTriggerLockCommandBuilder class.

return bleLockCommunicator.executeCommandAsync(
    bluetoothAddress,
    physicalLockId,
    tlcpConnection -> {

        // MIGRATION START
        // Replace:
        //
        //return commandExecutionFacade.triggerLockAsync(tlcpConnection, ct);
        // with:
        TriggerLockCommand triggerLockCommand = new DefaultTriggerLockCommandBuilder()
            .build();

        return commandExecutionFacade.executeStandardCommandAsync(
                tlcpConnection,
                triggerLockCommand,
                ct);
        // MIGRATION END
    }, ct)

Concept of incomplete lock ID superseded

Because of limited space in Bluetooth LE advertising frames, the lock id advertised by locking devices could have been incomplete. The BleLock class therefore had a boolean flag isLockIdComplete, which specified, whether the lock id provided in the incompleteLockId was complete or not.

Starting with this version of the Tapkey Mobile SDK, BleLock will always return complete lock IDs, therefore making matching of IDs much easier. The field isLockIdComplete was removed and the BleLock.incompleteLockId was renamed to BleLock.lockId.

Configuration of BLE Service UUID

The API for configuring a custom Bluetooth GATT Service UUID has changed. The method TapkeyEnvironmentConfigBuilder#setsetBleServiceUuid(...) was removed and was replaced by a more flexible solution based on the TapkeyBleAdvertisingFormatBuilder class.

Migration

In most cases no custom service UUID was configured, so nothing needs to be migrated. In all other cases replace the old code, which is similar to the following

TapkeyEnvironmentConfig config = TapkeyEnvironmentConfigBuilder()
    ...
    .setsetBleServiceUuid("[bleServiceUuid]")
    .build()

TapkeyServiceFactory sf = TapkeyServiceFactoryBuilder()
    ...
    .setConfig(config)
    .build()

with new code similar to this one:

TapkeyBleAdvertisingFormat advertisingFormat = TapkeyBleAdvertisingFormatBuilder()
    ...
    .addV1Format("[bleServiceUuid]")
    .build()

TapkeyServiceFactory sf = TapkeyServiceFactoryBuilder()
    ...
    .setBluetoothAdvertisingFormat(advertisingFormat)
    .build();