NMEA2000 status for web status page

This commit is contained in:
2026-03-01 11:55:18 +01:00
parent d13c1ef8c1
commit 294f1731c9
5 changed files with 22 additions and 4 deletions

View File

@@ -37,12 +37,20 @@ bool Nmea2kTwai::CANSendFrame(unsigned long id, unsigned char len, const unsigne
if (rt == ESP_ERR_TIMEOUT) {
if (txTimeouts < TIMEOUT_OFFLINE) {
txTimeouts++;
} else if (!tx_offline) {
tx_offline = true;
LOGW(TAG, "twai tx offline timeout reached");
}
}
LOGW(TAG, "twai transmit for %ld failed: %x", LOGID(id), (int)rt);
if (txTimeouts > 0 && !tx_offline) {
LOGW(TAG, "twai transmit for %ld failed: %x", LOGID(id), (int)rt);
} else {
// TODO log every <n> seconds a offline message
}
return false;
}
txTimeouts = 0;
tx_offline = false;
LOGV(TAG, "twai transmit id %ld, len %d", LOGID(id), (int)len);
return true;
}
@@ -231,6 +239,7 @@ const char * Nmea2kTwai::stateStr(const Nmea2kTwai::STATE &st)
}
return "ERROR";
}
const Nmea2kTwai::ManufacturerEntry Nmea2kTwai::ManufacturerTable[] = {
{0, "Reserved"},
{69, "ARKS Enterprises, Inc."},

View File

@@ -58,6 +58,7 @@ private:
uint32_t txTimeouts = 0;
// GwIntervalRunner timers;
bool disabled = false;
bool tx_offline = false;
unsigned long lastRecoveryStart = 0;
};