diff options
author | Sven Gothel <[email protected]> | 2021-10-10 04:52:25 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-10-10 04:52:25 +0200 |
commit | ae5fd90e31793b14f1e5a716b79a28ab75abcfdb (patch) | |
tree | 905e759f6627cfdfbd79c769cf908176f3da7932 /java/jni | |
parent | 90422e7f0323b7f3e171c89db12612b0dd9f15c2 (diff) |
Remove DirectBTJNISettings: Always use uuid_t -> uuid128_t mapping, unifying uuid_t
Equality and compare of uuid_t shall always be performed on uuid128_t if underlying types differ.
Diffstat (limited to 'java/jni')
-rw-r--r-- | java/jni/direct_bt/DBTDevice.cxx | 4 | ||||
-rw-r--r-- | java/jni/direct_bt/DBTGattChar.cxx | 4 | ||||
-rw-r--r-- | java/jni/direct_bt/DBTGattService.cxx | 4 | ||||
-rw-r--r-- | java/jni/direct_bt/DBTManager.cxx | 3 | ||||
-rw-r--r-- | java/jni/direct_bt/helper_dbt.cxx | 2 | ||||
-rw-r--r-- | java/jni/direct_bt/helper_dbt.hpp | 17 |
6 files changed, 4 insertions, 30 deletions
diff --git a/java/jni/direct_bt/DBTDevice.cxx b/java/jni/direct_bt/DBTDevice.cxx index 5141b548..b3e9c2bf 100644 --- a/java/jni/direct_bt/DBTDevice.cxx +++ b/java/jni/direct_bt/DBTDevice.cxx @@ -798,9 +798,7 @@ jobject Java_jau_direct_1bt_DBTDevice_getServicesImpl(JNIEnv *env, jobject obj) JavaGlobalObj::check(_device->getJavaObject(), E_FILE_LINE); jobject jdevice = JavaGlobalObj::GetObject(_device->getJavaObject()); const jboolean isPrimary = service->primary; - const jstring juuid = from_string_to_jstring(env_, - directBTJNISettings.getUnifyUUID128Bit() ? service->type->toUUID128String() : - service->type->toString()); + const jstring juuid = from_string_to_jstring(env_, service->type->toUUID128String()); java_exception_check_and_throw(env_, E_FILE_LINE); jobject jservice = env_->NewObject(clazz, clazz_ctor, (jlong)service, jdevice, isPrimary, diff --git a/java/jni/direct_bt/DBTGattChar.cxx b/java/jni/direct_bt/DBTGattChar.cxx index 5b6ab920..916beb4c 100644 --- a/java/jni/direct_bt/DBTGattChar.cxx +++ b/java/jni/direct_bt/DBTGattChar.cxx @@ -80,9 +80,7 @@ jobject Java_jau_direct_1bt_DBTGattChar_getDescriptorsImpl(JNIEnv *env, jobject JavaGlobalObj::check(_characteristic->getJavaObject(), E_FILE_LINE); jobject jcharacteristic = JavaGlobalObj::GetObject(_characteristic->getJavaObject()); - const jstring juuid = from_string_to_jstring(env_, - directBTJNISettings.getUnifyUUID128Bit() ? descriptor->type->toUUID128String() : - descriptor->type->toString()); + const jstring juuid = from_string_to_jstring(env_, descriptor->type->toUUID128String()); java_exception_check_and_throw(env_, E_FILE_LINE); const size_t value_size = descriptor->value.size(); diff --git a/java/jni/direct_bt/DBTGattService.cxx b/java/jni/direct_bt/DBTGattService.cxx index 43539077..c6082cbe 100644 --- a/java/jni/direct_bt/DBTGattService.cxx +++ b/java/jni/direct_bt/DBTGattService.cxx @@ -105,9 +105,7 @@ jobject Java_jau_direct_1bt_DBTGattService_getCharsImpl(JNIEnv *env, jobject obj JNIGlobalRef::check(jGattCharPropSet, E_FILE_LINE); java_exception_check_and_throw(env_, E_FILE_LINE); - const jstring uuid = from_string_to_jstring(env_, - directBTJNISettings.getUnifyUUID128Bit() ? characteristic->value_type->toUUID128String() : - characteristic->value_type->toString()); + const jstring uuid = from_string_to_jstring(env_, characteristic->value_type->toUUID128String()); java_exception_check_and_throw(env_, E_FILE_LINE); jobject jcharVal = env_->NewObject(clazz, clazz_ctor, (jlong)characteristic, jservice, diff --git a/java/jni/direct_bt/DBTManager.cxx b/java/jni/direct_bt/DBTManager.cxx index 985cb5b8..542e58a5 100644 --- a/java/jni/direct_bt/DBTManager.cxx +++ b/java/jni/direct_bt/DBTManager.cxx @@ -109,9 +109,8 @@ static void _addMgmtCBOnce(JNIEnv *env, BTManager & mgmt, JNIGlobalRef jmgmtRef, } } -void Java_jau_direct_1bt_DBTManager_initImpl(JNIEnv *env, jobject obj, jboolean unifyUUID128Bit) +void Java_jau_direct_1bt_DBTManager_initImpl(JNIEnv *env, jobject obj) { - directBTJNISettings.setUnifyUUID128Bit(unifyUUID128Bit); try { BTManager *manager = &BTManager::get(); // special: static singleton setInstance<BTManager>(env, obj, manager); diff --git a/java/jni/direct_bt/helper_dbt.cxx b/java/jni/direct_bt/helper_dbt.cxx index 23d54105..7bc4d8af 100644 --- a/java/jni/direct_bt/helper_dbt.cxx +++ b/java/jni/direct_bt/helper_dbt.cxx @@ -32,8 +32,6 @@ using namespace direct_bt; -DirectBTJNISettings direct_bt::directBTJNISettings; - static std::string jStringEmpty(""); static std::string jAddressTypePublic("public"); static std::string jAddressTypeRandom("random"); diff --git a/java/jni/direct_bt/helper_dbt.hpp b/java/jni/direct_bt/helper_dbt.hpp index 8c7a45b5..3fd4f0ac 100644 --- a/java/jni/direct_bt/helper_dbt.hpp +++ b/java/jni/direct_bt/helper_dbt.hpp @@ -32,23 +32,6 @@ namespace direct_bt { - class DirectBTJNISettings { - private: - bool unifyUUID128Bit = true; - - public: - /** - * Enables or disables uuid128_t consolidation - * for native uuid16_t and uuid32_t values before string conversion. - * <p> - * Default is {@code true}. - * </p> - */ - bool getUnifyUUID128Bit() { return unifyUUID128Bit; } - void setUnifyUUID128Bit(bool v) { unifyUUID128Bit = v; } - }; - extern DirectBTJNISettings directBTJNISettings; - BDAddressType fromJavaAdressTypeToBDAddressType(JNIEnv *env, jstring jAddressType); jstring fromBDAddressTypeToJavaAddressType(JNIEnv *env, BDAddressType bdAddressType); |