TinyB  0.5.1
TinyB - The Tiny Bluetooth LE library
Public Member Functions | List of all members
tinyb.BluetoothGattCharacteristic Class Reference
Inheritance diagram for tinyb.BluetoothGattCharacteristic:
tinyb.BluetoothObject

Public Member Functions

native BluetoothType getBluetoothType ()
 
native BluetoothGattCharacteristic clone ()
 
BluetoothGattDescriptor find (String UUID, Duration duration)
 
BluetoothGattDescriptor find (String UUID)
 
native byte[] readValue () throws BluetoothException
 
native void enableValueNotifications (BluetoothNotification< byte[]> callback)
 
native void disableValueNotifications ()
 
native boolean writeValue (byte[] argValue) throws BluetoothException
 
native String getUUID ()
 
native BluetoothGattService getService ()
 
native byte[] getValue ()
 
native boolean getNotifying ()
 
native String[] getFlags ()
 
native List< BluetoothGattDescriptorgetDescriptors ()
 
- Public Member Functions inherited from tinyb.BluetoothObject
native BluetoothType getBluetoothType ()
 
native BluetoothObject clone ()
 
boolean equals (Object obj)
 
int hashCode ()
 
synchronized void close ()
 

Additional Inherited Members

- Protected Member Functions inherited from tinyb.BluetoothObject
 BluetoothObject (long instance)
 
void finalize ()
 
native String getObjectPath ()
 
- Protected Attributes inherited from tinyb.BluetoothObject
long nativeInstance
 

Detailed Description

Provides access to Bluetooth GATT characteristic. Follows the BlueZ adapter API available at: http://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/gatt-api.txt

Member Function Documentation

native void tinyb.BluetoothGattCharacteristic.disableValueNotifications ( )

Disables notifications of the value and unregisters the callback object passed through the corresponding enable method. It disables notications at BLE level for this characteristic.

native void tinyb.BluetoothGattCharacteristic.enableValueNotifications ( BluetoothNotification< byte[]>  callback)

Enables notifications for the value and calls run function of the BluetoothNotification object. It enables notifications for this characteristic at BLE level.

Parameters
callbackA BluetoothNotification<byte[]> object. Its run function will be called when a notification is issued. The run function will deliver the new value of the value property.
BluetoothGattDescriptor tinyb.BluetoothGattCharacteristic.find ( String  UUID,
Duration  duration 
)

Find a BluetoothGattDescriptor. 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. UUID optionally specify the UUID of the BluetoothGattDescriptor you are waiting for timeout the function will return after timeout time, a value of zero means wait forever. If object is not found during this time null will be returned.

Returns
An object matching the UUID or null if not found before timeout expires or event is canceled.
BluetoothGattDescriptor tinyb.BluetoothGattCharacteristic.find ( String  UUID)

Find a BluetoothGattDescriptor. 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. UUID optionally specify the UUID of the BluetoothGattDescriptor you are waiting for

Returns
An object matching the UUID or null if not found before timeout expires or event is canceled.
native List<BluetoothGattDescriptor> tinyb.BluetoothGattCharacteristic.getDescriptors ( )

Returns a list of BluetoothGattDescriptors this characteristic exposes.

Returns
A list of BluetoothGattDescriptors exposed by this characteristic NULL if an error occurred
native String [] tinyb.BluetoothGattCharacteristic.getFlags ( )

Returns the flags this characterstic has.

Returns
A list of flags for this characteristic.
native boolean tinyb.BluetoothGattCharacteristic.getNotifying ( )

Returns true if notification for changes of this characteristic are activated.

Returns
True if notificatios are activated.
native BluetoothGattService tinyb.BluetoothGattCharacteristic.getService ( )

Returns the service to which this characteristic belongs to.

Returns
The service.
native String tinyb.BluetoothGattCharacteristic.getUUID ( )

Get the UUID of this characteristic.

Returns
The 128 byte UUID of this characteristic, NULL if an error occurred
native byte [] tinyb.BluetoothGattCharacteristic.getValue ( )

Returns the cached value of this characteristic, if any.

Returns
The cached value of this characteristic.
native byte [] tinyb.BluetoothGattCharacteristic.readValue ( ) throws BluetoothException

Reads the value of this characteristic.

Returns
A std::vector<unsgined char> containing the value of this characteristic.
native boolean tinyb.BluetoothGattCharacteristic.writeValue ( byte[]  argValue) throws BluetoothException

Writes the value of this characteristic.

Parameters
[in]arg_valueThe data as vector<uchar> to be written packed in a GBytes struct
Returns
TRUE if value was written succesfully

The documentation for this class was generated from the following file: