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

Public Member Functions

native BluetoothType getBluetoothType ()
 
native BluetoothDevice clone ()
 
BluetoothGattService find (String UUID, Duration duration)
 
BluetoothGattService find (String UUID)
 
native boolean disconnect () throws BluetoothException
 
native boolean connect () throws BluetoothException
 
native boolean connectProfile (String arg_UUID) throws BluetoothException
 
native boolean disconnectProfile (String arg_UUID) throws BluetoothException
 
native boolean pair () throws BluetoothException
 
native boolean remove () throws BluetoothException
 
native boolean cancelPairing () throws BluetoothException
 
native List< BluetoothGattServicegetServices ()
 
native String getAddress ()
 
native String getName ()
 
native String getAlias ()
 
native void setAlias (String value)
 
native int getBluetoothClass ()
 
native short getAppearance ()
 
native String getIcon ()
 
native boolean getPaired ()
 
native void enablePairedNotifications (BluetoothNotification< Boolean > callback)
 
native void disablePairedNotifications ()
 
native boolean getTrusted ()
 
native void enableTrustedNotifications (BluetoothNotification< Boolean > callback)
 
native void disableTrustedNotifications ()
 
native void setTrusted (boolean value)
 
native boolean getBlocked ()
 
native void enableBlockedNotifications (BluetoothNotification< Boolean > callback)
 
native void disableBlockedNotifications ()
 
native void setBlocked (boolean value)
 
native boolean getLegacyPairing ()
 
native short getRSSI ()
 
native void enableRSSINotifications (BluetoothNotification< Short > callback)
 
native void disableRSSINotifications ()
 
native boolean getConnected ()
 
native void enableConnectedNotifications (BluetoothNotification< Boolean > callback)
 
native void disableConnectedNotifications ()
 
native String[] getUUIDs ()
 
native String getModalias ()
 
native BluetoothAdapter getAdapter ()
 
native Map< Short, byte[]> getManufacturerData ()
 
native void enableManufacturerDataNotifications (BluetoothNotification< Map< Short, byte[]> > callback)
 
native void disableManufacturerDataNotifications ()
 
native Map< String, byte[]> getServiceData ()
 
native void enableServiceDataNotifications (BluetoothNotification< Map< String, byte[]> > callback)
 
native void disableServiceDataNotifications ()
 
native short getTxPower ()
 
native boolean getServicesResolved ()
 
native void enableServicesResolvedNotifications (BluetoothNotification< Boolean > callback)
 
native void disableServicesResolvedNotifications ()
 
- 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 devices. Follows the BlueZ adapter API available at: http://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/device-api.txt

Member Function Documentation

native boolean tinyb.BluetoothDevice.cancelPairing ( ) throws BluetoothException

Cancels an initiated pairing operation

Returns
TRUE if the paring is cancelled successfully
native boolean tinyb.BluetoothDevice.connect ( ) throws BluetoothException

A connection to this device is established, connecting each profile flagged as auto-connectable.

Returns
TRUE if the device connected
native boolean tinyb.BluetoothDevice.connectProfile ( String  arg_UUID) throws BluetoothException

Connects a specific profile available on the device, given by UUID

Parameters
arg_UUIDThe UUID of the profile to be connected
Returns
TRUE if the profile connected successfully
native void tinyb.BluetoothDevice.disableBlockedNotifications ( )

Disables notifications of the blocked property and unregisters the callback object passed through the corresponding enable method.

native void tinyb.BluetoothDevice.disableConnectedNotifications ( )

Disables notifications of the connected property and unregisters the callback object passed through the corresponding enable method.

native void tinyb.BluetoothDevice.disableManufacturerDataNotifications ( )

Disables notifications of the manufacturer data property and unregisters the callback object passed through the corresponding enable method.

native void tinyb.BluetoothDevice.disablePairedNotifications ( )

Disables notifications of the paired property and unregisters the callback object passed through the corresponding enable method.

native void tinyb.BluetoothDevice.disableRSSINotifications ( )

Disables notifications of the RSSI property and unregisters the callback object passed through the corresponding enable method.

native void tinyb.BluetoothDevice.disableServiceDataNotifications ( )

Disables notifications of the service data property and unregisters the callback object passed through the corresponding enable method.

native void tinyb.BluetoothDevice.disableServicesResolvedNotifications ( )

Disables notifications of the services resolved property and unregisters the callback object passed through the corresponding enable method.

native void tinyb.BluetoothDevice.disableTrustedNotifications ( )

Disables notifications of the trusted property and unregisters the callback object passed through the corresponding enable method.

native boolean tinyb.BluetoothDevice.disconnect ( ) throws BluetoothException

The connection to this device is removed, removing all connected profiles.

Returns
TRUE if the device disconnected
native boolean tinyb.BluetoothDevice.disconnectProfile ( String  arg_UUID) throws BluetoothException

Disconnects a specific profile available on the device, given by UUID

Parameters
arg_UUIDThe UUID of the profile to be disconnected
Returns
TRUE if the profile disconnected successfully
native void tinyb.BluetoothDevice.enableBlockedNotifications ( BluetoothNotification< Boolean >  callback)

Enables notifications for the blocked property and calls run function of the BluetoothNotification object.

Parameters
callbackA BluetoothNotification<Boolean> object. Its run function will be called when a notification is issued. The run function will deliver the new value of the blocked property.
native void tinyb.BluetoothDevice.enableConnectedNotifications ( BluetoothNotification< Boolean >  callback)

Enables notifications for the connected property and calls run function of the BluetoothNotification object.

Parameters
callbackA BluetoothNotification<Boolean> object. Its run function will be called when a notification is issued. The run function will deliver the new value of the connected property.
native void tinyb.BluetoothDevice.enableManufacturerDataNotifications ( BluetoothNotification< Map< Short, byte[]> >  callback)

Enables notifications for the manufacturer data property and calls run function of the BluetoothNotification object.

Parameters
callbackA BluetoothNotification<Map<Short, byte[]> > object. Its run function will be called when a notification is issued. The run function will deliver the new value of the manufacturer data property.
native void tinyb.BluetoothDevice.enablePairedNotifications ( BluetoothNotification< Boolean >  callback)

Enables notifications for the paired property and calls run function of the BluetoothNotification object.

Parameters
callbackA BluetoothNotification<Boolean> object. Its run function will be called when a notification is issued. The run function will deliver the new value of the paired property.
native void tinyb.BluetoothDevice.enableRSSINotifications ( BluetoothNotification< Short >  callback)

Enables notifications for the RSSI property and calls run function of the BluetoothNotification object.

Parameters
callbackA BluetoothNotification<Short> object. Its run function will be called when a notification is issued. The run function will deliver the new value of the RSSI property.
native void tinyb.BluetoothDevice.enableServiceDataNotifications ( BluetoothNotification< Map< String, byte[]> >  callback)

Enables notifications for the service data property and calls run function of the BluetoothNotification object.

Parameters
callbackA BluetoothNotification<Map<String, byte[]> > object. Its run function will be called when a notification is issued. The run function will deliver the new value of the service data property.
native void tinyb.BluetoothDevice.enableServicesResolvedNotifications ( BluetoothNotification< Boolean >  callback)

Enables notifications for the services resolved property and calls run function of the BluetoothNotification object.

Parameters
callbackA BluetoothNotification<Boolean> object. Its run function will be called when a notification is issued. The run function will deliver the new value of the services resolved property.
native void tinyb.BluetoothDevice.enableTrustedNotifications ( BluetoothNotification< Boolean >  callback)

Enables notifications for the trusted property and calls run function of the BluetoothNotification object.

Parameters
callbackA BluetoothNotification<Boolean> object. Its run function will be called when a notification is issued. The run function will deliver the new value of the trusted property.
BluetoothGattService tinyb.BluetoothDevice.find ( String  UUID,
Duration  duration 
)

Find a BluetoothGattService. 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 BluetoothGattService 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.
BluetoothGattService tinyb.BluetoothDevice.find ( String  UUID)

Find a BluetoothGattService. 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 BluetoothGattService you are waiting for

Returns
An object matching the UUID or null if not found before timeout expires or event is canceled.
native BluetoothAdapter tinyb.BluetoothDevice.getAdapter ( )

Returns the adapter on which this device was discovered or connected.

Returns
The adapter.
native String tinyb.BluetoothDevice.getAddress ( )

Returns the hardware address of this device.

Returns
The hardware address of this device.
native String tinyb.BluetoothDevice.getAlias ( )

Returns an alternative friendly name of this device.

Returns
The alternative friendly name of this device, or NULL if not set.
native short tinyb.BluetoothDevice.getAppearance ( )

Returns the appearance of the device, as found by GAP service.

Returns
The appearance of the device, as found by GAP service.
native boolean tinyb.BluetoothDevice.getBlocked ( )

Returns the blocked state the device.

Returns
The blocked state of the device.
native int tinyb.BluetoothDevice.getBluetoothClass ( )

Returns the Bluetooth class of the device.

Returns
The Bluetooth class of the device.
native boolean tinyb.BluetoothDevice.getConnected ( )

Returns the connected state of the device.

Returns
The connected state of the device.
native String tinyb.BluetoothDevice.getIcon ( )

Returns the proposed icon name of the device.

Returns
The proposed icon name, or NULL if not set.
native boolean tinyb.BluetoothDevice.getLegacyPairing ( )

Returns if device uses only pre-Bluetooth 2.1 pairing mechanism.

Returns
True if device uses only pre-Bluetooth 2.1 pairing mechanism.
native Map<Short, byte[]> tinyb.BluetoothDevice.getManufacturerData ( )

Returns a map containing manufacturer specific advertisement data. An entry has a uint16_t key and an array of bytes.

Returns
manufacturer specific advertisement data.
native String tinyb.BluetoothDevice.getModalias ( )

Returns the local ID of the adapter.

Returns
The local ID of the adapter.
native String tinyb.BluetoothDevice.getName ( )

Returns the remote friendly name of this device.

Returns
The remote friendly name of this device, or NULL if not set.
native boolean tinyb.BluetoothDevice.getPaired ( )

Returns the paired state the device.

Returns
The paired state of the device.
native short tinyb.BluetoothDevice.getRSSI ( )

Returns the Received Signal Strength Indicator of the device.

Returns
The Received Signal Strength Indicator of the device.
native Map<String, byte[]> tinyb.BluetoothDevice.getServiceData ( )

Returns a map containing service advertisement data. An entry has a UUID string key and an array of bytes.

Returns
service advertisement data.
native List<BluetoothGattService> tinyb.BluetoothDevice.getServices ( )

Returns a list of BluetoothGattServices available on this device.

Returns
A list of BluetoothGattServices available on this device, NULL if an error occurred
native boolean tinyb.BluetoothDevice.getServicesResolved ( )

Returns true if service discovery has ended.

Returns
true if the service discovery has ended.
native boolean tinyb.BluetoothDevice.getTrusted ( )

Returns the trusted state the device.

Returns
The trusted state of the device.
native short tinyb.BluetoothDevice.getTxPower ( )

Returns the transmission power level (0 means unknown).

Returns
the transmission power level (0 means unknown).
native String [] tinyb.BluetoothDevice.getUUIDs ( )

Returns the UUIDs of the device.

Returns
Array containing the UUIDs of the device, ends with NULL.
native boolean tinyb.BluetoothDevice.pair ( ) throws BluetoothException

A connection to this device is established, and the device is then paired.

Returns
TRUE if the device connected and paired
native boolean tinyb.BluetoothDevice.remove ( ) throws BluetoothException

Remove this device from the system (like an unpair).

Returns
TRUE if the device has been removed
Exceptions
BluetoothException
native void tinyb.BluetoothDevice.setAlias ( String  value)

Sets an alternative friendly name of this device.

native void tinyb.BluetoothDevice.setBlocked ( boolean  value)

Sets the blocked state the device.

native void tinyb.BluetoothDevice.setTrusted ( boolean  value)

Sets the trusted state the device.


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