Commit 68d0f8e0 authored by Omar Gabella's avatar Omar Gabella

KM3NET BROADCAST BASE : WR (signaling) messages for specific CLBs was targeted a.k.a targetIdentity

parent 26b16851
......@@ -107,6 +107,10 @@ struct FaultRecord { /* page 14 (34) -- never used */
/* Common Message header (table 18, page 124) */
typedef struct MsgHeader {
#ifdef BROADCAST_BASE
// KM3NeT: We need the targetIdentity of the packet for base modules
PortIdentity targetIdentity;
#endif
Nibble transportSpecific;
Enumeration4 messageType;
UInteger4 versionPTP;
......
......@@ -43,7 +43,18 @@ int wr_calibrated(struct pp_instance *ppi, unsigned char *pkt, int plen)
ppi->next_state = WRS_RESP_CALIB_REQ;
else if ((wrp->msgTmpWrMessageID == WR_MODE_ON) &&
(wrp->wrMode == WR_SLAVE))
{
#ifdef BROADCAST_BASE
if (memcmp(ppi->received_ptp_header.targetIdentity.clockIdentity.id,
DSPOR(ppi)->portIdentity.clockIdentity.id,
P_CLOCK_IDENTITY_LENGTH)!=0)
{
ppi->next_state = WRS_WR_LINK_ON;
}
#else
ppi->next_state = WRS_WR_LINK_ON;
#endif // BROADCAST_BASE
}
}
#endif // BROADCAST_NODE
......
......@@ -44,7 +44,18 @@ int wr_locked(struct pp_instance *ppi, unsigned char *pkt, int plen)
&(wrp->msgTmpWrMessageID));
if (wrp->msgTmpWrMessageID == CALIBRATE)
{
#ifdef BROADCAST_BASE
if (memcmp(ppi->received_ptp_header.targetIdentity.clockIdentity.id,
DSPOR(ppi)->portIdentity.clockIdentity.id,
PP_CLOCK_IDENTITY_LENGTH)!=0)
{
ppi->next_state = WRS_RESP_CALIB_REQ;
}
#else
ppi->next_state = WRS_RESP_CALIB_REQ;
#endif // BROADCAST_BASE
}
}
#endif // BROADCAST_NODE
......
......@@ -48,7 +48,18 @@ int wr_present(struct pp_instance *ppi, unsigned char *pkt, int plen)
&(wrp->msgTmpWrMessageID));
if (wrp->msgTmpWrMessageID == LOCK)
{
#ifdef BROADCAST_BASE
if (memcmp(ppi->received_ptp_header.targetIdentity.clockIdentity.id,
DSPOR(ppi)->portIdentity.clockIdentity.id,
PP_CLOCK_IDENTITY_LENGTH)!=0)
{
ppi->next_state = WRS_S_LOCK;
}
#else
ppi->next_state = WRS_S_LOCK;
#endif // BROADCAST_BASE
}
}
#endif // BROADCAST_NODE
......
......@@ -45,12 +45,23 @@ int wr_resp_calib_req(struct pp_instance *ppi, unsigned char *pkt, int plen)
&(wrp->msgTmpWrMessageID));
if (wrp->msgTmpWrMessageID == CALIBRATED) {
#ifdef BROADCAST_BASE
if (memcmp(ppi->received_ptp_header.targetIdentity.clockIdentity.id,
DSPOR(ppi)->portIdentity.clockIdentity.id,
PP_CLOCK_IDENTITY_LENGTH)!=0)
{
if (send_pattern)
wrp->ops->calib_pattern_disable(ppi);
ppi->next_state = WRS_CALIBRATION;
}
#else
if (send_pattern)
wrp->ops->calib_pattern_disable(ppi);
if (wrp->wrMode == WR_MASTER)
ppi->next_state = WRS_WR_LINK_ON;
else
ppi->next_state = WRS_CALIBRATION;
#endif // BROADCAST_BASE
}
}
#endif // BROADCAST_NODE
......
......@@ -35,6 +35,14 @@ int msg_unpack_header(struct pp_instance *ppi, void *buf, int plen)
hdr->sequenceId = htons(*(UInteger16 *) (buf + 30));
hdr->logMessageInterval = (*(Integer8 *) (buf + 33));
#ifdef BROADCAST_BASE
// KM3NeT: If the message is a Signaling, I associate the targetIdentity with the header.
if(hdr->messageType == PPM_SIGNALING)
{
memcpy(hdr->targetIdentity.clockIdentity.id,(buf+34),PP_CLOCK_IDENTITY_LENGTH);
hdr->targetIdentity.portNumber = (*(UInteger16 *) (buf + 42));
}
#endif
/*
* This FLAG_FROM_CURRENT_PARENT must be killed. Meanwhile, say it's
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment