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

Build TLV to send a PTP management message. More...

#include <msgCall.h>

Inheritance diagram for MessageBuilder:
Inheritance graph
[legend]
Collaboration diagram for MessageBuilder:
Collaboration graph
[legend]

Public Member Functions

 MessageBuilder (Message &msg)
 
MessagegetMsg ()
 
void clear ()
 
bool buildTlv (actionField_e actionField, mng_vals_e tlv_id)
 
- Public Member Functions inherited from BaseMngBuildCallback
virtual bool USER_DESCRIPTION_b (const Message &msg, USER_DESCRIPTION_t &tlv)
 
virtual bool INITIALIZE_b (const Message &msg, INITIALIZE_t &tlv)
 
virtual bool PRIORITY1_b (const Message &msg, PRIORITY1_t &tlv)
 
virtual bool PRIORITY2_b (const Message &msg, PRIORITY2_t &tlv)
 
virtual bool DOMAIN_b (const Message &msg, DOMAIN_t &tlv)
 
virtual bool SLAVE_ONLY_b (const Message &msg, SLAVE_ONLY_t &tlv)
 
virtual bool LOG_ANNOUNCE_INTERVAL_b (const Message &msg, LOG_ANNOUNCE_INTERVAL_t &tlv)
 
virtual bool ANNOUNCE_RECEIPT_TIMEOUT_b (const Message &msg, ANNOUNCE_RECEIPT_TIMEOUT_t &tlv)
 
virtual bool LOG_SYNC_INTERVAL_b (const Message &msg, LOG_SYNC_INTERVAL_t &tlv)
 
virtual bool VERSION_NUMBER_b (const Message &msg, VERSION_NUMBER_t &tlv)
 
virtual bool TIME_b (const Message &msg, TIME_t &tlv)
 
virtual bool CLOCK_ACCURACY_b (const Message &msg, CLOCK_ACCURACY_t &tlv)
 
virtual bool UTC_PROPERTIES_b (const Message &msg, UTC_PROPERTIES_t &tlv)
 
virtual bool TRACEABILITY_PROPERTIES_b (const Message &msg, TRACEABILITY_PROPERTIES_t &tlv)
 
virtual bool TIMESCALE_PROPERTIES_b (const Message &msg, TIMESCALE_PROPERTIES_t &tlv)
 
virtual bool UNICAST_NEGOTIATION_ENABLE_b (const Message &msg, UNICAST_NEGOTIATION_ENABLE_t &tlv)
 
virtual bool PATH_TRACE_ENABLE_b (const Message &msg, PATH_TRACE_ENABLE_t &tlv)
 
virtual bool GRANDMASTER_CLUSTER_TABLE_b (const Message &msg, GRANDMASTER_CLUSTER_TABLE_t &tlv)
 
virtual bool UNICAST_MASTER_TABLE_b (const Message &msg, UNICAST_MASTER_TABLE_t &tlv)
 
virtual bool ACCEPTABLE_MASTER_TABLE_b (const Message &msg, ACCEPTABLE_MASTER_TABLE_t &tlv)
 
virtual bool ACCEPTABLE_MASTER_TABLE_ENABLED_b (const Message &msg, ACCEPTABLE_MASTER_TABLE_ENABLED_t &tlv)
 
virtual bool ALTERNATE_MASTER_b (const Message &msg, ALTERNATE_MASTER_t &tlv)
 
virtual bool ALTERNATE_TIME_OFFSET_ENABLE_b (const Message &msg, ALTERNATE_TIME_OFFSET_ENABLE_t &tlv)
 
virtual bool ALTERNATE_TIME_OFFSET_NAME_b (const Message &msg, ALTERNATE_TIME_OFFSET_NAME_t &tlv)
 
virtual bool ALTERNATE_TIME_OFFSET_PROPERTIES_b (const Message &msg, ALTERNATE_TIME_OFFSET_PROPERTIES_t &tlv)
 
virtual bool LOG_MIN_PDELAY_REQ_INTERVAL_b (const Message &msg, LOG_MIN_PDELAY_REQ_INTERVAL_t &tlv)
 
virtual bool PRIMARY_DOMAIN_b (const Message &msg, PRIMARY_DOMAIN_t &tlv)
 
virtual bool DELAY_MECHANISM_b (const Message &msg, DELAY_MECHANISM_t &tlv)
 
virtual bool EXTERNAL_PORT_CONFIGURATION_ENABLED_b (const Message &msg, EXTERNAL_PORT_CONFIGURATION_ENABLED_t &tlv)
 
virtual bool MASTER_ONLY_b (const Message &msg, MASTER_ONLY_t &tlv)
 
virtual bool HOLDOVER_UPGRADE_ENABLE_b (const Message &msg, HOLDOVER_UPGRADE_ENABLE_t &tlv)
 
virtual bool EXT_PORT_CONFIG_PORT_DATA_SET_b (const Message &msg, EXT_PORT_CONFIG_PORT_DATA_SET_t &tlv)
 
virtual bool GRANDMASTER_SETTINGS_NP_b (const Message &msg, GRANDMASTER_SETTINGS_NP_t &tlv)
 
virtual bool PORT_DATA_SET_NP_b (const Message &msg, PORT_DATA_SET_NP_t &tlv)
 
virtual bool SUBSCRIBE_EVENTS_NP_b (const Message &msg, SUBSCRIBE_EVENTS_NP_t &tlv)
 
virtual bool SYNCHRONIZATION_UNCERTAIN_NP_b (const Message &msg, SYNCHRONIZATION_UNCERTAIN_NP_t &tlv)
 
virtual bool POWER_PROFILE_SETTINGS_NP_b (const Message &msg, POWER_PROFILE_SETTINGS_NP_t &tlv)
 

Detailed Description

Build TLV to send a PTP management message.

Note
You must inherit this class to use it!
Class allocate TLV object and store it,
buildTlv() has an implementation in lua, tcl and go languages, other languages uses swig to translate this class.

Constructor & Destructor Documentation

◆ MessageBuilder()

MessageBuilder::MessageBuilder ( Message msg)
inline

Construct a message TLV builder

Parameters
[in]msgMessage object

Member Function Documentation

◆ buildTlv()

bool MessageBuilder::buildTlv ( actionField_e  actionField,
mng_vals_e  tlv_id 
)

Allocate a management TLV, use a call-back to set its values and assign it with the Message object ready for sending

Parameters
[in]actionFieldaction type
[in]tlv_idTLV ID to send
Returns
true if setAction() succes
Note
This function calls Message.setAction
For empty TLV or GET action, the function will call setAction without TLV

◆ clear()

void MessageBuilder::clear ( )
inline

Clear the tlv in the Message object

◆ getMsg()

Message& MessageBuilder::getMsg ( )
inline

Get reference to the Message object

Returns
reference to the msg Message object

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