better naming for functions which reset states of replies
fsfw/fsfw/pipeline/pr-development This commit looks good Details
fsfw/fsfw/pipeline/head This commit looks good Details

This commit is contained in:
Jakob Meier 2022-07-14 09:15:13 +02:00
parent e8b8fff0b5
commit ecac08814e
2 changed files with 10 additions and 10 deletions

View File

@ -239,14 +239,14 @@ void DeviceHandlerBase::decrementDeviceReplyMap() {
for (std::pair<const DeviceCommandId_t, DeviceReplyInfo>& replyPair : deviceReplyMap) { for (std::pair<const DeviceCommandId_t, DeviceReplyInfo>& replyPair : deviceReplyMap) {
if (replyPair.second.countdown != nullptr && replyPair.second.active) { if (replyPair.second.countdown != nullptr && replyPair.second.active) {
if (replyPair.second.countdown->hasTimedOut()) { if (replyPair.second.countdown->hasTimedOut()) {
disableTimeoutControlledReply(&replyPair.second); resetTimeoutControlledReply(&replyPair.second);
timedOut = true; timedOut = true;
} }
} }
if (replyPair.second.delayCycles != 0 && replyPair.second.countdown == nullptr) { if (replyPair.second.delayCycles != 0 && replyPair.second.countdown == nullptr) {
replyPair.second.delayCycles--; replyPair.second.delayCycles--;
if (replyPair.second.delayCycles == 0) { if (replyPair.second.delayCycles == 0) {
disableDelayCyclesControlledReply(&replyPair.second); resetDelayCyclesControlledReply(&replyPair.second);
timedOut = true; timedOut = true;
} }
} }
@ -841,9 +841,9 @@ void DeviceHandlerBase::handleReply(const uint8_t* receivedData, DeviceCommandId
} }
if (info->active && info->countdown != nullptr) { if (info->active && info->countdown != nullptr) {
disableTimeoutControlledReply(info); resetTimeoutControlledReply(info);
} else if (info->delayCycles != 0) { } else if (info->delayCycles != 0) {
disableDelayCyclesControlledReply(info); resetDelayCyclesControlledReply(info);
} }
if (result != RETURN_OK) { 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) { if (info->periodic) {
info->countdown->resetTimer(); info->countdown->resetTimer();
} else { } else {
@ -871,7 +871,7 @@ void DeviceHandlerBase::disableTimeoutControlledReply(DeviceReplyInfo* info) {
} }
} }
void DeviceHandlerBase::disableDelayCyclesControlledReply(DeviceReplyInfo* info) { void DeviceHandlerBase::resetDelayCyclesControlledReply(DeviceReplyInfo* info) {
if (info->periodic) { if (info->periodic) {
info->delayCycles = info->maxDelayCycles; info->delayCycles = info->maxDelayCycles;
} else { } else {

View File

@ -1257,15 +1257,15 @@ class DeviceHandlerBase : public DeviceHandlerIF,
void doGetRead(void); 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. * missed replies.
*/ */
void disableDelayCyclesControlledReply(DeviceReplyInfo *info); void resetDelayCyclesControlledReply(DeviceReplyInfo *info);
/** /**
* Retrive data from the #IPCStore. * Retrive data from the #IPCStore.