diff options
author | Sven Gothel <[email protected]> | 2020-05-31 21:32:48 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-05-31 21:32:48 +0200 |
commit | 9ae37c02afdcd6344f32e823e40f9ee8c4a9ae0a (patch) | |
tree | 81ea71505b897fd8c57702e9d8bd53fa69116a95 /java/jni/direct_bt | |
parent | f76ad2569b3c57a8da3165c7ce79ad9a8a34d9b7 (diff) |
HCIErrorCode (Java): Use byte native value (uint8_t) and fast switch/case value mapping
Diffstat (limited to 'java/jni/direct_bt')
-rw-r--r-- | java/jni/direct_bt/DBTAdapter.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/java/jni/direct_bt/DBTAdapter.cxx b/java/jni/direct_bt/DBTAdapter.cxx index ba0862d4..8da84686 100644 --- a/java/jni/direct_bt/DBTAdapter.cxx +++ b/java/jni/direct_bt/DBTAdapter.cxx @@ -41,7 +41,7 @@ static const std::string _adapterSettingsClazzCtorArgs("(I)V"); static const std::string _eirDataTypeSetClassName("org/tinyb/EIRDataTypeSet"); static const std::string _eirDataTypeSetClazzCtorArgs("(I)V"); static const std::string _hciErrorCodeClassName("org/tinyb/HCIErrorCode"); -static const std::string _hciErrorCodeClazzGetArgs("(I)Lorg/tinyb/HCIErrorCode;"); +static const std::string _hciErrorCodeClazzGetArgs("(B)Lorg/tinyb/HCIErrorCode;"); static const std::string _deviceClazzCtorArgs("(JLdirect_bt/tinyb/DBTAdapter;Ljava/lang/String;ILjava/lang/String;J)V"); static const std::string _adapterSettingsChangedMethodArgs("(Lorg/tinyb/BluetoothAdapter;Lorg/tinyb/AdapterSettings;Lorg/tinyb/AdapterSettings;Lorg/tinyb/AdapterSettings;J)V"); @@ -334,7 +334,7 @@ class JNIAdapterStatusListener : public AdapterStatusListener { env->SetLongField(jdevice, deviceClazzTSUpdateField, (jlong)timestamp); java_exception_check_and_throw(env, E_FILE_LINE); - jobject hciErrorCode = env->CallStaticObjectMethod(hciErrorCodeClazzRef->getClass(), hciErrorCodeClazzGet, (jint)static_cast<uint8_t>(reason)); + jobject hciErrorCode = env->CallStaticObjectMethod(hciErrorCodeClazzRef->getClass(), hciErrorCodeClazzGet, (jbyte)static_cast<uint8_t>(reason)); java_exception_check_and_throw(env, E_FILE_LINE); JNIGlobalRef::check(hciErrorCode, E_FILE_LINE); |