Compare commits

..

32 Commits

Author SHA1 Message Date
b30e88640b Merge branch 'main' into spahr/SharedPowerLines 2025-03-31 13:56:16 +02:00
5818265a7d Add interface to modeHelper for FDH; add interface to ModeHelper for set msgQueId for 2025-03-31 13:31:51 +02:00
f01e58a757 Merge pull request 'seems like this should set the serializables to .get().setValid(valid) instead of true' (#55) from mdemke/hotfix_hk__setChildrenValidity into main
Reviewed-on: #55
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2025-03-31 12:25:06 +02:00
cd94fad8e5 Change the SubsystemBase to allow commanding of objects in executeTable which are not in the childrenMap. This enebales us to wiretap mode messages and operate the power switch of a shared power line without breaking the mode tree 2025-03-29 23:30:04 +01:00
0681b1895b add new MessageQueue to ModeHelper; which is equal to the parentQueue and can command the object without forcing the object to EXTERNAL_CONTROL 2025-03-29 23:28:24 +01:00
131456e19e improve docu 2025-03-29 23:27:18 +01:00
40be8ebef5 seems like this should set the serializables to .get().setValid(valid) instead of true 2025-03-28 00:41:40 +01:00
55b8d01b93 Merge pull request 'Compile time const event definitions and compile error for unique IDs above limit' (#53) from baumgartl/events into main
Reviewed-on: #53
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2025-03-18 14:39:34 +01:00
8cb1d84c58 fixed event definition for archive/mgm and pus 11 2025-03-12 22:18:55 +01:00
8801dfa31d implemented event limit. TODO: adjust generator parsing and usage in src-obsw 2025-03-12 21:46:48 +01:00
b8979d8f90 Merge pull request 'Improve readability of SubsystemBase::executeTable' (#49) from spahr/SubsystemBase into main
Reviewed-on: #49
2025-02-19 11:26:36 +01:00
9557db7036 Merge branch 'main' into spahr/SubsystemBase 2025-02-19 11:26:26 +01:00
c9fcabccd6 Merge pull request 'Missing valid flag update in readWithoutLock and commitWithoutLock' (#48) from bugfix-poolvariable into main
Reviewed-on: #48
2025-02-19 11:26:04 +01:00
ecd36f5e52 Merge branch 'main' into bugfix-poolvariable 2025-02-19 11:25:52 +01:00
fc19c0838e Merge pull request 'Formatting of debug printout' (#50) from spahr/formattingForDebugPrintout into main
Reviewed-on: #50
2025-02-19 11:24:39 +01:00
8c3f366d1a formatting for time prinout 2025-02-16 17:36:22 +01:00
6efb2641a7 Re-write the logic in executeTable() to improve the readabilty of the code. This gets rid of the usage of isFaulty() (which is misleading), and removes nexted if-statements 2025-02-16 17:07:40 +01:00
260bbad9a0 Modify the hard-coded strings which are printed to into the debug session to enforce alignment of all printouts, regardless of their printlevel (info, debug, warning, error). 2025-02-14 19:02:57 +01:00
9edd6221f8 Missing valid flag update in readWithoutLock and commitWithoutLock 2025-02-11 15:16:27 +01:00
735e341aab Merge pull request 'temperaturesensor-bugfix' (#47) from temperaturesensor-bugfix into main
Reviewed-on: #47
2025-01-21 14:33:29 +01:00
921bfb1e99 Merge branch 'main' into temperaturesensor-bugfix 2025-01-21 14:31:59 +01:00
5b1651e1a6 Merge pull request 'Update HK and datapool handling' (#45) from update-hk-handling-datapools into main
Reviewed-on: #45
2025-01-08 10:38:34 +01:00
e916b9b096 fix for CMakeLists.txt 2025-01-07 10:50:37 +01:00
b14e761bad small typo 2025-01-07 10:50:37 +01:00
33f3ae2434 Update and clean up HK and Local Pool Modules 2025-01-07 10:50:37 +01:00
f0087d5b0d Merge pull request 'FreeRTOS Monotonic Clock' (#46) from meier/freertos-monotonic-clock into main
Reviewed-on: #46
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2025-01-07 10:33:29 +01:00
69c33587e8 Merge remote-tracking branch 'origin/main' into temperaturesensor-bugfix 2024-12-31 10:51:11 +01:00
d1bf04cc29 Merge branch 'main' into meier/freertos-monotonic-clock 2024-12-25 10:20:22 +01:00
8e3bc1b8aa updated changelog 2024-12-23 12:07:54 +01:00
64f97fc3ba implemented freertos monotonic clock 2024-12-23 12:02:29 +01:00
1427fbd2fe added monotonic clock which is independend of clock jumps in the system clock 2024-12-22 18:37:44 +01:00
81cd8bd290 did not build before 2024-12-15 23:52:32 +01:00
20 changed files with 120 additions and 40 deletions

View File

@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## Added ## Added
- FreeRTOS monotonic clock which is not subjected to time jumps of the system clock
- add CFDP subsystem ID - add CFDP subsystem ID
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/742 https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/742
- `PusTmZcWriter` now exposes API to set message counter field. - `PusTmZcWriter` now exposes API to set message counter field.

View File

@ -18,13 +18,13 @@ class MgmRM3100Handler : public DeviceHandlerBase {
static const uint8_t INTERFACE_ID = CLASS_ID::MGM_RM3100; static const uint8_t INTERFACE_ID = CLASS_ID::MGM_RM3100;
//! [EXPORT] : [COMMENT] P1: TMRC value which was set, P2: 0 //! [EXPORT] : [COMMENT] P1: TMRC value which was set, P2: 0
static constexpr Event tmrcSet = event::makeEvent(SUBSYSTEM_ID::MGM_RM3100, 0x00, severity::INFO); static constexpr Event tmrcSet = event::makeEvent<SUBSYSTEM_ID::MGM_RM3100, 0x00, severity::INFO>();
//! [EXPORT] : [COMMENT] Cycle counter set. P1: First two bytes new Cycle Count X //! [EXPORT] : [COMMENT] Cycle counter set. P1: First two bytes new Cycle Count X
//! P1: Second two bytes new Cycle Count Y //! P1: Second two bytes new Cycle Count Y
//! P2: New cycle count Z //! P2: New cycle count Z
static constexpr Event cycleCountersSet = static constexpr Event cycleCountersSet =
event::makeEvent(SUBSYSTEM_ID::MGM_RM3100, 0x01, severity::INFO); event::makeEvent<SUBSYSTEM_ID::MGM_RM3100, 0x01, severity::INFO>();
MgmRM3100Handler(object_id_t objectId, object_id_t deviceCommunication, CookieIF *comCookie, MgmRM3100Handler(object_id_t objectId, object_id_t deviceCommunication, CookieIF *comCookie,
uint32_t transitionDelay); uint32_t transitionDelay);

View File

@ -19,13 +19,13 @@ struct FsfwParams {
}; };
namespace events { namespace events {
static constexpr Event PDU_SEND_ERROR = event::makeEvent(SSID, 1, severity::LOW); static constexpr Event PDU_SEND_ERROR = event::makeEvent<SSID, 1, severity::LOW>();
static constexpr Event SERIALIZATION_ERROR = event::makeEvent(SSID, 2, severity::LOW); static constexpr Event SERIALIZATION_ERROR = event::makeEvent<SSID, 2, severity::LOW>();
static constexpr Event FILESTORE_ERROR = event::makeEvent(SSID, 3, severity::LOW); static constexpr Event FILESTORE_ERROR = event::makeEvent<SSID, 3, severity::LOW>();
//! [EXPORT] : [COMMENT] P1: Transaction step ID, P2: 0 for source file name, 1 for dest file name //! [EXPORT] : [COMMENT] P1: Transaction step ID, P2: 0 for source file name, 1 for dest file name
static constexpr Event FILENAME_TOO_LARGE_ERROR = event::makeEvent(SSID, 4, severity::LOW); static constexpr Event FILENAME_TOO_LARGE_ERROR = event::makeEvent<SSID, 4, severity::LOW>();
//! [EXPORT] : [COMMENT] CFDP request handling failed. P2: Returncode. //! [EXPORT] : [COMMENT] CFDP request handling failed. P2: Returncode.
static constexpr Event HANDLING_CFDP_REQUEST_FAILED = event::makeEvent(SSID, 5, severity::LOW); static constexpr Event HANDLING_CFDP_REQUEST_FAILED = event::makeEvent<SSID, 5, severity::LOW>();
} // namespace events } // namespace events
static constexpr ReturnValue_t SOURCE_TRANSACTION_PENDING = returnvalue::makeCode(CID, 0); static constexpr ReturnValue_t SOURCE_TRANSACTION_PENDING = returnvalue::makeCode(CID, 0);

View File

@ -210,6 +210,7 @@ inline ReturnValue_t PoolVariable<T>::readWithoutLock() {
} }
this->value = *(poolEntry->getDataPtr()); this->value = *(poolEntry->getDataPtr());
this->valid = poolEntry->getValid();
return returnvalue::OK; return returnvalue::OK;
} }
@ -241,6 +242,7 @@ ReturnValue_t PoolVariable<T>::commitWithoutLock() {
} }
*(poolEntry->getDataPtr()) = this->value; *(poolEntry->getDataPtr()) = this->value;
poolEntry->setValid(this->valid);
return returnvalue::OK; return returnvalue::OK;
} }

View File

@ -190,4 +190,6 @@ ReturnValue_t FreshDeviceHandlerBase::getParameter(uint8_t domainId, uint8_t uni
return INVALID_DOMAIN_ID; return INVALID_DOMAIN_ID;
} }
datapool::SharedPool* FreshDeviceHandlerBase::getOptionalSharedPool() { return nullptr; } datapool::SharedPool* FreshDeviceHandlerBase::getOptionalSharedPool() { return nullptr; }
ModeHelper& FreshDeviceHandlerBase::getModeHelper() { return this->modeHelper; }

View File

@ -97,6 +97,11 @@ class FreshDeviceHandlerBase : public SystemObject,
ReturnValue_t connectModeTreeParent(HasModeTreeChildrenIF& parent) override; ReturnValue_t connectModeTreeParent(HasModeTreeChildrenIF& parent) override;
ModeTreeChildIF& getModeTreeChildIF() override; ModeTreeChildIF& getModeTreeChildIF() override;
/**
* @brief Return an interface to the ModeHelper.
*/
ModeHelper& getModeHelper();
protected: protected:
ActionHelper actionHelper; ActionHelper actionHelper;
ModeHelper modeHelper; ModeHelper modeHelper;

View File

@ -14,8 +14,6 @@ enum Severity : EventSeverity_t { INFO = 1, LOW = 2, MEDIUM = 3, HIGH = 4 };
} // namespace severity } // namespace severity
#define MAKE_EVENT(id, severity) (((severity) << 16) + (SUBSYSTEM_ID * 100) + (id))
typedef uint32_t Event; typedef uint32_t Event;
namespace event { namespace event {
@ -24,11 +22,14 @@ constexpr EventId_t getEventId(Event event) { return (event & 0xFFFF); }
constexpr EventSeverity_t getSeverity(Event event) { return ((event >> 16) & 0xFF); } constexpr EventSeverity_t getSeverity(Event event) { return ((event >> 16) & 0xFF); }
constexpr Event makeEvent(uint8_t subsystemId, UniqueEventId_t uniqueEventId, template<uint8_t subsystemId, UniqueEventId_t uniqueEventId, EventSeverity_t eventSeverity>
EventSeverity_t eventSeverity) { constexpr Event makeEvent() {
static_assert(uniqueEventId < 100, "The unique event ID must be smaller than 100!");
return (eventSeverity << 16) + (subsystemId * 100) + uniqueEventId; return (eventSeverity << 16) + (subsystemId * 100) + uniqueEventId;
} }
} // namespace event } // namespace event
#define MAKE_EVENT(id, severity) event::makeEvent<SUBSYSTEM_ID, id, severity>();
#endif /* EVENTOBJECT_EVENT_H_ */ #endif /* EVENTOBJECT_EVENT_H_ */

View File

@ -91,7 +91,7 @@ class Dataset : public SerializeIF {
void setChildrenValidity(bool valid) { void setChildrenValidity(bool valid) {
for (auto &serializable : serializables) { for (auto &serializable : serializables) {
serializable.get().setValid(true); serializable.get().setValid(valid);
} }
} }

View File

@ -35,8 +35,12 @@ ReturnValue_t ModeHelper::handleModeCommand(CommandMessage* command) {
commandedMode = mode; commandedMode = mode;
commandedSubmode = submode; commandedSubmode = submode;
if ((parentQueueId != MessageQueueIF::NO_QUEUE) && // if (((parentQueueId != MessageQueueIF::NO_QUEUE) &&
(theOneWhoCommandedAMode != parentQueueId)) { // (theOneWhoCommandedAMode != parentQueueId))) {
// owner->setToExternalControl();
// }
if(theOneWhoCommandedAMode != parentQueueId and theOneWhoCommandedAMode != powerswitchQueueId) {
owner->setToExternalControl(); owner->setToExternalControl();
} }
@ -106,3 +110,7 @@ bool ModeHelper::isTimedOut() { return countdown.hasTimedOut(); }
bool ModeHelper::isForced() { return forced; } bool ModeHelper::isForced() { return forced; }
void ModeHelper::setForced(bool forced) { this->forced = forced; } void ModeHelper::setForced(bool forced) { this->forced = forced; }
void ModeHelper::setPowerSwitchQueueId(MessageQueueId_t queueId) {
powerswitchQueueId = queueId;
}

View File

@ -21,10 +21,15 @@ class ModeHelper {
/** /**
* @param parentQueue the Queue id of the parent object. * @param parentQueue the Queue id of the parent object.
* Set to 0 if no parent present * Set to MessageQueueIF::NO_QUEUE if no parent present
*/ */
void setParentQueue(MessageQueueId_t parentQueueId); void setParentQueue(MessageQueueId_t parentQueueId);
/**
* Set to MessageQueue::NO_QUEUE if no powerswitch is commanding the obejct.
*/
void setPowerSwitchQueueId(MessageQueueId_t queueId);
ReturnValue_t initialize(MessageQueueId_t parentQueueId); ReturnValue_t initialize(MessageQueueId_t parentQueueId);
ReturnValue_t initialize(void); ReturnValue_t initialize(void);
@ -42,6 +47,7 @@ class ModeHelper {
protected: protected:
HasModesIF *owner; HasModesIF *owner;
MessageQueueId_t parentQueueId = MessageQueueIF::NO_QUEUE; MessageQueueId_t parentQueueId = MessageQueueIF::NO_QUEUE;
MessageQueueId_t powerswitchQueueId = MessageQueueIF::NO_QUEUE;
Countdown countdown; Countdown countdown;

View File

@ -5,6 +5,7 @@
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "fsfw/globalfunctions/timevalOperations.h" #include "fsfw/globalfunctions/timevalOperations.h"
#include "fsfw/serviceinterface/ServiceInterfacePrinter.h"
#include "fsfw/osal/freertos/Timekeeper.h" #include "fsfw/osal/freertos/Timekeeper.h"
#include "task.h" #include "task.h"
@ -47,8 +48,8 @@ ReturnValue_t Clock::getClock(timeval* time) {
} }
ReturnValue_t Clock::getClockMonotonic(timeval* time) { ReturnValue_t Clock::getClockMonotonic(timeval* time) {
// TODO: I don't actually know if the timekeeper is monotonic.. *time = Timekeeper::instance()->getMonotonicClockOffset() + getUptime();
return getClock_timeval(time); return returnvalue::OK;
} }
ReturnValue_t Clock::getUptime(timeval* uptime) { ReturnValue_t Clock::getUptime(timeval* uptime) {
@ -58,7 +59,7 @@ ReturnValue_t Clock::getUptime(timeval* uptime) {
} }
timeval Clock::getUptime() { timeval Clock::getUptime() {
TickType_t ticksSinceStart = xTaskGetTickCount(); TickType_t ticksSinceStart = Timekeeper::instance()->getTicks();
return Timekeeper::ticksToTimeval(ticksSinceStart); return Timekeeper::ticksToTimeval(ticksSinceStart);
} }

View File

@ -17,7 +17,13 @@ Timekeeper* Timekeeper::instance() {
return myinstance; return myinstance;
} }
void Timekeeper::setOffset(const timeval& offset) { this->offset = offset; } void Timekeeper::setOffset(const timeval& offset) {
if (not monotonicClockInitialized) {
this->monotonicClockOffset = offset;
monotonicClockInitialized = true;
}
this->offset = offset;
}
timeval Timekeeper::ticksToTimeval(TickType_t ticks) { timeval Timekeeper::ticksToTimeval(TickType_t ticks) {
timeval uptime; timeval uptime;
@ -33,3 +39,7 @@ timeval Timekeeper::ticksToTimeval(TickType_t ticks) {
} }
TickType_t Timekeeper::getTicks() { return xTaskGetTickCount(); } TickType_t Timekeeper::getTicks() { return xTaskGetTickCount(); }
const timeval Timekeeper::getMonotonicClockOffset() const {
return monotonicClockOffset;
}

View File

@ -18,9 +18,14 @@ class Timekeeper {
Timekeeper(); Timekeeper();
timeval offset; timeval offset;
// Set when offset is initialized the first time
timeval monotonicClockOffset;
bool monotonicClockInitialized = false;
static Timekeeper* myinstance; static Timekeeper* myinstance;
void setMonotonicClockOffset(const timeval& monotonicClockOffset);
public: public:
static Timekeeper* instance(); static Timekeeper* instance();
virtual ~Timekeeper(); virtual ~Timekeeper();
@ -34,6 +39,7 @@ class Timekeeper {
const timeval& getOffset() const; const timeval& getOffset() const;
void setOffset(const timeval& offset); void setOffset(const timeval& offset);
const timeval getMonotonicClockOffset() const;
}; };
#endif /* FRAMEWORK_OSAL_FREERTOS_TIMEKEEPER_H_ */ #endif /* FRAMEWORK_OSAL_FREERTOS_TIMEKEEPER_H_ */

View File

@ -49,7 +49,7 @@ class Service11TelecommandScheduling final : public PusServiceBase {
//! [EXPORT] : [COMMENT] Deletion of a TC from the map failed. //! [EXPORT] : [COMMENT] Deletion of a TC from the map failed.
//! P1: First 32 bit of request ID, P2. Last 32 bit of Request ID //! P1: First 32 bit of request ID, P2. Last 32 bit of Request ID
static constexpr Event TC_DELETION_FAILED = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); static constexpr Event TC_DELETION_FAILED = event::makeEvent<SUBSYSTEM_ID, 0, severity::MEDIUM>();
// The types of PUS-11 subservices // The types of PUS-11 subservices
enum Subservice : uint8_t { enum Subservice : uint8_t {

View File

@ -53,17 +53,17 @@ void fsfwPrint(sif::PrintLevel printType, const char *fmt, va_list arg) {
#endif #endif
if (printType == sif::PrintLevel::INFO_LEVEL) { if (printType == sif::PrintLevel::INFO_LEVEL) {
len += sprintf(bufferPosition + len, "INFO"); len += sprintf(bufferPosition + len, "INFO ");
} }
if (printType == sif::PrintLevel::DEBUG_LEVEL) { if (printType == sif::PrintLevel::DEBUG_LEVEL) {
len += sprintf(bufferPosition + len, "DEBUG"); len += sprintf(bufferPosition + len, "DEBUG ");
} }
if (printType == sif::PrintLevel::WARNING_LEVEL) { if (printType == sif::PrintLevel::WARNING_LEVEL) {
len += sprintf(bufferPosition + len, "WARNING"); len += sprintf(bufferPosition + len, "WARNING");
} }
if (printType == sif::PrintLevel::ERROR_LEVEL) { if (printType == sif::PrintLevel::ERROR_LEVEL) {
len += sprintf(bufferPosition + len, "ERROR"); len += sprintf(bufferPosition + len, "ERROR ");
} }
#if FSFW_COLORED_OUTPUT == 1 #if FSFW_COLORED_OUTPUT == 1
@ -75,7 +75,7 @@ void fsfwPrint(sif::PrintLevel printType, const char *fmt, va_list arg) {
/* /*
* Log current time to terminal if desired. * Log current time to terminal if desired.
*/ */
len += sprintf(bufferPosition + len, " | %lu:%02lu:%02lu.%03lu | ", (unsigned long)now.hour, len += sprintf(bufferPosition + len, " | %02lu:%02lu:%02lu.%03lu | ", (unsigned long)now.hour,
(unsigned long)now.minute, (unsigned long)now.second, (unsigned long)now.minute, (unsigned long)now.second,
(unsigned long)now.usecond / 1000); (unsigned long)now.usecond / 1000);

View File

@ -64,6 +64,11 @@ void SubsystemBase::executeTable(HybridIterator<ModeListEntry> tableIter, Submod
for (; tableIter.value != nullptr; ++tableIter) { for (; tableIter.value != nullptr; ++tableIter) {
object_id_t object = tableIter.value->getObject(); object_id_t object = tableIter.value->getObject();
// As default, the objectId in the commandTable is the same as the one in the childrenMap.
// The user has to specify otherwise if required.
object = commandObjectIdToChildrenMapObjectId(object);
if ((iter = childrenMap.find(object)) == childrenMap.end()) { if ((iter = childrenMap.find(object)) == childrenMap.end()) {
// illegal table entry, should only happen due to misconfigured mode table // illegal table entry, should only happen due to misconfigured mode table
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
@ -79,22 +84,36 @@ void SubsystemBase::executeTable(HybridIterator<ModeListEntry> tableIter, Submod
} }
if (healthHelper.healthTable->hasHealth(object)) { if (healthHelper.healthTable->hasHealth(object)) {
if (healthHelper.healthTable->isFaulty(object)) {
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND, HasModesIF::MODE_OFF, switch (healthHelper.healthTable->getHealth(object)) {
SUBMODE_NONE); case NEEDS_RECOVERY:
} else { case FAULTY:
if (modeHelper.isForced()) { case PERMANENT_FAULTY:
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND_FORCED, ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND, HasModesIF::MODE_OFF,
tableIter.value->getMode(), submodeToCommand); SUBMODE_NONE);
} else { break;
if (healthHelper.healthTable->isCommandable(object)) { case HEALTHY:
if (modeHelper.isForced()) {
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND_FORCED,
tableIter.value->getMode(), submodeToCommand);
} else {
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND, ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND,
tableIter.value->getMode(), submodeToCommand); tableIter.value->getMode(), submodeToCommand);
}
break;
case EXTERNAL_CONTROL:
if (modeHelper.isForced()) {
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND_FORCED,
tableIter.value->getMode(), submodeToCommand);
} else { } else {
continue; continue;
} }
} break;
default:
// This never happens
break;
} }
} else { } else {
ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND, ModeMessage::setModeMessage(&command, ModeMessage::CMD_MODE_COMMAND,
tableIter.value->getMode(), submodeToCommand); tableIter.value->getMode(), submodeToCommand);
@ -105,7 +124,11 @@ void SubsystemBase::executeTable(HybridIterator<ModeListEntry> tableIter, Submod
continue; // don't send redundant mode commands (produces event spam), but still command if continue; // don't send redundant mode commands (produces event spam), but still command if
// mode is forced to reach lower levels // mode is forced to reach lower levels
} }
ReturnValue_t result = commandQueue->sendMessage(iter->second.commandQueue, &command);
// Get the messageQueueId if the receiver specified by the commandTable.
// This the same MessageQueueId as stored in the childrenMap if the commanded object is part of the childrenMap.
MessageQueueId_t commandedReceiver = ObjectManager::instance()->get<HasHealthIF>(tableIter->getObject())->getCommandQueue();
ReturnValue_t result = commandQueue->sendMessage(commandedReceiver, &command);
if (result == returnvalue::OK) { if (result == returnvalue::OK) {
++commandsOutstanding; ++commandsOutstanding;
} }
@ -339,3 +362,7 @@ ReturnValue_t SubsystemBase::registerChild(object_id_t childObjectId, MessageQue
} }
return returnvalue::OK; return returnvalue::OK;
} }
object_id_t SubsystemBase::commandObjectIdToChildrenMapObjectId(object_id_t commandId) {
return commandId;
}

View File

@ -153,6 +153,15 @@ class SubsystemBase : public SystemObject,
virtual void announceMode(bool recursive) override; virtual void announceMode(bool recursive) override;
virtual void modeChanged(); virtual void modeChanged();
/**
* @brief This converts the objectId of the object we want to send a mode command to into the
* objectId of the corresponding object in the childrenMap for the current mode command.
* As default implementation, this is the same objectId, and this functions returns it's input value
*
* It is up to the user to specify otherwise.
*/
virtual object_id_t commandObjectIdToChildrenMapObjectId(object_id_t commandId);
}; };
#endif /* FSFW_SUBSYSTEM_SUBSYSTEMBASE_H_ */ #endif /* FSFW_SUBSYSTEM_SUBSYSTEMBASE_H_ */

View File

@ -25,7 +25,7 @@ static constexpr ReturnValue_t INCORRECT_SECONDARY_HEADER = MAKE_RETURN_CODE(11)
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TMTC_DISTRIBUTION; static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TMTC_DISTRIBUTION;
//! P1: Returnvalue, P2: 0 for TM issues, 1 for TC issues //! P1: Returnvalue, P2: 0 for TM issues, 1 for TC issues
static constexpr Event HANDLE_PACKET_FAILED = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW); static constexpr Event HANDLE_PACKET_FAILED = event::makeEvent<SUBSYSTEM_ID, 0, severity::LOW>();
}; // namespace tmtcdistrib }; // namespace tmtcdistrib
#endif // FSFW_TMTCPACKET_DEFINITIONS_H #endif // FSFW_TMTCPACKET_DEFINITIONS_H

View File

@ -142,7 +142,7 @@ class TemperatureSensor : public AbstractTemperatureSensor {
deltaTime = (uptime.tv_sec + uptime.tv_usec / 1000000.) - deltaTime = (uptime.tv_sec + uptime.tv_usec / 1000000.) -
(uptimeOfOldTemperature.tv_sec + uptimeOfOldTemperature.tv_usec / 1000000.); (uptimeOfOldTemperature.tv_sec + uptimeOfOldTemperature.tv_usec / 1000000.);
deltaTemp = oldTemperature - outputTemperature; deltaTemp = oldTemperature - outputTemperature.value;
if (deltaTemp < 0) { if (deltaTemp < 0) {
deltaTemp = -deltaTemp; deltaTemp = -deltaTemp;
} }
@ -160,13 +160,13 @@ class TemperatureSensor : public AbstractTemperatureSensor {
outputTemperature.setValid(PoolVariableIF::INVALID); outputTemperature.setValid(PoolVariableIF::INVALID);
outputTemperature = thermal::INVALID_TEMPERATURE; outputTemperature = thermal::INVALID_TEMPERATURE;
} else { } else {
oldTemperature = outputTemperature; oldTemperature = outputTemperature.value;
uptimeOfOldTemperature = uptime; uptimeOfOldTemperature = uptime;
} }
} }
public: public:
float getTemperature() { return outputTemperature; } float getTemperature() { return outputTemperature.value; }
bool isValid() { return outputTemperature.isValid(); } bool isValid() { return outputTemperature.isValid(); }

View File

@ -192,6 +192,8 @@ class Clock {
static MutexIF *timeMutex; static MutexIF *timeMutex;
static uint16_t leapSeconds; static uint16_t leapSeconds;
static bool leapSecondsSet; static bool leapSecondsSet;
static bool monotonicClockInitialized;
static timeval monotonicClockOffset;
}; };
#endif /* FSFW_TIMEMANAGER_CLOCK_H_ */ #endif /* FSFW_TIMEMANAGER_CLOCK_H_ */