Projekt

Allgemein

Profil

Aktionen

Alerts » Historie » Revision 6

« Zurück | Revision 6/8 (diff) | Weiter »
Maximilian Seesslen, 11.04.2024 15:43


Alarms/Alerts

Devices should indicate issues; e.g.:

  • Battery low
  • I2C problems
  • Buffer overflow

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

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.

bWarningE( EV_BUFFER_OVERFLOW | EV_UART, "Buffer overflow: %d", cnt);

Alarms are send explicitly as system errors in the main event loop. An Alarm has an concrete value.

sendAlarm( Tdt::EAlarm::OverTemperature,
                 Tdt::EUnit::centiCelsius, Tdt::SValue { ._int=temperature } );
sendAlarm( Tdt::EAlarm::UnderVoltage,
                 Tdt::EUnit::milliVolt, Tdt::SValue { ._int=voltage } );

Von Maximilian Seesslen vor 10 Monaten aktualisiert · 6 Revisionen