|
Direct-BT v3.3.0-1-gc2d430c
Direct-BT - Direct Bluetooth Programming.
|
BTAdapter status listener for remote BTDevice discovery events: Added, updated and removed; as well as for certain BTAdapter events.
More...
#include <BTAdapter.hpp>
Public Member Functions | |
| ~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 |
Public Member Functions inherited from jau::jni::JavaUplink | |
| JavaUplink () noexcept=default | |
| JavaUplink (const JavaUplink &o) noexcept=default | |
| JavaUplink (JavaUplink &&o) noexcept=default | |
| virtual | ~JavaUplink () noexcept |
| virtual void | checkValidInstance () const |
| Throws an IllegalStateException if instance is not valid. More... | |
| virtual std::string | get_java_class () const noexcept=0 |
| const JavaAnonRef & | getJavaObject () noexcept |
| std::string | javaObjectToString () const noexcept |
| JavaUplink & | operator= (const JavaUplink &o) noexcept=default |
| JavaUplink & | operator= (JavaUplink &&o) noexcept=default |
| void | setJavaObject () noexcept |
| Resets the shared JavaAnon reference, the replaced item might be deleted via JNI from dtor. More... | |
| void | setJavaObject (const JavaAnonRef &objRef) noexcept |
| Assigns a new shared JavaAnon reference, replaced item might be deleted via JNI from dtor. More... | |
| virtual std::string | toString () const noexcept |
Static Public Member Functions | |
| static std::string | java_class () noexcept |
BTAdapter status listener for remote BTDevice discovery events: Added, updated and removed; as well as for certain BTAdapter events.
User implementations shall return as early as possible to avoid blocking the event-handler thread, if not specified within the methods otherwise (see AdapterStatusListener::deviceReady()).
Especially complex mutable operations on BTDevice or BTAdapter should be issued off-thread!
A listener instance may be attached to a BTAdapter via BTAdapter::addStatusListener(const AdapterStatusListenerRef&).
The listener receiver maintains a unique set of listener instances without duplicates.
Definition at line 127 of file BTAdapter.hpp.
|
overridedefaultnoexcept |
|
inlinevirtual |
BTAdapter setting(s) changed.
| adapter | the adapter which settings have changed. |
| oldmask | the previous settings mask. AdapterSetting::NONE indicates the initial setting notification, see BTAdapter::addStatusListener(). |
| newmask | the new settings mask |
| changedmask | the changes settings mask. AdapterSetting::NONE indicates the initial setting notification, see BTAdapter::addStatusListener(). |
| timestamp | the time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds(). |
Reimplemented in JNIAdapterStatusListener.
Definition at line 137 of file BTAdapter.hpp.
|
inlinevirtual |
BTAdapter's discovery state has changed, i.e.
enabled or disabled.
| adapter | the adapter which discovering state has changed. |
| currentMeta | the current meta ScanType |
| changedType | denotes the changed native ScanType |
| changedEnabled | denotes whether the changed native ScanType has been enabled or disabled |
| policy | the current DiscoveryPolicy of the BTAdapter, chosen via BTAdapter::startDiscovery() |
| timestamp | the time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds(). |
changeScanType(const ScanType current, const bool enable, const ScanType enableChanged) noexcept {
Reimplemented in JNIAdapterStatusListener.
Definition at line 157 of file BTAdapter.hpp.
|
inlinevirtual |
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.
| device | the found remote device |
| timestamp | the time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds(). |
Reimplemented in JNIAdapterStatusListener.
Definition at line 185 of file BTAdapter.hpp.
|
inlinevirtual |
An already discovered remote BTDevice has been updated.
| device | the updated remote device |
| updateMask | the update mask of changed data |
| timestamp | the time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds(). |
Reimplemented in JNIAdapterStatusListener.
Definition at line 199 of file BTAdapter.hpp.
|
inlinevirtual |
Remote BTDevice got connected.
If a BTRole::Master BTDevice gets connected, BTDevice::unpair() has been called already.
| device | the remote device which has been connected, holding the new connection handle. |
| discovered | true if discovered before connected and deviceFound() has been sent (default), otherwise false. |
| timestamp | the time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds(). |
Reimplemented in JNIAdapterStatusListener.
Definition at line 216 of file BTAdapter.hpp.
|
inlinevirtual |
An already connected remote BTDevice's SMPPairingState has changed.
| device | the remote device which PairingMode has been changed. |
| state | the current SMPPairingState of the connected device, see BTDevice::getCurrentPairingState() |
| mode | the current PairingMode of the connected device, see BTDevice::getCurrentPairingMode() |
| timestamp | the time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds(). |
Reimplemented in JNIAdapterStatusListener.
Definition at line 231 of file BTAdapter.hpp.
|
inlinevirtual |
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.
| device | the remote device ready to use |
| timestamp | the time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds(). |
Reimplemented in JNIAdapterStatusListener.
Definition at line 251 of file BTAdapter.hpp.
|
inlinevirtual |
Remote BTDevice got disconnected.
BTDevice::unpair() has been called already.
| device | the remote device which has been disconnected with zeroed connection handle. |
| reason | the HCIStatusCode reason for disconnection |
| handle | the disconnected connection handle, which has been unassigned from the device already |
| timestamp | the time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds(). |
Reimplemented in JNIAdapterStatusListener.
Definition at line 267 of file BTAdapter.hpp.
|
inlineoverridevirtualnoexcept |
Reimplemented from jau::jni::JavaUplink.
Reimplemented in JNIAdapterStatusListener.
Definition at line 276 of file BTAdapter.hpp.
|
inlineoverridevirtualnoexcept |
Implements jau::jni::JavaUplink.
Definition at line 278 of file BTAdapter.hpp.
|
inlinestaticnoexcept |
|
inlinevirtual |
Default comparison operator, merely testing for same memory reference.
Specializations may override.
Definition at line 291 of file BTAdapter.hpp.
|
inline |
Definition at line 294 of file BTAdapter.hpp.