1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-14 22:43:07 +01:00

count timeouts to detect offline state

This commit is contained in:
andreas
2023-08-25 19:48:53 +02:00
parent 9fd25ab6a8
commit f5e48fcab3
3 changed files with 16 additions and 2 deletions

View File

@@ -861,11 +861,13 @@ void loop() {
if (now > (lastCanRecovery + CAN_RECOVERY_PERIOD)){
lastCanRecovery=now;
Nmea2kTwai::Status canState=NMEA2000.getStatus();
logger.logDebug(GwLog::DEBUG,"can state %s, rxerr %d, txerr %d, txfail %d, rxmiss %d, rxoverrun %d",
logger.logDebug(GwLog::DEBUG,
"can state %s, rxerr %d, txerr %d, txfail %d, txtimeout %d, rxmiss %d, rxoverrun %d",
NMEA2000.stateStr(canState.state),
canState.rx_errors,
canState.tx_errors,
canState.tx_failed,
canState.tx_timeouts,
canState.rx_missed,
canState.rx_overrun);
if (canState.state != Nmea2kTwai::ST_RUNNING){