Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
jau.direct_bt.DBTManager Class Reference
Inheritance diagram for jau.direct_bt.DBTManager:
Collaboration diagram for jau.direct_bt.DBTManager:

Public Member Functions

final void addChangedAdapterSetListener (final ChangedAdapterSetListener l)
 Add the given ChangedAdapterSetListener to this manager. More...
 
final BTAdapter getAdapter (final int dev_id)
 Returns the BluetoothAdapter matching the given dev_id or null if not found. More...
 
final List< BTAdaptergetAdapters ()
 Returns a list of BluetoothAdapters available in the system. More...
 
final BTAdapter getDefaultAdapter ()
 Gets the default adapter to use for discovery. More...
 
int removeAllChangedAdapterSetListener ()
 Remove all added ChangedAdapterSetListener entries from this manager. More...
 
final int removeChangedAdapterSetListener (final ChangedAdapterSetListener l)
 Remove the given ChangedAdapterSetListener from this manager. More...
 
final boolean setDefaultAdapter (final BTAdapter adapter)
 Sets a default adapter to use for discovery. More...
 
final void shutdown ()
 Release the native memory associated with this object and all related Bluetooth resources. More...
 
void addChangedAdapterSetListener (final ChangedAdapterSetListener l)
 Add the given ChangedAdapterSetListener to this manager. More...
 
BTAdapter getAdapter (final int dev_id)
 Returns the BluetoothAdapter matching the given dev_id or null if not found. More...
 
List< BTAdaptergetAdapters ()
 Returns a list of BluetoothAdapters available in the system. More...
 
BTAdapter getDefaultAdapter ()
 Gets the default adapter to use for discovery. More...
 
int removeAllChangedAdapterSetListener ()
 Remove all added ChangedAdapterSetListener entries from this manager. More...
 
int removeChangedAdapterSetListener (final ChangedAdapterSetListener l)
 Remove the given ChangedAdapterSetListener from this manager. More...
 
boolean setDefaultAdapter (BTAdapter adapter)
 Sets a default adapter to use for discovery. More...
 
void shutdown ()
 Release the native memory associated with this object and all related Bluetooth resources. More...
 

Static Public Member Functions

static final void addShutdownHook (final boolean head, final Runnable runnable)
 Add a shutdown hook to be performed at JVM shutdown before shutting down DBTManager instance. More...
 
static final BTManager getManager () throws RuntimeException, BTException
 Returns an instance of BluetoothManager, to be used instead of constructor. More...
 
static final boolean isJVMShuttingDown ()
 Returns true if the JVM is shutting down, otherwise false. More...
 

Protected Member Functions

final void finalize ()
 

Static Protected Attributes

static final boolean DEBUG = BTFactory.DEBUG
 
static final boolean VERBOSE = BTFactory.VERBOSE
 

Detailed Description

Definition at line 41 of file DBTManager.java.

Member Function Documentation

◆ isJVMShuttingDown()

static final boolean jau.direct_bt.DBTManager.isJVMShuttingDown ( )
static

Returns true if the JVM is shutting down, otherwise false.

Definition at line 108 of file DBTManager.java.

Here is the caller graph for this function:

◆ addShutdownHook()

static final void jau.direct_bt.DBTManager.addShutdownHook ( final boolean  head,
final Runnable  runnable 
)
static

Add a shutdown hook to be performed at JVM shutdown before shutting down DBTManager instance.

Parameters
headif true add runnable at the start, otherwise at the end
runnablerunnable to be added.

Definition at line 116 of file DBTManager.java.

◆ getAdapters()

final List< BTAdapter > jau.direct_bt.DBTManager.getAdapters ( )

Returns a list of BluetoothAdapters available in the system.

Returns
A list of BluetoothAdapters available in the system

Implements org.direct_bt.BTManager.

Definition at line 133 of file DBTManager.java.

◆ getAdapter()

final BTAdapter jau.direct_bt.DBTManager.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.

Parameters
dev_idthe internal temporary adapter device id
Since
2.0.0

Implements org.direct_bt.BTManager.

Definition at line 136 of file DBTManager.java.

◆ setDefaultAdapter()

final boolean jau.direct_bt.DBTManager.setDefaultAdapter ( final BTAdapter  adapter)

Sets a default adapter to use for discovery.

Returns
TRUE if the device was set @implNote not implemented for jau.direct_bt

Implements org.direct_bt.BTManager.

Definition at line 147 of file DBTManager.java.

◆ getDefaultAdapter()

final BTAdapter jau.direct_bt.DBTManager.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.

Returns
the used default adapter

Implements org.direct_bt.BTManager.

Definition at line 152 of file DBTManager.java.

◆ addChangedAdapterSetListener()

final void jau.direct_bt.DBTManager.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.

Since
2.0.0

Implements org.direct_bt.BTManager.

Definition at line 163 of file DBTManager.java.

◆ removeChangedAdapterSetListener()

final int jau.direct_bt.DBTManager.removeChangedAdapterSetListener ( final ChangedAdapterSetListener  l)

Remove the given ChangedAdapterSetListener from this manager.

Parameters
lthe to be removed element
Returns
the number of removed elements
Since
2.0.0

Implements org.direct_bt.BTManager.

Definition at line 175 of file DBTManager.java.

◆ removeAllChangedAdapterSetListener()

int jau.direct_bt.DBTManager.removeAllChangedAdapterSetListener ( )

Remove all added ChangedAdapterSetListener entries from this manager.

Returns
the number of removed elements
Since
2.7.0

Implements org.direct_bt.BTManager.

Definition at line 192 of file DBTManager.java.

◆ getManager()

static final BTManager jau.direct_bt.DBTManager.getManager ( ) throws RuntimeException, BTException
static

Returns an instance of BluetoothManager, to be used instead of constructor.

Returns
An initialized BluetoothManager instance.

Definition at line 304 of file DBTManager.java.

Here is the caller graph for this function:

◆ finalize()

final void jau.direct_bt.DBTManager.finalize ( )
protected

Definition at line 313 of file DBTManager.java.

◆ shutdown()

final void jau.direct_bt.DBTManager.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.

Implements org.direct_bt.BTManager.

Definition at line 318 of file DBTManager.java.

Here is the caller graph for this function:

Member Data Documentation

◆ DEBUG

final boolean jau.direct_bt.DBTManager.DEBUG = BTFactory.DEBUG
staticprotected

Definition at line 43 of file DBTManager.java.

◆ VERBOSE

final boolean jau.direct_bt.DBTManager.VERBOSE = BTFactory.VERBOSE
staticprotected

Definition at line 44 of file DBTManager.java.


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