|
| BluetoothObject (long instance) |
|
void | finalize () |
|
native String | getObjectPath () |
|
long | nativeInstance |
|
Provides access to Bluetooth adapters. Follows the BlueZ adapter API available at: http://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/adapter-api.txt
native void tinyb.BluetoothAdapter.disableDiscoverableNotifications |
( |
| ) |
|
Disables notifications of the discoverable property and unregisters the callback object passed through the corresponding enable method.
native void tinyb.BluetoothAdapter.disableDiscoveringNotifications |
( |
| ) |
|
Disables notifications of the discovering property and unregisters the discovering object passed through the corresponding enable method.
native void tinyb.BluetoothAdapter.disablePairableNotifications |
( |
| ) |
|
Disables notifications of the pairable property and unregisters the callback object passed through the corresponding enable method.
native void tinyb.BluetoothAdapter.disablePoweredNotifications |
( |
| ) |
|
Disables notifications of the powered property and unregisters the callback object passed through the corresponding enable method.
native void tinyb.BluetoothAdapter.enableDiscoverableNotifications |
( |
BluetoothNotification< Boolean > |
callback | ) |
|
Enables notifications for the discoverable property and calls run function of the BluetoothNotification object.
- Parameters
-
callback | A BluetoothNotification<Boolean> object. Its run function will be called when a notification is issued. The run function will deliver the new value of the discoverable property. |
native void tinyb.BluetoothAdapter.enableDiscoveringNotifications |
( |
BluetoothNotification< Boolean > |
callback | ) |
|
Enables notifications for the discovering property and calls run function of the BluetoothNotification object.
- Parameters
-
callback | A BluetoothNotification<Boolean> object. Its run function will be called when a notification is issued. The run function will deliver the new value of the discovering property. |
native void tinyb.BluetoothAdapter.enablePairableNotifications |
( |
BluetoothNotification< Boolean > |
callback | ) |
|
Enables notifications for the pairable property and calls run function of the BluetoothNotification object.
- Parameters
-
callback | A BluetoothNotification<Boolean> object. Its run function will be called when a notification is issued. The run function will deliver the new value of the pairable property. |
native void tinyb.BluetoothAdapter.enablePoweredNotifications |
( |
BluetoothNotification< Boolean > |
callback | ) |
|
Enables notifications for the powered property and calls run function of the BluetoothNotification object.
- Parameters
-
callback | A BluetoothNotification<Boolean> object. Its run function will be called when a notification is issued. The run function will deliver the new value of the powered property. |
BluetoothDevice tinyb.BluetoothAdapter.find |
( |
String |
name, |
|
|
String |
address, |
|
|
Duration |
duration |
|
) |
| |
Find a BluetoothDevice. If parameters name and address are not null, the returned object will have to match them. It will first check for existing objects. It will not turn on discovery or connect to devices. name optionally specify the name of the object you are waiting for address optionally specify the MAC address of the device 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 name and address or null if not found before timeout expires.
BluetoothDevice tinyb.BluetoothAdapter.find |
( |
String |
name, |
|
|
String |
address |
|
) |
| |
Find a BluetoothDevice. If parameters name and address are not null, the returned object will have to match them. It will first check for existing objects. It will not turn on discovery or connect to devices. name optionally specify the name of the object you are waiting for address optionally specify the MAC address of the device you are waiting for
- Returns
- An object matching the name and address.
native String tinyb.BluetoothAdapter.getAddress |
( |
| ) |
|
Returns the hardware address of this adapter.
- Returns
- The hardware address of this adapter.
native String tinyb.BluetoothAdapter.getAlias |
( |
| ) |
|
Returns the friendly name of this adapter.
- Returns
- The friendly name of this adapter, or NULL if not set.
native long tinyb.BluetoothAdapter.getBluetoothClass |
( |
| ) |
|
Returns the Bluetooth class of the adapter.
- Returns
- The Bluetooth class of the adapter.
Returns a list of BluetoothDevices visible from this adapter.
- Returns
- A list of BluetoothDevices visible on this adapter, NULL if an error occurred
native boolean tinyb.BluetoothAdapter.getDiscoverable |
( |
| ) |
|
Returns the discoverable state the adapter.
- Returns
- The discoverable state of the adapter.
native long tinyb.BluetoothAdapter.getDiscoverableTimeout |
( |
| ) |
|
Returns the discoverable timeout the adapter.
- Returns
- The discoverable timeout of the adapter.
native boolean tinyb.BluetoothAdapter.getDiscovering |
( |
| ) |
|
Returns the discovering state the adapter. It can be modified through start_discovery/stop_discovery functions.
- Returns
- The discovering state of the adapter.
String tinyb.BluetoothAdapter.getInterfaceName |
( |
| ) |
|
Returns the interface name of the adapter.
- Returns
- The interface name of the adapter.
native String tinyb.BluetoothAdapter.getModalias |
( |
| ) |
|
Returns the local ID of the adapter.
- Returns
- The local ID of the adapter.
native String tinyb.BluetoothAdapter.getName |
( |
| ) |
|
Returns the system name of this adapter.
- Returns
- The system name of this adapter.
native boolean tinyb.BluetoothAdapter.getPairable |
( |
| ) |
|
Returns the pairable state the adapter.
- Returns
- The pairable state of the adapter.
native long tinyb.BluetoothAdapter.getPairableTimeout |
( |
| ) |
|
Returns the timeout in seconds after which pairable state turns off automatically, 0 means never.
- Returns
- The pairable timeout of the adapter.
native boolean tinyb.BluetoothAdapter.getPowered |
( |
| ) |
|
Returns the power state the adapter.
- Returns
- The power state of the adapter.
native String [] tinyb.BluetoothAdapter.getUUIDs |
( |
| ) |
|
Returns the UUIDs of the adapter.
- Returns
- Array containing the UUIDs of the adapter, ends with NULL.
Remove all the known devices
- Returns
- The number of devices removed from internal list
- Exceptions
-
native void tinyb.BluetoothAdapter.setAlias |
( |
String |
value | ) |
|
Sets the friendly name of this adapter.
native void tinyb.BluetoothAdapter.setDiscoverable |
( |
boolean |
value | ) |
|
Sets the discoverable state the adapter.
native void tinyb.BluetoothAdapter.setDiscoverableTimout |
( |
long |
value | ) |
|
Sets the discoverable timeout the adapter. A value of 0 disables the timeout.
void tinyb.BluetoothAdapter.setDiscoveryFilter |
( |
List< UUID > |
uuids, |
|
|
int |
rssi, |
|
|
int |
pathloss, |
|
|
TransportType |
transportType |
|
) |
| |
This method sets the device discovery filter for the caller. When this method is called with no filter parameter, filter is removed.
When a remote device is found that advertises any UUID from UUIDs, it will be reported if:
-
Pathloss and RSSI are both empty.
-
only Pathloss param is set, device advertise TX pwer, and computed pathloss is less than Pathloss param.
-
only RSSI param is set, and received RSSI is higher than RSSI param.
If one or more discovery filters have been set, the RSSI delta-threshold, that is imposed by StartDiscovery by default, will not be applied.
If "auto" transport is requested, scan will use LE, BREDR, or both, depending on what's currently enabled on the controller.
- Parameters
-
uuids | a list of device UUIDs |
rssi | a rssi value |
pathloss | a pathloss value |
native void tinyb.BluetoothAdapter.setPairable |
( |
boolean |
value | ) |
|
Sets the discoverable state the adapter.
native void tinyb.BluetoothAdapter.setPairableTimeout |
( |
long |
value | ) |
|
Sets the timeout after which pairable state turns off automatically, 0 means never.
native void tinyb.BluetoothAdapter.setPowered |
( |
boolean |
value | ) |
|
Sets the power state the adapter.
void tinyb.BluetoothAdapter.setRssiDiscoveryFilter |
( |
int |
rssi | ) |
|
This method sets RSSI device discovery filter for the caller. When this method is called with 0, filter is removed.
- Parameters
-
Turns on device discovery if it is disabled.
- Returns
- TRUE if discovery was successfully enabled
Turns off device discovery if it is enabled.
- Returns
- TRUE if discovery was successfully disabled
The documentation for this class was generated from the following file:
- /iotdk/jenkins/workspace/tinyb-doc/java/BluetoothAdapter.java