summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergycharacteristic.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-06-20 13:25:17 +0200
committerAlex Blasche <alexander.blasche@digia.com>2014-06-25 08:37:32 +0200
commita7ac0f27240e189a4aadb712cff00cec11258cb2 (patch)
treec1cec2e87439214b66db1beaedaae938bccb722e /src/bluetooth/qlowenergycharacteristic.cpp
parent2107022665d63b13a051893cc250e68e3b84dcf3 (diff)
QLECharacteristic::handle() returns the value handle and not char handle
Change-Id: Ib9a8c0ebe50d783fb0fe26ae2e1ceed0c47d5027 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Diffstat (limited to 'src/bluetooth/qlowenergycharacteristic.cpp')
-rw-r--r--src/bluetooth/qlowenergycharacteristic.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bluetooth/qlowenergycharacteristic.cpp b/src/bluetooth/qlowenergycharacteristic.cpp
index c4d965eb..0d0ad60c 100644
--- a/src/bluetooth/qlowenergycharacteristic.cpp
+++ b/src/bluetooth/qlowenergycharacteristic.cpp
@@ -180,14 +180,16 @@ QByteArray QLowEnergyCharacteristic::value() const
}
/*!
- Returns the handle of the gatt characteristic; otherwise returns \c 0.
+ Returns the handle of the GATT characteristic's value attribute;
+ otherwise returns \c 0.
*/
QLowEnergyHandle QLowEnergyCharacteristic::handle() const
{
- if (!data)
+ if (d_ptr.isNull() || !data
+ || !d_ptr->characteristicList.contains(data->handle))
return 0;
- return data->handle;
+ return d_ptr->characteristicList[data->handle].valueHandle;
}
/*!