aqhome-react: read network files.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#endif
|
||||
|
||||
#include "./init.h"
|
||||
#include "./net_read.h"
|
||||
#include "./aqhome_react_p.h"
|
||||
#include "aqhome-react/units/u_timer.h"
|
||||
#include "aqhome-react/units/u_varchanges.h"
|
||||
@@ -95,7 +96,7 @@ int AqHomeReact_Init(AQHOME_REACT *aqh, int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
_setupBuiltinUnits(aqh);
|
||||
AqHomeReact_ReloadUnitNets(aqh);
|
||||
|
||||
rv=_setupBroker(aqh, dbArgs);
|
||||
if (rv<0) {
|
||||
@@ -108,6 +109,29 @@ int AqHomeReact_Init(AQHOME_REACT *aqh, int argc, char **argv)
|
||||
|
||||
|
||||
|
||||
void AqHomeReact_ReloadUnitNets(AQHOME_REACT *aqh)
|
||||
{
|
||||
AQHREACT_UNIT_NET_LIST *unitNetList;
|
||||
|
||||
AQHREACT_UnitNet_List_Clear(aqh->unitNetList);
|
||||
AQHREACT_Unit_List_Clear(aqh->unitList);
|
||||
aqh->timerUnit=NULL;
|
||||
aqh->varChangeUnit=NULL;
|
||||
|
||||
_setupBuiltinUnits(aqh);
|
||||
|
||||
unitNetList=AQHREACT_ReadUnitNetFiles(aqh);
|
||||
if (unitNetList) {
|
||||
AQHREACT_UnitNet_List_free(aqh->unitNetList);
|
||||
aqh->unitNetList=unitNetList;
|
||||
}
|
||||
else {
|
||||
DBG_INFO(NULL, "No unit nets read");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int _createPidFile(const char *pidFilename)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
Reference in New Issue
Block a user