flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
Loading...
Searching...
No Matches
common.c File Reference
#include "common.h"
#include "ptp_core.h"
#include "task_ptp.h"
#include "msg_utils.h"
#include "ptp_defs.h"
#include "ptp_types.h"

Go to the source code of this file.

Functions

void ptp_init_delay_req_header ()
 
void ptp_send_delay_req_message ()
 
void ptp_send_pdelay_resp_follow_up (const RawPtpMessage *pMsg)
 
void ptp_send_pdelay_resp (const RawPtpMessage *pMsg)
 
void ptp_compute_mean_path_delay_e2e (const TimestampI *pTs, const uint64_t *pCf, TimestampI *pMPD)
 
void ptp_compute_mean_path_delay_p2p (const TimestampI *pTs, const uint64_t *pCf, TimestampI *pMPD)
 
void ptp_common_reset ()
 

Variables

static PtpHeader delReqHeader
 header for sending Delay_Reg messages
 
static RawPtpMessage pdelRespMsg
 whole, compiled PDelay_Resp message
 
static RawPtpMessage pdelRespFUpMsg
 whole, compiled PDelay_Resp_Follow_Up message
 

Function Documentation

◆ ptp_common_reset()

void ptp_common_reset ( )

Reset functionality shared with both slave and master.

Definition at line 156 of file common.c.

◆ ptp_compute_mean_path_delay_e2e()

void ptp_compute_mean_path_delay_e2e ( const TimestampI pTs,
const uint64_t *  pCf,
TimestampI pMPD 
)

Compute Mean Path Delay when operating in E2E mode.

Parameters
pTspointer to array holding T1-T4 timestamps
pCfpointer to array holding correction fields associated with T1-T4 timestamps
pMPDpointer to area where the MPD gets stored

Definition at line 128 of file common.c.

◆ ptp_compute_mean_path_delay_p2p()

void ptp_compute_mean_path_delay_p2p ( const TimestampI pTs,
const uint64_t *  pCf,
TimestampI pMPD 
)

Compute Mean Path Delay when operating in P2P mode.

Parameters
pTspointer to array holding T1-T4 timestamps
pCfpointer to array holding correction fields associated with T1-T4 timestamps
pMPDpointer to area where the MPD gets stored

Definition at line 141 of file common.c.

◆ ptp_init_delay_req_header()

void ptp_init_delay_req_header ( )

Initialize Delay_Request header.

Definition at line 20 of file common.c.

◆ ptp_send_delay_req_message()

void ptp_send_delay_req_message ( )

Construct and send Delay_Req message.

Definition at line 39 of file common.c.

◆ ptp_send_pdelay_resp()

void ptp_send_pdelay_resp ( const RawPtpMessage pMsg)

Send PDelay_Resp based on PDelay_Req.

Parameters
pMsgpointer to PDelay_Req message object

Definition at line 91 of file common.c.

◆ ptp_send_pdelay_resp_follow_up()

void ptp_send_pdelay_resp_follow_up ( const RawPtpMessage pMsg)

Send PDelay_Resp_Follow_Up based on already transmitted PDelay_Resp message.

Parameters
pMsgpointer to the PDelay_Resp message that forms the base of the Pdelay_Resp_Follow_Up message

Definition at line 61 of file common.c.

Variable Documentation

◆ delReqHeader

PtpHeader delReqHeader
static

header for sending Delay_Reg messages

Definition at line 14 of file common.c.

◆ pdelRespFUpMsg

RawPtpMessage pdelRespFUpMsg
static

whole, compiled PDelay_Resp_Follow_Up message

Definition at line 16 of file common.c.

◆ pdelRespMsg

RawPtpMessage pdelRespMsg
static

whole, compiled PDelay_Resp message

Definition at line 15 of file common.c.