diff options
author | Sven Gothel <[email protected]> | 2020-10-13 02:19:02 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-10-13 02:19:02 +0200 |
commit | f3acf0e335bf65e67aa5b4d292bb5446ffbde271 (patch) | |
tree | a206c9b4aa0d550fe0d73f9d7e7d24e5680ad6d0 /java/org/tinyb/BluetoothManager.java | |
parent | d5adce54eedbbe17f47db839f47280ba8fcf1f49 (diff) |
AdapterStatusListener[1] and DBTAdapter[2] API Refinement: [1] non const DBTAdapter, [2] use HCIStatusCode for start/stopDiscovery
and well as [2] return boolean for set[Discoverable|Bondable|Powered](..).
AdapterStatusListener needs to pass non-const DBTAdapter to allow actionable modification of adapter state,
e.g. start/stopDiscovery.
HCIStatusCode is desired for start/stopDiscovery, allowing user to read actual HCI status code on failure.
boolean return value for set[Discoverable|Bondable|Powered](..) reflecting general success or failure
on these basic commands.
Diffstat (limited to 'java/org/tinyb/BluetoothManager.java')
-rw-r--r-- | java/org/tinyb/BluetoothManager.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/java/org/tinyb/BluetoothManager.java b/java/org/tinyb/BluetoothManager.java index 2ddad81e..5c7eba23 100644 --- a/java/org/tinyb/BluetoothManager.java +++ b/java/org/tinyb/BluetoothManager.java @@ -229,18 +229,20 @@ public interface BluetoothManager * Using {@link #startDiscovery(boolean) startDiscovery}({@code keepAlive=true}) * and {@link #stopDiscovery()} is the recommended workflow * for a reliable discovery process. - * @return TRUE if discovery was successfully enabled + * @return {@link HCIStatusCode#SUCCESS} if successful, otherwise the {@link HCIStatusCode} error state * @throws BluetoothException * @since 2.0.0 * @implNote {@code keepAlive} not implemented in tinyb.dbus */ - public boolean startDiscovery(final boolean keepAlive) throws BluetoothException; + public HCIStatusCode startDiscovery(final boolean keepAlive) throws BluetoothException; - - /** Turns off device discovery on the default adapter if it is enabled. - * @return TRUE if discovery was successfully disabled - */ - public boolean stopDiscovery() throws BluetoothException; + /** + * Turns off device discovery on the default adapter if it is enabled. + * @return {@link HCIStatusCode#SUCCESS} if successful, otherwise the {@link HCIStatusCode} error state + * @apiNote return {@link HCIStatusCode} since 2.0.0 + * @since 2.0.0 + */ + public HCIStatusCode stopDiscovery() throws BluetoothException; /** Returns if the discovers is running or not. * @return TRUE if discovery is running |