More work on aqhome-react.
- added some units - added some types
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
|
||||
#include "./init.h"
|
||||
#include "./aqhome_react_p.h"
|
||||
#include "aqhome-react/units/u_timer.h"
|
||||
#include "aqhome-react/units/u_varchanges.h"
|
||||
|
||||
#include "aqhome/aqhome.h"
|
||||
#include "aqhome/ipc/endpoint_ipc.h"
|
||||
@@ -48,6 +50,7 @@
|
||||
|
||||
static int _createPidFile(const char *pidFilename);
|
||||
static int _setupBroker(AQHOME_REACT *aqh, GWEN_DB_NODE *dbArgs);
|
||||
static void _setupBuiltinUnits(AQHOME_REACT *aqh);
|
||||
static int _readArgs(int argc, char **argv, GWEN_DB_NODE *dbArgs);
|
||||
|
||||
|
||||
@@ -84,7 +87,7 @@ int AqHomeReact_Init(AQHOME_REACT *aqh, int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: setup react units */
|
||||
_setupBuiltinUnits(aqh);
|
||||
|
||||
rv=_setupBroker(aqh, dbArgs);
|
||||
if (rv<0) {
|
||||
@@ -155,6 +158,7 @@ int _setupBroker(AQHOME_REACT *aqh, GWEN_DB_NODE *dbArgs)
|
||||
int rv;
|
||||
|
||||
ep=AQH_ClientIpcEndpoint_new("brokerIpcClient", 0);
|
||||
GWEN_MsgEndpoint_AddFlags(ep, AQH_IPCENDPOINT_FLAGS_WANTUPDATES);
|
||||
ipcBaseEndpoint=AQH_IpcEndpoint_CreateIpcTcpClient(brokerAddress, brokerPort, "brokerPhysEndpoint", 0);
|
||||
AQH_IpcEndpoint_SetServiceName(ipcBaseEndpoint, brokerClientId);
|
||||
GWEN_MsgEndpoint_Tree2_AddChild(ep, ipcBaseEndpoint);
|
||||
@@ -173,6 +177,23 @@ int _setupBroker(AQHOME_REACT *aqh, GWEN_DB_NODE *dbArgs)
|
||||
|
||||
|
||||
|
||||
void _setupBuiltinUnits(AQHOME_REACT *aqh)
|
||||
{
|
||||
AQHREACT_UNIT *unit;
|
||||
|
||||
unit=AqHomeReact_UnitTimer_new();
|
||||
AQHREACT_Unit_SetId(unit, ".timer");
|
||||
AQHREACT_Unit_List_Add(unit, aqh->unitList);
|
||||
aqh->timerUnit=unit;
|
||||
|
||||
unit=AqHomeReact_UnitVarChanges_new();
|
||||
AQHREACT_Unit_SetId(unit, ".updatedValue");
|
||||
AQHREACT_Unit_List_Add(unit, aqh->unitList);
|
||||
aqh->varChangeUnit=unit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int _readArgs(int argc, char **argv, GWEN_DB_NODE *dbArgs)
|
||||
{
|
||||
int rv;
|
||||
|
||||
Reference in New Issue
Block a user