From f9250fd02eba1a0e2fa2c52457398198549edf1b Mon Sep 17 00:00:00 2001
From: Sven Gothel
- * If the {@link BTDevice}'s GATTHandler is null, i.e. not connected, {@code false} is being returned. + * If the {@link BTDevice}'s BTGattHandler is null, i.e. not connected, {@code false} is being returned. *
* @param listener A {@link BTGattCharListener} instance * @return true if the given listener is an element of the list and has been removed, otherwise false. @@ -857,7 +857,7 @@ public interface BTDevice extends BTObject * Implementation tests all listener's {@link BTGattCharListener#getAssociatedChar()} * to match with the given associated characteristic. * - * @param associatedCharacteristic the match criteria to remove any GATTCharacteristicListener from the list + * @param associatedCharacteristic the match criteria to remove any BTGattCharListener from the list * @return number of removed listener. * @since 2.0.0 * @implNote not implemented in tinyb.dbus diff --git a/java/org/direct_bt/BTGattChar.java b/java/org/direct_bt/BTGattChar.java index 877e9cac..5dfb2373 100644 --- a/java/org/direct_bt/BTGattChar.java +++ b/java/org/direct_bt/BTGattChar.java @@ -134,7 +134,7 @@ public interface BTGattChar extends BTObject ** Occurring notifications and indications, if enabled via {@link #configNotificationIndication(boolean, boolean, boolean[])} * or {@link #enableNotificationOrIndication(boolean[])}, - * will call the respective GATTCharacteristicListener callback method. + * will call the respective BTGattCharListener callback method. *
* @param listener A {@link BTGattCharListener} instance, listening to this {@link BTGattChar}'s events * @return true if the given listener is not element of the list and has been newly added, otherwise false. @@ -145,7 +145,7 @@ public interface BTGattChar extends BTObject * @since 2.0.0 * @implNote not implemented in tinyb.dbus */ - public boolean addCharacteristicListener(final BTGattCharListener listener) + public boolean addCharListener(final BTGattCharListener listener) throws IllegalStateException; /** @@ -173,7 +173,7 @@ public interface BTGattChar extends BTObject * @since 2.0.0 * @implNote not implemented in tinyb.dbus */ - public boolean addCharacteristicListener(final BTGattCharListener listener, final boolean enabledState[/*2*/]) + public boolean addCharListener(final BTGattCharListener listener, final boolean enabledState[/*2*/]) throws IllegalStateException; /** @@ -192,7 +192,7 @@ public interface BTGattChar extends BTObject * @since 2.0.0 * @implNote not implemented in tinyb.dbus */ - public boolean removeCharacteristicListener(final BTGattCharListener l, final boolean disableIndicationNotification); + public boolean removeCharListener(final BTGattCharListener l, final boolean disableIndicationNotification); /** * Disables the notification and/or indication for this characteristic BLE level @@ -211,11 +211,11 @@ public interface BTGattChar extends BTObject * using {@link #configNotificationIndication(boolean, boolean, boolean[])} * @return number of removed listener. * @see #configNotificationIndication(boolean, boolean, boolean[]) - * @see BTDevice#removeAllAssociatedCharacteristicListener(BTGattChar) + * @see BTDevice#removeAllAssociatedCharListener(BTGattChar) * @since 2.0.0 * @implNote not implemented in tinyb.dbus */ - public int removeAllAssociatedCharacteristicListener(final boolean disableIndicationNotification); + public int removeAllAssociatedCharListener(final boolean disableIndicationNotification); /** * Sets the given value BluetoothNotification to have its run function diff --git a/java/org/direct_bt/BTGattCharListener.java b/java/org/direct_bt/BTGattCharListener.java index f95e0166..d24a3d49 100644 --- a/java/org/direct_bt/BTGattCharListener.java +++ b/java/org/direct_bt/BTGattCharListener.java @@ -31,11 +31,11 @@ import java.lang.ref.WeakReference; * {@link BTGattChar} event listener for notification and indication events. ** A listener instance may be attached to a {@link BTGattChar} via - * {@link BTGattChar#addCharacteristicListener(BTGattCharListener)} to listen to its events. + * {@link BTGattChar#addCharListener(BTGattCharListener)} to listen to its events. *
** A listener instance may be attached to a {@link BTDevice} via - * {@link BTDevice#addCharacteristicListener(BTGattCharListener, BTGattChar)} + * {@link BTDevice#addCharListener(BTGattCharListener, BTGattChar)} * to listen to all events of the device or the matching filtered events. *
*
@@ -46,7 +46,7 @@ import java.lang.ref.WeakReference;
* To attach multiple listener, one instance per attachment must be created.
*
* This restriction is due to implementation semantics of strictly associating
- * one Java {@link BTGattCharListener} instance to one C++ {@code GATTCharacteristicListener} instance.
+ * one Java {@link BTGattCharListener} instance to one C++ {@code BTGattCharListener} instance.
* The latter will be added to the native list of listeners.
* This class's {@code nativeInstance} field links the Java instance to mentioned C++ listener.
*
@@ -107,9 +107,10 @@ public abstract class BTGattCharListener {
final boolean confirmationSent) {
}
+ @Override
public String toString() {
final BTGattChar c = getAssociatedChar();
final String cs = null != c ? c.toString() : "null";
- return "GATTCharacteristicListener[associated "+cs+"]";
+ return "BTGattCharListener[associated "+cs+"]";
}
};
diff --git a/java/org/direct_bt/BTGattService.java b/java/org/direct_bt/BTGattService.java
index 6b85878d..4822d71c 100644
--- a/java/org/direct_bt/BTGattService.java
+++ b/java/org/direct_bt/BTGattService.java
@@ -42,11 +42,11 @@ public interface BTGattService extends BTObject
@Override
public BTGattService clone();
- /** Find a BluetoothGattCharacteristic. If parameter UUID is not null,
+ /** Find a BTGattChar. If parameter UUID is not null,
* the returned object will have to match it.
* It will first check for existing objects. It will not turn on discovery
* or connect to devices.
- * @parameter UUID optionally specify the UUID of the BluetoothGattCharacteristic you are
+ * @parameter UUID optionally specify the UUID of the BTGattChar you are
* waiting for
* @parameter timeoutMS the function will return after timeout time in milliseconds, a
* value of zero means wait forever. If object is not found during this time null will be returned.
@@ -55,7 +55,7 @@ public interface BTGattService extends BTObject
*/
public BTGattChar find(String UUID, long timeoutMS);
- /** Find a BluetoothGattCharacteristic. If parameter UUID is not null,
+ /** Find a BTGattChar. If parameter UUID is not null,
* the returned object will have to match it.
* It will first check for existing objects. It will not turn on discovery
* or connect to devices.
@@ -100,7 +100,7 @@ public interface BTGattService extends BTObject
* @since 2.0.0
* @implNote not implemented in tinyb.dbus
* @see BTGattChar#enableNotificationOrIndication(boolean[])
- * @see BTDevice#addCharacteristicListener(BTGattCharListener, BTGattChar)
+ * @see BTDevice#addCharListener(BTGattCharListener, BTGattChar)
*/
public static boolean addCharListenerToAll(final BTDevice device, final List
* If using {@link #isDirectBT() Direct-BT}, user are encouraged to - * {@link BTGattChar#addCharacteristicListener(GATTCharacteristicListener, boolean[]) utilize GATTCharacteristicListener} + * {@link BTGattChar#addCharListener(BTGattCharListener, boolean[]) utilize BTGattCharListener} * to handle value notifications when they occur w/o caching. *
*diff --git a/java/tinyb/dbus/DBusGattCharacteristic.java b/java/tinyb/dbus/DBusGattCharacteristic.java index 01d67e15..df270cfc 100644 --- a/java/tinyb/dbus/DBusGattCharacteristic.java +++ b/java/tinyb/dbus/DBusGattCharacteristic.java @@ -110,7 +110,7 @@ public class DBusGattCharacteristic extends DBusObject implements BTGattChar } @Override - public boolean addCharacteristicListener(final BTGattCharListener listener) { + public boolean addCharListener(final BTGattCharListener listener) { return false; // FIXME } @Override @@ -126,17 +126,17 @@ public class DBusGattCharacteristic extends DBusObject implements BTGattChar return false; // FIXME } @Override - public boolean addCharacteristicListener(final BTGattCharListener listener, final boolean[] enabledState) + public boolean addCharListener(final BTGattCharListener listener, final boolean[] enabledState) throws IllegalStateException { return false; // FIXME } @Override - public boolean removeCharacteristicListener(final BTGattCharListener l, final boolean disableIndicationNotification) { + public boolean removeCharListener(final BTGattCharListener l, final boolean disableIndicationNotification) { return false; // FIXME } @Override - public int removeAllAssociatedCharacteristicListener(final boolean disableIndicationNotification) { + public int removeAllAssociatedCharListener(final boolean disableIndicationNotification) { return 0; // FIXME } -- cgit v1.2.3