Prepared introduction of multiple ipc protocols.

This commit is contained in:
Martin Preuss
2023-08-13 14:09:15 +02:00
parent 590eccf8d9
commit 64938b9cb0
29 changed files with 203 additions and 124 deletions

View File

@@ -14,9 +14,9 @@
#include "./utils.h"
#include "aqhome/ipc/endpoint_ipc.h"
#include "aqhome/ipc/msg_ipc_getdevices_req.h"
#include "aqhome/ipc/msg_ipc_getdevices_rsp.h"
#include "aqhome/ipc/msg_ipc_error.h"
#include "aqhome/ipc/nodes/msg_ipc_getdevices_req.h"
#include "aqhome/ipc/nodes/msg_ipc_getdevices_rsp.h"
#include "aqhome/ipc/nodes/msg_ipc_error.h"
#include "aqhome/msg/msg_node.h"
#include <gwenhywfar/args.h>
@@ -146,19 +146,19 @@ int _doGetDevices(GWEN_DB_NODE *dbArgs)
GWEN_MSG *msg;
uint16_t code;
msg=Utils_WaitForSpecificIpcMessage(epTcp, AQH_MSGTYPE_IPC_GETDEVICES_RSP, timeoutInSeconds);
msg=Utils_WaitForSpecificIpcMessage(epTcp, AQH_MSGTYPE_IPC_NODES_GETDEVICES_RSP, timeoutInSeconds);
if (msg==NULL) {
DBG_INFO(NULL, "No GET_DEVICE response received.");
GWEN_MsgEndpoint_free(epTcp);
return 2;
}
code=GWEN_IpcMsg_GetCode(msg);
if (code==AQH_MSGTYPE_IPC_ERROR) {
if (code==AQH_MSGTYPE_IPC_NODES_ERROR) {
fprintf(stdout, "No device list (%d)\n", AQH_ErrorIpcMsg_GetErrorCode(msg));
GWEN_Msg_free(msg);
break;
}
else if (code==AQH_MSGTYPE_IPC_GETDEVICES_RSP) {
else if (code==AQH_MSGTYPE_IPC_NODES_GETDEVICES_RSP) {
uint16_t fwVersion;
int64_t ts64;
GWEN_TIMESTAMP *ts;
@@ -206,7 +206,7 @@ int _sendGetDevices(GWEN_MSG_ENDPOINT *epTcp)
{
GWEN_MSG *msgOut;
msgOut=AQH_GetDevicesRequestIpcMsg_new(AQH_MSGTYPE_IPC_GETDEVICES_REQ);
msgOut=AQH_GetDevicesRequestIpcMsg_new(AQH_MSGTYPE_IPC_NODES_GETDEVICES_REQ);
if (msgOut==NULL) {
DBG_ERROR(NULL, "Error creating message");
return GWEN_ERROR_GENERIC;