aqhome apps: more work on transition to events2.

This commit is contained in:
Martin Preuss
2025-03-09 00:06:12 +01:00
parent ca2103f7b3
commit ea564ba101
32 changed files with 475 additions and 268 deletions

View File

@@ -12,6 +12,7 @@
#include "./server_p.h"
#include "./s_publish.h"
#include "./s_setdata.h"
#include "./xmlread.h"
#include "./xmlwrite.h"
@@ -25,6 +26,7 @@
#include <aqhome/msg/ipc/m_ipc.h>
#include <aqhome/msg/ipc/m_ipc_result.h>
#include <aqhome/msg/ipc/m_ipc_connect.h>
#include <aqhome/msg/ipc/m_ipc_tag16.h>
#include <aqhome/msg/ipc/data/m_ipcd.h>
#include <aqhome/msg/ipc/data/m_ipcd_multidata.h>
#include <aqhome/ipc2/mqtt_endpoint.h>
@@ -657,21 +659,26 @@ void AQH_MqttLogServer_HandleBrokerMsgs(AQH_OBJECT *o)
void _handleMsgFromBroker(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_MESSAGE *msg)
{
uint16_t code;
uint8_t protoId;
GWEN_TAG16_LIST *tagList;
/* exec IPC message */
code=AQH_IpcMessage_GetCode(msg);
protoId=AQH_IpcMessage_GetProtoId(msg);
if (protoId==AQH_IPC_PROTOCOL_DATA_ID) {
DBG_ERROR(NULL, "Received IPC packet %d (%x)", (int) code, code);
switch(code) {
// case AQH_MSGTYPE_IPC_DATA_SETDATA: AQH_MqttLogServer_HandleSetData(o, ep, msg); break;
default: break;
tagList=AQH_IpcMessageTag16_ParsePayload(msg, 0);
if (tagList) {
uint16_t code;
uint8_t protoId;
code=AQH_IpcMessage_GetCode(msg);
protoId=AQH_IpcMessage_GetProtoId(msg);
if (protoId==AQH_IPC_PROTOCOL_DATA_ID) {
DBG_ERROR(NULL, "Received IPC packet %d (%x)", (int) code, code);
switch(code) {
case AQH_MSGTYPE_IPC_DATA_SETDATA: AQH_MqttLogServer_HandleSetData(o, msg, tagList); break;
default: break;
}
}
}
else {
DBG_ERROR(NULL, "Invalid IPC protocol %d (%02x)", protoId, protoId);
else {
DBG_ERROR(NULL, "Invalid IPC protocol %d (%02x)", protoId, protoId);
}
GWEN_Tag16_List_free(tagList);
}
}