diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2014-11-07 12:06:43 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2014-11-10 14:32:51 +0100 |
commit | 327b6b7f8ff9acda74f403f2ff286e67f4202dfd (patch) | |
tree | a8c5649da588a0d428b4710b6d0080fe2d273da1 /src/android | |
parent | e0dc61db4af89cce14ade3582ac92e4b713c7982 (diff) |
Propagate Charactereristic data to Qt layer
Although this makes the lowenergyscanner example functionally complete,
descriptor data and service meta data are still not accessable via the
Qt API.
Change-Id: Ifb84010b4fea054357c07424ac30116d1e4f9de0
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/android')
-rw-r--r-- | src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java b/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java index 50e2f293..93b4a50d 100644 --- a/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java +++ b/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLE.java @@ -168,6 +168,14 @@ public class QtBluetoothLE { GattEntry entry = entries.get(runningHandle); entry.valueKnown = true; entries.set(runningHandle, entry); + String data = new String(characteristic.getValue()); + // Qt manages handles starting at 1, in Java we use a system starting with 0 + characteristic.getService().getUuid().toString(); + + //TODO avoid sending service uuid -> service handle should be sufficient + leCharacteristicRead(qtObject, characteristic.getService().getUuid().toString(), + runningHandle+1, characteristic.getUuid().toString(), + characteristic.getProperties(), characteristic.getValue()); performServiceDiscoveryForHandle(runningHandle+1, false); } @@ -431,5 +439,8 @@ public class QtBluetoothLE { public native void leConnectionStateChange(long qtObject, int wasErrorTransition, int newState); public native void leServicesDiscovered(long qtObject, int errorCode, String uuidList); public native void leServiceDetailDiscoveryFinished(long qtObject, final String serviceUuid); + public native void leCharacteristicRead(long qtObject, String serviceUuid, + int charHandle, String charUuid, + int properties, byte[] data); } |