summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-06-01 02:52:08 +0200
committerSven Gothel <[email protected]>2020-06-01 02:52:08 +0200
commit171eda5060c20e190b960600e823c108c74ab2be (patch)
treefdfcf081c294753c0ba6b4f068e7397e9d5db650 /java
parent728cbb0c31ac8cab0cc6e7551c78adab5e2a4a4d (diff)
Clarify le_scan and conn[ection] arguments for whitelist and connect methods C++/Java, fix timeout semantics (API doc)
Diffstat (limited to 'java')
-rw-r--r--java/direct_bt/tinyb/DBTAdapter.java10
-rw-r--r--java/direct_bt/tinyb/DBTDevice.java14
-rw-r--r--java/org/tinyb/BluetoothAdapter.java12
-rw-r--r--java/org/tinyb/BluetoothDevice.java18
4 files changed, 27 insertions, 27 deletions
diff --git a/java/direct_bt/tinyb/DBTAdapter.java b/java/direct_bt/tinyb/DBTAdapter.java
index e0d9aa02..d9f5f684 100644
--- a/java/direct_bt/tinyb/DBTAdapter.java
+++ b/java/direct_bt/tinyb/DBTAdapter.java
@@ -141,14 +141,14 @@ public class DBTAdapter extends DBTObject implements BluetoothAdapter
@Override
public boolean addDeviceToWhitelist(final String address, final BluetoothAddressType address_type,
final HCIWhitelistConnectType ctype,
- final short min_interval, final short max_interval,
- final short latency, final short timeout) {
+ final short conn_interval_min, final short conn_interval_max,
+ final short conn_latency, final short timeout) {
return addDeviceToWhitelist(address, address_type.value, ctype.value,
- min_interval, max_interval, latency, timeout);
+ conn_interval_min, conn_interval_max, conn_latency, timeout);
}
private native boolean addDeviceToWhitelist(final String address, final int address_type, final int ctype,
- final short min_interval, final short max_interval,
- final short latency, final short timeout);
+ final short conn_interval_min, final short conn_interval_max,
+ final short conn_latency, final short timeout);
@Override
public boolean addDeviceToWhitelist(final String address, final BluetoothAddressType address_type,
diff --git a/java/direct_bt/tinyb/DBTDevice.java b/java/direct_bt/tinyb/DBTDevice.java
index fa749afe..5f122720 100644
--- a/java/direct_bt/tinyb/DBTDevice.java
+++ b/java/direct_bt/tinyb/DBTDevice.java
@@ -279,12 +279,12 @@ public class DBTDevice extends DBTObject implements BluetoothDevice
private native boolean connectImpl() throws BluetoothException;
@Override
- public boolean connect(final short interval, final short window,
- final short min_interval, final short max_interval,
- final short latency, final short timeout) {
+ public boolean connect(final short le_scan_interval, final short le_scan_window,
+ final short conn_interval_min, final short conn_interval_max,
+ final short conn_latency, final short timeout) {
boolean res = false;
if( !connected ) {
- res = connectImpl(interval, window, min_interval, max_interval, latency, timeout);
+ res = connectImpl(le_scan_interval, le_scan_window, conn_interval_min, conn_interval_max, conn_latency, timeout);
if( res ) {
connected = true;
if( null != userConnectedNotificationsCB ) {
@@ -301,9 +301,9 @@ public class DBTDevice extends DBTObject implements BluetoothDevice
}
return res;
}
- private native boolean connectImpl(final short interval, final short window,
- final short min_interval, final short max_interval,
- final short latency, final short timeout);
+ private native boolean connectImpl(final short le_scan_interval, final short le_scan_window,
+ final short conn_interval_min, final short conn_interval_max,
+ final short conn_latency, final short timeout);
/* DBT Java callbacks */
diff --git a/java/org/tinyb/BluetoothAdapter.java b/java/org/tinyb/BluetoothAdapter.java
index 16f3ef13..1261f28d 100644
--- a/java/org/tinyb/BluetoothAdapter.java
+++ b/java/org/tinyb/BluetoothAdapter.java
@@ -88,10 +88,10 @@ public interface BluetoothAdapter extends BluetoothObject
* @param address
* @param address_type
* @param ctype
- * @param min_interval default value 0x000F
- * @param max_interval default value 0x000F
- * @param latency default value 0x0000
- * @param timeout default value 0x0C80
+ * @param conn_interval_min default value 0x000F
+ * @param conn_interval_max default value 0x000F
+ * @param conn_latency default value 0x0000
+ * @param timeout in units of 10ms, default value 1000 for 10000ms or 10s.
* @return {@code true} if successful, otherwise {@code false}.
*
* @see #addDeviceToWhitelist(String, BluetoothAddressType, HCIWhitelistConnectType)
@@ -99,8 +99,8 @@ public interface BluetoothAdapter extends BluetoothObject
*/
public boolean addDeviceToWhitelist(final String address, final BluetoothAddressType address_type,
final HCIWhitelistConnectType ctype,
- final short min_interval, final short max_interval,
- final short latency, final short timeout);
+ final short conn_interval_min, final short conn_interval_max,
+ final short conn_latency, final short timeout);
/**
* Add the given device to the adapter's autoconnect whitelist.
diff --git a/java/org/tinyb/BluetoothDevice.java b/java/org/tinyb/BluetoothDevice.java
index dbfb1d06..d4b03019 100644
--- a/java/org/tinyb/BluetoothDevice.java
+++ b/java/org/tinyb/BluetoothDevice.java
@@ -88,20 +88,20 @@ public interface BluetoothDevice extends BluetoothObject
* Set window to the same value as the interval, enables continuous scanning.
* </p>
*
- * @param interval default value 0x0004
- * @param window default value 0x0004
- * @param min_interval default value 0x000F
- * @param max_interval default value 0x000F
- * @param latency default value 0x0000
- * @param timeout default value 0x0C80
+ * @param le_scan_interval default value 0x0004
+ * @param le_scan_window default value 0x0004
+ * @param conn_interval_min default value 0x000F
+ * @param conn_interval_max default value 0x000F
+ * @param conn_latency default value 0x0000
+ * @param timeout in units of 10ms, default value 1000 for 10000ms or 10s.
* @return {@code true} if successful, otherwise {@code false}.
*
* @see #connect()
* @since 2.0.0
*/
- public boolean connect(final short interval, final short window,
- final short min_interval, final short max_interval,
- final short latency, final short timeout);
+ public boolean connect(final short le_scan_interval, final short le_scan_window,
+ final short conn_interval_min, final short conn_interval_max,
+ final short conn_latency, final short timeout);
/** Connects a specific profile available on the device, given by UUID