From b3fbfe3f525c2b5f97e2dbcf2ffbbcd6ae94c0ff Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 15 Oct 2015 12:21:06 +0200 Subject: Bluetooth: Fix value of an ATT error type. Change-Id: I2239624dd411daf400e987ec092be48805b8fa57 Reviewed-by: Alex Blasche --- src/bluetooth/qlowenergycontroller_bluez.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp index a7b2e794..18d0f5a1 100644 --- a/src/bluetooth/qlowenergycontroller_bluez.cpp +++ b/src/bluetooth/qlowenergycontroller_bluez.cpp @@ -106,8 +106,10 @@ #define ATT_ERROR_INVAL_ATTR_VALUE_LEN 0x0D #define ATT_ERROR_UNLIKELY 0x0E #define ATT_ERROR_INSUF_ENCRYPTION 0x0F -#define ATT_ERROR_APPLICATION 0x10 +#define ATT_ERROR_UNSUPPRTED_GROUP_TYPE 0x10 #define ATT_ERROR_INSUF_RESOURCES 0x11 +#define ATT_ERROR_APPLICATION_START 0x80 +#define ATT_ERROR_APPLICATION_END 0x9f #define APPEND_VALUE true #define NEW_VALUE false @@ -176,12 +178,16 @@ static void dumpErrorInformation(const QByteArray &response) errorString = QStringLiteral("unlikely error"); break; case ATT_ERROR_INSUF_ENCRYPTION: errorString = QStringLiteral("needs encryption - permissions"); break; - case ATT_ERROR_APPLICATION: - errorString = QStringLiteral("application error"); break; + case ATT_ERROR_UNSUPPRTED_GROUP_TYPE: + errorString = QStringLiteral("unsupported group type"); break; case ATT_ERROR_INSUF_RESOURCES: errorString = QStringLiteral("insufficient resources to complete request"); break; default: - errorString = QStringLiteral("unknown error code"); break; + if (errorCode >= ATT_ERROR_APPLICATION_START && errorCode <= ATT_ERROR_APPLICATION_END) + errorString = QStringLiteral("application error"); + else + errorString = QStringLiteral("unknown error code"); + break; } qCDebug(QT_BT_BLUEZ) << "Error1:" << errorString -- cgit v1.2.3