aqhome: added AQH_IpcdMessageValues_newForOne()

This commit is contained in:
Martin Preuss
2025-03-01 15:23:07 +01:00
parent 6b61763d6f
commit c7551512bc
2 changed files with 27 additions and 0 deletions

View File

@@ -59,6 +59,30 @@ AQH_MESSAGE *AQH_IpcdMessageValues_new(uint16_t code, uint32_t msgId, uint32_t r
AQH_MESSAGE *AQH_IpcdMessageValues_newForOne(uint16_t code, uint32_t msgId, uint32_t refMsgId,
uint32_t flags, const AQH_VALUE *value)
{
AQH_MESSAGE *msg;
GWEN_BUFFER *buf;
int rv;
buf=GWEN_Buffer_new(0, 256, 0, 1);
GWEN_Tag16_WriteUint32TagToBuffer(AQH_MSGDATA_VALUES_TAGS_FLAGS, flags, buf);
rv=AQH_Tag16_WriteValueAsTagToBuffer(AQH_MSGDATA_VALUES_TAGS_VALUE, value, buf);
if (rv<0) {
DBG_INFO(AQH_LOGDOMAIN, "here (%d)", rv);
GWEN_Buffer_free(buf);
return NULL;
}
msg=AQH_IpcMessage_new(AQH_IPC_PROTOCOL_DATA_ID, AQH_IPC_PROTOCOL_DATA_VERSION, code, msgId, refMsgId,
GWEN_Buffer_GetUsedBytes(buf), (const uint8_t*) GWEN_Buffer_GetStart(buf));
GWEN_Buffer_free(buf);
return msg;
}
AQH_VALUE_LIST *AQH_IpcdMessageValues_ReadValueList(const GWEN_TAG16_LIST *tagList)
{
if (tagList) {

View File

@@ -29,6 +29,9 @@
AQHOME_API AQH_MESSAGE *AQH_IpcdMessageValues_new(uint16_t code, uint32_t msgId, uint32_t refMsgId,
uint32_t flags, const AQH_VALUE_LIST *valueList);
AQHOME_API AQH_MESSAGE *AQH_IpcdMessageValues_newForOne(uint16_t code, uint32_t msgId, uint32_t refMsgId,
uint32_t flags, const AQH_VALUE *value);
AQHOME_API AQH_VALUE_LIST *AQH_IpcdMessageValues_ReadValueList(const GWEN_TAG16_LIST *tagList);
AQHOME_API AQH_VALUE *AQH_IpcdMessageValues_ReadFirstValue(const GWEN_TAG16_LIST *tagList);
AQHOME_API uint32_t AQH_IpcdMessageValues_GetFlags(const GWEN_TAG16_LIST *tagList);