aboutsummaryrefslogtreecommitdiffstats
path: root/java/jni
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-10-27 07:26:31 +0200
committerSven Gothel <[email protected]>2021-10-27 07:26:31 +0200
commitdfec6813cd970049c7baf7c31d40e91fd56111ca (patch)
treeb770981fc056951e07f370f2d7baf5b8b81de024 /java/jni
parent7991e4ad41e7e3baf21cf499bfc04380ec4f4206 (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.cxx11
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);