libptpmgmt  1.4
libptpmgmt library that provides the functionality of linuxptp pmc
Public Member Functions | List of all members
Json2msg Class Reference

#include <json.h>

Public Member Functions

bool fromJson (const std::string &json)
 
mng_vals_e managementId () const
 
const BaseMngTlvdataField () const
 
actionField_e actionField () const
 
bool isUnicast () const
 
bool haveIsUnicast () const
 
uint8_t PTPProfileSpecific () const
 
bool havePTPProfileSpecific () const
 
uint8_t domainNumber () const
 
bool haveDomainNumber () const
 
uint8_t versionPTP () const
 
bool haveVersionPTP () const
 
uint8_t minorVersionPTP () const
 
bool haveMinorVersionPTP () const
 
uint16_t sequenceId () const
 
bool haveSequenceId () const
 
uint32_t sdoId () const
 
bool haveSdoId () const
 
const PortIdentity_tsrcPort () const
 
bool haveSrcPort () const
 
const PortIdentity_tdstPort () const
 
bool haveDstPort () const
 
bool setAction (Message &message) const
 

Detailed Description

Parse JSON to PTP management message Class provide converting function and store the result of the parsing.

Member Function Documentation

◆ actionField()

actionField_e Json2msg::actionField ( ) const
inline

Get action field

Returns
action field

◆ dataField()

const BaseMngTlv* Json2msg::dataField ( ) const
inline

Get dataField

Returns
dataField pointer or null
Note
User should not try to free this TLV object

◆ domainNumber()

uint8_t Json2msg::domainNumber ( ) const
inline

Get domain number

Returns
domain number

◆ dstPort()

const PortIdentity_t& Json2msg::dstPort ( ) const
inline

Get target port ID

Returns
target port ID

◆ fromJson()

bool Json2msg::fromJson ( const std::string &  json)

Convert JSON string to message

Parameters
[in]jsonstring
Returns
true if parsing success

◆ haveDomainNumber()

bool Json2msg::haveDomainNumber ( ) const
inline

Is domain number in JSON?

Returns
true if domain number in JSON

◆ haveDstPort()

bool Json2msg::haveDstPort ( ) const
inline

Is target port ID in JSON?

Returns
true if target port ID in JSON

◆ haveIsUnicast()

bool Json2msg::haveIsUnicast ( ) const
inline

Is Unicast flag in JSON?

Returns
true if Unicast flag in JSON

◆ haveMinorVersionPTP()

bool Json2msg::haveMinorVersionPTP ( ) const
inline

Is PTP minor version in JSON?

Returns
true if PTP minor version in JSON

◆ havePTPProfileSpecific()

bool Json2msg::havePTPProfileSpecific ( ) const
inline

Is PTP profile specific in JSON?

Returns
true if PTP profile specific in JSON

◆ haveSdoId()

bool Json2msg::haveSdoId ( ) const
inline

Is sdoId in JSON?

Returns
true if sdoId in JSON

◆ haveSequenceId()

bool Json2msg::haveSequenceId ( ) const
inline

Is sequence ID in JSON?

Returns
true if sequence ID in JSON

◆ haveSrcPort()

bool Json2msg::haveSrcPort ( ) const
inline

Is source port ID in JSON?

Returns
true if source port ID in JSON

◆ haveVersionPTP()

bool Json2msg::haveVersionPTP ( ) const
inline

Is PTP major version in JSON?

Returns
true if PTP major version in JSON

◆ isUnicast()

bool Json2msg::isUnicast ( ) const
inline

Get Unicast flag

Returns
Unicast flag

◆ managementId()

mng_vals_e Json2msg::managementId ( ) const
inline

Get management ID

Returns
management ID

◆ minorVersionPTP()

uint8_t Json2msg::minorVersionPTP ( ) const
inline

Get PTP minor version

Returns
PTP minor version

◆ PTPProfileSpecific()

uint8_t Json2msg::PTPProfileSpecific ( ) const
inline

Get PTP profile specific

Returns
PTP profile specific

◆ sdoId()

uint32_t Json2msg::sdoId ( ) const
inline

Get sdoId

Returns
sdoId

◆ sequenceId()

uint16_t Json2msg::sequenceId ( ) const
inline

Get sequence ID

Returns
sequence ID

◆ setAction()

bool Json2msg::setAction ( Message message) const
inline

Call message setAction with parsed JSON

Returns
message setAction result

◆ srcPort()

const PortIdentity_t& Json2msg::srcPort ( ) const
inline

Get source port ID

Returns
source port ID

◆ versionPTP()

uint8_t Json2msg::versionPTP ( ) const
inline

Get PTP major version

Returns
PTP major version

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