Bluetooth Low Energy (BLE) plugin that can communicate with single device
BLE device discovery
Connection BLE
BLE status
Connection BLE state
Discover services
Enable notification a characteristic
Enable indication a characteristic
Read a characteristic
Write a characteristic
-keep class com.hodoan.ble_sdk.** { * ; }
<key>NSBluetoothAlwaysUsageDescription</key>
<string>using BLE</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>using BLE</string>
BleSdk .instance.startScan (services: ['1808' ])
BleSdk .instance.stopScan ()
BleSdk .instance.connect (deviceId: '...' )
BleSdk .instance.connect (deviceId: '...' )
BleSdk .instance.discoverServices ()
set notification a characteristic
BleSdk .instance.setNotification (Characteristic (
characteristicId: '...' ,
serviceId: '...' ,
properties: [],
))
set indication a characteristic
BleSdk .instance.setIndication (Characteristic (
characteristicId: '...' ,
serviceId: '...' ,
properties: [],
))
BleSdk .instance.readCharacteristic (Characteristic (
characteristicId: '...' ,
serviceId: '...' ,
properties: [],
))
BleSdk .instance.readCharacteristic (CharacteristicValue (
characteristic: ...,
data: [],
))
BleSdk .instance.disconnect ()
BleSdk .instance.logResult.listen ((_){})
Listen Read/Write All Characteristic
BleSdk .instance.characteristicResult.listen ((_){})
BleSdk .instance.stateBluetoothResult.listen ((_){})
BleSdk .instance.stateConnectResult.listen ((_){})