|
LCC Fusion Project 1.0
LCC Automation
|
Manages alerts and notifications (voltage checks, communication statuses). More...
#include <LccNodeAlerts.h>

Public Member Functions | |
| LccNodeAlerts () | |
| Constructor for LccNodeAlerts class. | |
| ~LccNodeAlerts () | |
| Destructor for LccNodeAlerts class. | |
| void | init (Esp32HardwareTwai *pTwai, LccNodeSerialMonitor *pMonitor) |
| Initializes timers and verifies I2C connectivity. | |
| void | update () |
| Updates alerts and timers periodically. | |
Private Member Functions | |
| float | _readVoltageAveraged (gpio_num_t pin, float vrefScale, int samples=8) |
| Read and average multiple ADC voltage samples from a given pin. More... | |
| void | _handle3v3VoltageAlerts () |
| _handle3v3VoltageAlerts check to see Node Card's 3v3 is below 3v indicating low battery, or other power source More... | |
| void | _handle5vVoltageAlerts () |
| _handle5vVoltageAlerts check to see Node Card's 5v is below 5 V indicating low power source More... | |
| void | _handle12vVoltageAlerts () |
| _handle12vVoltageAlerts check to see Node Card's 12 V is below 12 V indicating low power source More... | |
| bool | _isTwaiConnected () |
| Determines if TWAI connectivity is active. More... | |
| void | _handleTwaiConnectivityAlerts () |
| Checks for TWAI connectivity issues. | |
| bool | _isIoPinConnected (int pinNum) |
| Checks if a pin is connected. More... | |
| void | _handleNodeIoDeviceAlerts () |
| Checks for attached IO devices and alerts only for changes. | |
| void | _handleCanhVoltageRangeAlerts () |
| Check CANH bias window and emit alerts with hysteresis and debouncing. Notes: More... | |
Manages alerts and notifications (voltage checks, communication statuses).
Definition at line 218 of file LccNodeAlerts.h.
|
inlineprivate |
_handle12vVoltageAlerts check to see Node Card's 12 V is below 12 V indicating low power source
Definition at line 370 of file LccNodeAlerts.h.


|
inlineprivate |
_handle3v3VoltageAlerts check to see Node Card's 3v3 is below 3v indicating low battery, or other power source
Definition at line 334 of file LccNodeAlerts.h.


|
inlineprivate |
_handle5vVoltageAlerts check to see Node Card's 5v is below 5 V indicating low power source
Definition at line 352 of file LccNodeAlerts.h.

|
inlineprivate |
Check CANH bias window and emit alerts with hysteresis and debouncing. Notes:
readVoltage(pin, vref_or_scale) should return volts at the pin. Definition at line 551 of file LccNodeAlerts.h.

|
inlineprivate |
Checks if a pin is connected.
| pinNum | Pin number to check. |
Definition at line 500 of file LccNodeAlerts.h.

|
inlineprivate |
Determines if TWAI connectivity is active.
Definition at line 388 of file LccNodeAlerts.h.

|
inlineprivate |
Read and average multiple ADC voltage samples from a given pin.
This helper function repeatedly calls readVoltage() on the specified ADC pin and returns the arithmetic mean of the collected samples. Averaging is recommended on the ESP32 because raw ADC values often fluctuate due to noise, ground bounce, and regulator ripple.
| pin | GPIO number configured as an ADC input. |
| vrefScale | Reference scaling factor passed through to readVoltage(). This usually represents either the ADC reference voltage (e.g., 3.3 V, 3.95 V measured) or a correction multiplier determined by calibration. |
| samples | Number of readings to collect and average. Typical values are 8–16. More samples improve stability at the cost of slightly longer measurement time. |
Definition at line 321 of file LccNodeAlerts.h.
