libptpmgmt  1.3
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 managment TLV to JSON string

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