reworked com stack.

- prepared for use of CRC8
- organized code in more files
- recv stats message now contains crc errors and io errors
This commit is contained in:
Martin Preuss
2023-04-07 19:13:54 +02:00
parent d0dea4aae5
commit 090122a192
22 changed files with 1326 additions and 1161 deletions

View File

@@ -333,23 +333,23 @@ void _processRecvStatsMessage(GWEN_MSG_ENDPOINT *ep, GWEN_MSG *nodeMsg)
packetsInInt=AQH_RecvStatsMsg_GetPacketsIn(nodeMsg);
if (packetsInInt) {
double packetsIn;
double errors;
double handled;
double errorsPercentage=0.0;
double handledPercentage=0.0;
double crcErrors;
double ioErrors;
double crcErrorsPercentage=0.0;
double ioErrorsPercentage=0.0;
packetsIn=(double) packetsInInt;
errors=(double)AQH_RecvStatsMsg_GetErrors(nodeMsg);
handled=(double)AQH_RecvStatsMsg_GetHandled(nodeMsg);
crcErrors=(double)AQH_RecvStatsMsg_GetCrcErrors(nodeMsg);
ioErrors=(double)AQH_RecvStatsMsg_GetIoErrors(nodeMsg);
errorsPercentage=errors*100.0/packetsIn;
handledPercentage=handled*100.0/packetsIn;
crcErrorsPercentage=crcErrors*100.0/packetsIn;
ioErrorsPercentage=ioErrors*100.0/packetsIn;
_publishInt(ep, AQH_RecvStatsMsg_GetUid(nodeMsg), 0, "net/packetsIn", packetsInInt);
_publishInt(ep, AQH_RecvStatsMsg_GetUid(nodeMsg), 0, "net/errors", (int) AQH_RecvStatsMsg_GetErrors(nodeMsg));
_publishInt(ep, AQH_RecvStatsMsg_GetUid(nodeMsg), 0, "net/handled", (int) AQH_RecvStatsMsg_GetHandled(nodeMsg));
_publishDouble(ep, AQH_RecvStatsMsg_GetUid(nodeMsg), 0, "net/errorsPercent", errorsPercentage);
_publishDouble(ep, AQH_RecvStatsMsg_GetUid(nodeMsg), 0, "net/handledPercent", handledPercentage);
_publishInt(ep, AQH_RecvStatsMsg_GetUid(nodeMsg), 0, "net/crcerrors", (int) AQH_RecvStatsMsg_GetCrcErrors(nodeMsg));
_publishInt(ep, AQH_RecvStatsMsg_GetUid(nodeMsg), 0, "net/ioerrors", (int) AQH_RecvStatsMsg_GetIoErrors(nodeMsg));
_publishDouble(ep, AQH_RecvStatsMsg_GetUid(nodeMsg), 0, "net/crcerrorsPercent", crcErrorsPercentage);
_publishDouble(ep, AQH_RecvStatsMsg_GetUid(nodeMsg), 0, "net/ioerrorsPercent", ioErrorsPercentage);
}
}