Fix: Only count RF RX packets when packets where sent
This mainly occours after a reset of the statistics that receive count is higher then transmit count
This commit is contained in:
parent
67cae68e83
commit
8e26ef4e2e
@ -67,7 +67,9 @@ void HoymilesRadio::handleReceivedPackage()
|
||||
} else if (verifyResult == FRAGMENT_ALL_MISSING_TIMEOUT) {
|
||||
Hoymiles.getMessageOutput()->println("Nothing received, resend count exeeded");
|
||||
// Statistics: Count RX Fail No Answer
|
||||
if (inv->RadioStats.TxRequestData > 0) {
|
||||
inv->RadioStats.RxFailNoAnswer++;
|
||||
}
|
||||
|
||||
_commandQueue.pop();
|
||||
_busyFlag = false;
|
||||
@ -75,7 +77,9 @@ void HoymilesRadio::handleReceivedPackage()
|
||||
} else if (verifyResult == FRAGMENT_RETRANSMIT_TIMEOUT) {
|
||||
Hoymiles.getMessageOutput()->println("Retransmit timeout");
|
||||
// Statistics: Count RX Fail Partial Answer
|
||||
if (inv->RadioStats.TxRequestData > 0) {
|
||||
inv->RadioStats.RxFailPartialAnswer++;
|
||||
}
|
||||
|
||||
_commandQueue.pop();
|
||||
_busyFlag = false;
|
||||
@ -83,7 +87,9 @@ void HoymilesRadio::handleReceivedPackage()
|
||||
} else if (verifyResult == FRAGMENT_HANDLE_ERROR) {
|
||||
Hoymiles.getMessageOutput()->println("Packet handling error");
|
||||
// Statistics: Count RX Fail Corrupt Data
|
||||
if (inv->RadioStats.TxRequestData > 0) {
|
||||
inv->RadioStats.RxFailCorruptData++;
|
||||
}
|
||||
|
||||
_commandQueue.pop();
|
||||
_busyFlag = false;
|
||||
@ -101,7 +107,9 @@ void HoymilesRadio::handleReceivedPackage()
|
||||
// Successful received all packages
|
||||
Hoymiles.getMessageOutput()->println("Success");
|
||||
// Statistics: Count RX Success
|
||||
if (inv->RadioStats.TxRequestData > 0) {
|
||||
inv->RadioStats.RxSuccess++;
|
||||
}
|
||||
|
||||
_commandQueue.pop();
|
||||
_busyFlag = false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user