better naming for functions which reset states of replies

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) {
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 {

View File

@ -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.