Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
org.direct_bt.DiscoveryPolicy Enum Reference

Discovery policy defines the BTAdapter discovery mode after connecting a remote BTDevice: More...

Collaboration diagram for org.direct_bt.DiscoveryPolicy:

Public Member Functions

 DiscoveryPolicy (final byte v)
 

Static Public Member Functions

static DiscoveryPolicy get (final byte value)
 Maps the specified integer value to a constant of DiscoveryPolicy. More...
 

Public Attributes

 ALWAYS_ON =((byte) 4)
 Always keep discovery enabled, i.e. More...
 
 AUTO_OFF =((byte) 0)
 Turn off discovery when a BTDevice gets connected and leave discovery disabled, if turned off by host system. More...
 
 PAUSE_CONNECTED_UNTIL_DISCONNECTED =((byte) 1)
 Pause discovery until all connected BTDevice become disconnected, effectively until AdapterStatusListener#deviceDisconnected(BTDevice, HCIStatusCode, short, long). More...
 
 PAUSE_CONNECTED_UNTIL_PAIRED =((byte) 3)
 Pause discovery until all connected BTDevice are optionally SMP paired (~120ms) without GATT service discovery (~700ms). More...
 
 PAUSE_CONNECTED_UNTIL_READY =((byte) 2)
 Pause discovery until all connected BTDevice reach readiness inclusive optional SMP pairing (~120ms) without GATT service discovery (~700ms), effectively until AdapterStatusListener#deviceReady(BTDevice, long). More...
 
final byte value
 

Detailed Description

Discovery policy defines the BTAdapter discovery mode after connecting a remote BTDevice:

Policy is set via BTAdapter#startDiscovery(DiscoveryPolicy, boolean, short, short, byte, boolean).

Default is DiscoveryPolicy#PAUSE_CONNECTED_UNTIL_READY, as it has been shown that continuous advertising reduces the bandwidth for the initial bring-up time including GATT service discovery considerably. Continuous advertising would increase the readiness lag of the remote device until AdapterStatusListener#deviceReady(BTDevice, long).

In case users favors faster parallel discovery of new remote devices and hence a slower readiness, DiscoveryPolicy#PAUSE_CONNECTED_UNTIL_PAIRED or even DiscoveryPolicy#ALWAYS_ON can be used.

Since
2.5.0

Definition at line 46 of file DiscoveryPolicy.java.

Constructor & Destructor Documentation

◆ DiscoveryPolicy()

org.direct_bt.DiscoveryPolicy.DiscoveryPolicy ( final byte  v)

Definition at line 81 of file DiscoveryPolicy.java.

Member Function Documentation

◆ get()

static DiscoveryPolicy org.direct_bt.DiscoveryPolicy.get ( final byte  value)
static

Maps the specified integer value to a constant of DiscoveryPolicy.

Parameters
valuethe integer value to be mapped to a constant of this enum type.
Returns
the corresponding constant of this enum type, using AUTO_OFF if not supported.

Definition at line 71 of file DiscoveryPolicy.java.

Here is the caller graph for this function:

Member Data Documentation

◆ AUTO_OFF

org.direct_bt.DiscoveryPolicy.AUTO_OFF =((byte) 0)

Turn off discovery when a BTDevice gets connected and leave discovery disabled, if turned off by host system.

Definition at line 48 of file DiscoveryPolicy.java.

◆ PAUSE_CONNECTED_UNTIL_DISCONNECTED

org.direct_bt.DiscoveryPolicy.PAUSE_CONNECTED_UNTIL_DISCONNECTED =((byte) 1)

Pause discovery until all connected BTDevice become disconnected, effectively until AdapterStatusListener#deviceDisconnected(BTDevice, HCIStatusCode, short, long).

Definition at line 53 of file DiscoveryPolicy.java.

◆ PAUSE_CONNECTED_UNTIL_READY

org.direct_bt.DiscoveryPolicy.PAUSE_CONNECTED_UNTIL_READY =((byte) 2)

Pause discovery until all connected BTDevice reach readiness inclusive optional SMP pairing (~120ms) without GATT service discovery (~700ms), effectively until AdapterStatusListener#deviceReady(BTDevice, long).

This is the default!

Definition at line 58 of file DiscoveryPolicy.java.

◆ PAUSE_CONNECTED_UNTIL_PAIRED

org.direct_bt.DiscoveryPolicy.PAUSE_CONNECTED_UNTIL_PAIRED =((byte) 3)

Pause discovery until all connected BTDevice are optionally SMP paired (~120ms) without GATT service discovery (~700ms).

Definition at line 60 of file DiscoveryPolicy.java.

◆ ALWAYS_ON

org.direct_bt.DiscoveryPolicy.ALWAYS_ON =((byte) 4)

Always keep discovery enabled, i.e.

re-enabled if automatically turned-off by HCI host OS as soon as possible.

Definition at line 62 of file DiscoveryPolicy.java.

◆ value

final byte org.direct_bt.DiscoveryPolicy.value

Definition at line 64 of file DiscoveryPolicy.java.


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