diff options
Diffstat (limited to 'src/bluetooth/android/jni_android.cpp')
-rw-r--r-- | src/bluetooth/android/jni_android.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bluetooth/android/jni_android.cpp b/src/bluetooth/android/jni_android.cpp index ae07608a..68e291e5 100644 --- a/src/bluetooth/android/jni_android.cpp +++ b/src/bluetooth/android/jni_android.cpp @@ -227,6 +227,17 @@ static JNINativeMethod methods_le[] = { (void *) LowEnergyNotificationHub::lowEnergy_serviceError}, }; +static JNINativeMethod methods_leServer[] = { + {"leServerConnectionStateChange", "(JII)V", + (void *) LowEnergyNotificationHub::lowEnergy_connectionChange}, + {"leServerAdvertisementError", "(JI)V", + (void *) LowEnergyNotificationHub::lowEnergy_advertisementError}, + {"leServerCharacteristicChanged", "(JLandroid/bluetooth/BluetoothGattCharacteristic;[B)V", + (void *) LowEnergyNotificationHub::lowEnergy_serverCharacteristicChanged}, + {"leServerDescriptorWritten", "(JLandroid/bluetooth/BluetoothGattDescriptor;[B)V", + (void *) LowEnergyNotificationHub::lowEnergy_serverDescriptorWritten}, +}; + static JNINativeMethod methods_server[] = { {"errorOccurred", "(JI)V", (void *) QtBluetoothSocketServer_errorOccurred}, @@ -267,6 +278,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) { |