commonMain.dev.bluefalcon.BlueFalcon.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of library-android Show documentation
Show all versions of library-android Show documentation
Kotlin Multiplatform Bluetooth Library
package dev.bluefalcon
expect class BlueFalcon(context: ApplicationContext, serviceUUID: String?) {
val delegates: MutableSet
var isScanning: Boolean
fun connect(bluetoothPeripheral: BluetoothPeripheral, autoConnect: Boolean = false)
fun disconnect(bluetoothPeripheral: BluetoothPeripheral)
fun scan()
fun stopScanning()
fun readCharacteristic(
bluetoothPeripheral: BluetoothPeripheral,
bluetoothCharacteristic: BluetoothCharacteristic
)
fun notifyCharacteristic(
bluetoothPeripheral: BluetoothPeripheral,
bluetoothCharacteristic: BluetoothCharacteristic,
notify: Boolean
)
fun indicateCharacteristic(
bluetoothPeripheral: BluetoothPeripheral,
bluetoothCharacteristic: BluetoothCharacteristic,
indicate: Boolean
)
fun notifyAndIndicateCharacteristic(
bluetoothPeripheral: BluetoothPeripheral,
bluetoothCharacteristic: BluetoothCharacteristic,
enable: Boolean
)
fun writeCharacteristic(
bluetoothPeripheral: BluetoothPeripheral,
bluetoothCharacteristic: BluetoothCharacteristic,
value: String,
writeType: Int?
)
fun writeCharacteristic(
bluetoothPeripheral: BluetoothPeripheral,
bluetoothCharacteristic: BluetoothCharacteristic,
value: ByteArray,
writeType: Int?
)
fun readDescriptor(
bluetoothPeripheral: BluetoothPeripheral,
bluetoothCharacteristic: BluetoothCharacteristic,
bluetoothCharacteristicDescriptor: BluetoothCharacteristicDescriptor
)
fun changeMTU(bluetoothPeripheral: BluetoothPeripheral, mtuSize: Int)
}