I have this bluetooth temperature sensor https://www.aliexpress.com/item/nRF51822-Bluetooth-4-0-BLE-SOC-Temperature-Atmospheric-Pressure-Acceleration-Sensor-Module-Gyroscope-Light-Sensor-MPU6050/32859423925.html?spm=a2g0s.9042311.0.0.e3534c4dT9GRz3 and I am trying to read temperature out of it. I can connect to it, get services via
BluetoothGatt.getService(UUID.fromString("6e400001-b5a3-f393-e0a9-e50e24dcca9e")
and get characteristics via
BluetoothGattCharacteristic mReadCharacteristic = mCustomService.getCharacteristic(UUID.fromString("6e400005-b5a3-f393-e0a9-e50e24dcca9e"));
result:
mReadCharacteristic = {BluetoothGattCharacteristic@5322}
mDescriptors = {ArrayList@5326} size = 1
mInstance = 20
mKeySize = 16
mPermissions = 0
mProperties = 16
mService = {BluetoothGattService@5295}
mUuid = {UUID@5327} "6e400005-b5a3-f393-e0a9-e50e24dcca9e"
mValue = null
mWriteType = 2
Then I call mBluetoothGatt.readCharacteristic(mReadCharacteristic) and hope to get data via BluetoothGattCallback, but readCharacteristic always returns false
if ((characteristic.getProperties() & BluetoothGattCharacteristic.PROPERTY_READ) == 0) {
return false;
}
properties = 16 PROPERTY_READ = 5 What am I doing wrong ?