lock

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

For locking 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 LockingSuccess 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