how to read bluetooth low energy value
Solved
General and Desktop
-
hello
i am trying to read bluetooth low energy value for a temperature sensor
but i have the following questionswhen i studied the heartrate-game example it uses the following to get the updated value from notification
connect(m_service, &QLowEnergyService::characteristicChanged, this, &DeviceHandler::updateHeartRateValue); void DeviceHandler::updateHeartRateValue(const QLowEnergyCharacteristic &c, const QByteArray &value) auto data = reinterpret_cast<const quint8 *>(value.constData()); quint8 flags = *data; qDebug() << "Data Byte" << &value ; but the low energy scanner example uses qDebug() << "c.value " << c.value().toHex();
my first question:
what is the difference between value and c.value.hex ?when i print them i get the following
c.value "00c70f00fe"
Data Byte 0x282855280c.value "00d10f00fe"
Data Byte 0x282848bf0c.value "00db0f00fe"
Data Byte 0x282848660c.value "00e50f00fe"
Data Byte 0x282848c30c.value "00ef0f00fe"
Data Byte 0x282848bf0c.value "00f90f00fe"
Data Byte 0x282848370which one is what ?
-
i found the solution, they should be the same, now i can see it. it was printing the adress.
qDebug() << "Data Byte" << value.toHex() ;