/****************************************************************************
 * 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.
 ****************************************************************************/

#ifndef AQH_MSG_IPC_TAG16_H
#define AQH_MSG_IPC_TAG16_H


#include <aqhome/api.h>

#include <gwenhywfar/msg.h>
#include <gwenhywfar/buffer.h>
#include <gwenhywfar/tag16.h>


AQHOME_API GWEN_MSG *AQH_Tag16IpcMsg_new(uint8_t protoId, uint8_t protoVer, uint16_t code, uint32_t payloadLen, const uint8_t *payload);
AQHOME_API void AQH_Tag16IpcMsg_ExtendAndParse(GWEN_MSG *msg, int doCopy);

AQHOME_API void AQH_Tag16IpcMsg_Extend(GWEN_MSG *msg);
AQHOME_API void AQH_Tag16IpcMsg_ReadTags(GWEN_MSG *msg, int doCopy);

AQHOME_API GWEN_TAG16_LIST *AQH_Tag16IpcMsg_GetTags(const GWEN_MSG *msg);

AQHOME_API GWEN_DEPRECATED GWEN_TAG16_LIST *AQH_Tag16IpcMsg_ParseTags(const GWEN_MSG *msg, int doCopy);
AQHOME_API void AQH_Tag16IpcMsg_DumpToBuffer(const GWEN_MSG *msg, GWEN_BUFFER *dbuf, const char *sText);

AQHOME_API const GWEN_TAG16 *AQH_Tag16IpcMsg_FindFirstTagByType(const GWEN_MSG *msg, unsigned int tagType);

AQHOME_API char *AQH_Tag16IpcMsg_GetTagDataAsNewString(const GWEN_MSG *msg, unsigned int tagType, const char *defaultValue);
AQHOME_API uint32_t AQH_Tag16IpcMsg_GetTagDataAsUint32(const GWEN_MSG *msg, unsigned int tagType, uint32_t defaultValue);
AQHOME_API uint64_t AQH_Tag16IpcMsg_GetTagDataAsUint64(const GWEN_MSG *msg, unsigned int tagType, uint64_t defaultValue);




#endif



