Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | List of all members
JNIAdapterStatusListener Class Reference
Inheritance diagram for JNIAdapterStatusListener:
Collaboration diagram for JNIAdapterStatusListener:

Public Member Functions

std::string toString () const override
 
 ~JNIAdapterStatusListener () override
 
 JNIAdapterStatusListener (JNIEnv *env, BTAdapter *adapter, jclass listenerClazz, jobject statusListenerObj, jmethodID statusListenerNotifyDeleted, const BTDevice *_deviceMatchRef)
 
bool matchDevice (const BTDevice &device) override
 Custom filter for all 'device*' notification methods, which will not be called if this method returns false. More...
 
void adapterSettingsChanged (BTAdapter &a, const AdapterSetting oldmask, const AdapterSetting newmask, const AdapterSetting changedmask, const uint64_t timestamp) override
 BTAdapter setting(s) changed. More...
 
void discoveringChanged (BTAdapter &a, const ScanType currentMeta, const ScanType changedType, const bool changedEnabled, const bool keepAlive, const uint64_t timestamp) override
 BTAdapter's discovery state has changed, i.e. More...
 
bool deviceFound (std::shared_ptr< BTDevice > device, const uint64_t timestamp) override
 A BTDevice has been newly discovered. More...
 
void deviceUpdated (std::shared_ptr< BTDevice > device, const EIRDataType updateMask, const uint64_t timestamp) override
 An already discovered BTDevice has been updated. More...
 
void deviceConnected (std::shared_ptr< BTDevice > device, const uint16_t handle, const uint64_t timestamp) override
 BTDevice got connected. More...
 
void devicePairingState (std::shared_ptr< BTDevice > device, const SMPPairingState state, const PairingMode mode, const uint64_t timestamp) override
 An already connected BTDevice's ::SMPPairingState has changed. More...
 
void deviceReady (std::shared_ptr< BTDevice > device, const uint64_t timestamp) override
 BTDevice is ready for user (GATT) processing, i.e. More...
 
void deviceDisconnected (std::shared_ptr< BTDevice > device, const HCIStatusCode reason, const uint16_t handle, const uint64_t timestamp) override
 BTDevice got disconnected. More...
 
- Public Member Functions inherited from direct_bt::AdapterStatusListener
virtual ~AdapterStatusListener ()
 
virtual bool operator== (const AdapterStatusListener &rhs) const
 Default comparison operator, merely testing for same memory reference. More...
 
bool operator!= (const AdapterStatusListener &rhs) const
 

Detailed Description

Definition at line 62 of file DBTAdapter.cxx.

Constructor & Destructor Documentation

◆ ~JNIAdapterStatusListener()

JNIAdapterStatusListener::~JNIAdapterStatusListener ( )
inlineoverride

Definition at line 122 of file DBTAdapter.cxx.

◆ JNIAdapterStatusListener()

JNIAdapterStatusListener::JNIAdapterStatusListener ( JNIEnv *  env,
BTAdapter adapter,
jclass  listenerClazz,
jobject  statusListenerObj,
jmethodID  statusListenerNotifyDeleted,
const BTDevice _deviceMatchRef 
)
inline

Definition at line 126 of file DBTAdapter.cxx.

Here is the call graph for this function:

Member Function Documentation

◆ adapterSettingsChanged()

void JNIAdapterStatusListener::adapterSettingsChanged ( BTAdapter adapter,
const AdapterSetting  oldmask,
const AdapterSetting  newmask,
const AdapterSetting  changedmask,
const uint64_t  timestamp 
)
inlineoverridevirtual

BTAdapter setting(s) changed.

Parameters
adapterthe adapter which settings have changed.
oldmaskthe previous settings mask. AdapterSetting::NONE indicates the initial setting notification, see BTAdapter::addStatusListener().
newmaskthe new settings mask
changedmaskthe changes settings mask. AdapterSetting::NONE indicates the initial setting notification, see BTAdapter::addStatusListener().
timestampthe time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds().

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 311 of file DBTAdapter.cxx.

Here is the call graph for this function:

◆ deviceConnected()

void JNIAdapterStatusListener::deviceConnected ( std::shared_ptr< BTDevice device,
const uint16_t  handle,
const uint64_t  timestamp 
)
inlineoverridevirtual

BTDevice got connected.

Parameters
devicethe device which has been connected, holding the new connection handle.
handlethe new connection handle, which has been assigned to the device already
timestampthe time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds().

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 414 of file DBTAdapter.cxx.

Here is the call graph for this function:

◆ deviceDisconnected()

void JNIAdapterStatusListener::deviceDisconnected ( std::shared_ptr< BTDevice device,
const HCIStatusCode  reason,
const uint16_t  handle,
const uint64_t  timestamp 
)
inlineoverridevirtual

BTDevice got disconnected.

Parameters
devicethe device which has been disconnected with zeroed connection handle.
reasonthe HCIStatusCode reason for disconnection
handlethe disconnected connection handle, which has been unassigned from the device already
timestampthe time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds().

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 471 of file DBTAdapter.cxx.

Here is the call graph for this function:

◆ deviceFound()

bool JNIAdapterStatusListener::deviceFound ( std::shared_ptr< BTDevice device,
const uint64_t  timestamp 
)
inlineoverridevirtual

A BTDevice has been newly discovered.

The boolean return value informs the adapter whether the device shall be made persistent for connection true, or that it can be discarded false.
If no registered AdapterStatusListener::deviceFound() implementation returns true, the device instance will be removed from all internal lists and can no longer being used.
If any registered AdapterStatusListener::deviceFound() implementation returns true, the device will be made persistent, is ready to connect and BTDevice::remove() shall be called after usage.

Parameters
devicethe found device
timestampthe time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds().
Returns
true if the device shall be made persistent and BTDevice::remove() issued later. Otherwise false to remove device right away.

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 379 of file DBTAdapter.cxx.

Here is the call graph for this function:

◆ devicePairingState()

void JNIAdapterStatusListener::devicePairingState ( std::shared_ptr< BTDevice device,
const SMPPairingState  state,
const PairingMode  mode,
const uint64_t  timestamp 
)
inlineoverridevirtual

An already connected BTDevice's ::SMPPairingState has changed.

Parameters
devicethe device which PairingMode has been changed.
statethe current ::SMPPairingState of the connected device, see BTDevice::getCurrentPairingState()
modethe current ::PairingMode of the connected device, see BTDevice::getCurrentPairingMode()
timestampthe time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds().
See also
BTDevice::setPairingPasskey()
BTDevice::setPairingNumericComparison()

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 435 of file DBTAdapter.cxx.

Here is the call graph for this function:

◆ deviceReady()

void JNIAdapterStatusListener::deviceReady ( std::shared_ptr< BTDevice device,
const uint64_t  timestamp 
)
inlineoverridevirtual

BTDevice is ready for user (GATT) processing, i.e.

already connected, optionally paired and ATT MTU size negotiated via connected GATT.

Method is being called from a dedicated native thread, hence restrictions on method duration and complex mutable operations don't apply here.

Parameters
devicethe device ready to use
timestampthe time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds().
See also
::SMPPairingState::COMPLETED

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 457 of file DBTAdapter.cxx.

Here is the call graph for this function:

◆ deviceUpdated()

void JNIAdapterStatusListener::deviceUpdated ( std::shared_ptr< BTDevice device,
const EIRDataType  updateMask,
const uint64_t  timestamp 
)
inlineoverridevirtual

An already discovered BTDevice has been updated.

Parameters
devicethe updated device
updateMaskthe update mask of changed data
timestampthe time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds().

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 396 of file DBTAdapter.cxx.

Here is the call graph for this function:

◆ discoveringChanged()

void JNIAdapterStatusListener::discoveringChanged ( BTAdapter adapter,
const ScanType  currentMeta,
const ScanType  changedType,
const bool  changedEnabled,
const bool  keepAlive,
const uint64_t  timestamp 
)
inlineoverridevirtual

BTAdapter's discovery state has changed, i.e.

enabled or disabled.

Parameters
adapterthe adapter which discovering state has changed.
currentMetathe current meta ScanType
changedTypedenotes the changed ScanType
changedEnableddenotes whether the changed ScanType has been enabled or disabled
keepAliveif true, the denoted changed ScanType will be re-enabled if disabled by the underlying Bluetooth implementation.
timestampthe time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds().

changeScanType(const ScanType current, const bool enable, const ScanType enableChanged) noexcept {

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 335 of file DBTAdapter.cxx.

Here is the call graph for this function:

◆ matchDevice()

bool JNIAdapterStatusListener::matchDevice ( const BTDevice device)
inlineoverridevirtual

Custom filter for all 'device*' notification methods, which will not be called if this method returns false.

User may override this method to test whether the 'device*' methods shall be called for the given device.

Defaults to true;

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 304 of file DBTAdapter.cxx.

◆ toString()

std::string JNIAdapterStatusListener::toString ( ) const
inlineoverridevirtual

Implements direct_bt::AdapterStatusListener.

Definition at line 117 of file DBTAdapter.cxx.

Here is the call graph for this function:

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