From ecac08814e8dbcf4d47ac0bea111502bcb528dfa Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 14 Jul 2022 09:15:13 +0200 Subject: [PATCH] better naming for functions which reset states of replies --- src/fsfw/devicehandlers/DeviceHandlerBase.cpp | 12 ++++++------ src/fsfw/devicehandlers/DeviceHandlerBase.h | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp index ca7701d0..cf457a03 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp @@ -239,14 +239,14 @@ void DeviceHandlerBase::decrementDeviceReplyMap() { for (std::pair& replyPair : deviceReplyMap) { if (replyPair.second.countdown != nullptr && replyPair.second.active) { if (replyPair.second.countdown->hasTimedOut()) { - disableTimeoutControlledReply(&replyPair.second); + resetTimeoutControlledReply(&replyPair.second); timedOut = true; } } if (replyPair.second.delayCycles != 0 && replyPair.second.countdown == nullptr) { replyPair.second.delayCycles--; if (replyPair.second.delayCycles == 0) { - disableDelayCyclesControlledReply(&replyPair.second); + resetDelayCyclesControlledReply(&replyPair.second); timedOut = true; } } @@ -841,9 +841,9 @@ void DeviceHandlerBase::handleReply(const uint8_t* receivedData, DeviceCommandId } if (info->active && info->countdown != nullptr) { - disableTimeoutControlledReply(info); + resetTimeoutControlledReply(info); } else if (info->delayCycles != 0) { - disableDelayCyclesControlledReply(info); + resetDelayCyclesControlledReply(info); } if (result != RETURN_OK) { @@ -862,7 +862,7 @@ void DeviceHandlerBase::handleReply(const uint8_t* receivedData, DeviceCommandId } } -void DeviceHandlerBase::disableTimeoutControlledReply(DeviceReplyInfo* info) { +void DeviceHandlerBase::resetTimeoutControlledReply(DeviceReplyInfo* info) { if (info->periodic) { info->countdown->resetTimer(); } else { @@ -871,7 +871,7 @@ void DeviceHandlerBase::disableTimeoutControlledReply(DeviceReplyInfo* info) { } } -void DeviceHandlerBase::disableDelayCyclesControlledReply(DeviceReplyInfo* info) { +void DeviceHandlerBase::resetDelayCyclesControlledReply(DeviceReplyInfo* info) { if (info->periodic) { info->delayCycles = info->maxDelayCycles; } else { diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.h b/src/fsfw/devicehandlers/DeviceHandlerBase.h index 1945ac65..e29e6596 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.h +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.h @@ -1257,15 +1257,15 @@ class DeviceHandlerBase : public DeviceHandlerIF, void doGetRead(void); /** - * @brief Handles disabling of replies which use a timeout to detect missed replies. + * @brief Resets replies which use a timeout to detect missed replies. */ - void disableTimeoutControlledReply(DeviceReplyInfo *info); + void resetTimeoutControlledReply(DeviceReplyInfo *info); /** - * @brief Handles disabling of replies which use a number of maximum delay cycles to detect + * @brief Resets replies which use a number of maximum delay cycles to detect * missed replies. */ - void disableDelayCyclesControlledReply(DeviceReplyInfo *info); + void resetDelayCyclesControlledReply(DeviceReplyInfo *info); /** * Retrive data from the #IPCStore.