1
0
forked from fsfw/fsfw

assuming that a default value of 0 for expectedReplies is needed, I introduced a new variable into DeviceCommandInfo, which stores another number of replies expected. this value is assigned in enableReplyInReplyMap. That way, the initial value of 0 remains the same (if it was needed), and is only set to another desired value if a write was sent

This commit is contained in:
2019-11-04 01:55:40 +01:00
parent 12f51575eb
commit cb919ada2a
2 changed files with 10 additions and 4 deletions

View File

@ -285,7 +285,8 @@ ReturnValue_t DeviceHandlerBase::insertInReplyMap(DeviceCommandId_t replyId,
ReturnValue_t DeviceHandlerBase::insertInCommandMap(
DeviceCommandId_t deviceCommand, uint8_t expectedReplies) {
DeviceCommandInfo info;
info.expectedReplies = expectedReplies;
info.expectedReplies = 0;
info.expectedRepliesWhenEnablingReplyMap = expectedReplies;
info.isExecuting = false;
info.sendReplyTo = NO_COMMANDER;
std::pair<std::map<DeviceCommandId_t, DeviceCommandInfo>::iterator, bool> returnValue;
@ -821,7 +822,7 @@ ReturnValue_t DeviceHandlerBase::enableReplyInReplyMap(
DeviceReplyInfo *info = &(iter->second);
info->delayCycles = info->maxDelayCycles;
info->command = command;
// command->second.expectedReplies = expectedReplies;
command->second.expectedReplies = command->second.expectedRepliesWhenEnablingReplyMap;
return RETURN_OK;
} else {
return NO_REPLY_EXPECTED;