Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
direct_bt::MgmtMsg Class Referenceabstract

#include <MgmtTypes.hpp>

Inheritance diagram for direct_bt::MgmtMsg:
Collaboration diagram for direct_bt::MgmtMsg:

Public Member Functions

 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
 
virtual std::string toString () const noexcept=0
 

Static Public Member Functions

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
 
virtual std::string valueString () const noexcept=0
 

Protected Attributes

POctets pdu
 
uint64_t ts_creation
 

Detailed Description

Definition at line 304 of file MgmtTypes.hpp.

Constructor & Destructor Documentation

◆ MgmtMsg() [1/2]

direct_bt::MgmtMsg::MgmtMsg ( const uint16_t  opc,
const uint16_t  dev_id,
const uint16_t  param_size 
)
inline

Definition at line 324 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ MgmtMsg() [2/2]

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

Definition at line 332 of file MgmtTypes.hpp.

◆ ~MgmtMsg()

virtual direct_bt::MgmtMsg::~MgmtMsg ( )
inlinevirtual

Definition at line 336 of file MgmtTypes.hpp.

Member Function Documentation

◆ baseString()

virtual std::string direct_bt::MgmtMsg::baseString ( ) const
inlineprotectedvirtualnoexcept

◆ clone()

template<class T >
static T* direct_bt::MgmtMsg::clone ( const T &  source)
inlinestaticnoexcept

Clone template for convenience, based on derived class's copy-constructor.


MgmtEvent callback example:

bool mgmtEvDeviceUnpairedMgmt(const MgmtEvent& e) noexcept {
    const MgmtEvtDeviceUnpaired &event = *static_cast<const MgmtEvtDeviceUnpaired *>(&e);
    MgmtMsg * b1 = MgmtMsg::clone(event);
    MgmtEvtDeviceUnpaired * b2 = MgmtMsg::clone(event);
    .. do something ..
}
Template Parameters
TThe derived definite class type, deducible by source argument
Parameters
sourcethe source to be copied
Returns
a new instance.

Definition at line 354 of file MgmtTypes.hpp.

◆ getDevID() [1/2]

uint16_t direct_bt::MgmtMsg::getDevID ( ) const
inlinenoexcept

Definition at line 364 of file MgmtTypes.hpp.

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

◆ getDevID() [2/2]

static uint16_t direct_bt::MgmtMsg::getDevID ( const uint8_t *  data)
inlinestatic

Definition at line 320 of file MgmtTypes.hpp.

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

◆ getIntOpcode() [1/2]

uint16_t direct_bt::MgmtMsg::getIntOpcode ( ) const
inlinenoexcept

Definition at line 363 of file MgmtTypes.hpp.

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

◆ getIntOpcode() [2/2]

static uint16_t direct_bt::MgmtMsg::getIntOpcode ( const uint8_t *  buffer)
inlinestatic

Definition at line 317 of file MgmtTypes.hpp.

Here is the call graph for this function:

◆ getParamSize()

uint16_t direct_bt::MgmtMsg::getParamSize ( ) const
inlinenoexcept

Definition at line 365 of file MgmtTypes.hpp.

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

◆ getPDU()

TROOctets& direct_bt::MgmtMsg::getPDU ( )
inlinenoexcept

Return the underlying octets read only.

Definition at line 361 of file MgmtTypes.hpp.

◆ getTimestamp()

uint64_t direct_bt::MgmtMsg::getTimestamp ( ) const
inlinenoexcept

Definition at line 356 of file MgmtTypes.hpp.

◆ getTotalSize()

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

Definition at line 358 of file MgmtTypes.hpp.

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

◆ toString()

virtual std::string direct_bt::MgmtMsg::toString ( ) const
pure virtualnoexcept

Implemented in direct_bt::MgmtEvent, and direct_bt::MgmtCommand.

Here is the caller graph for this function:

◆ valueString()

virtual std::string direct_bt::MgmtMsg::valueString ( ) const
protectedpure virtualnoexcept

Member Data Documentation

◆ pdu

POctets direct_bt::MgmtMsg::pdu
protected

Definition at line 307 of file MgmtTypes.hpp.

◆ ts_creation

uint64_t direct_bt::MgmtMsg::ts_creation
protected

Definition at line 308 of file MgmtTypes.hpp.


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