bool ServiceController::setState(acsdaemon::ServiceState istate) { bool stopped = state != acsdaemon::NOT_EXISTING && istate == acsdaemon::NOT_EXISTING; /* on state change... */ if (state != istate) { fireAlarm(istate); } state = istate; return stopped; }
bool ACSServiceController::setState(acsdaemon::ServiceState istate) { bool stopped = state != acsdaemon::NOT_EXISTING && istate == acsdaemon::NOT_EXISTING; /* on state change... and anytime when alarm system is not initialized to force inicialization and sending current state */ if (state != istate || !alarmSystemInitialized) { fireAlarm(istate); } state = istate; return stopped; }
void start() { while(TRUE) { blinkLeds(); if (fireAlarmState) fireAlarm(); } }