summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-05-28 19:11:57 +0200
committerSven Gothel <[email protected]>2020-05-28 19:11:57 +0200
commit94588c93be703c1e9ccf57b6c41c32b788c6f8a2 (patch)
tree26e9609f9da3e029601a0ad0aff0222ef0d0b001 /java
parent51a5d78c15a17f2b6fcab7de2366048471c381ab (diff)
Java GATTCharacteristic and -Descriptor readValue shall return an empty byte-array in case of error
Diffstat (limited to 'java')
-rw-r--r--java/jni/direct_bt/DBTGattCharacteristic.cxx2
-rw-r--r--java/jni/direct_bt/DBTGattDescriptor.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/java/jni/direct_bt/DBTGattCharacteristic.cxx b/java/jni/direct_bt/DBTGattCharacteristic.cxx
index 637b57e9..5c5480fe 100644
--- a/java/jni/direct_bt/DBTGattCharacteristic.cxx
+++ b/java/jni/direct_bt/DBTGattCharacteristic.cxx
@@ -113,7 +113,7 @@ jbyteArray Java_direct_1bt_tinyb_DBTGattCharacteristic_readValueImpl(JNIEnv *env
POctets res(GATTHandler::ClientMaxMTU, 0);
if( !characteristic->readValue(res) ) {
ERR_PRINT("Characteristic readValue failed: %s", characteristic->toString().c_str());
- return JNI_FALSE;
+ return env->NewByteArray((jsize)0);
}
const size_t value_size = res.getSize();
diff --git a/java/jni/direct_bt/DBTGattDescriptor.cxx b/java/jni/direct_bt/DBTGattDescriptor.cxx
index 2a3443fc..17a1a118 100644
--- a/java/jni/direct_bt/DBTGattDescriptor.cxx
+++ b/java/jni/direct_bt/DBTGattDescriptor.cxx
@@ -65,7 +65,7 @@ jbyteArray Java_direct_1bt_tinyb_DBTGattDescriptor_readValueImpl(JNIEnv *env, jo
if( !descriptor->readValue() ) {
ERR_PRINT("Characteristic readValue failed: %s", descriptor->toString().c_str());
- return JNI_FALSE;
+ return env->NewByteArray((jsize)0);
}
const size_t value_size = descriptor->value.getSize();
jbyteArray jres = env->NewByteArray((jsize)value_size);