Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
Classes | |
interface | ChangedAdapterSetListener |
Event listener to receive change events regarding the system's BTAdapter set, e.g. More... | |
interface | Settings |
Interface allowing to retrieve certain settings of the implementation. More... | |
Public Member Functions | |
Settings | getSettings () |
Returns this implmentation's Settings. More... | |
BTObject | find (BTType type, String name, String identifier, BTObject parent, long timeoutMS) |
Find a BluetoothObject of a type matching type. More... | |
BTObject | find (BTType type, String name, String identifier, BTObject parent) |
Find a BluetoothObject of a type matching type. More... | |
List< BTAdapter > | getAdapters () |
Returns a list of BluetoothAdapters available in the system. More... | |
BTAdapter | getAdapter (final int dev_id) |
Returns the BluetoothAdapter matching the given dev_id or null if not found. More... | |
List< BTDevice > | getDevices () |
Returns a list of discovered BluetoothDevices. More... | |
List< BTGattService > | getServices () |
Returns a list of available BluetoothGattServices. More... | |
boolean | setDefaultAdapter (BTAdapter adapter) |
Sets a default adapter to use for discovery. More... | |
BTAdapter | getDefaultAdapter () |
Gets the default adapter to use for discovery. More... | |
HCIStatusCode | startDiscovery (final boolean keepAlive, final boolean le_scan_active) throws BTException |
Turns on device discovery on the default adapter if it is disabled. More... | |
HCIStatusCode | stopDiscovery () throws BTException |
Turns off device discovery on the default adapter if it is enabled. More... | |
ScanType | getCurrentScanType () |
Returns the current meta discovering ScanType of the getDefaultAdapter() via BTAdapter#getCurrentScanType(). More... | |
void | addChangedAdapterSetListener (final ChangedAdapterSetListener l) |
Add the given ChangedAdapterSetListener to this manager. More... | |
int | removeChangedAdapterSetListener (final ChangedAdapterSetListener l) |
Remove the given ChangedAdapterSetListener from this manager. More... | |
void | shutdown () |
Release the native memory associated with this object and all related Bluetooth resources. More... | |
Definition at line 33 of file BTManager.java.
void org.direct_bt.BTManager.addChangedAdapterSetListener | ( | final ChangedAdapterSetListener | l | ) |
Add the given ChangedAdapterSetListener to this manager.
When a new callback is added, all available adapter's will be reported as added, this allows a fully event driven workflow.
The callback is performed on a dedicated thread, allowing the user to perform complex operations.
Implemented in jau.direct_bt.DBTManager.
BTObject org.direct_bt.BTManager.find | ( | BTType | type, |
String | name, | ||
String | identifier, | ||
BTObject | parent | ||
) |
Find a BluetoothObject of a type matching type.
If parameters name, identifier and parent 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. @parameter type specify the type of the object you are waiting for, NONE means anything. @parameter name optionally specify the name of the object you are waiting for (for Adapter or Device) @parameter identifier optionally specify the identifier of the object you are waiting for (UUID for GattService, GattCharacteristic or GattDescriptor, address for Adapter or Device) @parameter parent optionally specify the parent of the object you are waiting for
Implemented in jau.direct_bt.DBTManager.
BTObject org.direct_bt.BTManager.find | ( | BTType | type, |
String | name, | ||
String | identifier, | ||
BTObject | parent, | ||
long | timeoutMS | ||
) |
Find a BluetoothObject of a type matching type.
If parameters name, identifier and parent 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. @parameter type specify the type of the object you are waiting for, NONE means anything. @parameter name optionally specify the name of the object you are waiting for (for Adapter or Device) @parameter identifier optionally specify the identifier of the object you are waiting for (UUID for GattService, GattCharacteristic or GattDescriptor, address for Adapter or Device) @parameter parent optionally specify the parent of the object 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.
Implemented in jau.direct_bt.DBTManager.
BTAdapter org.direct_bt.BTManager.getAdapter | ( | final int | dev_id | ) |
Returns the BluetoothAdapter matching the given dev_id or null if not found.
The adapters internal device id is constant across the adapter lifecycle, but may change after its destruction.
dev_id | the internal temporary adapter device id |
Implemented in jau.direct_bt.DBTManager.
List<BTAdapter> org.direct_bt.BTManager.getAdapters | ( | ) |
Returns a list of BluetoothAdapters available in the system.
Implemented in jau.direct_bt.DBTManager.
ScanType org.direct_bt.BTManager.getCurrentScanType | ( | ) |
Returns the current meta discovering ScanType of the getDefaultAdapter() via BTAdapter#getCurrentScanType().
Implemented in jau.direct_bt.DBTManager.
BTAdapter org.direct_bt.BTManager.getDefaultAdapter | ( | ) |
Gets the default adapter to use for discovery.
The default adapter is either the first powered BTAdapter, or function returns nullptr if none is enabled.
Implemented in jau.direct_bt.DBTManager.
List<BTDevice> org.direct_bt.BTManager.getDevices | ( | ) |
Returns a list of discovered BluetoothDevices.
Implemented in jau.direct_bt.DBTManager.
List<BTGattService> org.direct_bt.BTManager.getServices | ( | ) |
Returns a list of available BluetoothGattServices.
Implemented in jau.direct_bt.DBTManager.
Settings org.direct_bt.BTManager.getSettings | ( | ) |
Returns this implmentation's Settings.
Implemented in jau.direct_bt.DBTManager.
int org.direct_bt.BTManager.removeChangedAdapterSetListener | ( | final ChangedAdapterSetListener | l | ) |
Remove the given ChangedAdapterSetListener from this manager.
l | the to be removed element |
Implemented in jau.direct_bt.DBTManager.
boolean org.direct_bt.BTManager.setDefaultAdapter | ( | BTAdapter | adapter | ) |
Sets a default adapter to use for discovery.
Implemented in jau.direct_bt.DBTManager.
void org.direct_bt.BTManager.shutdown | ( | ) |
Release the native memory associated with this object and all related Bluetooth resources.
The object should not be used following a call to close
Shutdown method is intended to allow a clean Bluetooth state at program exist.
Implemented in jau.direct_bt.DBTManager.
HCIStatusCode org.direct_bt.BTManager.startDiscovery | ( | final boolean | keepAlive, |
final boolean | le_scan_active | ||
) | throws BTException |
Turns on device discovery on the default adapter if it is disabled.
keepAlive | if true
keepAlive=true
|
le_scan_active | true enables delivery of active scanning PDUs, otherwise no scanning PDUs shall be sent (default) |
BTException |
Implemented in jau.direct_bt.DBTManager.
HCIStatusCode org.direct_bt.BTManager.stopDiscovery | ( | ) | throws BTException |
Turns off device discovery on the default adapter if it is enabled.
Implemented in jau.direct_bt.DBTManager.