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.