aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2022-01-29 03:45:41 +0100
committerSven Gothel <[email protected]>2022-01-29 03:45:41 +0100
commitd7992842f7cfaff04d9c6e20d3707fd5856bf0f2 (patch)
tree0f0a7d4ee1e3b82c5c66efa69d61fe9ef99d0652 /java
parentf1510640672b5055a81322d12c5521aa663581be (diff)
BTAdapter: Expose `getBTMajorVersion()` in C++ and Java, removing hasHCIExtScan(), hasHCIExtConn() and hasHCIExtAdv()
Diffstat (limited to 'java')
-rw-r--r--java/jau/direct_bt/DBTAdapter.java3
-rw-r--r--java/jni/direct_bt/DBTAdapter.cxx11
-rw-r--r--java/org/direct_bt/BTAdapter.java3
3 files changed, 17 insertions, 0 deletions
diff --git a/java/jau/direct_bt/DBTAdapter.java b/java/jau/direct_bt/DBTAdapter.java
index fc68ecf3..116d2516 100644
--- a/java/jau/direct_bt/DBTAdapter.java
+++ b/java/jau/direct_bt/DBTAdapter.java
@@ -177,6 +177,9 @@ public class DBTAdapter extends DBTObject implements BTAdapter
public int getDevID() { return dev_id; }
@Override
+ public native int getBTMajorVersion();
+
+ @Override
public final String getName() {
if( !isValid() ) {
return name_cached;
diff --git a/java/jni/direct_bt/DBTAdapter.cxx b/java/jni/direct_bt/DBTAdapter.cxx
index f932bef3..febe6ad4 100644
--- a/java/jni/direct_bt/DBTAdapter.cxx
+++ b/java/jni/direct_bt/DBTAdapter.cxx
@@ -641,6 +641,17 @@ void Java_jau_direct_1bt_DBTAdapter_deleteImpl(JNIEnv *env, jobject obj, jlong n
}
}
+jint Java_jau_direct_1bt_DBTAdapter_getBTMajorVersion(JNIEnv *env, jobject obj)
+{
+ try {
+ BTAdapter *adapter = jau::getJavaUplinkObject<BTAdapter>(env, obj);
+ return (jint) adapter->getBTMajorVersion();
+ } catch(...) {
+ rethrow_and_raise_java_exception(env);
+ }
+ return 0;
+}
+
jboolean Java_jau_direct_1bt_DBTAdapter_isPoweredImpl(JNIEnv *env, jobject obj)
{
try {
diff --git a/java/org/direct_bt/BTAdapter.java b/java/org/direct_bt/BTAdapter.java
index af8fd55e..375138ce 100644
--- a/java/org/direct_bt/BTAdapter.java
+++ b/java/org/direct_bt/BTAdapter.java
@@ -460,6 +460,9 @@ public interface BTAdapter extends BTObject
*/
int getDevID();
+ /** Returns the Bluetooth major version of this adapter. Currently either `4` or `5`. */
+ int getBTMajorVersion();
+
/**
* Returns the name.
* <p>