summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/android
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2017-01-03 17:21:17 +0100
committerAlex Blasche <alexander.blasche@qt.io>2017-01-23 09:03:43 +0000
commitd66b34100ad3e5ddd226ba85c4e974ad08e22205 (patch)
treec212ce7a0a30c9c94e17ec57986522b6186969b7 /src/bluetooth/android
parent46a776eb70d7b3e40bb80cb4f4314d3462801b62 (diff)
Android: Implement QLEC::stateChanged() notification
Change-Id: Id2cabd9df7b5387fe5e6f1c898fe02e40f7c0a3d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/bluetooth/android')
-rw-r--r--src/bluetooth/android/jni_android.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bluetooth/android/jni_android.cpp b/src/bluetooth/android/jni_android.cpp
index ae07608a..3cec0c64 100644
--- a/src/bluetooth/android/jni_android.cpp
+++ b/src/bluetooth/android/jni_android.cpp
@@ -227,6 +227,11 @@ static JNINativeMethod methods_le[] = {
(void *) LowEnergyNotificationHub::lowEnergy_serviceError},
};
+static JNINativeMethod methods_leServer[] = {
+ {"leServerConnectionStateChange", "(JII)V",
+ (void *) LowEnergyNotificationHub::lowEnergy_connectionChange},
+};
+
static JNINativeMethod methods_server[] = {
{"errorOccurred", "(JI)V",
(void *) QtBluetoothSocketServer_errorOccurred},
@@ -267,6 +272,11 @@ static bool registerNatives(JNIEnv *env)
return false;
}
+ FIND_AND_CHECK_CLASS("org/qtproject/qt5/android/bluetooth/QtBluetoothLEServer");
+ if (env->RegisterNatives(clazz, methods_leServer, sizeof(methods_leServer) / sizeof(methods_leServer[0])) < 0) {
+ __android_log_print(ANDROID_LOG_FATAL, logTag, "RegisterNatives for QBLuetoothLEServer failed");
+ return false;
+ }
FIND_AND_CHECK_CLASS("org/qtproject/qt5/android/bluetooth/QtBluetoothSocketServer");
if (env->RegisterNatives(clazz, methods_server, sizeof(methods_server) / sizeof(methods_server[0])) < 0) {