Skip to content

2.15.3.0 and Later

Locking/Unlocking api changes

The following information is outdated. TKMDefaultTriggerLockCommandBuilder will be replaced by the more generic TKMCompatTriggerLockCommandBuilder 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 TKMCommandExecutionFacade.triggerLockAsync(...), the new method TKMCommandExecutionFacade.executeStandardCommandAsync(...) should be used together with the TKMDefaultTriggerLockCommandBuilder class.

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

Migration

Search for triggerLockAsync and replace it with executeStandardCommandAsync. For the command parameter should be build with the TKMDefaultTriggerLockCommandBuilder.

    self.bleLockCommunicator.executeCommandAsync(
        bluetoothAddress: bluetoothAddress,
        physicalLockId: physicalLockId,
        commandFunc: { tlcpConnection -> TKMPromise<TKMCommandResult> in

            // MIGRATION START
            // Replace:
            //
            //return self.commandExecutionFacade.triggerLockAsync(
            //    tlcpConnection,
            //    cancellationToken: ct
            //)
            //
            // with:

            let triggerLockCommand = TKMDefaultTriggerLockCommandBuilder()
                                        .build()

            return self.commandExecutionFacade.executeStandardCommandAsync(
                tlcpConnection,
                command: triggerLockCommand,
                cancellationToken: ct
            )
            // MIGRATION END

        },
        cancellationToken: ct)

Removed concept of incompleteLockId

Because of limited space in Bluetooth LE advertising frames, the lock id advertised by locking devices could have been incomplete. The TKBleLock 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, TKBleLock will always return complete lock IDs, therefore making matching of IDs much easier. The field isLockIdComplete was removed and the TKBleLock.incompleteLockId was renamed to TKBleLock.lockId.

Configuration of BLE Service UUID

The API for configuring a custom Bluetooth GATT Service UUID has changed. The method TKMEnvironmentConfigBuilder#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

let config = TKMEnvironmentConfigBuilder()
    ...
    .setsetBleServiceUuid("[bleServiceUuid]")
    .build()

let sf = TKMServiceFactoryBuilder()
    ...
    .setConfig(config)
    .build()

with new code similar to this one:

let advertisingFormat = TKMBleAdvertisingFormatBuilder()
    ...
    .addV1Format("[bleServiceUuid]")
    .build()

let sf = TKMServiceFactoryBuilder()
    ...
    .setBluetoothAdvertisingFormat(advertisingFormat)
    .build();