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

Public Member Functions

 MgmtCommand (const Opcode opc, const uint16_t dev_id, const uint16_t param_size, const uint8_t *param)
 
 MgmtCommand (const Opcode opc, const uint16_t dev_id, const uint16_t param_size=0)
 
 ~MgmtCommand () noexcept override=default
 
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 ()=default
 
uint16_t getDevID () const noexcept
 
uint16_t getIntOpcode () const noexcept
 
uint16_t getParamSize () const noexcept
 
jau::TROOctetsgetPDU () noexcept
 Return the underlying octets read only. More...
 
uint64_t getTimestamp () const noexcept
 
jau::nsize_t getTotalSize () const noexcept
 
virtual std::string toString () const noexcept=0
 

Static Public Member Functions

static std::string getOpcodeString (const Opcode op) noexcept
 
static constexpr uint16_t number (const Opcode rhs) noexcept
 
- Static Public Member Functions inherited from direct_bt::MgmtMsg
template<class T >
static T * clone (const T &source) noexcept
 Clone template for convenience, based on derived class's copy-constructor. More...
 
static uint16_t getDevID (const uint8_t *data)
 
static uint16_t getIntOpcode (const uint8_t *buffer)
 

Protected Member Functions

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

Static Protected Member Functions

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

Additional Inherited Members

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

Detailed Description

Definition at line 415 of file MgmtTypes.hpp.

Member Enumeration Documentation

◆ Opcode

enum class 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 
LAST_OPC 

Definition at line 418 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 540 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 546 of file MgmtTypes.hpp.

◆ ~MgmtCommand()

direct_bt::MgmtCommand::~MgmtCommand ( )
overridedefaultnoexcept

Member Function Documentation

◆ number()

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

Definition at line 506 of file MgmtTypes.hpp.

◆ 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:

◆ checkOpcode() [1/2]

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

Definition at line 512 of file MgmtTypes.hpp.

◆ checkOpcode() [2/2]

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

Definition at line 520 of file MgmtTypes.hpp.

◆ baseString()

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

Reimplemented from direct_bt::MgmtMsg.

Definition at line 528 of file MgmtTypes.hpp.

◆ valueString()

std::string direct_bt::MgmtCommand::valueString ( ) const
inlineoverrideprotectedvirtualnoexcept

◆ getOpcode()

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

Definition at line 555 of file MgmtTypes.hpp.

◆ getParam()

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

Definition at line 557 of file MgmtTypes.hpp.

◆ toString()

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

Implements direct_bt::MgmtMsg.

Definition at line 559 of file MgmtTypes.hpp.

Here is the caller graph for this function:

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