software:firmware
MakAir Firmware
|
Describe an alarm and handle its dynamic state. More...
#include <alarm.h>
Public Member Functions | |
Alarm (AlarmPriority p_priority, uint8_t p_code, uint8_t p_detectionThreshold) | |
Parameterized constructor. More... | |
AlarmPriority | getPriority () const |
Get the alarm priority. More... | |
uint8_t | getCode () const |
Get the alarm code. More... | |
bool | isTriggered () const |
True if the number of detections is equal or above the detection threshold, false otherwise. More... | |
uint32_t | getCyclesSinceTrigger () const |
Get the number of cycles since the alarm was triggered. More... | |
void | detected (uint32_t p_cycleNumber) |
If the alarm is detected, it increments the number of detection until the detection threshold. More... | |
void | notDetected () |
Reset to zero the number of detection. More... | |
void | enable () |
Enable this alarm. More... | |
void | disable () |
Disable this alarm. More... | |
bool | isEnabled () |
True if this alarm is enabled. More... | |
Private Attributes | |
AlarmPriority | m_priority |
Alarm priority. More... | |
uint8_t | m_code |
Alarm code. More... | |
uint8_t | m_detectionThreshold |
Alarm detection threshold. More... | |
uint8_t | m_detectionNumber |
Number of detections. More... | |
uint32_t | m_cycleNumber |
Cycle number. More... | |
uint32_t | m_cyclesSinceTrigger |
Number of cycles since the alarm was triggered. More... | |
bool | m_enabled |
Whether or not this alarm is enabled. More... | |
Alarm::Alarm | ( | AlarmPriority | p_priority, |
uint8_t | p_code, | ||
uint8_t | p_detectionThreshold | ||
) |
Parameterized constructor.
p_priority | Alarm priority |
p_code | Alarm code |
p_detectionThreshold | Number of detections in a row to trigger this alarm |
Definition at line 20 of file alarm.cpp.
void Alarm::detected | ( | uint32_t | p_cycleNumber | ) |
void Alarm::disable | ( | ) |
void Alarm::enable | ( | ) |
uint8_t Alarm::getCode | ( | ) | const |
uint32_t Alarm::getCyclesSinceTrigger | ( | ) | const |
AlarmPriority Alarm::getPriority | ( | ) | const |
bool Alarm::isEnabled | ( | ) |
bool Alarm::isTriggered | ( | ) | const |
void Alarm::notDetected | ( | ) |
Reset to zero the number of detection.
|
private |
|
private |
|
private |
|
private |
|
private |