flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
Loading...
Searching...
No Matches
logging.h File Reference

This module handles various logging capabilities. More...

#include <stdbool.h>

Go to the source code of this file.

Enumerations

enum  {
  PTP_LOG_DEF , PTP_LOG_CORR_FIELD , PTP_LOG_TIMESTAMPS , PTP_LOG_INFO ,
  PTP_LOG_LOCKED_STATE , PTP_LOG_BMCA , PTP_LOG_N
}
 Collection type of possible predefined PTP log types. More...
 

Functions

void ptp_log_enable (int logId, bool en)
 
void ptp_log_disable_all ()
 

Detailed Description

This module handles various logging capabilities.

Definition in file logging.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Collection type of possible predefined PTP log types.

Enumerator
PTP_LOG_DEF 

Default PTP log, prints sync-cycle related data (e.g. time error, tuning, code word etc.).

PTP_LOG_CORR_FIELD 

The PTP engine will print the correction fields of particular PTP messages.

PTP_LOG_TIMESTAMPS 

The PTP engine will print the T1-T4/T6 timestamps (in E2E/P2P modes).

PTP_LOG_INFO 

If enabled, the user will be notified of unexpected events occurred and exceptions.

PTP_LOG_LOCKED_STATE 

Signals the user if the PTP engine consideres the clock have gotten locked.

PTP_LOG_BMCA 

Notifies the user about BMCA state changes.

PTP_LOG_N 

Definition at line 17 of file logging.h.

Function Documentation

◆ ptp_log_disable_all()

void ptp_log_disable_all ( )

Disable all logging features.

Definition at line 59 of file logging.c.

◆ ptp_log_enable()

void ptp_log_enable ( int  logId,
bool  en 
)

Enable or disable a specific kind of logging.

Parameters
logIdlog ID, one of the PTP_LOG_* values
enenabled/disabled logId kind of logging feature

Definition at line 45 of file logging.c.