/**************************************************************************** * This file is part of the project AqHome. * AqHome (c) by 2023 Martin Preuss, all rights reserved. * * The license for this file can be found in the file COPYING which you * should have received along with this file. ****************************************************************************/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #define AQH_MSGDATA_QWORDS_OFFS_FLAGS 0 /* 4 bytes */ #define AQH_MSGDATA_QWORDS_OFFS_NUMVALUES 4 /* 4 bytes */ #define AQH_MSGDATA_QWORDS_OFFS_VALUES 8 /* 8 byte */ #define AQH_MSGDATA_QWORDS_PAYLOADSIZE (AQH_MSGDATA_QWORDS_OFFS_VALUES) #define AQH_MSGDATA_QWORDS_MINSIZE (GWEN_MSGIPC_OFFS_PAYLOAD+AQH_MSGDATA_QWORDS_PAYLOADSIZE) GWEN_MSG *AQH_QwordsIpcMsg_new(uint8_t protoId, uint8_t protoVer, uint16_t code, uint32_t msgId, uint32_t refMsgId, uint32_t flags, const uint64_t *i64Ptr, int count) { GWEN_MSG *msg; uint8_t *ptr; int payloadSize; int i; payloadSize=AQH_MSGDATA_QWORDS_PAYLOADSIZE+(count*8); msg=GWEN_IpcMsg_new(protoId, protoVer, code, msgId, refMsgId, payloadSize, NULL); GWEN_Msg_AddUint32(msg, flags); GWEN_Msg_AddUint32(msg, count); for(i=0; i=AQH_MSGDATA_QWORDS_MINSIZE) { GWEN_Buffer_AppendArgs(dbuf, "QWORDS (code=%d, proto=%d, proto version=%d, flags=0x%08x, values=%d)\n", GWEN_IpcMsg_GetCode(msg), GWEN_IpcMsg_GetProtoId(msg), GWEN_IpcMsg_GetProtoVersion(msg), (unsigned int)AQH_QwordsIpcMsg_GetFlags(msg), AQH_QwordsIpcMsg_GetNumValues(msg)); } }