diff options
author | Sven Gothel <[email protected]> | 2021-09-18 22:54:03 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-09-18 22:54:03 +0200 |
commit | fa733201d719ca64d203d7adccd6b127f4fa73d5 (patch) | |
tree | ee53519b86e5875db9b29e9c7993767ec41171bf /java/jni | |
parent | 1480355ba4c81057f702130d6f4b7c5315d9e0c8 (diff) |
Add BTAdapter::isInitialized(): Allow to avoid re-initialization of an adapter.
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 b5bd1083..259686c3 100644 --- a/java/jni/direct_bt/DBTAdapter.cxx +++ b/java/jni/direct_bt/DBTAdapter.cxx @@ -890,6 +890,17 @@ jbyte Java_jau_direct_1bt_DBTAdapter_initializeImpl(JNIEnv *env, jobject obj, jb return (jbyte) number(HCIStatusCode::INTERNAL_FAILURE); } +jboolean Java_jau_direct_1bt_DBTAdapter_isInitialized(JNIEnv *env, jobject obj) { + try { + BTAdapter *adapter = jau::getJavaUplinkObject<BTAdapter>(env, obj); + jau::JavaGlobalObj::check(adapter->getJavaObject(), E_FILE_LINE); + return adapter->isInitialized(); + } catch(...) { + rethrow_and_raise_java_exception(env); + } + return JNI_FALSE; +} + jbyte Java_jau_direct_1bt_DBTAdapter_resetImpl(JNIEnv *env, jobject obj) { try { BTAdapter *adapter = jau::getJavaUplinkObject<BTAdapter>(env, obj); |