Bridge

object Bridge : IBridge

The entry point for the SDK meant to initialize the SDK, scan and connect to nearby devices over BLE as well as perform credential exchange operations and create proxy network in the background for the locks to connect to the cloud. Note, Bridge and its implementation is designed to be asynchronous delivering results via delegates / callbacks.

Usage:

  • Retrieve instances of BlueLink, BLEProxy, DFUService, CredLink, etc. via the IsolatedKoinContext singleton.

  • Use this object to initialize the library, start scanning, and perform other integration tasks.

  • All dependencies are managed through Koin, ensuring isolated and safe access to library components.

Typical flow:

  1. Call init with your application context to initialize the library using the production server.

  2. Use start to begin the foreground service to run blueLink and bleProxy, or startLimited to run the same service without a notification (foreground app only).

  3. Use getBlueLink, getCredLink, etc. to retrieve library instances as needed.

Properties

Link copied to clipboard
const val TAG: String

Functions

Link copied to clipboard
open override fun getBLEProxy(): BLEProxy

Returns the current BLEProxy instance.

Link copied to clipboard
open override fun getBlueLink(): BlueLink

Returns the current BlueLink instance for Bluetooth interactions, such as scanning, adding listeners for BlueLink callbacks, and implementing BlueLinkEventListener to receive events.

Link copied to clipboard
Link copied to clipboard

Returns the current CredLink instance for credential operations (create credential, trigger unlock, etc.). This instance can also be used to implement credential exchange callbacks.

Link copied to clipboard
open override fun getDFUService(): DFUService

Returns the current DFUService instance used for managing and performing device firmware updates.

Link copied to clipboard
fun init(context: Any, serverAddress: String = "plane.lastlock.com")

Initializes the Bridge SDK with the application context and server address registering the context, loads modules, and configures shared dependencies used by the SDK.

Link copied to clipboard
suspend fun restart(serverAddress: String, uuid: String, port: Int = 443)

Restarts proxy streaming and BLE scan against a new plane host / service UUID.

Link copied to clipboard

Enable local debug capture (on by default). Disabling also clears its history.

Link copied to clipboard
open override fun setLogsEnabled(isEnabled: Boolean)

Enable or disable logging.

Link copied to clipboard
fun setServerAddress(serverAddress: String)

Sets the server address used by SDK services.

Link copied to clipboard
fun setServerPort(port: Int)
Link copied to clipboard
fun setUUID(UUID: String)

Sets the service UUID used by the Bluetooth service.

Link copied to clipboard
fun start(UUID: String = "FC5A")

Starts scanning for Bluetooth LE peripherals advertising the specified service UUID.

Link copied to clipboard
fun startLimited(UUID: String = "FC5A")

Starts BluetoothService as a background service. No notification is posted.

Link copied to clipboard
suspend fun submitDebugReport(): String

Submit recent logs and return the report ID for support. Throws when unavailable; safe to retry.