From 98fd49f1a5989dd2da466e0058daa626e6f51d58 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 25 May 2020 03:51:37 +0200 Subject: Expose Whitelist (auto-)connect management to BluetoothAdapter.java, impl in DBTAdapter.java only at this point. Instead of using the "string definition" of addressType, we introduce a universal BluetoothAddressType (java) which corresponds with BDAddressType (C++). BluetoothAddressType (java) supports a string conversion, which also accepts the D-Bus names "", "public" and "random" - as also used in TinyB. ++++ Further adds HCIWhitelistConnectType (java) representing the same C++ type. --- java/tinyb/dbus/DBusAdapter.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'java/tinyb') diff --git a/java/tinyb/dbus/DBusAdapter.java b/java/tinyb/dbus/DBusAdapter.java index 8666e8d3..b8866534 100644 --- a/java/tinyb/dbus/DBusAdapter.java +++ b/java/tinyb/dbus/DBusAdapter.java @@ -34,12 +34,14 @@ import java.util.List; import java.util.UUID; import org.tinyb.BluetoothAdapter; +import org.tinyb.BluetoothAddressType; import org.tinyb.BluetoothDevice; import org.tinyb.AdapterStatusListener; import org.tinyb.BluetoothException; import org.tinyb.BluetoothManager; import org.tinyb.BluetoothNotification; import org.tinyb.BluetoothType; +import org.tinyb.HCIWhitelistConnectType; import org.tinyb.TransportType; public class DBusAdapter extends DBusObject implements BluetoothAdapter @@ -63,6 +65,30 @@ public class DBusAdapter extends DBusObject implements BluetoothAdapter return find(name, address, 0); } + @Override + public boolean isDeviceWhitelisted(final String address) { + return false; // FIXME + } + + @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) { + return false; // FIXME + } + + @Override + public boolean addDeviceToWhitelist(final String address, final BluetoothAddressType address_type, + final HCIWhitelistConnectType ctype) { + return false; // FIXME + } + + @Override + public boolean removeDeviceFromWhitelist(final String address, final BluetoothAddressType address_type) { + return false; // FIXME + } + /* D-Bus method calls: */ @Override -- cgit v1.2.3