diff options
author | Nedim Hadzic <nhadzic@blackberry.com> | 2014-03-03 15:05:57 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-06 13:16:42 +0100 |
commit | 11bba384354291704f0599a0b381f9365e32de5e (patch) | |
tree | 3832d359e0b1edddf8f45fbf90f918395cc7df59 /src/bluetooth | |
parent | ef90f1f204a2aca5860e64433d070fd0916ba1ee (diff) |
QNX notification value fix
1.) Implemented proper conversion to hexadecimal value.
2.) Error was emitted in case of value assignment and it is
fixed now.
Change-Id: Ifb6220a6379b350eaa8bb67841a5029ecc55cad2
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth')
-rw-r--r-- | src/bluetooth/qlowenergycharacteristicinfo_qnx.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/bluetooth/qlowenergycharacteristicinfo_qnx.cpp b/src/bluetooth/qlowenergycharacteristicinfo_qnx.cpp index 50f1d5ae..09db7e67 100644 --- a/src/bluetooth/qlowenergycharacteristicinfo_qnx.cpp +++ b/src/bluetooth/qlowenergycharacteristicinfo_qnx.cpp @@ -88,7 +88,7 @@ int stringToBuffer(const QString &stringData, quint8 *buffer, int bufferLength) } QLowEnergyCharacteristicInfoPrivate::QLowEnergyCharacteristicInfoPrivate(): - permission(0), handle(QStringLiteral("0x0000")), instance(-1) + permission(0), notification(false), handle(QStringLiteral("0x0000")), instance(-1) { } @@ -119,11 +119,12 @@ void QLowEnergyCharacteristicInfoPrivate::serviceNotification(int instance, shor QByteArray receivedValue; for (int j = 0; j < len; j++) { - QString hexadecimal; - hexadecimal.setNum(val[j], 16); - receivedValue.append(hexadecimal.toLatin1()); + QByteArray hexadecimal; + hexadecimal.append(val[j]); + receivedValue.append(hexadecimal.toHex()); } + p->characteristicList.at(i).d_ptr->notification = true; p->characteristicList.at(i).d_ptr->setValue(receivedValue); current = true; } @@ -186,7 +187,7 @@ void QLowEnergyCharacteristicInfoPrivate::setValue(const QByteArray &wantedValue } } } - else { + else if (!notification) { errorString = QStringLiteral("Characteristic does not allow write operations. The wanted value was not written to the device."); emit error(uuid); } |