Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
direct_bt::MgmtEvent Class Reference

uint16_t opcode, uint16_t dev-id, uint16_t param_size More...

#include <MgmtTypes.hpp>

Inheritance diagram for direct_bt::MgmtEvent:
Collaboration diagram for direct_bt::MgmtEvent:

Public Types

enum  Opcode : uint16_t {
  Opcode::INVALID = 0x0000, Opcode::CMD_COMPLETE = 0x0001, Opcode::CMD_STATUS = 0x0002, Opcode::CONTROLLER_ERROR = 0x0003,
  Opcode::INDEX_ADDED = 0x0004, Opcode::INDEX_REMOVED = 0x0005, Opcode::NEW_SETTINGS = 0x0006, Opcode::CLASS_OF_DEV_CHANGED = 0x0007,
  Opcode::LOCAL_NAME_CHANGED = 0x0008, Opcode::NEW_LINK_KEY = 0x0009, Opcode::NEW_LONG_TERM_KEY = 0x000A, Opcode::DEVICE_CONNECTED = 0x000B,
  Opcode::DEVICE_DISCONNECTED = 0x000C, Opcode::CONNECT_FAILED = 0x000D, Opcode::PIN_CODE_REQUEST = 0x000E, Opcode::USER_CONFIRM_REQUEST = 0x000F,
  Opcode::USER_PASSKEY_REQUEST = 0x0010, Opcode::AUTH_FAILED = 0x0011, Opcode::DEVICE_FOUND = 0x0012, Opcode::DISCOVERING = 0x0013,
  Opcode::DEVICE_BLOCKED = 0x0014, Opcode::DEVICE_UNBLOCKED = 0x0015, Opcode::DEVICE_UNPAIRED = 0x0016, Opcode::PASSKEY_NOTIFY = 0x0017,
  Opcode::NEW_IRK = 0x0018, Opcode::NEW_CSRK = 0x0019, Opcode::DEVICE_WHITELIST_ADDED = 0x001A, Opcode::DEVICE_WHITELIST_REMOVED = 0x001B,
  Opcode::NEW_CONN_PARAM = 0x001C, Opcode::UNCONF_INDEX_ADDED = 0x001D, Opcode::UNCONF_INDEX_REMOVED = 0x001E, Opcode::NEW_CONFIG_OPTIONS = 0x001F,
  Opcode::EXT_INDEX_ADDED = 0x0020, Opcode::EXT_INDEX_REMOVED = 0x0021, Opcode::LOCAL_OOB_DATA_UPDATED = 0x0022, Opcode::ADVERTISING_ADDED = 0x0023,
  Opcode::ADVERTISING_REMOVED = 0x0024, Opcode::EXT_INFO_CHANGED = 0x0025, Opcode::PHY_CONFIGURATION_CHANGED = 0x0026, Opcode::EXP_FEATURE_CHANGED = 0x0027,
  Opcode::DEVICE_FLAGS_CHANGED = 0x002a, Opcode::ADV_MONITOR_ADDED = 0x002b, Opcode::ADV_MONITOR_REMOVED = 0x002c, Opcode::PAIR_DEVICE_COMPLETE = 0x002d,
  Opcode::HCI_ENC_CHANGED = 0x002e, Opcode::HCI_ENC_KEY_REFRESH_COMPLETE = 0x002f, Opcode::HCI_LE_REMOTE_USR_FEATURES = 0x0030, Opcode::MGMT_EVENT_TYPE_COUNT = 0x0031
}
 

Public Member Functions

 MgmtEvent (const uint8_t *buffer, const jau::nsize_t buffer_len, const jau::nsize_t exp_param_size)
 Persistent memory, w/ ownership . More...
 
 MgmtEvent (const Opcode opc, const uint16_t dev_id, const uint16_t param_size=0)
 
 MgmtEvent (const Opcode opc, const uint16_t dev_id, const uint16_t param_size, const uint8_t *param)
 
virtual ~MgmtEvent () noexcept override
 
jau::nsize_t getTotalSize () const noexcept
 
Opcode getOpcode () const noexcept
 
virtual jau::nsize_t getDataOffset () const noexcept
 
virtual jau::nsize_t getDataSize () const noexcept
 
virtual const uint8_t * getData () const noexcept
 
virtual bool validate (const MgmtCommand &req) const noexcept
 
std::string toString () const noexcept override
 
- Public Member Functions inherited from direct_bt::MgmtMsg
 MgmtMsg (const uint16_t opc, const uint16_t dev_id, const uint16_t param_size)
 
 MgmtMsg (const uint8_t *buffer, const jau::nsize_t buffer_len)
 
virtual ~MgmtMsg ()
 
uint64_t getTimestamp () const noexcept
 
jau::nsize_t getTotalSize () const noexcept
 
TROOctetsgetPDU () noexcept
 Return the underlying octets read only. More...
 
uint16_t getIntOpcode () const noexcept
 
uint16_t getDevID () const noexcept
 
uint16_t getParamSize () const noexcept
 

Static Public Member Functions

static constexpr uint16_t number (const Opcode rhs) noexcept
 
static std::string getOpcodeString (const Opcode opc) noexcept
 
static MgmtEvent::Opcode getOpcode (const uint8_t *buffer)
 
static std::unique_ptr< MgmtEventgetSpecialized (const uint8_t *buffer, jau::nsize_t const buffer_size) noexcept
 Return a newly created specialized instance pointer to base class. More...
 
- Static Public Member Functions inherited from direct_bt::MgmtMsg
static uint16_t getIntOpcode (const uint8_t *buffer)
 
static uint16_t getDevID (const uint8_t *data)
 
template<class T >
static T * clone (const T &source) noexcept
 Clone template for convenience, based on derived class's copy-constructor. More...
 

Protected Member Functions

virtual std::string baseString () const noexcept override
 
virtual std::string valueString () const noexcept override
 

Static Protected Member Functions

static void checkOpcode (const Opcode has, const Opcode min, const Opcode max)
 
static void checkOpcode (const Opcode has, const Opcode exp)
 

Additional Inherited Members

- Protected Attributes inherited from direct_bt::MgmtMsg
POctets pdu
 
uint64_t ts_creation
 

Detailed Description

uint16_t opcode, uint16_t dev-id, uint16_t param_size

Definition at line 1082 of file MgmtTypes.hpp.

Member Enumeration Documentation

◆ Opcode

enum direct_bt::MgmtEvent::Opcode : uint16_t
strong
Enumerator
INVALID 
CMD_COMPLETE 
CMD_STATUS 
CONTROLLER_ERROR 
INDEX_ADDED 
INDEX_REMOVED 
NEW_SETTINGS 
CLASS_OF_DEV_CHANGED 
LOCAL_NAME_CHANGED 
NEW_LINK_KEY 
NEW_LONG_TERM_KEY 
DEVICE_CONNECTED 
DEVICE_DISCONNECTED 
CONNECT_FAILED 
PIN_CODE_REQUEST 
USER_CONFIRM_REQUEST 
USER_PASSKEY_REQUEST 
AUTH_FAILED 
DEVICE_FOUND 
DISCOVERING 
DEVICE_BLOCKED 
DEVICE_UNBLOCKED 
DEVICE_UNPAIRED 
PASSKEY_NOTIFY 
NEW_IRK 
NEW_CSRK 
DEVICE_WHITELIST_ADDED 
DEVICE_WHITELIST_REMOVED 
NEW_CONN_PARAM 
UNCONF_INDEX_ADDED 
UNCONF_INDEX_REMOVED 
NEW_CONFIG_OPTIONS 
EXT_INDEX_ADDED 
EXT_INDEX_REMOVED 
LOCAL_OOB_DATA_UPDATED 
ADVERTISING_ADDED 
ADVERTISING_REMOVED 
EXT_INFO_CHANGED 
PHY_CONFIGURATION_CHANGED 
EXP_FEATURE_CHANGED 
DEVICE_FLAGS_CHANGED 
ADV_MONITOR_ADDED 
ADV_MONITOR_REMOVED 
PAIR_DEVICE_COMPLETE 
HCI_ENC_CHANGED 
HCI_ENC_KEY_REFRESH_COMPLETE 
HCI_LE_REMOTE_USR_FEATURES 
MGMT_EVENT_TYPE_COUNT 

Definition at line 1085 of file MgmtTypes.hpp.

Constructor & Destructor Documentation

◆ MgmtEvent() [1/3]

direct_bt::MgmtEvent::MgmtEvent ( const uint8_t *  buffer,
const jau::nsize_t  buffer_len,
const jau::nsize_t  exp_param_size 
)
inline

Persistent memory, w/ ownership .

Definition at line 1180 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ MgmtEvent() [2/3]

direct_bt::MgmtEvent::MgmtEvent ( const Opcode  opc,
const uint16_t  dev_id,
const uint16_t  param_size = 0 
)
inline

Definition at line 1191 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ MgmtEvent() [3/3]

direct_bt::MgmtEvent::MgmtEvent ( const Opcode  opc,
const uint16_t  dev_id,
const uint16_t  param_size,
const uint8_t *  param 
)
inline

Definition at line 1200 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ ~MgmtEvent()

virtual direct_bt::MgmtEvent::~MgmtEvent ( )
inlineoverridevirtualnoexcept

Definition at line 1208 of file MgmtTypes.hpp.

Member Function Documentation

◆ baseString()

virtual std::string direct_bt::MgmtEvent::baseString ( ) const
inlineoverrideprotectedvirtualnoexcept

◆ checkOpcode() [1/2]

static void direct_bt::MgmtEvent::checkOpcode ( const Opcode  has,
const Opcode  exp 
)
inlinestaticprotected

Definition at line 1149 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ checkOpcode() [2/2]

static void direct_bt::MgmtEvent::checkOpcode ( const Opcode  has,
const Opcode  min,
const Opcode  max 
)
inlinestaticprotected

Definition at line 1141 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ getData()

virtual const uint8_t* direct_bt::MgmtEvent::getData ( ) const
inlinevirtualnoexcept

◆ getDataOffset()

virtual jau::nsize_t direct_bt::MgmtEvent::getDataOffset ( ) const
inlinevirtualnoexcept

◆ getDataSize()

virtual jau::nsize_t direct_bt::MgmtEvent::getDataSize ( ) const
inlinevirtualnoexcept

◆ getOpcode() [1/2]

Opcode direct_bt::MgmtEvent::getOpcode ( ) const
inlinenoexcept

Definition at line 1212 of file MgmtTypes.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOpcode() [2/2]

static MgmtEvent::Opcode direct_bt::MgmtEvent::getOpcode ( const uint8_t *  buffer)
inlinestatic

Definition at line 1167 of file MgmtTypes.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOpcodeString()

std::string MgmtEvent::getOpcodeString ( const Opcode  opc)
staticnoexcept

Definition at line 314 of file MgmtTypes.cpp.

Here is the caller graph for this function:

◆ getSpecialized()

std::unique_ptr< MgmtEvent > MgmtEvent::getSpecialized ( const uint8_t *  buffer,
jau::nsize_t const  buffer_size 
)
staticnoexcept

Return a newly created specialized instance pointer to base class.

Returned memory reference is managed by caller (delete etc)

Definition at line 322 of file MgmtTypes.cpp.

Here is the call graph for this function:

◆ getTotalSize()

jau::nsize_t direct_bt::MgmtEvent::getTotalSize ( ) const
inlinenoexcept

Definition at line 1210 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ number()

static constexpr uint16_t direct_bt::MgmtEvent::number ( const Opcode  rhs)
inlinestaticconstexprnoexcept

Definition at line 1135 of file MgmtTypes.hpp.

◆ toString()

std::string direct_bt::MgmtEvent::toString ( ) const
inlineoverridevirtualnoexcept

Implements direct_bt::MgmtMsg.

Definition at line 1222 of file MgmtTypes.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate()

virtual bool direct_bt::MgmtEvent::validate ( const MgmtCommand req) const
inlinevirtualnoexcept

Reimplemented in direct_bt::MgmtEvtCmdStatus, and direct_bt::MgmtEvtCmdComplete.

Definition at line 1218 of file MgmtTypes.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valueString()

virtual std::string direct_bt::MgmtEvent::valueString ( ) const
inlineoverrideprotectedvirtualnoexcept

Implements direct_bt::MgmtMsg.

Reimplemented in direct_bt::MgmtEvtAdapterInfo, and direct_bt::MgmtEvtLocalNameChanged.

Definition at line 1160 of file MgmtTypes.hpp.

Here is the call graph for this function:

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