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

This module implements the Best Master Clock Algorithm. More...

#include "ptp_types.h"

Go to the source code of this file.

Functions

int ptp_select_better_master (PtpMasterProperties *pMP1, PtpMasterProperties *pMP2)
 
void ptp_handle_announce_msg (PtpAnnounceBody *pAnn, PtpHeader *pHeader)
 
void ptp_bmca_init ()
 
void ptp_bmca_destroy ()
 
void ptp_bmca_reset ()
 
void ptp_bmca_tick ()
 

Detailed Description

This module implements the Best Master Clock Algorithm.

Definition in file bmca.h.

Function Documentation

◆ ptp_bmca_destroy()

void ptp_bmca_destroy ( )

Destroy SBMC module.

Definition at line 205 of file bmca.c.

◆ ptp_bmca_init()

void ptp_bmca_init ( )

Initialize SBMC module.

Definition at line 191 of file bmca.c.

◆ ptp_bmca_reset()

void ptp_bmca_reset ( )

Reset the SBMC module.

Definition at line 209 of file bmca.c.

◆ ptp_bmca_tick()

void ptp_bmca_tick ( )

Call this to notify SBMC about the time passing.

Definition at line 72 of file bmca.c.

◆ ptp_handle_announce_msg()

void ptp_handle_announce_msg ( PtpAnnounceBody pAnn,
PtpHeader pHeader 
)

Handle announce messages.

Parameters
pAnnpointer to PtpAnnounceBody object
pHeaderpointer to Announce message header

Definition at line 135 of file bmca.c.

◆ ptp_select_better_master()

int ptp_select_better_master ( PtpMasterProperties pMP1,
PtpMasterProperties pMP2 
)

Select better master. (Not "best", with intent!)

Parameters
pMP1pointer to the first master's PtpMasterProperites object
pMP2pointer to the second master's PtpMasterProperites object
Returns
0: if pMP1 is better than pMP2, 1: if reversed

Definition at line 31 of file bmca.c.