Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
BTAdapter status listener for BTDevice discovery events: Added, updated and removed; as well as for certain BTAdapter events. More...
#include <BTAdapter.hpp>
Public Member Functions | |
virtual bool | matchDevice (const BTDevice &device) |
Custom filter for all 'device*' notification methods, which will not be called if this method returns false. More... | |
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 | discoveringChanged (BTAdapter &adapter, const ScanType currentMeta, const ScanType changedType, const bool changedEnabled, const bool keepAlive, const uint64_t timestamp) |
BTAdapter's discovery state has changed, i.e. More... | |
virtual bool | deviceFound (std::shared_ptr< BTDevice > device, const uint64_t timestamp) |
A BTDevice has been newly discovered. More... | |
virtual void | deviceUpdated (std::shared_ptr< BTDevice > device, const EIRDataType updateMask, const uint64_t timestamp) |
An already discovered BTDevice has been updated. More... | |
virtual void | deviceConnected (std::shared_ptr< BTDevice > device, const uint16_t handle, const uint64_t timestamp) |
BTDevice got connected. More... | |
virtual void | devicePairingState (std::shared_ptr< BTDevice > device, const SMPPairingState state, const PairingMode mode, const uint64_t timestamp) |
An already connected BTDevice's SMPPairingState has changed. More... | |
virtual void | deviceReady (std::shared_ptr< BTDevice > device, const uint64_t timestamp) |
BTDevice is ready for user (GATT) processing, i.e. More... | |
virtual void | deviceDisconnected (std::shared_ptr< BTDevice > device, const HCIStatusCode reason, const uint16_t handle, const uint64_t timestamp) |
BTDevice got disconnected. More... | |
virtual | ~AdapterStatusListener () |
virtual std::string | toString () const =0 |
virtual bool | operator== (const AdapterStatusListener &rhs) const |
Default comparison operator, merely testing for same memory reference. More... | |
bool | operator!= (const AdapterStatusListener &rhs) const |
BTAdapter status listener for 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(std::shared_ptr<AdapterStatusListener>).
The listener receiver maintains a unique set of listener instances without duplicates.
Definition at line 67 of file BTAdapter.hpp.
|
inlinevirtual |
Definition at line 210 of file BTAdapter.hpp.
|
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 93 of file BTAdapter.hpp.
|
inlinevirtual |
BTDevice got connected.
device | the device which has been connected, holding the new connection handle. |
handle | the new connection handle, which has been assigned to the device already |
timestamp | the time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds(). |
Reimplemented in JNIAdapterStatusListener.
Definition at line 160 of file BTAdapter.hpp.
|
inlinevirtual |
BTDevice got disconnected.
device | the 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 203 of file BTAdapter.hpp.
|
inlinevirtual |
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.
device | the found device |
timestamp | the time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds(). |
Reimplemented in JNIAdapterStatusListener.
Definition at line 136 of file BTAdapter.hpp.
|
inlinevirtual |
An already connected BTDevice's SMPPairingState has changed.
device | the 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 175 of file BTAdapter.hpp.
|
inlinevirtual |
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.
device | the device ready to use |
timestamp | the time in monotonic milliseconds when this event occurred. See BasicTypes::getCurrentMilliseconds(). |
Reimplemented in JNIAdapterStatusListener.
Definition at line 191 of file BTAdapter.hpp.
|
inlinevirtual |
An already discovered BTDevice has been updated.
device | the updated 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 148 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 ScanType |
changedEnabled | denotes whether the changed ScanType has been enabled or disabled |
keepAlive | if true , the denoted changed ScanType will be re-enabled if disabled by the underlying Bluetooth implementation. |
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 113 of file BTAdapter.hpp.
|
inlinevirtual |
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 in JNIAdapterStatusListener.
Definition at line 80 of file BTAdapter.hpp.
|
inline |
Definition at line 223 of file BTAdapter.hpp.
|
inlinevirtual |
Default comparison operator, merely testing for same memory reference.
Specializations may override.
Definition at line 220 of file BTAdapter.hpp.
|
pure virtual |