aqhome-data: use requests for SETDATA ipc command.

This commit is contained in:
Martin Preuss
2024-10-01 22:04:01 +02:00
parent 9c2001285b
commit 6f5da8ee6c
5 changed files with 204 additions and 35 deletions

View File

@@ -28,6 +28,7 @@
#include "aqhome/ipc/data/msg_data_datapoints.h"
#include "aqhome/ipc/endpoint_ipc.h"
#include "aqhome/ipc/msg_ipc_result.h"
#include "aqhome/ipc/requests.h"
#include <gwenhywfar/gwenhywfar.h>
#include <gwenhywfar/args.h>
@@ -67,6 +68,9 @@ void AqHomeData_Loop(AQHOME_DATA *aqh, int timeoutInMsecs)
if (aqh) {
GWEN_MsgEndpoint_IoLoop(aqh->ipcdEndpoint, timeoutInMsecs);
_readAndHandleIpcMessages(aqh);
AQH_Requests_CheckTimeouts(aqh->requestTree);
AQH_Requests_Cleanup(aqh->requestTree);
}
}
@@ -210,7 +214,13 @@ void _handleIpcEndpoint(AQHOME_DATA *aqh, GWEN_MSG_ENDPOINT *ep)
GWEN_MSG *msg;
while( (msg=GWEN_MsgEndpoint_TakeFirstReceivedMessage(ep)) ) {
_handleIpcMsg(aqh, ep, msg);
DBG_ERROR(NULL, "Got IPS message %d (msgId=%d, refMsgId=%d) [%s]",
GWEN_IpcMsg_GetCode(msg),
GWEN_IpcMsg_GetMsgId(msg),
GWEN_IpcMsg_GetRefMsgId(msg),
GWEN_MsgEndpoint_GetName(ep));
if (AQH_Requests_HandleIpcMsg(aqh->requestTree, ep, msg)!=GWEN_MSG_REQUEST_RESULT_HANDLED)
_handleIpcMsg(aqh, ep, msg);
GWEN_Msg_free(msg);
}
}