Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
Bluetooth Low Energy Characteristic Indications (not Notifications)
ZSoft last edited by
Can anybody explain how Bluetooth Low Energy Indications (QLowEnergyCharacteristic::Indicate) are supposed to work please?
There is very little documentation on them so I assume they work very similair to BTLE Notifications. Is that correct?
The Heart Listener example has this code where notifications are enabled:
const QLowEnergyDescriptor m_notificationDesc = characteristic.descriptor(QBluetoothUuid::ClientCharacteristicConfiguration);
if (m_notificationDesc.isValid()) m_service->writeDescriptor(m_notificationDesc, QByteArray::fromHex("0100"));
So is it a matter of setting the bit flags differently?
And can I assume indiciations are delivered through characteristicChanged?
I would be very thankful for a small example or verification of my assumptions.
Josaphat last edited by
A bit of a late response, but...
Assuming the GATT server on the other end has a characteristic that allows for Indicate, then the only thing that needs to change is the value that you write to the descriptor. Set Bit 1 of the CCC to enable indicates by writing "0200" instead of "0100" (the descriptor is little-endian according to the BLE documentation for the Client Characteristic Configuration descriptor).
As far as I know, indications are delivered with the characteristicChanged signal just like notifications.
SherifOmran last edited by
a little bit late but for anybody searching. Indication is different than notification in that there is a confirmation that data sent from peripherical (hardware measuring device as heart rate) to the central device (same as your phone app) reached. Notification does not offer this confirmation. It is something like udp (no confiramtion available) and http (confirmation available)