diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-04-01 17:17:22 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-04-15 05:44:26 +0000 |
commit | 5be8b3d9273afcd41c6c60e6f6d2dfd5cd8b30e3 (patch) | |
tree | 08ec49c6cb04c0be06b8e3d73a384287f0946f00 /src/bluetooth/qlowenergyservice_osx.mm | |
parent | 99d62bcce229ab2807f0ea5b8a0f618b4e93c665 (diff) |
Always read/write the GATT hardware even if meta data reports otherwise
It is possible that a ATT attribute is not readable or writable.
Usually this is reported via descriptors or other types of meta data.
However it is possible that the meta data is reporting the wrong
information. Therefore we always ensure that every read and write request
is forwarded to the hardware. It is up to the hardware to respond
to such requests.
This change keeps the device usable in cases of buggy device meta data.
This only affected writeCharacteristic() calls.
Change-Id: Ieb2b95f47aa51c86a8ae7c4bebed4043d7478874
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Diffstat (limited to 'src/bluetooth/qlowenergyservice_osx.mm')
-rw-r--r-- | src/bluetooth/qlowenergyservice_osx.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bluetooth/qlowenergyservice_osx.mm b/src/bluetooth/qlowenergyservice_osx.mm index 51b0f53d..b5d89dd7 100644 --- a/src/bluetooth/qlowenergyservice_osx.mm +++ b/src/bluetooth/qlowenergyservice_osx.mm @@ -200,9 +200,9 @@ void QLowEnergyService::writeCharacteristic(const QLowEnergyCharacteristic &ch, } // Don't write if properties don't permit it - if (mode == WriteWithResponse && (ch.properties() & QLowEnergyCharacteristic::Write)) + if (mode == WriteWithResponse) controller->writeCharacteristic(ch.d_ptr, ch.attributeHandle(), newValue, true); - else if (mode == WriteWithoutResponse && (ch.properties() & QLowEnergyCharacteristic::WriteNoResponse)) + else if (mode == WriteWithoutResponse) controller->writeCharacteristic(ch.d_ptr, ch.attributeHandle(), newValue, false); else d_ptr->setError(QLowEnergyService::OperationError); |