Merge remote-tracking branch 'origin/develop' into mueller/acs-ss-init
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
commit
7db0872ee3
@ -16,6 +16,7 @@ list yields a list of all related PRs for each release.
|
||||
## Added
|
||||
|
||||
- ACS Subsystem
|
||||
- Custom Syrlinks FDIR which disabled most of the default FDIR functionality
|
||||
|
||||
## Changed
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include "ObjectFactory.h"
|
||||
|
||||
#include <mission/system/fdir/GomspacePowerFdir.h>
|
||||
#include <mission/system/fdir/SyrlinksFdir.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "bsp_q7s/boardtest/Q7STestTask.h"
|
||||
#include "bsp_q7s/callbacks/gnssCallback.h"
|
||||
@ -37,10 +40,10 @@
|
||||
#include "linux/obc/PdecHandler.h"
|
||||
#include "linux/obc/Ptme.h"
|
||||
#include "linux/obc/PtmeConfig.h"
|
||||
#include "mission/system/objects/AcsBoardFdir.h"
|
||||
#include "mission/system/objects/RtdFdir.h"
|
||||
#include "mission/system/fdir/AcsBoardFdir.h"
|
||||
#include "mission/system/fdir/RtdFdir.h"
|
||||
#include "mission/system/fdir/SusFdir.h"
|
||||
#include "mission/system/objects/SusAssembly.h"
|
||||
#include "mission/system/objects/SusFdir.h"
|
||||
#include "mission/system/objects/TcsBoardAssembly.h"
|
||||
#include "mission/system/tree/acsModeTree.h"
|
||||
#include "tmtc/apid.h"
|
||||
@ -255,14 +258,22 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI
|
||||
CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU1);
|
||||
CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU2);
|
||||
CspCookie* acuCspCookie = new CspCookie(ACU::MAX_REPLY_LENGTH, addresses::ACU);
|
||||
/* Device Handler */
|
||||
|
||||
auto p60Fdir = new GomspacePowerFdir(objects::P60DOCK_HANDLER);
|
||||
P60DockHandler* p60dockhandler =
|
||||
new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie);
|
||||
new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie, p60Fdir);
|
||||
|
||||
auto pdu1Fdir = new GomspacePowerFdir(objects::PDU1_HANDLER);
|
||||
PDU1Handler* pdu1handler =
|
||||
new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie);
|
||||
new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie, pdu1Fdir);
|
||||
|
||||
auto pdu2Fdir = new GomspacePowerFdir(objects::PDU2_HANDLER);
|
||||
PDU2Handler* pdu2handler =
|
||||
new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie);
|
||||
ACUHandler* acuhandler = new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie);
|
||||
new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie, pdu2Fdir);
|
||||
|
||||
auto acuFdir = new GomspacePowerFdir(objects::ACU_HANDLER);
|
||||
ACUHandler* acuhandler =
|
||||
new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie, acuFdir);
|
||||
auto pcduHandler = new PCDUHandler(objects::PCDU_HANDLER, 50);
|
||||
|
||||
/**
|
||||
@ -645,8 +656,10 @@ void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
|
||||
syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
|
||||
syrlinksUartCookie->setParityEven();
|
||||
|
||||
auto syrlinksHandler = new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF,
|
||||
syrlinksUartCookie, pcdu::PDU1_CH1_SYRLINKS_12V);
|
||||
auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HK_HANDLER);
|
||||
auto syrlinksHandler =
|
||||
new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie,
|
||||
pcdu::PDU1_CH1_SYRLINKS_12V, syrlinksFdir);
|
||||
syrlinksHandler->setPowerSwitcher(pwrSwitcher);
|
||||
#if OBSW_DEBUG_SYRLINKS == 1
|
||||
syrlinksHandler->setDebugMode(true);
|
||||
|
@ -30,6 +30,7 @@ enum: uint8_t {
|
||||
PDU1_HANDLER = 133,
|
||||
PDU2_HANDLER = 134,
|
||||
ACU_HANDLER = 135,
|
||||
SYRLINKS = 136,
|
||||
COMMON_SUBSYSTEM_ID_END
|
||||
};
|
||||
}
|
||||
|
@ -9,9 +9,9 @@
|
||||
#include <linux/callbacks/gpioCallbacks.h>
|
||||
#include <mission/devices/Max31865PT1000Handler.h>
|
||||
#include <mission/devices/SusHandler.h>
|
||||
#include <mission/system/objects/RtdFdir.h>
|
||||
#include <mission/system/fdir/RtdFdir.h>
|
||||
#include <mission/system/fdir/SusFdir.h>
|
||||
#include <mission/system/objects/SusAssembly.h>
|
||||
#include <mission/system/objects/SusFdir.h>
|
||||
#include <mission/system/objects/TcsBoardAssembly.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie)
|
||||
: GomspaceDeviceHandler(objectId, comIF, comCookie, ACU::MAX_CONFIGTABLE_ADDRESS,
|
||||
ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
|
||||
FailureIsolationBase *customFdir)
|
||||
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, ACU::MAX_CONFIGTABLE_ADDRESS,
|
||||
ACU::MAX_HKTABLE_ADDRESS, ACU::HK_TABLE_REPLY_SIZE),
|
||||
acuHkTableDataset(this) {}
|
||||
|
||||
|
@ -12,7 +12,8 @@
|
||||
*/
|
||||
class ACUHandler : public GomspaceDeviceHandler {
|
||||
public:
|
||||
ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
|
||||
ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
|
||||
FailureIsolationBase* customFdir);
|
||||
virtual ~ACUHandler();
|
||||
|
||||
void setDebugMode(bool enable);
|
||||
|
@ -7,9 +7,10 @@
|
||||
#include "devicedefinitions/powerDefinitions.h"
|
||||
|
||||
GomspaceDeviceHandler::GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF,
|
||||
CookieIF* comCookie, uint16_t maxConfigTableAddress,
|
||||
CookieIF* comCookie, FailureIsolationBase* customFdir,
|
||||
uint16_t maxConfigTableAddress,
|
||||
uint16_t maxHkTableAddress, uint16_t hkTableReplySize)
|
||||
: DeviceHandlerBase(objectId, comIF, comCookie),
|
||||
: DeviceHandlerBase(objectId, comIF, comCookie, customFdir),
|
||||
maxConfigTableAddress(maxConfigTableAddress),
|
||||
maxHkTableAddress(maxHkTableAddress),
|
||||
hkTableReplySize(hkTableReplySize) {
|
||||
|
@ -38,8 +38,8 @@ class GomspaceDeviceHandler : public DeviceHandlerBase {
|
||||
* device.
|
||||
*/
|
||||
GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
|
||||
uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress,
|
||||
uint16_t hkTableReplySize);
|
||||
FailureIsolationBase *customFdir, uint16_t maxConfigTableAddress,
|
||||
uint16_t maxHkTableAddress, uint16_t hkTableReplySize);
|
||||
virtual ~GomspaceDeviceHandler();
|
||||
|
||||
/**
|
||||
|
@ -4,9 +4,11 @@
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie)
|
||||
: GomspaceDeviceHandler(objectId, comIF, comCookie, P60Dock::MAX_CONFIGTABLE_ADDRESS,
|
||||
P60Dock::MAX_HKTABLE_ADDRESS, P60Dock::HK_TABLE_REPLY_SIZE),
|
||||
P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
|
||||
FailureIsolationBase *customFdir)
|
||||
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir,
|
||||
P60Dock::MAX_CONFIGTABLE_ADDRESS, P60Dock::MAX_HKTABLE_ADDRESS,
|
||||
P60Dock::HK_TABLE_REPLY_SIZE),
|
||||
coreHk(this),
|
||||
auxHk(this) {}
|
||||
|
||||
|
@ -21,7 +21,8 @@ class P60DockHandler : public GomspaceDeviceHandler {
|
||||
//! [EXPORT] : [COMMENT] Battery mode has changed. P1: Old mode. P2: New mode
|
||||
static constexpr Event BATT_MODE_CHANGED = event::makeEvent(SUBSYSTEM_ID, 2, severity::MEDIUM);
|
||||
|
||||
P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
|
||||
P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
|
||||
FailureIsolationBase* customFdir);
|
||||
virtual ~P60DockHandler();
|
||||
|
||||
void setDebugMode(bool enable);
|
||||
|
@ -5,8 +5,9 @@
|
||||
|
||||
#include "devices/powerSwitcherList.h"
|
||||
|
||||
PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie)
|
||||
: GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
|
||||
PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
|
||||
FailureIsolationBase *customFdir)
|
||||
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, PDU::MAX_CONFIGTABLE_ADDRESS,
|
||||
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE),
|
||||
coreHk(this),
|
||||
auxHk(this) {}
|
||||
|
@ -21,7 +21,8 @@
|
||||
*/
|
||||
class PDU1Handler : public GomspaceDeviceHandler {
|
||||
public:
|
||||
PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
|
||||
PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
|
||||
FailureIsolationBase* customFdir);
|
||||
virtual ~PDU1Handler();
|
||||
|
||||
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||
|
@ -5,8 +5,9 @@
|
||||
|
||||
#include "devices/powerSwitcherList.h"
|
||||
|
||||
PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie)
|
||||
: GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
|
||||
PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
|
||||
FailureIsolationBase *customFdir)
|
||||
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, PDU::MAX_CONFIGTABLE_ADDRESS,
|
||||
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE),
|
||||
coreHk(this),
|
||||
auxHk(this) {}
|
||||
|
@ -21,7 +21,8 @@
|
||||
*/
|
||||
class PDU2Handler : public GomspaceDeviceHandler {
|
||||
public:
|
||||
PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
|
||||
PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
|
||||
FailureIsolationBase* customFdir);
|
||||
virtual ~PDU2Handler();
|
||||
|
||||
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
|
||||
power::Switch_t powerSwitch)
|
||||
: DeviceHandlerBase(objectId, comIF, comCookie),
|
||||
power::Switch_t powerSwitch, FailureIsolationBase* customFdir)
|
||||
: DeviceHandlerBase(objectId, comIF, comCookie, customFdir),
|
||||
rxDataset(this),
|
||||
txDataset(this),
|
||||
temperatureSet(this),
|
||||
|
@ -20,7 +20,7 @@
|
||||
class SyrlinksHkHandler : public DeviceHandlerBase {
|
||||
public:
|
||||
SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
|
||||
power::Switch_t powerSwitch);
|
||||
power::Switch_t powerSwitch, FailureIsolationBase* customFdir);
|
||||
virtual ~SyrlinksHkHandler();
|
||||
|
||||
/**
|
||||
|
@ -1,8 +1,14 @@
|
||||
#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_
|
||||
#define MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_
|
||||
|
||||
#include <commonSubsystemIds.h>
|
||||
|
||||
namespace syrlinks {
|
||||
|
||||
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SYRLINKS;
|
||||
|
||||
static constexpr Event FDIR_REACTION_IGNORED = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
|
||||
|
||||
static const DeviceCommandId_t NONE = 0;
|
||||
static const DeviceCommandId_t RESET_UNIT = 1;
|
||||
/** Reads out all status registers */
|
||||
|
@ -15,6 +15,8 @@ static constexpr Event SWITCH_CMD_SENT = event::makeEvent(SUBSYSTEM_ID, 0, sever
|
||||
static constexpr Event SWITCH_HAS_CHANGED = event::makeEvent(SUBSYSTEM_ID, 1, severity::INFO);
|
||||
static constexpr Event SWITCHING_Q7S_DENIED = event::makeEvent(SUBSYSTEM_ID, 2, severity::MEDIUM);
|
||||
|
||||
static constexpr Event FDIR_REACTION_IGNORED = event::makeEvent(SUBSYSTEM_ID, 3, severity::MEDIUM);
|
||||
|
||||
} // namespace power
|
||||
|
||||
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_POWERDEFINITIONS_H_ */
|
||||
|
@ -1,2 +1,3 @@
|
||||
add_subdirectory(objects)
|
||||
add_subdirectory(tree)
|
||||
add_subdirectory(fdir)
|
||||
|
7
mission/system/fdir/CMakeLists.txt
Normal file
7
mission/system/fdir/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${LIB_EIVE_MISSION} PRIVATE
|
||||
AcsBoardFdir.cpp
|
||||
RtdFdir.cpp
|
||||
SusFdir.cpp
|
||||
SyrlinksFdir.cpp
|
||||
GomspacePowerFdir.cpp
|
||||
)
|
128
mission/system/fdir/GomspacePowerFdir.cpp
Normal file
128
mission/system/fdir/GomspacePowerFdir.cpp
Normal file
@ -0,0 +1,128 @@
|
||||
#include "GomspacePowerFdir.h"
|
||||
|
||||
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
|
||||
#include "fsfw/health/HealthTableIF.h"
|
||||
#include "fsfw/modes/HasModesIF.h"
|
||||
#include "fsfw/objectmanager/ObjectManager.h"
|
||||
#include "fsfw/power/Fuse.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "fsfw/thermal/ThermalComponentIF.h"
|
||||
#include "mission/devices/devicedefinitions/powerDefinitions.h"
|
||||
|
||||
GomspacePowerFdir::GomspacePowerFdir(object_id_t devId, object_id_t parentId)
|
||||
: DeviceHandlerFailureIsolation(devId, parentId) {}
|
||||
|
||||
ReturnValue_t GomspacePowerFdir::eventReceived(EventMessage* event) {
|
||||
if (isFdirInActionOrAreWeFaulty(event)) {
|
||||
return RETURN_OK;
|
||||
}
|
||||
ReturnValue_t result = RETURN_FAILED;
|
||||
switch (event->getEvent()) {
|
||||
case HasModesIF::MODE_TRANSITION_FAILED:
|
||||
case HasModesIF::OBJECT_IN_INVALID_MODE:
|
||||
case DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT:
|
||||
// We'll try a recovery as long as defined in MAX_REBOOT.
|
||||
// Might cause some AssemblyBase cycles, so keep number low.
|
||||
// handleRecovery(event->getEvent());
|
||||
triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0);
|
||||
break;
|
||||
case DeviceHandlerIF::DEVICE_INTERPRETING_REPLY_FAILED:
|
||||
case DeviceHandlerIF::DEVICE_READING_REPLY_FAILED:
|
||||
case DeviceHandlerIF::DEVICE_UNREQUESTED_REPLY:
|
||||
case DeviceHandlerIF::DEVICE_UNKNOWN_REPLY: // Some DH's generate generic reply-ids.
|
||||
case DeviceHandlerIF::DEVICE_BUILDING_COMMAND_FAILED:
|
||||
// These faults all mean that there were stupid replies from a device.
|
||||
if (strangeReplyCount.incrementAndCheck()) {
|
||||
// handleRecovery(event->getEvent());
|
||||
triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0);
|
||||
}
|
||||
break;
|
||||
case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED:
|
||||
case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED:
|
||||
// The two above should never be confirmed.
|
||||
case DeviceHandlerIF::DEVICE_MISSED_REPLY:
|
||||
result = sendConfirmationRequest(event);
|
||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||
break;
|
||||
}
|
||||
// else
|
||||
if (missedReplyCount.incrementAndCheck()) {
|
||||
// handleRecovery(event->getEvent());
|
||||
triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0);
|
||||
}
|
||||
break;
|
||||
case StorageManagerIF::GET_DATA_FAILED:
|
||||
case StorageManagerIF::STORE_DATA_FAILED:
|
||||
// Rather strange bugs, occur in RAW mode only. Ignore.
|
||||
break;
|
||||
case DeviceHandlerIF::INVALID_DEVICE_COMMAND:
|
||||
// Ignore, is bad configuration. We can't do anything in flight.
|
||||
break;
|
||||
case HasHealthIF::HEALTH_INFO:
|
||||
case HasModesIF::MODE_INFO:
|
||||
case HasModesIF::CHANGING_MODE:
|
||||
// Do nothing, but mark as handled.
|
||||
break;
|
||||
//****Power*****
|
||||
case PowerSwitchIF::SWITCH_WENT_OFF:
|
||||
if (powerConfirmation != MessageQueueIF::NO_QUEUE) {
|
||||
result = sendConfirmationRequest(event, powerConfirmation);
|
||||
if (result == RETURN_OK) {
|
||||
setFdirState(DEVICE_MIGHT_BE_OFF);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Fuse::FUSE_WENT_OFF:
|
||||
// Not so good, because PCDU reacted.
|
||||
case Fuse::POWER_ABOVE_HIGH_LIMIT:
|
||||
// Better, because software detected over-current.
|
||||
setFaulty(event->getEvent());
|
||||
break;
|
||||
case Fuse::POWER_BELOW_LOW_LIMIT:
|
||||
// Device might got stuck during boot, retry.
|
||||
// handleRecovery(event->getEvent());
|
||||
triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0);
|
||||
break;
|
||||
//****Thermal*****
|
||||
case ThermalComponentIF::COMPONENT_TEMP_LOW:
|
||||
case ThermalComponentIF::COMPONENT_TEMP_HIGH:
|
||||
case ThermalComponentIF::COMPONENT_TEMP_OOL_LOW:
|
||||
case ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH:
|
||||
// Well, the device is not really faulty, but it is required to stay off as long as possible.
|
||||
setFaulty(event->getEvent());
|
||||
break;
|
||||
case ThermalComponentIF::TEMP_NOT_IN_OP_RANGE:
|
||||
// Ignore, is information only.
|
||||
break;
|
||||
//*******Default monitoring variables. Are currently not used.*****
|
||||
// case DeviceHandlerIF::MONITORING_LIMIT_EXCEEDED:
|
||||
// setFaulty(event->getEvent());
|
||||
// break;
|
||||
// case DeviceHandlerIF::MONITORING_AMBIGUOUS:
|
||||
// break;
|
||||
default:
|
||||
// We don't know the event, someone else should handle it.
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
void GomspacePowerFdir::eventConfirmed(EventMessage* event) {
|
||||
switch (event->getEvent()) {
|
||||
case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED:
|
||||
case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED:
|
||||
case DeviceHandlerIF::DEVICE_MISSED_REPLY:
|
||||
if (missedReplyCount.incrementAndCheck()) {
|
||||
// handleRecovery(event->getEvent());
|
||||
triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0);
|
||||
}
|
||||
break;
|
||||
case PowerSwitchIF::SWITCH_WENT_OFF:
|
||||
// This means the switch went off only for one device.
|
||||
// handleRecovery(event->getEvent());
|
||||
triggerEvent(power::FDIR_REACTION_IGNORED, event->getEvent(), 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
15
mission/system/fdir/GomspacePowerFdir.h
Normal file
15
mission/system/fdir/GomspacePowerFdir.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef MISSION_SYSTEM_FDIR_GOMSPACEPOWERFDIR_H_
|
||||
#define MISSION_SYSTEM_FDIR_GOMSPACEPOWERFDIR_H_
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerFailureIsolation.h>
|
||||
|
||||
class GomspacePowerFdir : public DeviceHandlerFailureIsolation {
|
||||
public:
|
||||
GomspacePowerFdir(object_id_t devId, object_id_t parentId = objects::NO_OBJECT);
|
||||
|
||||
private:
|
||||
ReturnValue_t eventReceived(EventMessage* event) override;
|
||||
void eventConfirmed(EventMessage* event) override;
|
||||
};
|
||||
|
||||
#endif /* MISSION_SYSTEM_FDIR_GOMSPACEPOWERFDIR_H_ */
|
128
mission/system/fdir/SyrlinksFdir.cpp
Normal file
128
mission/system/fdir/SyrlinksFdir.cpp
Normal file
@ -0,0 +1,128 @@
|
||||
#include "SyrlinksFdir.h"
|
||||
|
||||
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
|
||||
#include "fsfw/health/HealthTableIF.h"
|
||||
#include "fsfw/modes/HasModesIF.h"
|
||||
#include "fsfw/objectmanager/ObjectManager.h"
|
||||
#include "fsfw/power/Fuse.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "fsfw/thermal/ThermalComponentIF.h"
|
||||
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
||||
|
||||
SyrlinksFdir::SyrlinksFdir(object_id_t syrlinksId)
|
||||
: DeviceHandlerFailureIsolation(syrlinksId, objects::NO_OBJECT) {}
|
||||
|
||||
ReturnValue_t SyrlinksFdir::eventReceived(EventMessage* event) {
|
||||
if (isFdirInActionOrAreWeFaulty(event)) {
|
||||
return RETURN_OK;
|
||||
}
|
||||
ReturnValue_t result = RETURN_FAILED;
|
||||
switch (event->getEvent()) {
|
||||
case HasModesIF::MODE_TRANSITION_FAILED:
|
||||
case HasModesIF::OBJECT_IN_INVALID_MODE:
|
||||
case DeviceHandlerIF::DEVICE_WANTS_HARD_REBOOT:
|
||||
// We'll try a recovery as long as defined in MAX_REBOOT.
|
||||
// Might cause some AssemblyBase cycles, so keep number low.
|
||||
// handleRecovery(event->getEvent());
|
||||
triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0);
|
||||
break;
|
||||
case DeviceHandlerIF::DEVICE_INTERPRETING_REPLY_FAILED:
|
||||
case DeviceHandlerIF::DEVICE_READING_REPLY_FAILED:
|
||||
case DeviceHandlerIF::DEVICE_UNREQUESTED_REPLY:
|
||||
case DeviceHandlerIF::DEVICE_UNKNOWN_REPLY: // Some DH's generate generic reply-ids.
|
||||
case DeviceHandlerIF::DEVICE_BUILDING_COMMAND_FAILED:
|
||||
// These faults all mean that there were stupid replies from a device.
|
||||
if (strangeReplyCount.incrementAndCheck()) {
|
||||
// handleRecovery(event->getEvent());
|
||||
triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0);
|
||||
}
|
||||
break;
|
||||
case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED:
|
||||
case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED:
|
||||
// The two above should never be confirmed.
|
||||
case DeviceHandlerIF::DEVICE_MISSED_REPLY:
|
||||
result = sendConfirmationRequest(event);
|
||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||
break;
|
||||
}
|
||||
// else
|
||||
if (missedReplyCount.incrementAndCheck()) {
|
||||
// handleRecovery(event->getEvent());
|
||||
triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0);
|
||||
}
|
||||
break;
|
||||
case StorageManagerIF::GET_DATA_FAILED:
|
||||
case StorageManagerIF::STORE_DATA_FAILED:
|
||||
// Rather strange bugs, occur in RAW mode only. Ignore.
|
||||
break;
|
||||
case DeviceHandlerIF::INVALID_DEVICE_COMMAND:
|
||||
// Ignore, is bad configuration. We can't do anything in flight.
|
||||
break;
|
||||
case HasHealthIF::HEALTH_INFO:
|
||||
case HasModesIF::MODE_INFO:
|
||||
case HasModesIF::CHANGING_MODE:
|
||||
// Do nothing, but mark as handled.
|
||||
break;
|
||||
//****Power*****
|
||||
case PowerSwitchIF::SWITCH_WENT_OFF:
|
||||
if (powerConfirmation != MessageQueueIF::NO_QUEUE) {
|
||||
result = sendConfirmationRequest(event, powerConfirmation);
|
||||
if (result == RETURN_OK) {
|
||||
setFdirState(DEVICE_MIGHT_BE_OFF);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Fuse::FUSE_WENT_OFF:
|
||||
// Not so good, because PCDU reacted.
|
||||
case Fuse::POWER_ABOVE_HIGH_LIMIT:
|
||||
// Better, because software detected over-current.
|
||||
setFaulty(event->getEvent());
|
||||
break;
|
||||
case Fuse::POWER_BELOW_LOW_LIMIT:
|
||||
// Device might got stuck during boot, retry.
|
||||
// handleRecovery(event->getEvent());
|
||||
triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0);
|
||||
break;
|
||||
//****Thermal*****
|
||||
case ThermalComponentIF::COMPONENT_TEMP_LOW:
|
||||
case ThermalComponentIF::COMPONENT_TEMP_HIGH:
|
||||
case ThermalComponentIF::COMPONENT_TEMP_OOL_LOW:
|
||||
case ThermalComponentIF::COMPONENT_TEMP_OOL_HIGH:
|
||||
// Well, the device is not really faulty, but it is required to stay off as long as possible.
|
||||
setFaulty(event->getEvent());
|
||||
break;
|
||||
case ThermalComponentIF::TEMP_NOT_IN_OP_RANGE:
|
||||
// Ignore, is information only.
|
||||
break;
|
||||
//*******Default monitoring variables. Are currently not used.*****
|
||||
// case DeviceHandlerIF::MONITORING_LIMIT_EXCEEDED:
|
||||
// setFaulty(event->getEvent());
|
||||
// break;
|
||||
// case DeviceHandlerIF::MONITORING_AMBIGUOUS:
|
||||
// break;
|
||||
default:
|
||||
// We don't know the event, someone else should handle it.
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
void SyrlinksFdir::eventConfirmed(EventMessage* event) {
|
||||
switch (event->getEvent()) {
|
||||
case DeviceHandlerIF::DEVICE_SENDING_COMMAND_FAILED:
|
||||
case DeviceHandlerIF::DEVICE_REQUESTING_REPLY_FAILED:
|
||||
case DeviceHandlerIF::DEVICE_MISSED_REPLY:
|
||||
if (missedReplyCount.incrementAndCheck()) {
|
||||
// handleRecovery(event->getEvent());
|
||||
triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0);
|
||||
}
|
||||
break;
|
||||
case PowerSwitchIF::SWITCH_WENT_OFF:
|
||||
// This means the switch went off only for one device.
|
||||
// handleRecovery(event->getEvent());
|
||||
triggerEvent(syrlinks::FDIR_REACTION_IGNORED, event->getEvent(), 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
15
mission/system/fdir/SyrlinksFdir.h
Normal file
15
mission/system/fdir/SyrlinksFdir.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef MISSION_DEVICES_SYRLINKSFDIR_H_
|
||||
#define MISSION_DEVICES_SYRLINKSFDIR_H_
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerFailureIsolation.h>
|
||||
|
||||
class SyrlinksFdir : public DeviceHandlerFailureIsolation {
|
||||
public:
|
||||
SyrlinksFdir(object_id_t syrlinksId);
|
||||
|
||||
private:
|
||||
ReturnValue_t eventReceived(EventMessage* event) override;
|
||||
void eventConfirmed(EventMessage* event) override;
|
||||
};
|
||||
|
||||
#endif /* MISSION_DEVICES_SYRLINKSFDIR_H_ */
|
@ -10,8 +10,4 @@ target_sources(${LIB_EIVE_MISSION} PRIVATE
|
||||
PowerStateMachineBase.cpp
|
||||
DualLaneAssemblyBase.cpp
|
||||
TcsBoardAssembly.cpp
|
||||
|
||||
AcsBoardFdir.cpp
|
||||
SusFdir.cpp
|
||||
RtdFdir.cpp
|
||||
)
|
||||
|
@ -120,8 +120,8 @@ void buildOffSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TGT.first, 0, false);
|
||||
ihs(ACS_SEQUENCE_OFF.second, ACS_TABLE_OFF_TRANS.first, 0, false);
|
||||
check(ss->addSequence(&ACS_SEQUENCE_OFF.second, ACS_SEQUENCE_OFF.first, ACS_SEQUENCE_OFF.first,
|
||||
false, true),
|
||||
ctxc);
|
||||
false, true),
|
||||
ctxc);
|
||||
}
|
||||
|
||||
void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
@ -157,20 +157,20 @@ void buildSafeSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second);
|
||||
iht(objects::RW_ASS, OFF, 0, ACS_TABLE_SAFE_TRANS_0.second);
|
||||
check(ss->addTable(&ACS_TABLE_SAFE_TRANS_0.second, ACS_TABLE_SAFE_TRANS_0.first, false, true),
|
||||
ctxc);
|
||||
ctxc);
|
||||
|
||||
// Build SAFE transition 1
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::SAFE, 0, ACS_TABLE_SAFE_TRANS_1.second);
|
||||
check(ss->addTable(&ACS_TABLE_SAFE_TRANS_1.second, ACS_TABLE_SAFE_TRANS_1.first, false, true),
|
||||
ctxc);
|
||||
ctxc);
|
||||
|
||||
// Build SAFE sequence
|
||||
ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TGT.first, 0, true);
|
||||
ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_0.first, 0, false);
|
||||
ihs(ACS_SEQUENCE_SAFE.second, ACS_TABLE_SAFE_TRANS_1.first, 0, false);
|
||||
check(ss->addSequence(&ACS_SEQUENCE_SAFE.second, ACS_SEQUENCE_SAFE.first, ACS_SEQUENCE_OFF.first,
|
||||
false, true),
|
||||
ctxc);
|
||||
false, true),
|
||||
ctxc);
|
||||
}
|
||||
|
||||
void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
@ -198,7 +198,7 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second);
|
||||
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_DETUMBLE_TGT.second);
|
||||
check(ss->addTable(&ACS_TABLE_DETUMBLE_TGT.second, ACS_TABLE_DETUMBLE_TGT.first, false, true),
|
||||
ctxc);
|
||||
ctxc);
|
||||
|
||||
// Build DETUMBLE transition 0
|
||||
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_DETUMBLE_TRANS_0.second);
|
||||
@ -207,22 +207,22 @@ void buildDetumbleSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second);
|
||||
iht(objects::RW_ASS, OFF, 0, ACS_TABLE_DETUMBLE_TRANS_0.second);
|
||||
check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_0.second, ACS_TABLE_DETUMBLE_TRANS_0.first, false,
|
||||
true),
|
||||
ctxc);
|
||||
true),
|
||||
ctxc);
|
||||
|
||||
// Build DETUMBLE transition 1
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::DETUMBLE, 0, ACS_TABLE_DETUMBLE_TRANS_1.second);
|
||||
check(ss->addTable(&ACS_TABLE_DETUMBLE_TRANS_1.second, ACS_TABLE_DETUMBLE_TRANS_1.first, false,
|
||||
true),
|
||||
ctxc);
|
||||
true),
|
||||
ctxc);
|
||||
|
||||
// Build DETUMBLE sequence
|
||||
ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TGT.first, 0, true);
|
||||
ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_0.first, 0, false);
|
||||
ihs(ACS_SEQUENCE_DETUMBLE.second, ACS_TABLE_DETUMBLE_TRANS_1.first, 0, false);
|
||||
check(ss->addSequence(&ACS_SEQUENCE_DETUMBLE.second, ACS_SEQUENCE_DETUMBLE.first,
|
||||
ACS_SEQUENCE_SAFE.first, false, true),
|
||||
ctxc);
|
||||
ACS_SEQUENCE_SAFE.first, false, true),
|
||||
ctxc);
|
||||
}
|
||||
|
||||
void buildIdleSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
@ -298,7 +298,7 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
iht(objects::SUS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second);
|
||||
iht(objects::ACS_BOARD_ASS, NML, 0, ACS_TABLE_IDLE_CHRG_TGT.second);
|
||||
check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TGT.second, ACS_TABLE_IDLE_CHRG_TGT.first, false, true),
|
||||
ctxc);
|
||||
ctxc);
|
||||
|
||||
// Build IDLE transition 0
|
||||
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second);
|
||||
@ -307,23 +307,23 @@ void buildIdleChargeSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
iht(objects::RW_ASS, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second);
|
||||
iht(objects::STAR_TRACKER, OFF, 0, ACS_TABLE_IDLE_CHRG_TRANS_0.second);
|
||||
check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_0.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, false,
|
||||
true),
|
||||
ctxc);
|
||||
true),
|
||||
ctxc);
|
||||
|
||||
// Build IDLE transition 1
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::IDLE, acs::IDLE_CHARGE,
|
||||
ACS_TABLE_IDLE_CHRG_TRANS_1.second);
|
||||
check(ss->addTable(&ACS_TABLE_IDLE_CHRG_TRANS_1.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, false,
|
||||
true),
|
||||
ctxc);
|
||||
true),
|
||||
ctxc);
|
||||
|
||||
// Build IDLE sequence
|
||||
ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TGT.first, 0, true);
|
||||
ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_0.first, 0, true);
|
||||
ihs(ACS_SEQUENCE_IDLE_CHRG.second, ACS_TABLE_IDLE_CHRG_TRANS_1.first, 0, false);
|
||||
check(ss->addSequence(&ACS_SEQUENCE_IDLE_CHRG.second, ACS_SEQUENCE_IDLE_CHRG.first,
|
||||
ACS_SEQUENCE_SAFE.first, false, true),
|
||||
ctxc);
|
||||
ACS_SEQUENCE_SAFE.first, false, true),
|
||||
ctxc);
|
||||
}
|
||||
|
||||
void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
@ -354,7 +354,7 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TGT.second);
|
||||
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TGT.second);
|
||||
check(ss->addTable(&ACS_TABLE_TARGET_PT_TGT.second, ACS_TABLE_TARGET_PT_TGT.first, false, true),
|
||||
ctxc);
|
||||
ctxc);
|
||||
|
||||
// Build TARGET PT transition 0
|
||||
iht(objects::IMTQ_HANDLER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second);
|
||||
@ -363,22 +363,22 @@ void buildTargetPtSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
iht(objects::RW_ASS, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second);
|
||||
iht(objects::STAR_TRACKER, NML, 0, ACS_TABLE_TARGET_PT_TRANS_0.second);
|
||||
check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_0.second, ACS_TABLE_TARGET_PT_TRANS_0.first, false,
|
||||
true),
|
||||
ctxc);
|
||||
true),
|
||||
ctxc);
|
||||
|
||||
// Build TARGET PT transition 1
|
||||
iht(objects::ACS_CONTROLLER, acs::CtrlModes::TARGET_PT, 0, ACS_TABLE_TARGET_PT_TRANS_1.second);
|
||||
check(ss->addTable(&ACS_TABLE_TARGET_PT_TRANS_1.second, ACS_TABLE_TARGET_PT_TRANS_1.first, false,
|
||||
true),
|
||||
ctxc);
|
||||
true),
|
||||
ctxc);
|
||||
|
||||
// Build IDLE sequence
|
||||
ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TGT.first, 0, true);
|
||||
ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_0.first, 0, true);
|
||||
ihs(ACS_SEQUENCE_TARGET_PT.second, ACS_TABLE_TARGET_PT_TRANS_1.first, 0, false);
|
||||
check(ss->addSequence(&ACS_SEQUENCE_TARGET_PT.second, ACS_SEQUENCE_TARGET_PT.first,
|
||||
ACS_SEQUENCE_IDLE.first, false, true),
|
||||
ctxc);
|
||||
ACS_SEQUENCE_IDLE.first, false, true),
|
||||
ctxc);
|
||||
}
|
||||
|
||||
void checkInsert(ReturnValue_t result, const char* ctx) {
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit 76da8042a4601087e99fa856af241afe9e43695d
|
||||
Subproject commit 8d0a83122932deb49a9e536bea1a0b5723b1cb2a
|
Loading…
Reference in New Issue
Block a user