Files
aqhomecontrol/apps/aqhome-nodes/aqhomed.h

60 lines
1.8 KiB
C

/****************************************************************************
* 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 AQHOMED_H
#define AQHOMED_H
#include <gwenhywfar/endpoint.h>
#include <gwenhywfar/db.h>
#include <gwenhywfar/request.h>
#define AQHOME_ENDPOINTGROUP_NODE 1
#define AQHOME_ENDPOINTGROUP_IPC 2
#define AQHOME_ENDPOINTGROUP_MQTT 4
typedef struct AQHOMED AQHOMED;
#include "aqhome-nodes/types/device.h"
AQHOMED *AqHomed_new(void);
void AqHomed_free(AQHOMED *aqh);
GWEN_MSG_ENDPOINT *AqHomed_GetTtyEndpoint(const AQHOMED *aqh);
GWEN_MSG_ENDPOINT *AqHomed_GetIpcdEndpoint(const AQHOMED *aqh);
GWEN_MSG_ENDPOINT *AqHomed_GetBrokerEndpoint(const AQHOMED *aqh);
GWEN_DB_NODE *AqHomed_GetDbArgs(const AQHOMED *aqh);
const char *AqHomed_GetLogFile(const AQHOMED *aqh);
void AqHomed_SetLogFile(AQHOMED *aqh, const char *s);
const char *AqHomed_GetPidFile(const AQHOMED *aqh);
void AqHomed_SetPidFile(AQHOMED *aqh, const char *s);
const char *AqHomed_GetDbFile(const AQHOMED *aqh);
void AqHomed_SetDbFile(AQHOMED *aqh, const char *s);
int AqHomed_GetTimeout(const AQHOMED *aqh);
GWEN_MSG_REQUEST *AqHomed_GetRequestTree(const AQHOMED *aqh);
void AqHomed_AddRequestToTree(AQHOMED *aqh, GWEN_MSG_REQUEST *rq);
const AQHNODE_DEVICE_LIST *AqHomed_GetDeviceDefList(const AQHOMED *aqh);
const AQHNODE_DEVICE *AqHomed_FindDeviceDef(const AQHOMED *aqh, uint32_t manufacturer, uint16_t deviceType, uint16_t deviceVersion);
const AQHNODE_DEVICE *AqHomed_GetDeviceDefByName(const AQHOMED *aqh, const char *name);
#endif