diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2014-12-02 14:41:38 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2014-12-04 09:35:09 +0100 |
commit | 01ea948742b649ad482c2e3e6d914fc1ac5f4917 (patch) | |
tree | fd086faa30826117ab430764efda54984d53d607 /src/bluetooth/qlowenergycontroller_android.cpp | |
parent | 6d399ac04e1a1cb67444ff6557f425392031d37a (diff) |
Android: enable writing of characteristics without response mode
Change-Id: I9c26aaa11857db8dc33a99d42347a9b7f6281ad7
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_android.cpp')
-rw-r--r-- | src/bluetooth/qlowenergycontroller_android.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bluetooth/qlowenergycontroller_android.cpp b/src/bluetooth/qlowenergycontroller_android.cpp index 25bd35d7..9be5cff0 100644 --- a/src/bluetooth/qlowenergycontroller_android.cpp +++ b/src/bluetooth/qlowenergycontroller_android.cpp @@ -165,7 +165,7 @@ void QLowEnergyControllerPrivate::writeCharacteristic( const QSharedPointer<QLowEnergyServicePrivate> service, const QLowEnergyHandle charHandle, const QByteArray &newValue, - bool /*writeWithResponse*/) + bool writeWithResponse) { //TODO don't ignore WriteWithResponse, right now we assume responses Q_ASSERT(!service.isNull()); @@ -182,9 +182,11 @@ void QLowEnergyControllerPrivate::writeCharacteristic( bool result = false; if (hub) { qCDebug(QT_BT_ANDROID) << "Write characteristic with handle " << charHandle - << newValue.toHex() << "(service:" << service->uuid << ")"; - result = hub->javaObject().callMethod<jboolean>("writeCharacteristic", "(I[B)Z", - charHandle, payload); + << newValue.toHex() << "(service:" << service->uuid + << ", writeWithResponse:" << writeWithResponse << ")"; + result = hub->javaObject().callMethod<jboolean>("writeCharacteristic", "(I[BI)Z", + charHandle, payload, + writeWithResponse ? QLowEnergyService::WriteWithResponse : QLowEnergyService::WriteWithoutResponse); } if (env->ExceptionOccurred()) { |