*bugfix: name error
This commit is contained in:
@@ -230,8 +230,8 @@ int32_t L2_Service_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
|||||||
{
|
{
|
||||||
ASSERT(instPtr != NULL);
|
ASSERT(instPtr != NULL);
|
||||||
ASSERT(msg != NULL);
|
ASSERT(msg != NULL);
|
||||||
#ifndef DATALINK_ENABLE_BERTEST
|
|
||||||
int32_t Status;
|
int32_t Status;
|
||||||
|
#ifndef DATALINK_ENABLE_BERTEST
|
||||||
uint8_t frameType;
|
uint8_t frameType;
|
||||||
L2_FrameGetChunk(msg, L2_MSG_TYPE, L2_MSG_TYPE_LEN, &frameType);
|
L2_FrameGetChunk(msg, L2_MSG_TYPE, L2_MSG_TYPE_LEN, &frameType);
|
||||||
switch (frameType)
|
switch (frameType)
|
||||||
@@ -319,13 +319,13 @@ int32_t L2_Service_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
|||||||
return Status;
|
return Status;
|
||||||
#else
|
#else
|
||||||
uint32_t errorBits = 0;
|
uint32_t errorBits = 0;
|
||||||
for (int i = 0; i < SVC_PACK_LEN; i++)
|
for (int i = 0; i < L2_SVC_PACK_LEN; i++)
|
||||||
{
|
{
|
||||||
errorBits += count_ones(msg[i] ^ testData[i]);
|
errorBits += count_ones(msg[i] ^ testData[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
instPtr->serviceFsm.bitError += errorBits;
|
instPtr->serviceFSM->bitError += errorBits;
|
||||||
instPtr->serviceFsm.bitTotal += SVC_PACK_LEN * 8;
|
instPtr->serviceFSM->bitTotal += L2_SVC_PACK_LEN * 8;
|
||||||
|
|
||||||
// Calculate time deviation
|
// Calculate time deviation
|
||||||
uint32_t frameNum, slotNum = 0;
|
uint32_t frameNum, slotNum = 0;
|
||||||
@@ -335,7 +335,7 @@ int32_t L2_Service_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
|||||||
if (Status != SUCCESS)
|
if (Status != SUCCESS)
|
||||||
{
|
{
|
||||||
DBG_ERROR("Failed to compute time deviation.\n")
|
DBG_ERROR("Failed to compute time deviation.\n")
|
||||||
break;
|
return Status;
|
||||||
}
|
}
|
||||||
// Implement a auto time sync.
|
// Implement a auto time sync.
|
||||||
if (L2_GetNodeType(instPtr) != L2_NODE_HEAD)
|
if (L2_GetNodeType(instPtr) != L2_NODE_HEAD)
|
||||||
@@ -343,6 +343,7 @@ int32_t L2_Service_PktHandler(L2_INST *instPtr, uint8_t *msg)
|
|||||||
// Time sync.
|
// Time sync.
|
||||||
L2_TimeAdjust(instPtr, &(instPtr->log.timeDev));
|
L2_TimeAdjust(instPtr, &(instPtr->log.timeDev));
|
||||||
}
|
}
|
||||||
|
return SUCCESS;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,7 +391,7 @@ int32_t L2_Service_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntr
|
|||||||
// Packing service data
|
// Packing service data
|
||||||
Service_Packing(instPtr, L2_SVC_FRAME, rtneEntry->dst);
|
Service_Packing(instPtr, L2_SVC_FRAME, rtneEntry->dst);
|
||||||
#else
|
#else
|
||||||
memcpy(instPtr->sendPktData, testData, SVC_PACK_LEN);
|
memcpy(instPtr->sendPktData, testData, L2_SVC_PACK_LEN);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
// FIXME: Steer antenna to point to destination.
|
// FIXME: Steer antenna to point to destination.
|
||||||
@@ -407,8 +408,8 @@ int32_t L2_Service_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntr
|
|||||||
pktLoss = instPtr->log.svcRecvCnt - instPtr->log.svcCorrectCnt;
|
pktLoss = instPtr->log.svcRecvCnt - instPtr->log.svcCorrectCnt;
|
||||||
instPtr->serviceFSM->lossRate = (instPtr->log.svcRecvCnt == 0) ? 0 : (double)pktLoss / (double)instPtr->serviceFSM->pktRecv;
|
instPtr->serviceFSM->lossRate = (instPtr->log.svcRecvCnt == 0) ? 0 : (double)pktLoss / (double)instPtr->serviceFSM->pktRecv;
|
||||||
instPtr->serviceFSM->errorRate = (instPtr->serviceFSM->bitTotal == 0) ? 0 : (double)instPtr->serviceFSM->bitError / (double)instPtr->serviceFSM->bitTotal;
|
instPtr->serviceFSM->errorRate = (instPtr->serviceFSM->bitTotal == 0) ? 0 : (double)instPtr->serviceFSM->bitError / (double)instPtr->serviceFSM->bitTotal;
|
||||||
DBG_PRINT("Packet Loss Rate -- Total: %lu, Loss: %lu.\n", instPtr->serviceFsm.pktRecv, pktLoss);
|
DBG_PRINT("Packet Loss Rate -- Total: %lu, Loss: %lu.\n", instPtr->serviceFSM->pktRecv, pktLoss);
|
||||||
DBG_PRINT("Bit Error Rate -- Total:%lu, Error:%lu.\n", instPtr->serviceFsm.bitTotal, instPtr->serviceFsm.bitError);
|
DBG_PRINT("Bit Error Rate -- Total:%lu, Error:%lu.\n", instPtr->serviceFSM->bitTotal, instPtr->serviceFSM->bitError);
|
||||||
#endif
|
#endif
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user