From 8b334771babd64b1c7f47babcb5c4c449b9067a1 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Fri, 13 Apr 2018 13:17:18 +0200 Subject: Android: Fix QLEController's remoteName() and remoteAddress() The values were never obtained on the Java side. Task-number: QTBUG-67651 Change-Id: Ifceb124b07cf505c4e96fe7ba9d58364b3923c3a Reviewed-by: Timur Pocheptsov --- .../org/qtproject/qt5/android/bluetooth/QtBluetoothLEServer.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/android/bluetooth') diff --git a/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLEServer.java b/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLEServer.java index 00217904..034190fd 100644 --- a/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLEServer.java +++ b/src/android/bluetooth/src/org/qtproject/qt5/android/bluetooth/QtBluetoothLEServer.java @@ -82,6 +82,12 @@ public class QtBluetoothLEServer { private BluetoothGattServer mGattServer = null; private BluetoothLeAdvertiser mLeAdvertiser = null; + private String mRemoteName = ""; + public String remoteName() { return mRemoteName; } + + private String mRemoteAddress = ""; + public String remoteAddress() { return mRemoteAddress; } + /* As per Bluetooth specification each connected device can have individual and persistent Client characteristic configurations (see Bluetooth Spec 5.0 Vol 3 Part G 3.3.3.3) @@ -238,6 +244,9 @@ public class QtBluetoothLEServer { break; } + mRemoteName = device.getName(); + mRemoteAddress = device.getAddress(); + int qtErrorCode; switch (status) { case BluetoothGatt.GATT_SUCCESS: -- cgit v1.2.3