aboutsummaryrefslogtreecommitdiffstats
path: root/java/jni
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2022-01-18 02:48:02 +0100
committerSven Gothel <[email protected]>2022-01-18 02:48:02 +0100
commitc7ea56b310d5da9d50f8934e22f8572d371fe2f0 (patch)
treebbd057a2498244720aba3db42c555589c150069c /java/jni
parent481ea1cbba81e6fbd48e3f50e534ee0c3d358cf8 (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.cxx3
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);