aqhome apps: fixed taglist handling.

This commit is contained in:
Martin Preuss
2025-03-11 22:59:18 +01:00
parent 263ce00a14
commit fecaaaf341
11 changed files with 426 additions and 409 deletions

View File

@@ -31,6 +31,7 @@
void AqHomeDataServer_HandleAddValue(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList)
{
if (tagList) {
AQHOME_SERVER *xo;
xo=AqHomeDataServer_GetServerData(o);
@@ -59,6 +60,7 @@ void AqHomeDataServer_HandleAddValue(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_ME
resultCode, NULL);
AQH_Endpoint_AddMsgOut(ep, outMsg);
}
}
}

View File

@@ -31,6 +31,7 @@
void AqHomeDataServer_HandleAnnounceValue(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList)
{
if (tagList) {
AQHOME_SERVER *xo;
xo=AqHomeDataServer_GetServerData(o);
@@ -43,6 +44,7 @@ void AqHomeDataServer_HandleAnnounceValue(AQH_OBJECT *o, AQH_OBJECT *ep, const A
AQH_Value_free(recvdValue);
}
}
}
}

View File

@@ -31,6 +31,7 @@
void AqHomeDataServer_HandleConnect(GWEN_UNUSED AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList)
{
if (tagList) {
AQH_MESSAGE *outMsg;
int resultCode=AQH_MSGDATA_RESULT_SUCCESS;
char *clientId=NULL;
@@ -74,6 +75,7 @@ void AqHomeDataServer_HandleConnect(GWEN_UNUSED AQH_OBJECT *o, AQH_OBJECT *ep, c
AQH_IpcMessage_GetMsgId(msg),
resultCode, NULL);
AQH_Endpoint_AddMsgOut(ep, outMsg);
}
}

View File

@@ -62,6 +62,7 @@ static void _getAndSendLastDatapoint(AQH_STORAGE *storage, AQH_OBJECT *ep, const
void AqHomeDataServer_HandleGetDataPoints(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_MESSAGE *recvdMsg, const GWEN_TAG16_LIST *tagList)
{
if (tagList) {
AQHOME_SERVER *xo;
xo=AqHomeDataServer_GetServerData(o);
@@ -106,6 +107,7 @@ void AqHomeDataServer_HandleGetDataPoints(AQH_OBJECT *o, AQH_OBJECT *ep, const A
AqHomeDataServer_SendResponseResultToEndpoint(ep, refMsgId, AQH_MSGDATA_RESULT_ERROR_PERMS);
}
}
}
}

View File

@@ -49,6 +49,7 @@ static void _sendDeviceList(AQH_OBJECT *ep, const AQH_DEVICE_LIST *vl, uint32_t
void AqHomeDataServer_HandleGetDevices(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList)
{
if (tagList) {
AQHOME_SERVER *xo;
xo=AqHomeDataServer_GetServerData(o);
@@ -99,6 +100,7 @@ void AqHomeDataServer_HandleGetDevices(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_
_sendDeviceList(ep, NULL, AQH_MSGDATA_DEVICES_FLAGS_LASTMSG, refMsgId);
}
}
}
}

View File

@@ -49,6 +49,7 @@ static void _sendValueList(AQH_OBJECT *ep, const AQH_VALUE_LIST *vl, uint32_t fl
void AqHomeDataServer_HandleGetValues(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList)
{
if (tagList) {
AQHOME_SERVER *xo;
xo=AqHomeDataServer_GetServerData(o);
@@ -100,6 +101,7 @@ void AqHomeDataServer_HandleGetValues(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_M
_sendValueList(ep, NULL, AQH_MSGDATA_VALUES_FLAGS_LASTMSG, refMsgId);
}
}
}
}

View File

@@ -36,6 +36,7 @@
void AqHomeDataServer_HandleModDevice(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_MESSAGE *recvdMsg, const GWEN_TAG16_LIST *tagList)
{
if (tagList) {
AQHOME_SERVER *xo;
xo=AqHomeDataServer_GetServerData(o);
@@ -97,6 +98,7 @@ void AqHomeDataServer_HandleModDevice(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_M
}
AqHomeDataServer_SendResponseResultToEndpoint(ep, AQH_IpcMessage_GetMsgId(recvdMsg), resultCode);
}
}
}

View File

@@ -62,6 +62,7 @@ static void _subRqAbort(AQH_MSG_REQUEST *rq, int reason);
void AqHomeDataServer_HandleSetData(AQH_OBJECT *o, AQH_OBJECT *epSrc, const AQH_MESSAGE *recvdMsg, const GWEN_TAG16_LIST *tagList)
{
if (tagList) {
AQHOME_SERVER *xo;
xo=AqHomeDataServer_GetServerData(o);
@@ -125,6 +126,7 @@ void AqHomeDataServer_HandleSetData(AQH_OBJECT *o, AQH_OBJECT *epSrc, const AQH_
AqHomeDataServer_SendResponseResultToEndpoint(epSrc, msgId, AQH_MSGDATA_RESULT_ERROR_BADDATA);
}
}
}
}

View File

@@ -53,6 +53,7 @@ static void _sendDataChangedMsgToAllClients(AQHOME_SERVER *xo, AQH_OBJECT *epSrc
void AqHomeDataServer_HandleUpdateData(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList)
{
if (tagList) {
AQHOME_SERVER *xo;
xo=AqHomeDataServer_GetServerData(o);
@@ -108,6 +109,7 @@ void AqHomeDataServer_HandleUpdateData(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_
resultCode, NULL);
AQH_Endpoint_AddMsgOut(ep, outMsg);
}
}
}

View File

@@ -423,12 +423,11 @@ void _handleMsgsFromClient(AQH_OBJECT *o, AQHOME_SERVER *xo, AQH_OBJECT *ep)
void _handleMsgFromClient(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_MESSAGE *msg)
{
GWEN_TAG16_LIST *tagList;
tagList=AQH_IpcMessageTag16_ParsePayload(msg, 0);
if (tagList) {
uint16_t code;
uint8_t protoId;
tagList=AQH_IpcMessageTag16_ParsePayload(msg, 0);
code=AQH_IpcMessage_GetCode(msg);
protoId=AQH_IpcMessage_GetProtoId(msg);
if (protoId==AQH_IPC_PROTOCOL_DATA_ID) {
@@ -450,7 +449,6 @@ void _handleMsgFromClient(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_MESSAGE *msg)
DBG_ERROR(NULL, "Invalid IPC protocol %d (%02x)", protoId, protoId);
}
GWEN_Tag16_List_free(tagList);
}
}

View File

@@ -31,6 +31,7 @@
void AQH_NodeServer_HandleConnect(GWEN_UNUSED AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList)
{
if (tagList) {
AQH_MESSAGE *outMsg;
int resultCode=AQH_MSGDATA_RESULT_SUCCESS;
char *clientId=NULL;
@@ -74,7 +75,7 @@ void AQH_NodeServer_HandleConnect(GWEN_UNUSED AQH_OBJECT *o, AQH_OBJECT *ep, con
AQH_IpcMessage_GetMsgId(msg),
resultCode, NULL);
AQH_Endpoint_AddMsgOut(ep, outMsg);
DBG_ERROR(NULL, "Client connected");
}
}