Alerts » Historie » Revision 6
Revision 5 (Maximilian Seesslen, 25.03.2024 16:33) → Revision 6/8 (Maximilian Seesslen, 11.04.2024 15:43)
h2. Alarms/Alerts
Devices should indicate issues; e.g.:
* Battery low
* I2C problems
* Buffer overflow
h2. Object structutre
|_. Size |_. Decription |_. Examples |
| 2 | Object/Subsystem | I2C, VBat, |
| 1 | Unit | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String |
| 1 | Issue | Whats wrong, Undervolts, Communication error |
| 4 | Value | 32Bit data of kind 'unit' |
|_. Size |_. Decription |_. Examples |
| 2 | Event/Alert | buffer overflow, want sleep, overtemperature, Undervolts, Communication error + categorie |
| 1 | Unit | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String |
| 1 | type | |
| 4 | Value | 32Bit data of kind 'unit' |
Room is a bit specifik to the timeout-shutdown-thing. subindex
Setting ambient light has the same issue.
Categorie:
USB, UART, System
Type:
Critical, Warning, Info, Event
Events:
Simple integer code which can be send via logging
* Buffer overflow
* I2C issue
h2. Events vs. Alerts
Events can be integrated into logging. They can be used anywhere in the code like ISRs. An Event has no output value.
<pre><code class="cpp">
bWarningE( EV_BUFFER_OVERFLOW | EV_UART, "Buffer overflow: %d", cnt);
</code></pre>
Alarms are send explicitly as system errors in the main event loop. An Alarm has an concrete value.
<pre><code class="cpp">
sendAlarm( Tdt::EAlarm::OverTemperature,
Tdt::EUnit::centiCelsius, Tdt::SValue { ._int=temperature } );
sendAlarm( Tdt::EAlarm::UnderVoltage,
Tdt::EUnit::milliVolt, Tdt::SValue { ._int=voltage } );
</code></pre>
Devices should indicate issues; e.g.:
* Battery low
* I2C problems
* Buffer overflow
h2. Object structutre
|_. Size |_. Decription |_. Examples |
| 2 | Object/Subsystem | I2C, VBat, |
| 1 | Unit | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String |
| 1 | Issue | Whats wrong, Undervolts, Communication error |
| 4 | Value | 32Bit data of kind 'unit' |
|_. Size |_. Decription |_. Examples |
| 2 | Event/Alert | buffer overflow, want sleep, overtemperature, Undervolts, Communication error + categorie |
| 1 | Unit | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String |
| 1 | type | |
| 4 | Value | 32Bit data of kind 'unit' |
Room is a bit specifik to the timeout-shutdown-thing. subindex
Setting ambient light has the same issue.
Categorie:
USB, UART, System
Type:
Critical, Warning, Info, Event
Events:
Simple integer code which can be send via logging
* Buffer overflow
* I2C issue
h2. Events vs. Alerts
Events can be integrated into logging. They can be used anywhere in the code like ISRs. An Event has no output value.
<pre><code class="cpp">
bWarningE( EV_BUFFER_OVERFLOW | EV_UART, "Buffer overflow: %d", cnt);
</code></pre>
Alarms are send explicitly as system errors in the main event loop. An Alarm has an concrete value.
<pre><code class="cpp">
sendAlarm( Tdt::EAlarm::OverTemperature,
Tdt::EUnit::centiCelsius, Tdt::SValue { ._int=temperature } );
sendAlarm( Tdt::EAlarm::UnderVoltage,
Tdt::EUnit::milliVolt, Tdt::SValue { ._int=voltage } );
</code></pre>