aqhome-tool: more work on transformation to events2.
This commit is contained in:
@@ -215,42 +215,6 @@ GWEN_MSG *Utils_WaitForSpecificNodeMessage(GWEN_MSG_ENDPOINT *epTcp,
|
||||
|
||||
|
||||
|
||||
AQH_MESSAGE *Utils2_WaitForResponseMsg(AQH_EVENT_LOOP *eventLoop, AQH_OBJECT *epTcp, uint32_t refMsgId, int timeoutInSeconds)
|
||||
{
|
||||
time_t startTime;
|
||||
|
||||
startTime=time(NULL);
|
||||
|
||||
for (;;) {
|
||||
AQH_MESSAGE *msg;
|
||||
time_t now;
|
||||
|
||||
AQH_EventLoop_Run(eventLoop, 500);
|
||||
msg=AQH_Endpoint_GetNextMsgIn(epTcp);
|
||||
if (msg) {
|
||||
if (refMsgId==0 || refMsgId==AQH_IpcMessage_GetRefMsgId(msg))
|
||||
return msg;
|
||||
else {
|
||||
uint16_t code;
|
||||
|
||||
code=AQH_IpcMessage_GetCode(msg);
|
||||
DBG_ERROR(NULL, "Received unexpected message %d (%x), ignoring", code, code);
|
||||
AQH_Message_free(msg);
|
||||
}
|
||||
}
|
||||
|
||||
now=time(NULL);
|
||||
if (now-startTime>timeoutInSeconds) {
|
||||
DBG_INFO(NULL, "Timeout");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
GWEN_MSG *Utils_WaitForSpecificIpcMessage(GWEN_MSG_ENDPOINT *epTcp,
|
||||
int msgCode,
|
||||
int timeoutInSeconds)
|
||||
|
||||
Reference in New Issue
Block a user