libptpmgmt  1.4
libptpmgmt library that provides the functionality of linuxptp pmc
Classes | Functions
json.h File Reference

Convert a management or a signalling message to JSON. More...

#include "msg.h"
Include dependency graph for json.h:

Go to the source code of this file.

Classes

class  Json2msg
 

Functions

__PTPMGMT_NAMESPACE_BEGIN std::string msg2json (const Message &message, int indent=0)
 
std::string tlv2json (mng_vals_e managementId, const BaseMngTlv *tlv, int indent=0)
 

Detailed Description

Convert a management or a signalling message to JSON.

Author
Erez Geva <ErezGeva2@gmail.com>

Function Documentation

◆ msg2json()

__PTPMGMT_NAMESPACE_BEGIN std::string msg2json ( const Message message,
int  indent = 0 
)

Convert Message to JSON string

Parameters
[in]messagereceived from PTP entity
[in]indentbase indent for the JSON string
Returns
JSON string

◆ tlv2json()

std::string tlv2json ( mng_vals_e  managementId,
const BaseMngTlv tlv,
int  indent = 0 
)

Convert PTP management TLV to JSON string

Parameters
[in]managementIdPTP management TLV id
[in]tlvPTP management TLV
[in]indentbase indent for the JSON string
Returns
JSON string