took over dHB failure isolation base fixes

This commit is contained in:
Robin Müller 2020-08-27 20:00:36 +02:00
parent 4d1b1ba506
commit a6e99e443a
2 changed files with 304 additions and 305 deletions

View File

@ -1,11 +1,12 @@
#include "../devicehandlers/DeviceHandlerBase.h" #include "DeviceHandlerBase.h"
#include "../devicehandlers/DeviceHandlerFailureIsolation.h" #include "DeviceHandlerFailureIsolation.h"
#include "../health/HealthTableIF.h" #include "../health/HealthTableIF.h"
#include "../power/Fuse.h" #include "../power/Fuse.h"
#include "../serviceinterface/ServiceInterfaceStream.h" #include "../serviceinterface/ServiceInterfaceStream.h"
#include "../thermal/ThermalComponentIF.h" #include "../thermal/ThermalComponentIF.h"
object_id_t DeviceHandlerFailureIsolation::powerConfirmationId = 0; object_id_t DeviceHandlerFailureIsolation::powerConfirmationId =
objects::NO_OBJECT;
DeviceHandlerFailureIsolation::DeviceHandlerFailureIsolation(object_id_t owner, DeviceHandlerFailureIsolation::DeviceHandlerFailureIsolation(object_id_t owner,
object_id_t parent) : object_id_t parent) :
@ -70,7 +71,7 @@ ReturnValue_t DeviceHandlerFailureIsolation::eventReceived(EventMessage* event)
break; break;
//****Power***** //****Power*****
case PowerSwitchIF::SWITCH_WENT_OFF: case PowerSwitchIF::SWITCH_WENT_OFF:
if(hasPowerConfirmation) { if(powerConfirmation != MessageQueueIF::NO_QUEUE) {
result = sendConfirmationRequest(event, powerConfirmation); result = sendConfirmationRequest(event, powerConfirmation);
if (result == RETURN_OK) { if (result == RETURN_OK) {
setFdirState(DEVICE_MIGHT_BE_OFF); setFdirState(DEVICE_MIGHT_BE_OFF);
@ -171,7 +172,6 @@ ReturnValue_t DeviceHandlerFailureIsolation::initialize() {
powerConfirmationId); powerConfirmationId);
if (power != nullptr) { if (power != nullptr) {
powerConfirmation = power->getEventReceptionQueue(); powerConfirmation = power->getEventReceptionQueue();
hasPowerConfirmation = true;
} }
return RETURN_OK; return RETURN_OK;

View File

@ -3,11 +3,11 @@
#include "../fdir/FaultCounter.h" #include "../fdir/FaultCounter.h"
#include "../fdir/FailureIsolationBase.h" #include "../fdir/FailureIsolationBase.h"
namespace Factory{ namespace Factory{
void setStaticFrameworkObjectIds(); void setStaticFrameworkObjectIds();
} }
class DeviceHandlerFailureIsolation: public FailureIsolationBase { class DeviceHandlerFailureIsolation: public FailureIsolationBase {
friend void (Factory::setStaticFrameworkObjectIds)(); friend void (Factory::setStaticFrameworkObjectIds)();
friend class Heater; friend class Heater;
@ -28,8 +28,7 @@ protected:
NONE, RECOVERY_ONGOING, DEVICE_MIGHT_BE_OFF, AWAIT_SHUTDOWN NONE, RECOVERY_ONGOING, DEVICE_MIGHT_BE_OFF, AWAIT_SHUTDOWN
}; };
FDIRState fdirState; FDIRState fdirState;
bool hasPowerConfirmation = false; MessageQueueId_t powerConfirmation = MessageQueueIF::NO_QUEUE;
MessageQueueId_t powerConfirmation;
static object_id_t powerConfirmationId; static object_id_t powerConfirmationId;
// TODO: Are those hardcoded value? How can they be changed. // TODO: Are those hardcoded value? How can they be changed.
static const uint32_t MAX_REBOOT = 1; static const uint32_t MAX_REBOOT = 1;