diff options
author | Sven Gothel <[email protected]> | 2020-09-23 01:05:15 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-09-23 01:05:15 +0200 |
commit | 02909e574ad5b6900cddcc4c7f231257fe3124c3 (patch) | |
tree | d77a0c945d9033f7d797587a44555cc8c1aa59b6 /java | |
parent | 9394da807db36d64014139aae824be85a9196aac (diff) | |
parent | c7bac778e9cdda69c4baaa47c7bdd86b3e1bfea0 (diff) |
Merge Secure Pairing API changele_secure_connections
Diffstat (limited to 'java')
-rw-r--r-- | java/direct_bt/tinyb/DBTDevice.java | 12 | ||||
-rw-r--r-- | java/org/tinyb/BluetoothDevice.java | 8 | ||||
-rw-r--r-- | java/tinyb/dbus/DBusDevice.java | 9 |
3 files changed, 15 insertions, 14 deletions
diff --git a/java/direct_bt/tinyb/DBTDevice.java b/java/direct_bt/tinyb/DBTDevice.java index 793d542e..08484eba 100644 --- a/java/direct_bt/tinyb/DBTDevice.java +++ b/java/direct_bt/tinyb/DBTDevice.java @@ -345,22 +345,22 @@ public class DBTDevice extends DBTObject implements BluetoothDevice private native byte pairImpl(final String passkey) throws BluetoothException; @Override - public final PairingMode[] getSupportedPairingModes() throws BluetoothException { + public final List<PairingMode> getSupportedPairingModes() throws BluetoothException { final byte[] res0 = getSupportedPairingModesImpl(); - final PairingMode[] res1 = new PairingMode[res0.length]; + final ArrayList<PairingMode> res1 = new ArrayList<PairingMode>(res0.length); for(int i=0; i<res0.length; i++) { - res1[i] = PairingMode.get(res0[i]); + res1.add( PairingMode.get(res0[i]) ); } return res1; } private native byte[] getSupportedPairingModesImpl() throws BluetoothException; @Override - public final PairingMode[] getRequiredPairingModes() throws BluetoothException { + public final List<PairingMode> getRequiredPairingModes() throws BluetoothException { final byte[] res0 = getRequiredPairingModesImpl(); - final PairingMode[] res1 = new PairingMode[res0.length]; + final ArrayList<PairingMode> res1 = new ArrayList<PairingMode>(res0.length); for(int i=0; i<res0.length; i++) { - res1[i] = PairingMode.get(res0[i]); + res1.add( PairingMode.get(res0[i]) ); } return res1; } diff --git a/java/org/tinyb/BluetoothDevice.java b/java/org/tinyb/BluetoothDevice.java index b0ba1420..20b018c0 100644 --- a/java/org/tinyb/BluetoothDevice.java +++ b/java/org/tinyb/BluetoothDevice.java @@ -213,11 +213,11 @@ public interface BluetoothDevice extends BluetoothObject * The device must be {@link #connect(short, short, short, short, short, short) connected} * before querying this status. FIXME? * </p> - * @return array of supported PairingMode, empty if pairing is not supported. + * @return list of supported PairingMode, empty if pairing is not supported. * @since 2.1.0 * @implNote not implemented in tinyb.dbus */ - PairingMode[] getSupportedPairingModes() throws BluetoothException; + List<PairingMode> getSupportedPairingModes() throws BluetoothException; /** * Returns a vector of required PairingMode by the device. @@ -225,11 +225,11 @@ public interface BluetoothDevice extends BluetoothObject * The device must be {@link #connect(short, short, short, short, short, short) connected} * before querying this status. FIXME? * </p> - * @return array of required PairingMode, empty if pairing is not required. + * @return list of required PairingMode, empty if pairing is not required. * @since 2.1.0 * @implNote not implemented in tinyb.dbus */ - PairingMode[] getRequiredPairingModes() throws BluetoothException; + List<PairingMode> getRequiredPairingModes() throws BluetoothException; /** * Remove this device from the system (like an unpair). diff --git a/java/tinyb/dbus/DBusDevice.java b/java/tinyb/dbus/DBusDevice.java index 7413ff18..8a37ab95 100644 --- a/java/tinyb/dbus/DBusDevice.java +++ b/java/tinyb/dbus/DBusDevice.java @@ -28,6 +28,7 @@ package tinyb.dbus; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -110,13 +111,13 @@ public class DBusDevice extends DBusObject implements BluetoothDevice public HCIStatusCode pair(final String passkey) throws BluetoothException { return HCIStatusCode.INTERNAL_FAILURE; } @Override - public final PairingMode[] getSupportedPairingModes() throws BluetoothException { - return new PairingMode[0]; + public final List<PairingMode> getSupportedPairingModes() throws BluetoothException { + return new ArrayList<PairingMode>(0); } @Override - public final PairingMode[] getRequiredPairingModes() throws BluetoothException { - return new PairingMode[0]; + public final List<PairingMode> getRequiredPairingModes() throws BluetoothException { + return new ArrayList<PairingMode>(0); } @Override |