aqhome-nodes: re-implemented setdata request received via broker.

This commit is contained in:
Martin Preuss
2024-09-30 22:43:35 +02:00
parent 03f9178dd2
commit 8199f7c3b0
14 changed files with 260 additions and 326 deletions

View File

@@ -264,12 +264,14 @@ GWEN_MSG_ENDPOINT *AQH_IpcEndpoint_CreateIpcTcpServiceForSocket(GWEN_SOCKET *sk,
void AQH_IpcEndpoint_SendResponseResult(GWEN_MSG_ENDPOINT *ep, uint32_t refMsgId, uint16_t code, uint32_t resultCode)
{
GWEN_MSG *msgOut;
uint32_t msgId;
if (ep) {
GWEN_MSG *msgOut;
uint32_t msgId;
msgId=GWEN_MsgEndpoint_GetNextMessageId(ep);
msgOut=AQH_ResultIpcMsg_new(code, msgId, refMsgId, resultCode);
GWEN_MsgEndpoint_AddSendMessage(ep, msgOut);
msgId=GWEN_MsgEndpoint_GetNextMessageId(ep);
msgOut=AQH_ResultIpcMsg_new(code, msgId, refMsgId, resultCode);
GWEN_MsgEndpoint_AddSendMessage(ep, msgOut);
}
}

View File

@@ -11,6 +11,7 @@
#endif
#include <aqhome/ipc/msg_ipc_result.h>
#include <aqhome/ipc/data/ipc_data.h>
#include <gwenhywfar/msg.h>
#include <gwenhywfar/buffer.h>
@@ -35,9 +36,8 @@
GWEN_MSG *AQH_ResultIpcMsg_new(uint16_t code, uint32_t msgId, uint32_t refMsgId, uint32_t resultCode)
{
GWEN_MSG *msg;
uint8_t *ptr;
msg=GWEN_IpcMsg_new(AQH_IPC_PROTOCOL_RESULT_ID, AQH_IPC_PROTOCOL_RESULT_VERSION, code,
msg=GWEN_IpcMsg_new(AQH_IPC_PROTOCOL_DATA_ID, AQH_IPC_PROTOCOL_DATA_VERSION, code,
msgId, refMsgId,
AQH_MSGIPC_RESULT_PAYLOADSIZE, NULL);
GWEN_Msg_AddUint32(msg, resultCode);
@@ -59,7 +59,8 @@ void AQH_ResultIpcMsg_DumpToBuffer(const GWEN_MSG *msg, GWEN_BUFFER *dbuf, const
{
if (GWEN_Msg_GetBytesInBuffer(msg)>=AQH_MSGIPC_RESULT_MINSIZE) {
GWEN_Buffer_AppendArgs(dbuf,
"ERROR (code=%d, proto=%d, proto version=%d, error=%d, msgId=%d, refMsgId=%d)\n",
"ERROR %s (code=%d, proto=%d, proto version=%d, error=%d, msgId=%d, refMsgId=%d)\n",
sText?sText:"",
GWEN_IpcMsg_GetCode(msg),
GWEN_IpcMsg_GetProtoId(msg),
GWEN_IpcMsg_GetProtoVersion(msg),

View File

@@ -31,6 +31,7 @@
#define AQH_MSG_IPC_ERROR_PERMS 6
#define AQH_MSG_IPC_ERROR_NOTFOUND 7
#define AQH_MSG_IPC_ERROR_IO 8
#define AQH_MSG_IPC_ERROR_TRYAGAIN 9
AQHOME_API GWEN_MSG *AQH_ResultIpcMsg_new(uint16_t code, uint32_t msgId, uint32_t refMsgId, uint32_t resultCode);