25package test.org.direct_bt;
27import java.lang.reflect.InvocationTargetException;
30import org.direct_bt.BTRole;
31import org.direct_bt.BTSecurityRegistry;
32import org.direct_bt.BTAdapter;
33import org.direct_bt.BTDeviceRegistry;
34import org.direct_bt.BTException;
35import org.direct_bt.BTFactory;
36import org.direct_bt.BTManager;
37import org.direct_bt.DirectBTVersion;
38import org.jau.io.PrintUtil;
39import org.junit.Assert;
40import org.junit.FixMethodOrder;
42import org.junit.runners.MethodSorters;
44import jau.test.junit.util.SingletonJunitCase;
52@FixMethodOrder(MethodSorters.NAME_ASCENDING)
54 static final boolean DEBUG =
false;
56 private void resetStates() {
60 }
catch (
BTException | NoSuchMethodException | SecurityException
61 | IllegalAccessException | IllegalArgumentException
62 | InvocationTargetException | ClassNotFoundException e) {
64 PrintUtil.println(System.err,
"Unable to instantiate Direct-BT BluetoothManager: "+e.getMessage());
67 if(
null != manager ) {
68 final List<BTAdapter> adapters = manager.
getAdapters();
71 a.removeAllStatusListener();
83 @Test(timeout = 40000)
84 public final
void test01_ManagerBringup() {
99 }
catch (
BTException | NoSuchMethodException | SecurityException
100 | IllegalAccessException | IllegalArgumentException
101 | InvocationTargetException | ClassNotFoundException e) {
103 Assert.assertNull(
"Unable to instantiate Direct-BT BluetoothManager: "+e.getMessage(), e);
105 if(
null == manager ) {
108 final List<BTAdapter> adapters = manager.
getAdapters();
109 PrintUtil.println(System.err,
"Adapter: Count "+adapters.size());
110 for(
int i=0; i<adapters.size(); i++) {
111 PrintUtil.println(System.err, i+
": "+adapters.get(i).toString());
115 Assert.assertFalse( a.isInitialized() );
118 Assert.assertTrue( 4 <= a.getBTMajorVersion() );
126 public static void main(
final String args[]) {
127 org.junit.runner.JUnitCore.main(
TestBringup00.class.getName());
Application toolkit providing BT device registration of processed and awaited devices.
static void clearWaitForDevices()
Clears internal list.
static void clearProcessedDevices()
Clears internal list.
One stop BTManager API entry point.
static synchronized void initDirectBTLibrary()
Preloads the DirectBT native library w/o instantiating BTManager.
static synchronized BTManager getDirectBTManager()
Returns an initialized BluetoothManager instance using the DirectBT implementation.
Application toolkit providing BT security setup and its device association on a pattern matching basi...
static void clear()
Clears internal list.
This jaulib derived version info class is only usable when having jaulib available,...
static final void printVersionInfo(final PrintStream out)
Print full Direct-BT version information.
Testing BTManager bring up using fat Direct-BT Jaulib Fat Jar and.
static void main(final String args[])
Bluetooth roles from the perspective of the link layer (connection initiator).
Master
Master or central role, discovering remote devices and initiating connection.
BTAdapter represents one local Bluetooth Controller.
A thread safe singleton handler of the BTAdapter manager, e.g.
int removeAllChangedAdapterSetListener()
Remove all added ChangedAdapterSetListener entries from this manager.
List< BTAdapter > getAdapters()
Returns a list of BluetoothAdapters available in the system.
void shutdown()
Release the native memory associated with this object and all related Bluetooth resources.