diff options
Diffstat (limited to 'examples/bluetooth/heartlistener/heartrate.cpp')
-rw-r--r-- | examples/bluetooth/heartlistener/heartrate.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/bluetooth/heartlistener/heartrate.cpp b/examples/bluetooth/heartlistener/heartrate.cpp index 7ada09dd..ac61a076 100644 --- a/examples/bluetooth/heartlistener/heartrate.cpp +++ b/examples/bluetooth/heartlistener/heartrate.cpp @@ -223,7 +223,7 @@ void HeartRate::disconnectService() //disable notifications if (m_notificationDesc.isValid() && m_service) { - m_service->writeDescriptor(m_notificationDesc, QByteArray("0000")); + m_service->writeDescriptor(m_notificationDesc, QByteArray::fromHex("0000")); } else { m_control->disconnectFromDevice(); delete m_service; @@ -255,7 +255,7 @@ void HeartRate::serviceStateChanged(QLowEnergyService::ServiceState s) const QLowEnergyDescriptor m_notificationDesc = hrChar.descriptor( QBluetoothUuid::ClientCharacteristicConfiguration); if (m_notificationDesc.isValid()) { - m_service->writeDescriptor(m_notificationDesc, QByteArray("0100")); + m_service->writeDescriptor(m_notificationDesc, QByteArray::fromHex("0100")); setMessage("Measuring"); m_start = QDateTime::currentDateTime(); } @@ -287,7 +287,7 @@ void HeartRate::updateHeartRateValue(const QLowEnergyCharacteristic &c, return; //! [Reading value] - const char *data = QByteArray::fromHex(value).constData(); + const char *data = value.constData(); quint8 flags = data[0]; //Heart Rate |