Direct-BT v3.3.0-1-gc2d430c
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 ()=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

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

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

Protected Attributes

jau::POctets pdu
 
uint64_t ts_creation
 

Detailed Description

Definition at line 347 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 367 of file MgmtTypes.hpp.

◆ MgmtMsg() [2/2]

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

Definition at line 376 of file MgmtTypes.hpp.

◆ ~MgmtMsg()

virtual direct_bt::MgmtMsg::~MgmtMsg ( )
virtualdefault

Member Function Documentation

◆ baseString()

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

◆ valueString()

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

◆ getIntOpcode() [1/2]

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

Definition at line 360 of file MgmtTypes.hpp.

◆ getDevID() [1/2]

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

Definition at line 363 of file MgmtTypes.hpp.

Here is the caller graph for this function:

◆ 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 399 of file MgmtTypes.hpp.

◆ getTimestamp()

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

Definition at line 401 of file MgmtTypes.hpp.

◆ getTotalSize()

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

Definition at line 403 of file MgmtTypes.hpp.

Here is the caller graph for this function:

◆ getPDU()

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

Return the underlying octets read only.

Definition at line 406 of file MgmtTypes.hpp.

◆ getIntOpcode() [2/2]

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

Definition at line 408 of file MgmtTypes.hpp.

Here is the caller graph for this function:

◆ getDevID() [2/2]

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

Definition at line 409 of file MgmtTypes.hpp.

Here is the caller graph for this function:

◆ getParamSize()

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

Definition at line 410 of file MgmtTypes.hpp.

Here is the caller graph for this function:

◆ toString()

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

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

Here is the caller graph for this function:

Member Data Documentation

◆ pdu

jau::POctets direct_bt::MgmtMsg::pdu
protected

Definition at line 350 of file MgmtTypes.hpp.

◆ ts_creation

uint64_t direct_bt::MgmtMsg::ts_creation
protected

Definition at line 351 of file MgmtTypes.hpp.


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