flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
Loading...
Searching...
No Matches
logging.c File Reference
#include "logging.h"
#include "ptp_core.h"
#include <flexptp_options.h>

Go to the source code of this file.

Data Structures

struct  PtpLogPair
 PTP log pair. More...
 

Typedefs

typedef void(* LogEnFn) (bool en)
 

Functions

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

Variables

static PtpLogPair sLogTable [PTP_LOG_N+1]
 

Typedef Documentation

◆ LogEnFn

typedef void(* LogEnFn) (bool en)

Prototype for callbacks that get called when a particular kind of log is turned on or off.

Parameters
enindicates if loggin is enabled of disabled

Definition at line 24 of file logging.c.

Function Documentation

◆ ptp_log_def_en()

static void ptp_log_def_en ( bool  en)
static

Definition at line 11 of file logging.c.

◆ 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.

Variable Documentation

◆ sLogTable

PtpLogPair sLogTable[PTP_LOG_N+1]
static
Initial value:
= {
{ PTP_LOG_DEF, ptp_log_def_en, &(S.logging.def) },
{ PTP_LOG_CORR_FIELD, NULL, &(S.logging.corr) },
{ PTP_LOG_TIMESTAMPS, NULL, &(S.logging.timestamps) },
{ PTP_LOG_INFO, NULL, &(S.logging.info) },
{ PTP_LOG_LOCKED_STATE, NULL, &(S.logging.locked) },
{ PTP_LOG_BMCA, NULL, &(S.logging.bmca) },
{ -1, NULL, NULL }
}
static void ptp_log_def_en(bool en)
Definition: logging.c:11
@ PTP_LOG_BMCA
Notifies the user about BMCA state changes.
Definition: logging.h:23
@ PTP_LOG_INFO
If enabled, the user will be notified of unexpected events occurred and exceptions.
Definition: logging.h:21
@ PTP_LOG_CORR_FIELD
The PTP engine will print the correction fields of particular PTP messages.
Definition: logging.h:19
@ PTP_LOG_LOCKED_STATE
Signals the user if the PTP engine consideres the clock have gotten locked.
Definition: logging.h:22
@ PTP_LOG_TIMESTAMPS
The PTP engine will print the T1-T4/T6 timestamps (in E2E/P2P modes).
Definition: logging.h:20
@ PTP_LOG_DEF
Default PTP log, prints sync-cycle related data (e.g. time error, tuning, code word etc....
Definition: logging.h:18

Definition at line 35 of file logging.c.