aqhome-tool: more work on transformation to events2.

This commit is contained in:
Martin Preuss
2025-03-01 15:22:00 +01:00
parent 0cfec70025
commit 106f47d465
2 changed files with 15 additions and 85 deletions

View File

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