small fix which allows sending action reply immediately #109
@ -1320,18 +1320,22 @@ ReturnValue_t DeviceHandlerBase::executeAction(ActionId_t actionId, MessageQueue
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
DeviceCommandMap::iterator iter = deviceCommandMap.find(actionId);
|
DeviceCommandMap::iterator iter = deviceCommandMap.find(actionId);
|
||||||
|
MessageQueueId_t prevRecipient = MessageQueueIF::NO_QUEUE;
|
||||||
if (iter == deviceCommandMap.end()) {
|
if (iter == deviceCommandMap.end()) {
|
||||||
result = COMMAND_NOT_SUPPORTED;
|
result = COMMAND_NOT_SUPPORTED;
|
||||||
} else if (iter->second.isExecuting) {
|
} else if (iter->second.isExecuting) {
|
||||||
result = COMMAND_ALREADY_SENT;
|
result = COMMAND_ALREADY_SENT;
|
||||||
} else {
|
} else {
|
||||||
|
prevRecipient = iter->second.sendReplyTo;
|
||||||
|
iter->second.sendReplyTo = commandedBy;
|
||||||
result = buildCommandFromCommand(actionId, data, size);
|
result = buildCommandFromCommand(actionId, data, size);
|
||||||
}
|
}
|
||||||
if (result == returnvalue::OK) {
|
if (result == returnvalue::OK) {
|
||||||
iter->second.sendReplyTo = commandedBy;
|
|
||||||
iter->second.isExecuting = true;
|
iter->second.isExecuting = true;
|
||||||
cookieInfo.pendingCommand = iter;
|
cookieInfo.pendingCommand = iter;
|
||||||
cookieInfo.state = COOKIE_WRITE_READY;
|
cookieInfo.state = COOKIE_WRITE_READY;
|
||||||
|
} else {
|
||||||
|
iter->second.sendReplyTo = prevRecipient;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user