forked from gatsby/df_datalink
service FSM add bit error rate and packet loss rate log
This commit is contained in:
@@ -213,6 +213,8 @@ typedef struct
|
||||
#ifdef DATALINK_ENABLE_BERTEST
|
||||
uint32_t bitTotal;
|
||||
uint32_t bitError;
|
||||
double lossRate;
|
||||
double errorRate;
|
||||
#endif
|
||||
} L2_SVC_FSM;
|
||||
|
||||
|
||||
@@ -404,10 +404,9 @@ int32_t L2_Service_Routine(L2_INST *instPtr, const L2_RTNE_TABLE_ENTRY *rtneEntr
|
||||
}
|
||||
#ifdef DATALINK_ENABLE_BERTEST
|
||||
uint32_t pktLoss;
|
||||
double errorRate, lossRate;
|
||||
pktLoss = instPtr->log.svcRecvCnt - instPtr->log.svcCorrectCnt;
|
||||
lossRate = (instPtr->log.svcRecvCnt == 0) ? 0 : (double)pktLoss / (double)instPtr->serviceFsm.pktRecv;
|
||||
errorRate = (instPtr->serviceFsm.bitTotal == 0) ? 0 : (double)instPtr->serviceFsm.bitError / (double)instPtr->serviceFsm.bitTotal;
|
||||
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;
|
||||
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);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user