Merge pull request 'spahr/handleRecoveryEvents' (#54) from spahr/handleRecoveryEvents into main
Reviewed-on: #54 Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
This commit is contained in:
commit
daac5ea727
@ -235,14 +235,14 @@ bool AssemblyBase::checkAndHandleRecovery() {
|
|||||||
if (recoveryOffTimer.isBusy()) {
|
if (recoveryOffTimer.isBusy()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
triggerEvent(RECOVERY_STEP, 0);
|
triggerEvent(RECOVERY_WAITING, recoveringDevice->first);
|
||||||
sendHealthCommand(recoveringDevice->second.commandQueue, HEALTHY);
|
sendHealthCommand(recoveringDevice->second.commandQueue, HEALTHY);
|
||||||
internalState = STATE_NONE;
|
internalState = STATE_NONE;
|
||||||
recoveryState = RECOVERY_ONGOING;
|
recoveryState = RECOVERY_ONGOING;
|
||||||
// Don't check state!
|
// Don't check state!
|
||||||
return true;
|
return true;
|
||||||
case RECOVERY_ONGOING:
|
case RECOVERY_ONGOING:
|
||||||
triggerEvent(RECOVERY_STEP, 1);
|
triggerEvent(RECOVERY_RESTARTING, recoveringDevice->first);
|
||||||
recoveryState = RECOVERY_ONGOING_2;
|
recoveryState = RECOVERY_ONGOING_2;
|
||||||
recoveringDevice->second.healthChanged = false;
|
recoveringDevice->second.healthChanged = false;
|
||||||
// Device should be healthy again, so restart a transition.
|
// Device should be healthy again, so restart a transition.
|
||||||
@ -250,7 +250,7 @@ bool AssemblyBase::checkAndHandleRecovery() {
|
|||||||
doStartTransition(targetMode, targetSubmode);
|
doStartTransition(targetMode, targetSubmode);
|
||||||
return true;
|
return true;
|
||||||
case RECOVERY_ONGOING_2:
|
case RECOVERY_ONGOING_2:
|
||||||
triggerEvent(RECOVERY_DONE);
|
triggerEvent(RECOVERY_DONE, recoveringDevice->first);
|
||||||
// Now we're through, but not sure if it was successful.
|
// Now we're through, but not sure if it was successful.
|
||||||
recoveryState = RECOVERY_IDLE;
|
recoveryState = RECOVERY_IDLE;
|
||||||
return false;
|
return false;
|
||||||
|
@ -27,13 +27,19 @@ class HasHealthIF {
|
|||||||
static const Event CHILD_PROBLEMS = MAKE_EVENT(8, severity::LOW);
|
static const Event CHILD_PROBLEMS = MAKE_EVENT(8, severity::LOW);
|
||||||
//! Assembly overwrites health information of children to keep satellite alive.
|
//! Assembly overwrites health information of children to keep satellite alive.
|
||||||
static const Event OVERWRITING_HEALTH = MAKE_EVENT(9, severity::LOW);
|
static const Event OVERWRITING_HEALTH = MAKE_EVENT(9, severity::LOW);
|
||||||
//! Someone starts a recovery of a component (typically power-cycle). No parameters.
|
//! Someone starts a recovery of a component (typically power-cycle).
|
||||||
|
//! P1: Object Id of the recovering device.
|
||||||
static const Event TRYING_RECOVERY = MAKE_EVENT(10, severity::MEDIUM);
|
static const Event TRYING_RECOVERY = MAKE_EVENT(10, severity::MEDIUM);
|
||||||
//! Recovery is ongoing. Comes twice during recovery.
|
|
||||||
//! P1: 0 for the first, 1 for the second event. P2: 0
|
|
||||||
static const Event RECOVERY_STEP = MAKE_EVENT(11, severity::MEDIUM);
|
|
||||||
//! Recovery was completed. Not necessarily successful. No parameters.
|
//! Recovery was completed. Not necessarily successful. No parameters.
|
||||||
|
//! P1: Object Id of the recovering device.
|
||||||
static const Event RECOVERY_DONE = MAKE_EVENT(12, severity::MEDIUM);
|
static const Event RECOVERY_DONE = MAKE_EVENT(12, severity::MEDIUM);
|
||||||
|
//! Recovery is ongoing. The recovering device is currently OFF, waiting for restart.
|
||||||
|
//! P1: Object Id of the recovering device.
|
||||||
|
static const Event RECOVERY_WAITING = MAKE_EVENT(13, severity::MEDIUM);
|
||||||
|
//! Recovery is ongoing. Restarting the recovering device.
|
||||||
|
//! P1: Object Id of the recovering device.
|
||||||
|
static const Event RECOVERY_RESTARTING = MAKE_EVENT(14, severity::MEDIUM);
|
||||||
|
|
||||||
virtual ~HasHealthIF() {}
|
virtual ~HasHealthIF() {}
|
||||||
|
|
||||||
virtual MessageQueueId_t getCommandQueue() const = 0;
|
virtual MessageQueueId_t getCommandQueue() const = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user