unlock

open override fun unlock(deviceName: String, onUpdate: (ConnectionUpdate) -> Unit, onResult: (Result<UnlockingSuccess>) -> Unit)

For unlocking a Donkey bike, use this function

Parameters

deviceName

String value of the given lock device name for bluetooth communication

onUpdate

callback provides different ConnectionUpdates for the app to display progress

onResult

callback provides the UnlockingSuccess if it was successful, or Throwable in the case of any errors

Throws

UninitializedSdkError

(bike.donkey.lockkit.errors.UninitializedSdkError) if the SDK has not been successfully initialized

LockError.OfflineDuringPickup

(bike.donkey.lockkit.errors.LockError.OfflineDuringPickup) if the user is not online for the first unlock