Efento-Bluetooth-SDK

2.4.0

efento/Efento-Bluetooth-SDK

What's New

2.4.0

2026-07-29T08:55:00Z

Efento Bluetooth Library

iOS Badge iOS Badge Kotlin kotlinx-coroutines

Efento Bluetooth library allows scanning for and connecting to Efento Bluetooth Low Energy (BLE) devices.

This Kotlin Multiplatform library is built to support both Android and iOS, and uses kotlin coroutines.

It's intended for use in multiplatform projects targeting Kotlin/Android and Kotlin/Native (iOS).

Setup

Add the Efento Maven repository to your project

dependencyResolutionManagement {
    repositories {
        maven("https://maven.efento.io/releases")
    }
}

Include the Library Dependency

commonMain.dependencies {
    implementation("pl.efento.mobile:bluetooth:2.4.0")
}

Quick start

Initialize the library by passing in the application context.

Android

class Application : Application() {
    override fun onCreate() {
        super.onCreate()
        EfentoBluetooth.init(this)
    }
}

iOS

EfentoBluetooth.init(IosNoOpApplicationContext()) //application context is not applicable for iOS

Scanning for devices

Set scanner parameters and start collecting device data using the deviceFlow method.

val scanner = EfentoBluetooth.scanner(
    //scan parameters
)

scanner.deviceFlow()
       .catch { exception ->
           //handle exception here
       }
       .collect { efentoDevice -> 
           //handle scanned device here
       }

Connecting to a Device

Define connection parameters and execute commands as needed.

val connection = EfentoBluetooth.sensorConnection(
        deviceID = "00010203-0405-0607-0809-0a0b0c0d0e0f",
        bluetoothMacAddress = BluetoothMacAddress("28:2C:02:4F:FF:FF"),
        resetCode = 1111
        //other connection parameters
    )

connection.runCatching {
    connect()

    val measurements = commands.downloadMeasurements() { progress ->
        log.debug { "Progress: $progress" }
    }

    disconnect()
}.onFailure { exception ->
    //handle exception here
}

Documentation

Access the full KDoc documentation for detailed information on usage and functions here

Description

  • Swift Tools
View More Packages from this Author

Dependencies

  • None
Last updated: Thu Jul 30 2026 01:47:57 GMT-0900 (Hawaii-Aleutian Daylight Time)