67 lines
2.5 KiB
C
67 lines
2.5 KiB
C
/****************************************************************************
|
|
* This file is part of the project AqHome.
|
|
* AqHome (c) by 2024 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_REACT_H
|
|
#define AQHOME_REACT_H
|
|
|
|
#include <gwenhywfar/endpoint.h>
|
|
|
|
|
|
typedef struct AQHOME_REACT AQHOME_REACT;
|
|
|
|
#include "aqhome-react/types/unit.h"
|
|
#include "aqhome/data/vars.h"
|
|
|
|
|
|
AQHOME_REACT *AqHomeReact_new();
|
|
void AqHomeReact_free(AQHOME_REACT *aqh);
|
|
|
|
GWEN_MSG_ENDPOINT *AqHomeReact_GetBrokerEndpoint(const AQHOME_REACT *aqh);
|
|
|
|
GWEN_DB_NODE *AqHomeReact_GetDbArgs(const AQHOME_REACT *aqh);
|
|
|
|
const char *AqHomeReact_GetPidFile(const AQHOME_REACT *aqh);
|
|
void AqHomeReact_SetPidFile(AQHOME_REACT *aqh, const char *s);
|
|
|
|
const char *AqHomeReact_GetVarsFile(const AQHOME_REACT *aqh);
|
|
void AqHomeReact_SetVarsFile(AQHOME_REACT *aqh, const char *s);
|
|
|
|
int AqHomeReact_GetTimeout(const AQHOME_REACT *aqh);
|
|
|
|
time_t AqHomeReact_GetLatestNetworkFileTime(const AQHOME_REACT *aqh);
|
|
void AqHomeReact_SetLatestNetworkFileTime(AQHOME_REACT *aqh, time_t t);
|
|
|
|
|
|
AQHREACT_UNIT *AqHomeReact_GetTimerUnit(const AQHOME_REACT *aqh);
|
|
AQHREACT_UNIT *AqHomeReact_GetServerVarChangeUnit(const AQHOME_REACT *aqh);
|
|
AQHREACT_UNIT *AqHomeReact_GetLocalVarChangeUnit(const AQHOME_REACT *aqh);
|
|
|
|
AQHREACT_UNIT *AqHomeReact_FindUnitByUnitId(const AQHOME_REACT *aqh, const char *unitId);
|
|
void AqHomeReact_AddUnit(AQHOME_REACT *aqh, AQHREACT_UNIT *unit);
|
|
|
|
AQHREACT_UNIT *AqHomeReact_CreateUnitByName(AQHOME_REACT *aqh, const char *unitType);
|
|
|
|
AQH_VARS *AqHomeReact_GetLocalVars(const AQHOME_REACT *aqh);
|
|
|
|
int AqHomeReact_SetCharValue(AQHOME_REACT *aqh, const char *path, const char *value);
|
|
const char *AqHomeReact_GetCharValue(AQHOME_REACT *aqh, const char *path, int idx, const char *defaultValue);
|
|
|
|
int AqHomeReact_SetDoubleValue(AQHOME_REACT *aqh, const char *path, double value);
|
|
double AqHomeReact_GetDoubleValue(AQHOME_REACT *aqh, const char *path, int idx, double defaultValue);
|
|
|
|
int AqHomeReact_SetIntValue(AQHOME_REACT *aqh, const char *path, int value);
|
|
int AqHomeReact_GetIntValue(AQHOME_REACT *aqh, const char *path, int idx, int defaultValue);
|
|
|
|
int AqHomeReact_IncIntValue(AQHOME_REACT *aqh, const char *path, int startValue, int defaultValue);
|
|
int AqHomeReact_DecIntValue(AQHOME_REACT *aqh, const char *path, int startValue, int defaultValue);
|
|
|
|
int AqHomeReact_WriteVarsFile(AQHOME_REACT *aqh);
|
|
|
|
#endif
|
|
|