1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-16 07:23: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

@@ -11,6 +11,7 @@ class Nmea2kTwai : public tNMEA2000{
ST_RUNNING,
ST_BUS_OFF,
ST_RECOVERING,
ST_OFFLINE,
ST_ERROR
} STATE;
typedef struct{
@@ -20,6 +21,7 @@ class Nmea2kTwai : public tNMEA2000{
uint32_t tx_failed=0;
uint32_t rx_missed=0;
uint32_t rx_overrun=0;
uint32_t tx_timeouts=0;
STATE state=ST_ERROR;
} Status;
Status getStatus();
@@ -47,6 +49,7 @@ class Nmea2kTwai : public tNMEA2000{
void initDriver();
gpio_num_t TxPin;
gpio_num_t RxPin;
uint32_t txTimeouts=0;
};
#endif