diff options
author | Sven Gothel <[email protected]> | 2021-10-10 07:14:46 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2021-10-10 07:14:46 +0200 |
commit | dade7d8db9f89ac4c44c3ce5c1d7b9d1676c47c4 (patch) | |
tree | 70d755b605be300473247b5667898bf3bd085c16 /java | |
parent | 57819d5aa74d6ab6e93e570f2c67c781f52f186d (diff) |
BTAdapter: Remove setDiscoverable() and setBondable() (-> startAdvertising() incl connectable)
Diffstat (limited to 'java')
-rw-r--r-- | java/jau/direct_bt/DBTAdapter.java | 16 | ||||
-rw-r--r-- | java/jni/direct_bt/DBTAdapter.cxx | 22 | ||||
-rw-r--r-- | java/org/direct_bt/BTAdapter.java | 19 |
3 files changed, 0 insertions, 57 deletions
diff --git a/java/jau/direct_bt/DBTAdapter.java b/java/jau/direct_bt/DBTAdapter.java index f67bff89..eeb6e845 100644 --- a/java/jau/direct_bt/DBTAdapter.java +++ b/java/jau/direct_bt/DBTAdapter.java @@ -80,7 +80,6 @@ public class DBTAdapter extends DBTObject implements BTAdapter private final AtomicBoolean isClosing = new AtomicBoolean(false); private final AtomicBoolean powered_state = new AtomicBoolean(false); // AdapterSettings - private final AtomicBoolean isDiscoverable = new AtomicBoolean(false); // AdapterSettings private final AtomicReference<ScanType> currentMetaScanType = new AtomicReference<ScanType>(ScanType.NONE); // AdapterStatusListener and powerdOff @@ -242,9 +241,6 @@ public class DBTAdapter extends DBTObject implements BTAdapter /* Unsupported */ @Override - public boolean getDiscoverable() { return isDiscoverable.get(); } - - @Override public final ScanType getCurrentScanType() { return currentMetaScanType.get(); } @@ -298,18 +294,12 @@ public class DBTAdapter extends DBTObject implements BTAdapter private native byte setDefaultLE_PHYImpl(final byte Tx, final byte Rx); @Override - public native boolean setDiscoverable(boolean value); - - @Override public final BTDevice connectDevice(final BDAddressAndType addressAndType) { return connectDeviceImpl(addressAndType.address.b, addressAndType.type.value); } private native BTDevice connectDeviceImpl(byte[] address, byte addressType); @Override - public native boolean setPairable(boolean value); - - @Override public boolean getPoweredState() { return powered_state.get(); } @Override @@ -519,7 +509,6 @@ public class DBTAdapter extends DBTObject implements BTAdapter } if( initialSetting ) { powered_state.set( newmask.isSet(AdapterSettings.SettingType.POWERED) ); - isDiscoverable.set( newmask.isSet(AdapterSettings.SettingType.DISCOVERABLE) ); return; } if( changedmask.isSet(AdapterSettings.SettingType.POWERED) ) { @@ -530,11 +519,6 @@ public class DBTAdapter extends DBTObject implements BTAdapter } } } - if( changedmask.isSet(AdapterSettings.SettingType.DISCOVERABLE) ) { - final boolean _isDiscoverable = newmask.isSet(AdapterSettings.SettingType.DISCOVERABLE); - if( isDiscoverable.compareAndSet(!_isDiscoverable, _isDiscoverable) ) { - } - } } @Override public void discoveringChanged(final BTAdapter adapter, final ScanType currentMeta, final ScanType changedType, final boolean changedEnabled, final boolean keepAlive, final long timestamp) { diff --git a/java/jni/direct_bt/DBTAdapter.cxx b/java/jni/direct_bt/DBTAdapter.cxx index 09c8f666..b1072f5d 100644 --- a/java/jni/direct_bt/DBTAdapter.cxx +++ b/java/jni/direct_bt/DBTAdapter.cxx @@ -975,17 +975,6 @@ jbyte Java_jau_direct_1bt_DBTAdapter_setNameImpl(JNIEnv *env, jobject obj, jstri return (jbyte) number(HCIStatusCode::INTERNAL_FAILURE); } -jboolean Java_jau_direct_1bt_DBTAdapter_setDiscoverable(JNIEnv *env, jobject obj, jboolean value) { - try { - BTAdapter *adapter = jau::getJavaUplinkObject<BTAdapter>(env, obj); - jau::JavaGlobalObj::check(adapter->getJavaObject(), E_FILE_LINE); - return adapter->setDiscoverable(JNI_TRUE == value ? true : false) ? JNI_TRUE : JNI_FALSE; - } catch(...) { - rethrow_and_raise_java_exception(env); - } - return JNI_FALSE; -} - jobject Java_jau_direct_1bt_DBTAdapter_connectDeviceImpl(JNIEnv *env, jobject obj, jbyteArray jaddress, jbyte jaddressType) { try { BTAdapter *adapter = jau::getJavaUplinkObject<BTAdapter>(env, obj); @@ -1027,17 +1016,6 @@ jobject Java_jau_direct_1bt_DBTAdapter_connectDeviceImpl(JNIEnv *env, jobject ob return nullptr; } -jboolean Java_jau_direct_1bt_DBTAdapter_setPairable(JNIEnv *env, jobject obj, jboolean value) { - try { - BTAdapter *adapter = jau::getJavaUplinkObject<BTAdapter>(env, obj); - jau::JavaGlobalObj::check(adapter->getJavaObject(), E_FILE_LINE); - return adapter->setBondable(JNI_TRUE == value ? true : false) ? JNI_TRUE : JNI_FALSE; - } catch(...) { - rethrow_and_raise_java_exception(env); - } - return JNI_FALSE; -} - void Java_jau_direct_1bt_DBTAdapter_printDeviceListsImpl(JNIEnv *env, jobject obj) { try { BTAdapter *adapter = jau::getJavaUplinkObject<BTAdapter>(env, obj); diff --git a/java/org/direct_bt/BTAdapter.java b/java/org/direct_bt/BTAdapter.java index d2dd9a45..6ffa9af9 100644 --- a/java/org/direct_bt/BTAdapter.java +++ b/java/org/direct_bt/BTAdapter.java @@ -541,18 +541,6 @@ public interface BTAdapter extends BTObject */ HCIStatusCode setDefaultLE_PHY(final LE_PHYs Tx, final LE_PHYs Rx); - /** Returns the discoverable state the adapter. - * @return The discoverable state of the adapter. - */ - boolean getDiscoverable(); - - /** - * Sets the discoverable state the adapter. - * @apiNote return value boolean since 2.0.0 - * @since 2.0.0 - */ - boolean setDiscoverable(boolean value); - /** * This method connects to device without need of * performing General Discovery. Connection mechanism is @@ -580,13 +568,6 @@ public interface BTAdapter extends BTObject BTDevice connectDevice(BDAddressAndType addressAndType); /** - * Sets the discoverable state the adapter. - * @apiNote return value boolean since 2.0.0 - * @since 2.0.0 - */ - boolean setPairable(boolean value); - - /** * Returns the current meta discovering {@link ScanType}. * It can be modified through {@link #startDiscovery(boolean, boolean)} and {@link #stopDiscovery()}. * <p> |