From dc75ca260e79b01cb5dcbf6682660c948a2935a3 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Wed, 19 Feb 2014 15:39:42 +0100 Subject: Show characteristic values with proper encoding in LEscanner example Change-Id: I7f5fceae5d47e62d9b26fbced0cf73abe8d18d23 Reviewed-by: Nedim Hadzic Reviewed-by: Alex Blasche --- examples/bluetooth/lowenergyscanner/characteristicinfo.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'examples/bluetooth/lowenergyscanner/characteristicinfo.cpp') 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 -- cgit v1.2.3