/**************************************************************************** * 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 AQHOME_TOOL_CLIENT_H #define AQHOME_TOOL_CLIENT_H #include "aqhome/msg/ipc/m_ipc_tag16.h" #include typedef AQH_MESSAGE* (*AQH_TOOLCLIENT_CREATEREQUESTMESSAGE_FN)(AQH_OBJECT *o, uint32_t msgId); typedef int (*AQH_TOOLCLIENT_HANDLERESPONSEMESSAGE_FN)(AQH_OBJECT *o, const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList, int first); AQH_OBJECT *AQH_ToolClient_new(AQH_EVENT_LOOP *eventLoop, GWEN_DB_NODE *dbGlobalArgs, const GWEN_ARGS *argDescrs); int AQH_ToolClient_ReadLocalArgs(AQH_OBJECT *o, int argc, char **argv); int AQH_ToolClient_Run(AQH_OBJECT *o); int AQH_ToolClient_Watch(AQH_OBJECT *o); GWEN_DB_NODE *AQH_ToolClient_GetDbGlobalArgs(const AQH_OBJECT *o); GWEN_DB_NODE *AQH_ToolClient_GetDbLocalArgs(const AQH_OBJECT *o); uint32_t AQH_ToolClient_GetFlags(const AQH_OBJECT *o); void AQH_ToolClient_SetFlags(AQH_OBJECT *o, uint32_t f); void AQH_ToolClient_AddFlags(AQH_OBJECT *o, uint32_t f); void AQH_ToolClient_SubFlags(AQH_OBJECT *o, uint32_t f); /** * @param o client object * @param msg received message * @param tagList list of GWEN_TAG16 objects * @param first msg is the first response received */ int AQH_ToolClient_HandleResultMsg(const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList, int first); void AQH_ToolClient_SetCreateRequestMessageFn(AQH_OBJECT *o, AQH_TOOLCLIENT_CREATEREQUESTMESSAGE_FN f); void AQH_ToolClient_SetHandleResponseMessageFn(AQH_OBJECT *o, AQH_TOOLCLIENT_HANDLERESPONSEMESSAGE_FN f); #endif