Using Argon as BLE Central.
My BLE peripheral sends 2 services
one temperature as INDICATE
BleCharacteristic temperatureMeasurementCharacteristic(“temp”, BleCharacteristicProperty::INDICATE, BleUuid(0x2A1C), healthThermometerService);
and one as Battery level as READ
BleCharacteristic batteryLevelCharacteristic(“bat”, BleCharacteristicProperty::READ, BleUuid(0x2A19), batteryLevelService);
In the Argon I am connecting and can read the temperature using
peer.getCharacteristicByUUID(temperatureMeasurementCharacteristic, BleUuid(0x2a1c));
But I cannot get the battery level
peer.getCharacteristicByUUID(batteryLevelCharacteristic, BleUuid(0x2a19));
Since the battery level is READ and not NOTIFY what function can I use other than getCharacteristicByUUID(…)?
I do not see any functions as readCharacteristics… or else.
You store the characteristic object reference you get back from getCharacteristicByUUID() and then use (the approriate overload of) getValue() on that object reference.
@ScruffR, thank you for the rapid feeback. Not sure I understood…
I am using onDataReceive for the result and seems not to get any callback for the battery read.
For a callback like onDataReceive() you need someone to actively push the data to your central - a ::READ characterisitc does not do that, you have to read it
@ScruffR, you are right…
so how to I store the object value? What overload? sorry I am not very good in C++
peer.getCharacteristicByUUID(…) return only a boolean.