I\'m building an app with Android Studio that can read the value from a device BLE. This device, have 4 services. The fourth services have 3 characteristic. I want to read t
First store your read characteristics, and ghatt objects. and if you want to read a value from characteristic call this method:
private fun readDataFromCharacteristic(ghatt: BluetoothGhatt? , characteristic:BluetoothGhattCharacteristic) {
Log.d(TAG, " readDataFromCharacteristic")
ghatt?.readCharacteristic(characteristic)
}
if you call readCharacteristic(characteristic) on ghatt , below method will give result
override fun onCharacteristicRead(gatt: BluetoothGatt, characteristic: BluetoothGattCharacteristic, status: Int) {}