diff options
author | Sven Gothel <[email protected]> | 2020-05-10 06:03:59 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-05-10 06:03:59 +0200 |
commit | 0f53fde528dea4470d152d30f33f357dde1b2e10 (patch) | |
tree | e504202c2a92bd16299ee1204ed5b2130ecb8aa4 /java/tinyb | |
parent | 7adcc61246e0948041e77c4eb45c75c1f46ea2b4 (diff) |
[Bluetooth]AdapterStatusListener: Renamed; Using a list instead of one-shot callback; Mutable callbacks for_each...
[Bluetooth]AdapterStatusListener:
- Renamed BluetoothAdapterStatusListener -> AdapterStatusListener
- Using a list instead of one-shot callback: Allows utilizing information from multiple actors,
which also allows a more efficient implementation of the tinyb interfaces.
- Mutable callbacks for_each...: BasicAlgos.hpp adds for_each_idx_mtx(..) template algos,
allowing to perform one UnaryFunction via indices and utilizing mutex lock
for thread safety. This pattern reduces code complexity, as we need to
use the visitor model for the listener multiple times.
- Java: DBTDevice's AdapterStatusListener hook performs certain TinyB one-shot callbacks
Diffstat (limited to 'java/tinyb')
-rw-r--r-- | java/tinyb/dbus/DBusAdapter.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/java/tinyb/dbus/DBusAdapter.java b/java/tinyb/dbus/DBusAdapter.java index 0fa8b787..2a46f4c7 100644 --- a/java/tinyb/dbus/DBusAdapter.java +++ b/java/tinyb/dbus/DBusAdapter.java @@ -35,7 +35,7 @@ import java.util.UUID; import org.tinyb.BluetoothAdapter; import org.tinyb.BluetoothDevice; -import org.tinyb.BluetoothAdapterStatusListener; +import org.tinyb.AdapterStatusListener; import org.tinyb.BluetoothException; import org.tinyb.BluetoothManager; import org.tinyb.BluetoothNotification; @@ -149,11 +149,16 @@ public class DBusAdapter extends DBusObject implements BluetoothAdapter public native boolean getDiscovering(); @Override - public void setStatusListener(final BluetoothAdapterStatusListener l) { + public boolean addStatusListener(final AdapterStatusListener l) { throw new UnsupportedOperationException(); // FIXME } @Override + public boolean removeStatusListener(final AdapterStatusListener l) { + return false; // FIXME + } + + @Override public native void enableDiscoveringNotifications(BluetoothNotification<Boolean> callback); @Override |