Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
|
Public Member Functions | |
final boolean | addCharListener (final BTGattCharListener listener) |
Add the given BTGattCharListener to the listener list if not already present. More... | |
final boolean | addCharListener (final BTGattCharListener listener, final boolean enabledState[]) |
Add the given BTGattCharListener to the listener list if not already present and if enabling the notification or indication for this characteristic at BLE level was successful. More... | |
synchronized void | close () |
Release the native memory associated with this object The object should not be used following a call to close. More... | |
final synchronized boolean | configNotificationIndication (final boolean enableNotification, final boolean enableIndication, final boolean enabledState[]) throws IllegalStateException |
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration. More... | |
boolean | disableIndicationNotification () throws IllegalStateException |
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration. More... | |
boolean | enableNotificationOrIndication (final boolean enabledState[]) throws IllegalStateException |
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration. More... | |
boolean | equals (final Object obj) |
BTGattDesc | findGattDesc (final String desc_uuid) |
Find a BTGattDesc by its desc_uuid. More... | |
final BTGattDesc | getClientCharConfig () |
Return the Client Characteristic Configuration BTGattDesc if available or null. More... | |
final List< BTGattDesc > | getDescriptors () |
Returns a list of BluetoothGattDescriptors this characteristic exposes. More... | |
final short | getHandle () |
Characteristic Handle of this instance. More... | |
final boolean | getNotifying (final boolean enabledState[]) |
Returns true if notification for changes of this characteristic are activated. More... | |
final GattCharPropertySet | getProperties () |
Returns the properties of this characteristic. More... | |
final BTGattService | getService () |
Returns the service to which this characteristic belongs to. More... | |
final BTGattDesc | getUserDescription () |
Return the User Description BTGattDesc if available or null. More... | |
String | getUUID () |
Get the UUID of this characteristic. More... | |
final short | getValueHandle () |
Returns Characteristics Value Handle. More... | |
final byte[] | readValue () throws BTException |
Reads the value of this characteristic. More... | |
final int | removeAllAssociatedCharListener (final boolean shallDisableIndicationNotification) |
Disables the notification and/or indication for this characteristic BLE level if disableIndicationNotification == true and removes all associated BTGattChar.Listener or BTGattCharListener from the listener list, which are associated with this characteristic instance. More... | |
final boolean | removeCharListener (final BTGattCharListener listener) |
Remove the given associated BTGattCharListener from the listener list if present. More... | |
final String | toString () |
final boolean | writeValue (final byte[] value, final boolean withResponse) throws BTException |
Writes the value of this characteristic, using one of the following methods depending on withResponse @endiliteral. More... | |
Public Member Functions inherited from jau.direct_bt.DBTObject | |
synchronized void | close () |
Release the native memory associated with this object The object should not be used following a call to close. More... | |
abstract boolean | equals (final Object obj) |
final int | hashCode () |
Public Member Functions inherited from jau.direct_bt.DBTNativeDownlink | |
final void | delete () |
Deletes the nativeInstance in the following order. More... | |
void | close () |
Release the native memory associated with this object The object should not be used following a call to close. More... | |
boolean | equals (Object obj) |
int | hashCode () |
boolean | addCharListener (final BTGattCharListener listener) throws IllegalStateException |
Add the given BTGattCharListener to the listener list if not already present. More... | |
boolean | addCharListener (final BTGattCharListener listener, final boolean enabledState[]) throws IllegalStateException |
Add the given BTGattCharListener to the listener list if not already present and if enabling the notification or indication for this characteristic at BLE level was successful. More... | |
boolean | configNotificationIndication (final boolean enableNotification, final boolean enableIndication, final boolean enabledState[]) throws IllegalStateException |
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration. More... | |
boolean | disableIndicationNotification () throws IllegalStateException |
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration. More... | |
boolean | enableNotificationOrIndication (final boolean enabledState[]) throws IllegalStateException |
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration. More... | |
BTGattDesc | findGattDesc (final String desc_uuid) |
Find a BTGattDesc by its desc_uuid. More... | |
BTGattDesc | getClientCharConfig () |
Return the Client Characteristic Configuration BTGattDesc if available or null. More... | |
List< BTGattDesc > | getDescriptors () |
Returns a list of BluetoothGattDescriptors this characteristic exposes. More... | |
boolean | getNotifying (final boolean enabledState[]) |
Returns true if notification for changes of this characteristic are activated. More... | |
GattCharPropertySet | getProperties () |
Returns the properties of this characteristic. More... | |
BTGattService | getService () |
Returns the service to which this characteristic belongs to. More... | |
BTGattDesc | getUserDescription () |
Return the User Description BTGattDesc if available or null. More... | |
String | getUUID () |
Get the UUID of this characteristic. More... | |
byte[] | readValue () throws BTException |
Reads the value of this characteristic. More... | |
int | removeAllAssociatedCharListener (final boolean shallDisableIndicationNotification) |
Disables the notification and/or indication for this characteristic BLE level if disableIndicationNotification == true and removes all associated BTGattChar.Listener or BTGattCharListener from the listener list, which are associated with this characteristic instance. More... | |
boolean | removeCharListener (final BTGattCharListener listener) |
Remove the given associated BTGattCharListener from the listener list if present. More... | |
String | toString () |
boolean | writeValue (byte[] argValue, boolean withResponse) throws BTException |
Writes the value of this characteristic, using one of the following methods depending on withResponse @endiliteral. More... | |
Protected Member Functions | |
native void | deleteImpl (long nativeInstance) |
Deletes the native instance. More... | |
Protected Member Functions inherited from jau.direct_bt.DBTObject | |
DBTObject (final long nativeInstance, final int hashValue) | |
void | finalize () |
Protected Member Functions inherited from jau.direct_bt.DBTNativeDownlink | |
DBTNativeDownlink () | |
DBTNativeDownlink (final long nativeInstance) | |
abstract void | deleteImpl (long nativeInstance) |
Deletes the native instance. More... | |
void | finalize () |
final void | initDownlink (final long nativeInstance) |
final boolean | isNativeValid () |
Returns true if native instance is valid, otherwise false. More... | |
Definition at line 39 of file DBTGattChar.java.
|
protected |
Deletes the native instance.
Called via delete()
and at this point
JavaUplink
's javaObjectRef = nullptr
nativeInstance
reference has been zeroed, but passed as argument for this final native deletion task. nativeInstance | copy of nativeInstance reference, which has been already zeroed. |
Reimplemented from jau.direct_bt.DBTNativeDownlink.
synchronized void jau.direct_bt.DBTGattChar.close | ( | ) |
Release the native memory associated with this object The object should not be used following a call to close.
Reimplemented from jau.direct_bt.DBTObject.
Definition at line 124 of file DBTGattChar.java.
boolean jau.direct_bt.DBTGattChar.equals | ( | final Object | obj | ) |
Reimplemented from jau.direct_bt.DBTObject.
Definition at line 133 of file DBTGattChar.java.
String jau.direct_bt.DBTGattChar.getUUID | ( | ) |
Get the UUID of this characteristic.
Implements org.direct_bt.BTGattChar.
Definition at line 143 of file DBTGattChar.java.
BTGattDesc jau.direct_bt.DBTGattChar.findGattDesc | ( | final String | desc_uuid | ) |
Find a BTGattDesc
by its desc_uuid.
@parameter desc_uuid the UUID of the desired BTGattDesc
Implements org.direct_bt.BTGattChar.
Definition at line 146 of file DBTGattChar.java.
final BTGattService jau.direct_bt.DBTGattChar.getService | ( | ) |
Returns the service to which this characteristic belongs to.
Implements org.direct_bt.BTGattChar.
Definition at line 166 of file DBTGattChar.java.
final boolean jau.direct_bt.DBTGattChar.getNotifying | ( | final boolean | enabledState[] | ) |
Returns true if notification for changes of this characteristic are activated.
enabledState | array of size 2, storage for the current enabled state for notification and indication. |
Implements org.direct_bt.BTGattChar.
Definition at line 169 of file DBTGattChar.java.
final GattCharPropertySet jau.direct_bt.DBTGattChar.getProperties | ( | ) |
Returns the properties of this characteristic.
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.1.1 Characteristic Properties
Implements org.direct_bt.BTGattChar.
Definition at line 176 of file DBTGattChar.java.
final List< BTGattDesc > jau.direct_bt.DBTGattChar.getDescriptors | ( | ) |
Returns a list of BluetoothGattDescriptors this characteristic exposes.
Implements org.direct_bt.BTGattChar.
Definition at line 179 of file DBTGattChar.java.
final synchronized boolean jau.direct_bt.DBTGattChar.configNotificationIndication | ( | final boolean | enableNotification, |
final boolean | enableIndication, | ||
final boolean | enabledState[] | ||
) | throws IllegalStateException |
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration.
Method enables notification and/or indication for this characteristic at BLE level.
Implementation masks this Characteristic properties PropertyBitVal::Notify and PropertyBitVal::Indicate with the respective user request parameters, hence removes unsupported requests.
Notification and/or indication configuration is only performed per characteristic if changed.
It is recommended to utilize notification over indication, as its link-layer handshake and higher potential bandwidth may deliver material higher performance.
enableNotification | |
enableIndication | |
enabledState | array of size 2, holding the resulting enabled state for notification and indication. |
IllegalStateException | if notification or indication is set to be enabled and the BTDevice 's GATTHandler is null, i.e. not connected |
Implements org.direct_bt.BTGattChar.
Definition at line 182 of file DBTGattChar.java.
boolean jau.direct_bt.DBTGattChar.enableNotificationOrIndication | ( | final boolean | enabledState[] | ) | throws IllegalStateException |
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration.
Method will attempt to enable notification on the BLE level, if available, otherwise indication if available.
Notification and/or indication configuration is only performed per characteristic if changed.
It is recommended to utilize notification over indication, as its link-layer handshake and higher potential bandwidth may deliver material higher performance.
enabledState | array of size 2, holding the resulting enabled state for notification and indication. |
IllegalStateException | if notification or indication is set to be enabled and the BTDevice 's GATTHandler is null, i.e. not connected |
Implements org.direct_bt.BTGattChar.
Definition at line 232 of file DBTGattChar.java.
boolean jau.direct_bt.DBTGattChar.disableIndicationNotification | ( | ) | throws IllegalStateException |
BT Core Spec v5.2: Vol 3, Part G GATT: 3.3.3.3 Client Characteristic Configuration.
Method will attempt to disable notification and indication on the BLE level.
Notification and/or indication configuration is only performed per characteristic if changed.
IllegalStateException | if notification or indication is set to be enabled and the BTDevice 's GATTHandler is null, i.e. not connected |
Implements org.direct_bt.BTGattChar.
Definition at line 242 of file DBTGattChar.java.
final boolean jau.direct_bt.DBTGattChar.addCharListener | ( | final BTGattCharListener | listener | ) |
Add the given BTGattCharListener to the listener list if not already present.
Occurring notifications and indications for this characteristic, if enabled via configNotificationIndication(boolean, boolean, boolean[])
or enableNotificationOrIndication(boolean[])
, will call the respective BTGattCharListener callback method.
Returns true if the given listener is not element of the list and has been newly added, otherwise false.
listener | A BTGattCharListener } instance, listening to this BTGattChar 's events |
IllegalStateException | if the DBTDevice's GATTHandler is null, i.e. not connected |
Implements org.direct_bt.BTGattChar.
Definition at line 247 of file DBTGattChar.java.
final boolean jau.direct_bt.DBTGattChar.addCharListener | ( | final BTGattCharListener | listener, |
final boolean | enabledState[] | ||
) |
Add the given BTGattCharListener to the listener list if not already present and if enabling the notification or indication for this characteristic at BLE level was successful.
Notification and/or indication configuration is only performed per characteristic if changed.
Implementation will enable notification if available, otherwise indication will be enabled if available.
Implementation uses enableNotificationOrIndication(boolean[])
to enable either.
Occurring notifications and indications for this characteristic will call the respective BTGattCharListener callback method.
Returns true if enabling the notification and/or indication was successful and if the given listener is not element of the list and has been newly added, otherwise false.
listener | A BTGattChar.Listener instance, listening to this BTGattChar 's events |
enabledState | array of size 2, holding the resulting enabled state for notification and indication using enableNotificationOrIndication(boolean[]) |
IllegalStateException | if the BTDevice 's GATTHandler is null, i.e. not connected |
IllegalStateException | if the given BTGattChar.Listener is already in use, i.e. added. |
Implements org.direct_bt.BTGattChar.
Definition at line 252 of file DBTGattChar.java.
final boolean jau.direct_bt.DBTGattChar.removeCharListener | ( | final BTGattCharListener | listener | ) |
Remove the given associated BTGattCharListener
from the listener list if present.
To disables the notification and/or indication for this characteristic at BLE level use disableIndicationNotification()
when desired.
listener | returned BTGattCharListener from addCharListener(Listener) ... |
Implements org.direct_bt.BTGattChar.
Definition at line 260 of file DBTGattChar.java.
final int jau.direct_bt.DBTGattChar.removeAllAssociatedCharListener | ( | final boolean | shallDisableIndicationNotification | ) |
Disables the notification and/or indication for this characteristic BLE level if disableIndicationNotification == true
and removes all associated BTGattChar.Listener
or BTGattCharListener
from the listener list, which are associated with this characteristic instance.
If the DBTDevice's GATTHandler is null, i.e. not connected, false
is being returned.
shallDisableIndicationNotification | if true, disables the notification and/or indication for this characteristic using disableIndicationNotification() |
Implements org.direct_bt.BTGattChar.
Definition at line 265 of file DBTGattChar.java.
final short jau.direct_bt.DBTGattChar.getHandle | ( | ) |
Characteristic Handle of this instance.
Attribute handles are unique for each device (server) (BT Core Spec v5.2: Vol 3, Part F Protocol..: 3.2.2 Attribute Handle).
Definition at line 278 of file DBTGattChar.java.
final short jau.direct_bt.DBTGattChar.getValueHandle | ( | ) |
Returns Characteristics Value Handle.
Attribute handles are unique for each device (server) (BT Core Spec v5.2: Vol 3, Part F Protocol..: 3.2.2 Attribute Handle).
Definition at line 286 of file DBTGattChar.java.
final BTGattDesc jau.direct_bt.DBTGattChar.getClientCharConfig | ( | ) |
Return the Client Characteristic Configuration BTGattDesc if available or null.
The BTGattDesc#UUID128#CCC_DESC
has been indexed while retrieving the GATT database from the server.
Implements org.direct_bt.BTGattChar.
Definition at line 289 of file DBTGattChar.java.
final BTGattDesc jau.direct_bt.DBTGattChar.getUserDescription | ( | ) |
Return the User Description BTGattDesc if available or null.
The BTGattDesc#UUID128#USER_DESC
has been indexed while retrieving the GATT database from the server.
Implements org.direct_bt.BTGattChar.
Definition at line 297 of file DBTGattChar.java.
final byte[] jau.direct_bt.DBTGattChar.readValue | ( | ) | throws BTException |
Reads the value of this characteristic.
Implements org.direct_bt.BTGattChar.
Definition at line 305 of file DBTGattChar.java.
final boolean jau.direct_bt.DBTGattChar.writeValue | ( | final byte[] | argValue, |
final boolean | withResponse | ||
) | throws BTException |
Writes the value of this characteristic, using one of the following methods depending on withResponse @endiliteral.
BT Core Spec v5.2: Vol 3, Part G GATT: 4.9.3 Write Characteristic Value BT Core Spec v5.2: Vol 3, Part G GATT: 4.9.1 Write Characteristic Value Without Response
[in] | arg_value | The data as vector<uchar> to be written packed in a GBytes struct |
withResponse | if true a subsequent ATT_WRITE_RSP is expected, otherwise not. |
withResponse
parameter has been added since 2.0.0 Implements org.direct_bt.BTGattChar.
Definition at line 311 of file DBTGattChar.java.
final String jau.direct_bt.DBTGattChar.toString | ( | ) |
Implements org.direct_bt.BTGattChar.
Definition at line 317 of file DBTGattChar.java.