summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/heartrate-game/devicehandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bluetooth/heartrate-game/devicehandler.cpp')
-rw-r--r--examples/bluetooth/heartrate-game/devicehandler.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/bluetooth/heartrate-game/devicehandler.cpp b/examples/bluetooth/heartrate-game/devicehandler.cpp
index 96c78313..153a99fb 100644
--- a/examples/bluetooth/heartrate-game/devicehandler.cpp
+++ b/examples/bluetooth/heartrate-game/devicehandler.cpp
@@ -249,7 +249,7 @@ void DeviceHandler::updateDemoHR()
void DeviceHandler::confirmedDescriptorWrite(const QLowEnergyDescriptor &d, const QByteArray &value)
{
- if (d.isValid() && d == m_notificationDesc && value == QByteArray("0000")) {
+ if (d.isValid() && d == m_notificationDesc && value == QByteArray::fromHex("0000")) {
//disabled notifications -> assume disconnect intent
m_control->disconnectFromDevice();
delete m_service;
@@ -262,7 +262,8 @@ void DeviceHandler::disconnectService()
m_foundHeartRateService = false;
//disable notifications
- if (m_notificationDesc.isValid() && m_service) {
+ if (m_notificationDesc.isValid() && m_service
+ && m_notificationDesc.value() == QByteArray::fromHex("0100")) {
m_service->writeDescriptor(m_notificationDesc, QByteArray::fromHex("0000"));
} else {
if (m_control)