Direct-BT v3.3.0-1-gc2d430c
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

 JNIAdapterStatusListener (JNIEnv *env, jobject statusListenerObj)
 
 ~JNIAdapterStatusListener () override=default
 
void adapterSettingsChanged (BTAdapter &a, const AdapterSetting oldmask, const AdapterSetting newmask, const AdapterSetting changedmask, const uint64_t timestamp) override
 BTAdapter setting(s) changed. More...
 
void deviceConnected (const BTDeviceRef &device, const bool discovered, const uint64_t timestamp) override
 Remote BTDevice got connected. More...
 
void deviceDisconnected (const BTDeviceRef &device, const HCIStatusCode reason, const uint16_t handle, const uint64_t timestamp) override
 Remote BTDevice got disconnected. More...
 
bool deviceFound (const BTDeviceRef &device, const uint64_t timestamp) override
 A remote BTDevice has been newly discovered. More...
 
void devicePairingState (const BTDeviceRef &device, const SMPPairingState state, const PairingMode mode, const uint64_t timestamp) override
 An already connected remote BTDevice's ::SMPPairingState has changed. More...
 
void deviceReady (const BTDeviceRef &device, const uint64_t timestamp) override
 Remote BTDevice is ready for user (GATT) processing, i.e. More...
 
void deviceUpdated (const BTDeviceRef &device, const EIRDataType updateMask, const uint64_t timestamp) override
 An already discovered remote BTDevice has been updated. More...
 
void discoveringChanged (BTAdapter &a, const ScanType currentMeta, const ScanType changedType, const bool changedEnabled, const DiscoveryPolicy policy, const uint64_t timestamp) override
 BTAdapter's discovery state has changed, i.e. More...
 
std::string toString () const noexcept override
 
- Public Member Functions inherited from direct_bt::AdapterStatusListener
 ~AdapterStatusListener () noexcept override=default
 
virtual void adapterSettingsChanged (BTAdapter &adapter, const AdapterSetting oldmask, const AdapterSetting newmask, const AdapterSetting changedmask, const uint64_t timestamp)
 BTAdapter setting(s) changed. More...
 
virtual void deviceConnected (const BTDeviceRef &device, const bool discovered, const uint64_t timestamp)
 Remote BTDevice got connected. More...
 
virtual void deviceDisconnected (const BTDeviceRef &device, const HCIStatusCode reason, const uint16_t handle, const uint64_t timestamp)
 Remote BTDevice got disconnected. More...
 
virtual bool deviceFound (const BTDeviceRef &device, const uint64_t timestamp)
 A remote BTDevice has been newly discovered. More...
 
virtual void devicePairingState (const BTDeviceRef &device, const SMPPairingState state, const PairingMode mode, const uint64_t timestamp)
 An already connected remote BTDevice's SMPPairingState has changed. More...
 
virtual void deviceReady (const BTDeviceRef &device, const uint64_t timestamp)
 Remote BTDevice is ready for user (GATT) processing, i.e. More...
 
virtual void deviceUpdated (const BTDeviceRef &device, const EIRDataType updateMask, const uint64_t timestamp)
 An already discovered remote BTDevice has been updated. More...
 
virtual void discoveringChanged (BTAdapter &adapter, const ScanType currentMeta, const ScanType changedType, const bool changedEnabled, const DiscoveryPolicy policy, const uint64_t timestamp)
 BTAdapter's discovery state has changed, i.e. More...
 
std::string get_java_class () const noexcept override
 
bool operator!= (const AdapterStatusListener &rhs) const
 
virtual bool operator== (const AdapterStatusListener &rhs) const
 Default comparison operator, merely testing for same memory reference. More...
 
std::string toString () const noexcept override
 

Additional Inherited Members

- Static Public Member Functions inherited from direct_bt::AdapterStatusListener
static std::string java_class () noexcept
 

Detailed Description

Definition at line 66 of file DBTAdapter.cxx.

Constructor & Destructor Documentation

◆ ~JNIAdapterStatusListener()

JNIAdapterStatusListener::~JNIAdapterStatusListener ( )
overridedefault

◆ JNIAdapterStatusListener()

JNIAdapterStatusListener::JNIAdapterStatusListener ( JNIEnv *  env,
jobject  statusListenerObj 
)
inline

Definition at line 125 of file DBTAdapter.cxx.

Member Function Documentation

◆ toString()

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

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 118 of file DBTAdapter.cxx.

◆ 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 208 of file DBTAdapter.cxx.

◆ discoveringChanged()

void JNIAdapterStatusListener::discoveringChanged ( BTAdapter adapter,
const ScanType  currentMeta,
const ScanType  changedType,
const bool  changedEnabled,
const DiscoveryPolicy  policy,
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 native ScanType
changedEnableddenotes whether the changed native ScanType has been enabled or disabled
policythe current DiscoveryPolicy of the BTAdapter, chosen via BTAdapter::startDiscovery()
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 238 of file DBTAdapter.cxx.

◆ deviceFound()

bool JNIAdapterStatusListener::deviceFound ( const BTDeviceRef device,
const uint64_t  timestamp 
)
inlineoverridevirtual

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

BTDevice::unpair() has been called already.

Parameters
devicethe found remote 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.
See also
BTDevice::unpair()
BTDevice::getEIR()

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 296 of file DBTAdapter.cxx.

◆ deviceUpdated()

void JNIAdapterStatusListener::deviceUpdated ( const BTDeviceRef device,
const EIRDataType  updateMask,
const uint64_t  timestamp 
)
inlineoverridevirtual

An already discovered remote BTDevice has been updated.

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

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 316 of file DBTAdapter.cxx.

◆ deviceConnected()

void JNIAdapterStatusListener::deviceConnected ( const BTDeviceRef device,
const bool  discovered,
const uint64_t  timestamp 
)
inlineoverridevirtual

Remote BTDevice got connected.

If a BTRole::Master BTDevice gets connected, BTDevice::unpair() has been called already.

Parameters
devicethe remote device which has been connected, holding the new connection handle.
discoveredtrue if discovered before connected and deviceFound() has been sent (default), otherwise false.
timestampthe time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds().
See also
BTDevice::unpair()
Since
2.6.6

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 337 of file DBTAdapter.cxx.

◆ devicePairingState()

void JNIAdapterStatusListener::devicePairingState ( const BTDeviceRef device,
const SMPPairingState  state,
const PairingMode  mode,
const uint64_t  timestamp 
)
inlineoverridevirtual

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

Parameters
devicethe remote 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 360 of file DBTAdapter.cxx.

◆ deviceReady()

void JNIAdapterStatusListener::deviceReady ( const BTDeviceRef device,
const uint64_t  timestamp 
)
inlineoverridevirtual

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

already connected, optionally (SMP) paired.

In case of a LE connection to a remote BTDevice in BTRole::Slave, a GATT server (GATTRole::Server), user needs to call BTDevice::getGattServices() to have GATT MTU size negotiated and GATT services discovered.

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

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

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 385 of file DBTAdapter.cxx.

◆ deviceDisconnected()

void JNIAdapterStatusListener::deviceDisconnected ( const BTDeviceRef device,
const HCIStatusCode  reason,
const uint16_t  handle,
const uint64_t  timestamp 
)
inlineoverridevirtual

Remote BTDevice got disconnected.

BTDevice::unpair() has been called already.

Parameters
devicethe remote 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().
See also
BTDevice::unpair()

Reimplemented from direct_bt::AdapterStatusListener.

Definition at line 402 of file DBTAdapter.cxx.


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