diff options
author | Sven Gothel <[email protected]> | 2022-01-18 02:48:02 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-01-18 02:48:02 +0100 |
commit | c7ea56b310d5da9d50f8934e22f8572d371fe2f0 (patch) | |
tree | bbd057a2498244720aba3db42c555589c150069c /java/jni | |
parent | 481ea1cbba81e6fbd48e3f50e534ee0c3d358cf8 (diff) |
DBTDevice.java/cxx: Reuse EInfoReport instance and clear before retrieving data
Diffstat (limited to 'java/jni')
-rw-r--r-- | java/jni/direct_bt/DBTDevice.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/java/jni/direct_bt/DBTDevice.cxx b/java/jni/direct_bt/DBTDevice.cxx index a22e0b05..141c151b 100644 --- a/java/jni/direct_bt/DBTDevice.cxx +++ b/java/jni/direct_bt/DBTDevice.cxx @@ -954,10 +954,11 @@ jshort Java_jau_direct_1bt_DBTDevice_getRSSI(JNIEnv *env, jobject obj) return 0; } -void Java_jau_direct_1bt_DBTDevice_getImpl(JNIEnv *env, jobject obj, jobject jeir_sink) { +void Java_jau_direct_1bt_DBTDevice_getEIRImpl(JNIEnv *env, jobject obj, jobject jeir_sink) { try { BTDevice *device = getJavaUplinkObject<BTDevice>(env, obj); EInfoReport * eir_sink_ptr = jau::getInstance<EInfoReport>(env, jeir_sink); + eir_sink_ptr->clear(); eir_sink_ptr->set( device->getEIR() ); } catch(...) { rethrow_and_raise_java_exception(env); |