diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-09-05 11:58:40 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2014-09-08 14:40:31 +0200 |
commit | 877420119f320136f72e70c456b504c5f8af24f8 (patch) | |
tree | ce6f10fc2e4b07b6680927af323b18980fc1c9ca | |
parent | 17d9b0d5bf5630a403345221309adc615b59db77 (diff) |
Misc TODO and test fixes
1.) Use updateValueOf*() where possible to channel all value changes
through the same gate.
2.) BTLE connects have a much larger timeout when the remote device is
not present. The device discovery could still turn up this device due
to existing pairing information.
3.) Remove obsolete write long characteristic TODO
Change-Id: I5b5815b0c3b99f8c4f87e0f1747ac6f1e274e592
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
4 files changed, 5 insertions, 8 deletions
diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp index da26a35e..ad8c4973 100644 --- a/src/bluetooth/qlowenergycontroller_bluez.cpp +++ b/src/bluetooth/qlowenergycontroller_bluez.cpp @@ -799,13 +799,11 @@ void QLowEnergyControllerPrivate::processReply( const QByteArray newValue = request.reference2.toByteArray(); if (!descriptorHandle) { - //TODO use updateValueOfCharacteristic() - service->characteristicList[charHandle].value = newValue; + updateValueOfCharacteristic(charHandle, newValue, NEW_VALUE); QLowEnergyCharacteristic ch(service, charHandle); emit service->characteristicWritten(ch, newValue); } else { - //TODO use updateValueOfDescriptor() - service->characteristicList[charHandle].descriptorList[descriptorHandle].value = newValue; + updateValueOfDescriptor(charHandle, descriptorHandle, newValue, NEW_VALUE); QLowEnergyDescriptor descriptor(service, charHandle, descriptorHandle); emit service->descriptorWritten(descriptor, newValue); } @@ -852,7 +850,7 @@ void QLowEnergyControllerPrivate::processReply( // charHandle == 0 -> cancellation service->setError(QLowEnergyService::CharacteristicWriteError); } else { - service->characteristicList[charHandle].value = newValue; + updateValueOfCharacteristic(charHandle, newValue, NEW_VALUE); QLowEnergyCharacteristic ch(service, charHandle); emit service->characteristicWritten(ch, newValue); } diff --git a/src/bluetooth/qlowenergyservice.cpp b/src/bluetooth/qlowenergyservice.cpp index 9136f83b..f52f2dc3 100644 --- a/src/bluetooth/qlowenergyservice.cpp +++ b/src/bluetooth/qlowenergyservice.cpp @@ -498,7 +498,6 @@ void QLowEnergyService::writeCharacteristic( const QByteArray &newValue, QLowEnergyService::WriteMode mode) { //TODO check behavior when writing to WriteSigned characteristic - //TODO add support for write long characteristic value (newValue.size() > MTU - 3) Q_D(QLowEnergyService); // not a characteristic of this service diff --git a/tests/auto/qlowenergycharacteristic/tst_qlowenergycharacteristic.cpp b/tests/auto/qlowenergycharacteristic/tst_qlowenergycharacteristic.cpp index 23189f51..e65b573c 100644 --- a/tests/auto/qlowenergycharacteristic/tst_qlowenergycharacteristic.cpp +++ b/tests/auto/qlowenergycharacteristic/tst_qlowenergycharacteristic.cpp @@ -116,7 +116,7 @@ void tst_QLowEnergyCharacteristic::initTestCase() qDebug() << "Connecting to" << remoteDevice; controller->connectToDevice(); QTRY_IMPL(controller->state() != QLowEnergyController::ConnectingState, - 10000); + 20000); if (controller->state() != QLowEnergyController::ConnectedState) { // any error and we skip delete controller; diff --git a/tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp b/tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp index e276b2ea..ff958cc6 100644 --- a/tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp +++ b/tests/auto/qlowenergydescriptor/tst_qlowenergydescriptor.cpp @@ -119,7 +119,7 @@ void tst_QLowEnergyDescriptor::initTestCase() qDebug() << "Connecting to" << remoteDevice; controller->connectToDevice(); QTRY_IMPL(controller->state() != QLowEnergyController::ConnectingState, - 10000); + 20000); if (controller->state() != QLowEnergyController::ConnectedState) { // any error and we skip delete controller; |