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::MgmtCommand Class Reference

#include <MgmtTypes.hpp>

Inheritance diagram for direct_bt::MgmtCommand:
Collaboration diagram for direct_bt::MgmtCommand:

Public Types

enum  Opcode : uint16_t {
  Opcode::READ_VERSION = 0x0001, Opcode::READ_COMMANDS = 0x0002, Opcode::READ_INDEX_LIST = 0x0003, Opcode::READ_INFO = 0x0004,
  Opcode::SET_POWERED = 0x0005, Opcode::SET_DISCOVERABLE = 0x0006, Opcode::SET_CONNECTABLE = 0x0007, Opcode::SET_FAST_CONNECTABLE = 0x0008,
  Opcode::SET_BONDABLE = 0x0009, Opcode::SET_LINK_SECURITY = 0x000A, Opcode::SET_SSP = 0x000B, Opcode::SET_HS = 0x000C,
  Opcode::SET_LE = 0x000D, Opcode::SET_DEV_CLASS = 0x000E, Opcode::SET_LOCAL_NAME = 0x000F, Opcode::ADD_UUID = 0x0010,
  Opcode::REMOVE_UUID = 0x0011, Opcode::LOAD_LINK_KEYS = 0x0012, Opcode::LOAD_LONG_TERM_KEYS = 0x0013, Opcode::DISCONNECT = 0x0014,
  Opcode::GET_CONNECTIONS = 0x0015, Opcode::PIN_CODE_REPLY = 0x0016, Opcode::PIN_CODE_NEG_REPLY = 0x0017, Opcode::SET_IO_CAPABILITY = 0x0018,
  Opcode::PAIR_DEVICE = 0x0019, Opcode::CANCEL_PAIR_DEVICE = 0x001A, Opcode::UNPAIR_DEVICE = 0x001B, Opcode::USER_CONFIRM_REPLY = 0x001C,
  Opcode::USER_CONFIRM_NEG_REPLY = 0x001D, Opcode::USER_PASSKEY_REPLY = 0x001E, Opcode::USER_PASSKEY_NEG_REPLY = 0x001F, Opcode::READ_LOCAL_OOB_DATA = 0x0020,
  Opcode::ADD_REMOTE_OOB_DATA = 0x0021, Opcode::REMOVE_REMOTE_OOB_DATA = 0x0022, Opcode::START_DISCOVERY = 0x0023, Opcode::STOP_DISCOVERY = 0x0024,
  Opcode::CONFIRM_NAME = 0x0025, Opcode::BLOCK_DEVICE = 0x0026, Opcode::UNBLOCK_DEVICE = 0x0027, Opcode::SET_DEVICE_ID = 0x0028,
  Opcode::SET_ADVERTISING = 0x0029, Opcode::SET_BREDR = 0x002A, Opcode::SET_STATIC_ADDRESS = 0x002B, Opcode::SET_SCAN_PARAMS = 0x002C,
  Opcode::SET_SECURE_CONN = 0x002D, Opcode::SET_DEBUG_KEYS = 0x002E, Opcode::SET_PRIVACY = 0x002F, Opcode::LOAD_IRKS = 0x0030,
  Opcode::GET_CONN_INFO = 0x0031, Opcode::GET_CLOCK_INFO = 0x0032, Opcode::ADD_DEVICE_WHITELIST = 0x0033, Opcode::REMOVE_DEVICE_WHITELIST = 0x0034,
  Opcode::LOAD_CONN_PARAM = 0x0035, Opcode::READ_UNCONF_INDEX_LIST = 0x0036, Opcode::READ_CONFIG_INFO = 0x0037, Opcode::SET_EXTERNAL_CONFIG = 0x0038,
  Opcode::SET_PUBLIC_ADDRESS = 0x0039, Opcode::START_SERVICE_DISCOVERY = 0x003A, Opcode::READ_LOCAL_OOB_EXT_DATA = 0x003B, Opcode::READ_EXT_INDEX_LIST = 0x003C,
  Opcode::READ_ADV_FEATURES = 0x003D, Opcode::ADD_ADVERTISING = 0x003E, Opcode::REMOVE_ADVERTISING = 0x003F, Opcode::GET_ADV_SIZE_INFO = 0x0040,
  Opcode::START_LIMITED_DISCOVERY = 0x0041, Opcode::READ_EXT_INFO = 0x0042, Opcode::SET_APPEARANCE = 0x0043, Opcode::GET_PHY_CONFIGURATION = 0x0044,
  Opcode::SET_PHY_CONFIGURATION = 0x0045, Opcode::SET_BLOCKED_KEYS = 0x0046, Opcode::SET_WIDEBAND_SPEECH = 0x0047, Opcode::READ_SECURITY_INFO = 0x0048,
  Opcode::READ_EXP_FEATURES_INFO = 0x0049, Opcode::SET_EXP_FEATURE = 0x004a, Opcode::READ_DEF_SYSTEM_CONFIG = 0x004b, Opcode::SET_DEF_SYSTEM_CONFIG = 0x004c,
  Opcode::READ_DEF_RUNTIME_CONFIG = 0x004d, Opcode::SET_DEF_RUNTIME_CONFIG = 0x004e, Opcode::GET_DEVICE_FLAGS = 0x004f, Opcode::SET_DEVICE_FLAGS = 0x0050,
  Opcode::READ_ADV_MONITOR_FEATURES = 0x0051, Opcode::ADD_ADV_PATTERNS_MONITOR = 0x0052, Opcode::REMOVE_ADV_MONITOR = 0x0053
}
 

Public Member Functions

 MgmtCommand (const Opcode opc, const uint16_t dev_id, const uint16_t param_size=0)
 
 MgmtCommand (const Opcode opc, const uint16_t dev_id, const uint16_t param_size, const uint8_t *param)
 
virtual ~MgmtCommand () noexcept override
 
Opcode getOpcode () const noexcept
 
const uint8_t * getParam () 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 op) noexcept
 
- 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

Definition at line 370 of file MgmtTypes.hpp.

Member Enumeration Documentation

◆ Opcode

enum direct_bt::MgmtCommand::Opcode : uint16_t
strong
Enumerator
READ_VERSION 
READ_COMMANDS 
READ_INDEX_LIST 
READ_INFO 
SET_POWERED 
SET_DISCOVERABLE 
SET_CONNECTABLE 
SET_FAST_CONNECTABLE 
SET_BONDABLE 
SET_LINK_SECURITY 
SET_SSP 

Secure Simple Pairing: 0x00 disabled, 0x01 enable.

SSP only available for BREDR >= 2.1 not single-mode LE.

SET_HS 
SET_LE 
SET_DEV_CLASS 
SET_LOCAL_NAME 
ADD_UUID 
REMOVE_UUID 
LOAD_LINK_KEYS 
LOAD_LONG_TERM_KEYS 
DISCONNECT 
GET_CONNECTIONS 
PIN_CODE_REPLY 
PIN_CODE_NEG_REPLY 
SET_IO_CAPABILITY 
PAIR_DEVICE 
CANCEL_PAIR_DEVICE 
UNPAIR_DEVICE 
USER_CONFIRM_REPLY 
USER_CONFIRM_NEG_REPLY 
USER_PASSKEY_REPLY 
USER_PASSKEY_NEG_REPLY 
READ_LOCAL_OOB_DATA 
ADD_REMOTE_OOB_DATA 
REMOVE_REMOTE_OOB_DATA 
START_DISCOVERY 
STOP_DISCOVERY 
CONFIRM_NAME 
BLOCK_DEVICE 
UNBLOCK_DEVICE 
SET_DEVICE_ID 
SET_ADVERTISING 
SET_BREDR 
SET_STATIC_ADDRESS 
SET_SCAN_PARAMS 
SET_SECURE_CONN 

LE Secure Connections: 0x01 enables SC mixed, 0x02 enables SC only mode; Core Spec >= 4.1.

SET_DEBUG_KEYS 
SET_PRIVACY 
LOAD_IRKS 
GET_CONN_INFO 
GET_CLOCK_INFO 
ADD_DEVICE_WHITELIST 
REMOVE_DEVICE_WHITELIST 
LOAD_CONN_PARAM 
READ_UNCONF_INDEX_LIST 
READ_CONFIG_INFO 
SET_EXTERNAL_CONFIG 
SET_PUBLIC_ADDRESS 
START_SERVICE_DISCOVERY 
READ_LOCAL_OOB_EXT_DATA 
READ_EXT_INDEX_LIST 
READ_ADV_FEATURES 
ADD_ADVERTISING 
REMOVE_ADVERTISING 
GET_ADV_SIZE_INFO 
START_LIMITED_DISCOVERY 
READ_EXT_INFO 
SET_APPEARANCE 
GET_PHY_CONFIGURATION 
SET_PHY_CONFIGURATION 
SET_BLOCKED_KEYS 
SET_WIDEBAND_SPEECH 
READ_SECURITY_INFO 
READ_EXP_FEATURES_INFO 
SET_EXP_FEATURE 
READ_DEF_SYSTEM_CONFIG 
SET_DEF_SYSTEM_CONFIG 
READ_DEF_RUNTIME_CONFIG 
SET_DEF_RUNTIME_CONFIG 
GET_DEVICE_FLAGS 
SET_DEVICE_FLAGS 
READ_ADV_MONITOR_FEATURES 
ADD_ADV_PATTERNS_MONITOR 
REMOVE_ADV_MONITOR 

Definition at line 373 of file MgmtTypes.hpp.

Constructor & Destructor Documentation

◆ MgmtCommand() [1/2]

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

Definition at line 494 of file MgmtTypes.hpp.

◆ MgmtCommand() [2/2]

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

Definition at line 500 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ ~MgmtCommand()

virtual direct_bt::MgmtCommand::~MgmtCommand ( )
inlineoverridevirtualnoexcept

Definition at line 507 of file MgmtTypes.hpp.

Member Function Documentation

◆ baseString()

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

Reimplemented from direct_bt::MgmtMsg.

Definition at line 482 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ checkOpcode() [1/2]

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

Definition at line 474 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ checkOpcode() [2/2]

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

Definition at line 466 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ getOpcode()

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

Definition at line 509 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ getOpcodeString()

std::string MgmtCommand::getOpcodeString ( const Opcode  op)
staticnoexcept

Definition at line 251 of file MgmtTypes.cpp.

Here is the caller graph for this function:

◆ getParam()

const uint8_t* direct_bt::MgmtCommand::getParam ( ) const
inlinenoexcept

Definition at line 511 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ number()

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

Definition at line 460 of file MgmtTypes.hpp.

◆ toString()

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

Implements direct_bt::MgmtMsg.

Definition at line 513 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::MgmtCommand::valueString ( ) const
inlineoverrideprotectedvirtualnoexcept

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