diff options
author | Sven Gothel <[email protected]> | 2021-10-27 07:26:31 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-10-27 07:26:31 +0200 |
commit | dfec6813cd970049c7baf7c31d40e91fd56111ca (patch) | |
tree | b770981fc056951e07f370f2d7baf5b8b81de024 /java/jni | |
parent | 7991e4ad41e7e3baf21cf499bfc04380ec4f4206 (diff) |
Add BTAdapter::setSecureConnections(bool) (C++/Java): Allow testing peripheral with legacy mode
Diffstat (limited to 'java/jni')
-rw-r--r-- | java/jni/direct_bt/DBTAdapter.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/java/jni/direct_bt/DBTAdapter.cxx b/java/jni/direct_bt/DBTAdapter.cxx index b1072f5d..a9898dbc 100644 --- a/java/jni/direct_bt/DBTAdapter.cxx +++ b/java/jni/direct_bt/DBTAdapter.cxx @@ -888,6 +888,17 @@ jboolean Java_jau_direct_1bt_DBTAdapter_setPowered(JNIEnv *env, jobject obj, jbo return JNI_FALSE; } +jboolean Java_jau_direct_1bt_DBTAdapter_setSecureConnections(JNIEnv *env, jobject obj, jboolean enable) { + try { + BTAdapter *adapter = jau::getJavaUplinkObject<BTAdapter>(env, obj); + jau::JavaGlobalObj::check(adapter->getJavaObject(), E_FILE_LINE); + return adapter->setSecureConnections(JNI_TRUE == enable ? true : false) ? JNI_TRUE : JNI_FALSE; + } catch(...) { + rethrow_and_raise_java_exception(env); + } + return JNI_FALSE; +} + jbyte Java_jau_direct_1bt_DBTAdapter_initializeImpl(JNIEnv *env, jobject obj, jbyte jbtMode) { try { BTAdapter *adapter = jau::getJavaUplinkObject<BTAdapter>(env, obj); |