File I2cHealth.h
FileList > Firmware > Libraries > PanelGroup > Helpers > I2cHealth > I2cHealth.h
Go to the source code of this file
Circuit-breaker mixin ("trait") for I2C-backed device classes. More...
#include <Arduino.h>
Namespaces
| Type | Name |
|---|---|
| namespace | OpenSkyhawk |
Classes
| Type | Name |
|---|---|
| class | I2cHealth Per-device I2C circuit breaker. Mix into any class that talks to an I2C device. |
Detailed Description
A blocking I2C transaction to an absent or dead device stalls PanelGroup::loop() and starves the node heartbeat — the bridge then flaps the node online/offline (#164). Any OpenSkyhawk class that drives an I2C device mixes this in and implements i2cProbe() (its own reachability check); it then gates every I2C op behind i2cReachable(). A dead device drops from "block every
loop" to "one probe every I2C\_RETRY\_MS", and auto-recovers when it returns. The class's data/decode path must stay I2C-free, so values stay current and the next reachable frame catches up to the live value instead of showing a stale one.
This is the C++ analog of a trait: shared behaviour lives here, the contract (i2cProbe()) is pure-virtual so a mixing class cannot compile without honouring it.
Version:
0.1.0
Copyright:
GPL-2.0-only — see Firmware/LICENSE
The documentation for this class was generated from the following file Firmware/Libraries/PanelGroup/Helpers/I2cHealth/I2cHealth.h