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:
@ -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;
|
||||
|
Reference in New Issue
Block a user