Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Classes | Public Member Functions | List of all members
org.direct_bt.BTManager Interface Reference

A thread safe singleton handler of the BTAdapter manager, e.g. More...

Inheritance diagram for org.direct_bt.BTManager:
Collaboration diagram for org.direct_bt.BTManager:

Classes

interface  ChangedAdapterSetListener
 Event listener to receive change events regarding the system's BTAdapter set, e.g. More...
 

Public Member Functions

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...
 

Detailed Description

A thread safe singleton handler of the BTAdapter manager, e.g.

Linux Kernel's BlueZ manager control channel.

See also
Direct-BT Overview

Definition at line 35 of file BTManager.java.

Member Function Documentation

◆ getAdapters()

List< BTAdapter > org.direct_bt.BTManager.getAdapters ( )

Returns a list of BluetoothAdapters available in the system.

Returns
A list of BluetoothAdapters available in the system

Implemented in jau.direct_bt.DBTManager.

Here is the caller graph for this function:

◆ getAdapter()

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.

Parameters
dev_idthe internal temporary adapter device id
Since
2.0.0

Implemented in jau.direct_bt.DBTManager.

◆ setDefaultAdapter()

boolean org.direct_bt.BTManager.setDefaultAdapter ( BTAdapter  adapter)

Sets a default adapter to use for discovery.

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

Implemented in jau.direct_bt.DBTManager.

◆ getDefaultAdapter()

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.

Returns
the used default adapter

Implemented in jau.direct_bt.DBTManager.

◆ addChangedAdapterSetListener()

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.

Since
2.0.0

Implemented in jau.direct_bt.DBTManager.

Here is the caller graph for this function:

◆ removeChangedAdapterSetListener()

int org.direct_bt.BTManager.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

Implemented in jau.direct_bt.DBTManager.

Here is the caller graph for this function:

◆ removeAllChangedAdapterSetListener()

int org.direct_bt.BTManager.removeAllChangedAdapterSetListener ( )

Remove all added ChangedAdapterSetListener entries from this manager.

Returns
the number of removed elements
Since
2.7.0

Implemented in jau.direct_bt.DBTManager.

◆ shutdown()

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.

Here is the caller graph for this function:

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