PTP functions specific to the implementation. More...
#include <stdlib.h>
#include "ptp_util.h"
#include "ptp.h"
#include "ptp_const.h"
#include "ptp_cfg.h"
#include "ptp_types.h"
#include "ptp_messages.h"
#include "clock.h"
#include "nwk.h"
Go to the source code of this file.
Variables | |
ptp_recommendedState | ptp_portRecommendedState [PTP_NUMBERPORTS] |
Recommended portState set by BMC (Best Master Clock) Algorithm. | |
PTP_announceDS | ptp_announce [PTP_NUMBERPORTS] |
Last announce message received for each port. | |
PTP functions specific to the implementation.
Definition in file ptp_util.c.
void ptp_bmc | ( | ) |
Best master clock.
This function executes the BMC algorithm, this is not the standard algorithm specified on the IEC 61588/IEEE 1588 standard, it is an adaptation to PTP working on a ZigBee network with P2P where the master is always the parent node and the GrandMasterClock is the coordinator. If the port have no connection, the recommendation is to stay on listening state. IEC 61588-2009 / IEEE 1588-2008 9.3.1 b) doesn't describe the listening return value. IEC 61588-2009 / IEEE 1588-2008 9.2.6.8 and 9.3.1 b)
Definition at line 274 of file ptp_util.c.
References nwk_getNeighborAddress(), PTP_BMC_LISTENING, PTP_BMC_M1, PTP_BMC_M2, PTP_BMC_M3, PTP_BMC_P1, PTP_BMC_P2, PTP_BMC_S1, ptp_clockIdentityCompare(), ptp_dataSetComparisonDE(), ptp_dataSetComparisonEE(), ptp_portRecommendedState, and PTP_ZEROSEQ64.
Referenced by ptp_state_decision_event().
void ptp_portUpdateDS | ( | ) |
Port update data set.
This function updates data sets for all ports. IEC 61588-2009 / IEEE 1588-2008 9.2.6.8 and 9.3.5
Definition at line 344 of file ptp_util.c.
References nwk_getNeighborAddress(), nwk_getNeighborForeignPort(), PTP_BMC_M1, PTP_BMC_M2, PTP_BMC_M3, PTP_BMC_P1, PTP_BMC_P2, PTP_BMC_S1, PTP_DESIGNTIME_UTCOFFSET, and ptp_portRecommendedState.
Referenced by ptp_state_decision_event().
void ptp_portUpdateStatus | ( | ) |
Port update status.
This function updates the status for all ports.
Definition at line 445 of file ptp_util.c.
References PTP_BMC_M1, PTP_BMC_M2, PTP_BMC_M3, PTP_BMC_P1, PTP_BMC_P2, PTP_BMC_S1, and ptp_portRecommendedState.
Referenced by ptp_state_decision_event().