diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-02-19 15:39:42 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-20 21:37:53 +0100 |
commit | dc75ca260e79b01cb5dcbf6682660c948a2935a3 (patch) | |
tree | 2539e74d058e00a21ec499c47bbbad4df9846702 /examples/bluetooth/lowenergyscanner/characteristicinfo.cpp | |
parent | d772307dab9e2a3ef99d924d23af8688bff592db (diff) |
Show characteristic values with proper encoding in LEscanner example
Change-Id: I7f5fceae5d47e62d9b26fbced0cf73abe8d18d23
Reviewed-by: Nedim Hadzic <nedimhadzija@gmail.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'examples/bluetooth/lowenergyscanner/characteristicinfo.cpp')
-rw-r--r-- | examples/bluetooth/lowenergyscanner/characteristicinfo.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/bluetooth/lowenergyscanner/characteristicinfo.cpp b/examples/bluetooth/lowenergyscanner/characteristicinfo.cpp index 1d6bfa21..18b9e282 100644 --- a/examples/bluetooth/lowenergyscanner/characteristicinfo.cpp +++ b/examples/bluetooth/lowenergyscanner/characteristicinfo.cpp @@ -72,11 +72,12 @@ QString CharacteristicInfo::getUuid() const QString CharacteristicInfo::getValue() const { // All characteristics values are in hexadecimal format. - QString hexvalue = ""; + // Show human string first and hex value below QByteArray a = m_characteristic.value(); - for (int i = 0; i < a.size(); i++){ - hexvalue.append(a.at(i));} - return hexvalue; + QString result; + result += QByteArray::fromHex(a) + QLatin1Char('\n'); + result += a; + return result; } QString CharacteristicInfo::getHandle() const |