Compare commits

...

12 Commits

Author SHA1 Message Date
5abbf42e9f some form updates 2022-06-21 00:49:58 +02:00
438efe074e Merge pull request 'LocalDataPoolManager Warning Text' (#99) from meier/eive-debug-info into develop
Reviewed-on: #99
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-06-20 09:35:31 +02:00
1759700b6a Merge branch 'develop' into meier/eive-debug-info 2022-06-20 09:35:14 +02:00
c7618294ac Merge pull request 'HK Generation for L3GD20, LIS3MDL, RM3100' (#97) from meier/device-hk into develop
Reviewed-on: #97
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-06-20 09:34:16 +02:00
af890c6218 corrected warning text 2022-06-16 07:55:57 +02:00
7f3e5e42bb Merge branch 'develop' into meier/device-hk 2022-06-16 07:44:58 +02:00
5a69c1f8b9 Merge pull request 'DHB Mode Off disable pending commands' (#95) from meier/dhb-disable-pending-commands into develop
Reviewed-on: #95
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-05-27 14:40:36 +02:00
1d1d91f591 Merge branch 'develop' into meier/dhb-disable-pending-commands 2022-05-27 14:40:18 +02:00
043b8b5b3f Merge pull request 'FixedTimeSlotTaskBase Bugfix' (#96) from meier/FixedTimeSlotTaskBase-BugFix into develop
Reviewed-on: #96
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2022-05-27 14:38:04 +02:00
Jakob Meier
ab68817e9a removed debugging printout 2022-05-26 02:06:05 +02:00
Jakob Meier
36652e6fce Merge branch 'develop' into meier/dhb-disable-pending-commands 2022-05-26 02:04:33 +02:00
Jakob Meier
3749f31ab4 disable pending commands and replies in MODE_OFF transition 2022-05-26 02:03:39 +02:00
9 changed files with 51 additions and 15 deletions

View File

@@ -182,7 +182,10 @@ if(FSFW_BUILD_UNITTESTS)
endif() endif()
endif() endif()
message(STATUS "${MSG_PREFIX} Finding and/or providing etl library with version ${FSFW_ETL_LIB_MAJOR_VERSION}") message(
STATUS
"${MSG_PREFIX} Finding and/or providing etl library with version ${FSFW_ETL_LIB_MAJOR_VERSION}"
)
# Check whether the user has already installed ETL first # Check whether the user has already installed ETL first
find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET) find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)

View File

@@ -577,8 +577,9 @@ ReturnValue_t LocalDataPoolManager::handleHousekeepingMessage(CommandMessage* me
CommandMessage reply; CommandMessage reply;
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
if(result == WRONG_HK_PACKET_TYPE) { if (result == WRONG_HK_PACKET_TYPE) {
printWarningOrError(sif::OutputTypes::OUT_WARNING, "handleHousekeepingMessage", WRONG_HK_PACKET_TYPE); printWarningOrError(sif::OutputTypes::OUT_WARNING, "handleHousekeepingMessage",
WRONG_HK_PACKET_TYPE);
} }
HousekeepingMessage::setHkRequestFailureReply(&reply, sid, result); HousekeepingMessage::setHkRequestFailureReply(&reply, sid, result);
} else { } else {
@@ -699,9 +700,10 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver& receiver) {
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
/* Configuration error */ /* Configuration error */
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "LocalDataPoolManager::performHkOperation: HK generation failed." << std::endl; sif::warning << "LocalDataPoolManager::performPeriodicHkOperation: HK generation failed."
<< std::endl;
#else #else
sif::printWarning("LocalDataPoolManager::performHkOperation: HK generation failed.\n"); sif::printWarning("LocalDataPoolManager::performPeriodicHkOperation: HK generation failed.\n");
#endif #endif
} }
} }

View File

@@ -572,6 +572,9 @@ void DeviceHandlerBase::setMode(Mode_t newMode, uint8_t newSubmode) {
mode = newMode; mode = newMode;
modeChanged(); modeChanged();
setNormalDatapoolEntriesInvalid(); setNormalDatapoolEntriesInvalid();
if (newMode == MODE_OFF) {
disableCommandsAndReplies();
}
if (!isTransitionalMode()) { if (!isTransitionalMode()) {
modeHelper.modeChanged(newMode, newSubmode); modeHelper.modeChanged(newMode, newSubmode);
announceMode(false); announceMode(false);
@@ -1567,3 +1570,21 @@ void DeviceHandlerBase::setParent(object_id_t parent) { this->parent = parent; }
void DeviceHandlerBase::setPowerSwitcher(PowerSwitchIF* switcher) { void DeviceHandlerBase::setPowerSwitcher(PowerSwitchIF* switcher) {
this->powerSwitcher = switcher; this->powerSwitcher = switcher;
} }
void DeviceHandlerBase::disableCommandsAndReplies() {
for (auto& command : deviceCommandMap) {
if (command.second.isExecuting) {
command.second.isExecuting = false;
}
}
for (auto& reply : deviceReplyMap) {
if (!reply.second.periodic) {
if (reply.second.countdown != nullptr) {
reply.second.countdown->timeOut();
} else {
reply.second.delayCycles = 0;
}
reply.second.active = false;
}
}
}

View File

@@ -1325,6 +1325,11 @@ class DeviceHandlerBase : public DeviceHandlerIF,
void printWarningOrError(sif::OutputTypes errorType, const char *functionName, void printWarningOrError(sif::OutputTypes errorType, const char *functionName,
ReturnValue_t errorCode = HasReturnvaluesIF::RETURN_FAILED, ReturnValue_t errorCode = HasReturnvaluesIF::RETURN_FAILED,
const char *errorPrint = nullptr); const char *errorPrint = nullptr);
/**
* @brief Disables all commands and replies when device is set to MODE_OFF
*/
void disableCommandsAndReplies();
}; };
#endif /* FSFW_DEVICEHANDLERS_DEVICEHANDLERBASE_H_ */ #endif /* FSFW_DEVICEHANDLERS_DEVICEHANDLERBASE_H_ */

View File

@@ -16,7 +16,9 @@ elseif(FSFW_OSAL MATCHES "host")
else() else()
message(WARNING "${MSG_PREFIX} The FSFW_OSAL variable was not set. Assuming host OS..") message(
WARNING
"${MSG_PREFIX} The FSFW_OSAL variable was not set. Assuming host OS..")
# Not set. Assumuing this is a host build, try to determine host OS # Not set. Assumuing this is a host build, try to determine host OS
if(WIN32) if(WIN32)
add_subdirectory(host) add_subdirectory(host)

View File

@@ -53,6 +53,7 @@ class PeriodicTask : public PeriodicTaskBase {
ReturnValue_t sleepFor(uint32_t ms) override; ReturnValue_t sleepFor(uint32_t ms) override;
bool isEmpty() const override; bool isEmpty() const override;
protected: protected:
using chron_ms = std::chrono::milliseconds; using chron_ms = std::chrono::milliseconds;
bool started; bool started;

View File

@@ -29,9 +29,9 @@ class PowerSwitchIF : public HasReturnvaluesIF {
static const ReturnValue_t FUSE_ON = MAKE_RETURN_CODE(3); static const ReturnValue_t FUSE_ON = MAKE_RETURN_CODE(3);
static const ReturnValue_t FUSE_OFF = MAKE_RETURN_CODE(4); static const ReturnValue_t FUSE_OFF = MAKE_RETURN_CODE(4);
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PCDU_2; static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PCDU_2;
static const Event SWITCH_WENT_OFF = MAKE_EVENT( //!< Someone detected that a switch went off which shouldn't. Severity:
0, severity::LOW); //!< Someone detected that a switch went off which shouldn't. Severity: //!< Low, Parameter1: switchId1, Parameter2: switchId2
//!< Low, Parameter1: switchId1, Parameter2: switchId2 static const Event SWITCH_WENT_OFF = MAKE_EVENT(0, severity::LOW);
/** /**
* send a direct command to the Power Unit to enable/disable the specified switch. * send a direct command to the Power Unit to enable/disable the specified switch.
* *

View File

@@ -248,16 +248,18 @@ void Service3Housekeeping::handleUnrequestedReply(CommandMessage* reply) {
case (HousekeepingMessage::HK_REQUEST_FAILURE): { case (HousekeepingMessage::HK_REQUEST_FAILURE): {
break; break;
} }
case(CommandMessage::REPLY_REJECTED): { case (CommandMessage::REPLY_REJECTED): {
sif::warning << "Service3Housekeeping::handleUnrequestedReply: Unexpected reply " sif::warning << "Service3Housekeeping::handleUnrequestedReply: Unexpected reply "
"rejected with error code" << reply->getParameter() << std::endl; "rejected with error code"
<< reply->getParameter() << std::endl;
break; break;
} }
default: { default: {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "Service3Housekeeping::handleUnrequestedReply: Invalid reply with reply " sif::warning << "Service3Housekeeping::handleUnrequestedReply: Invalid reply with reply "
"command " << command << "" << std::endl; "command "
<< command << "" << std::endl;
#else #else
sif::printWarning( sif::printWarning(
"Service3Housekeeping::handleUnrequestedReply: Invalid reply with " "Service3Housekeeping::handleUnrequestedReply: Invalid reply with "

View File

@@ -13,9 +13,9 @@ class ThermalComponentIF : public HasParametersIF {
static const Event COMPONENT_TEMP_HIGH = MAKE_EVENT(2, severity::LOW); static const Event COMPONENT_TEMP_HIGH = MAKE_EVENT(2, severity::LOW);
static const Event COMPONENT_TEMP_OOL_LOW = MAKE_EVENT(3, severity::LOW); static const Event COMPONENT_TEMP_OOL_LOW = MAKE_EVENT(3, severity::LOW);
static const Event COMPONENT_TEMP_OOL_HIGH = MAKE_EVENT(4, severity::LOW); static const Event COMPONENT_TEMP_OOL_HIGH = MAKE_EVENT(4, severity::LOW);
static const Event TEMP_NOT_IN_OP_RANGE = MAKE_EVENT( //!< Is thrown when a device should start-up, but the temperature is out
5, severity::LOW); //!< Is thrown when a device should start-up, but the temperature is out //!< of OP range. P1: thermalState of the component, P2: 0
//!< of OP range. P1: thermalState of the component, P2: 0 static const Event TEMP_NOT_IN_OP_RANGE = MAKE_EVENT(5, severity::LOW);
static const uint8_t INTERFACE_ID = CLASS_ID::THERMAL_COMPONENT_IF; static const uint8_t INTERFACE_ID = CLASS_ID::THERMAL_COMPONENT_IF;
static const ReturnValue_t INVALID_TARGET_STATE = MAKE_RETURN_CODE(1); static const ReturnValue_t INVALID_TARGET_STATE = MAKE_RETURN_CODE(1);