aqhome-react: finish new network reading code, improved debugging helper code.
This commit is contained in:
@@ -39,6 +39,7 @@ static void GWENHYWFAR_CB _freeData(void *bp, void *p);
|
||||
static void _cbInputData(AQHREACT_UNIT *unit, AQHREACT_PORT *port, const AQHREACT_DATAOBJECT *dataObject);
|
||||
static AQHREACT_PARAM *_cbGetParamByName(const AQHREACT_UNIT *unit, const char *paramName);
|
||||
static int _cbProcess(AQHREACT_UNIT *unit);
|
||||
static void _cbDump(const AQHREACT_UNIT *unit, GWEN_BUFFER *buf, int indent);
|
||||
|
||||
static void _readProxyFromXml(GWEN_XMLNODE *xmlNode,
|
||||
MODULE_PROXY_DESCR_LIST *proxyDescrList,
|
||||
@@ -155,6 +156,7 @@ AQHREACT_UNIT *AqHomeReact_UnitModule_new(AQHOME_REACT *aqh)
|
||||
AQHREACT_Unit_SetInputDataFn(unit, _cbInputData);
|
||||
AQHREACT_Unit_SetGetParamByNameFn(unit, _cbGetParamByName);
|
||||
AQHREACT_Unit_SetProcessFn(unit, _cbProcess);
|
||||
AQHREACT_Unit_SetDumpFn(unit, _cbDump);
|
||||
|
||||
return unit;
|
||||
}
|
||||
@@ -243,13 +245,18 @@ AQHREACT_PARAM *_cbGetParamByName(const AQHREACT_UNIT *unit, const char *paramNa
|
||||
{
|
||||
AQHREACT_UNIT_MODULE *xunit;
|
||||
|
||||
DBG_INFO(NULL, "Looking for param \"%s\" in proxy descr of module \"%s\"", paramName, AQHREACT_Unit_GetName(unit));
|
||||
xunit=(AQHREACT_UNIT_MODULE*)GWEN_INHERIT_GETDATA(AQHREACT_UNIT, AQHREACT_UNIT_MODULE, unit);
|
||||
if (xunit) {
|
||||
const MODULE_PROXY_DESCR *pd;
|
||||
|
||||
pd=ModuleProxyDescr_List_FindByName(xunit->paramProxyList, paramName);
|
||||
if (pd)
|
||||
AQHREACT_Unit_GetParamByName(pd->targetObjectPtr, pd->targetName);
|
||||
if (pd) {
|
||||
DBG_INFO(NULL, "Found proxydescr for param (-> %s:%s)",
|
||||
(pd->targetObjectPtr)?AQHREACT_Unit_GetName(pd->targetObjectPtr):"<no unit>",
|
||||
(pd->targetName)?(pd->targetName):"<no param>");
|
||||
return AQHREACT_Unit_GetParamByName(pd->targetObjectPtr, pd->targetName);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -282,6 +289,17 @@ int _cbProcess(AQHREACT_UNIT *unit)
|
||||
|
||||
|
||||
|
||||
void _cbDump(const AQHREACT_UNIT *unit, GWEN_BUFFER *buf, int indent)
|
||||
{
|
||||
AQHREACT_UNIT_MODULE *xunit;
|
||||
|
||||
xunit=(AQHREACT_UNIT_MODULE*)GWEN_INHERIT_GETDATA(AQHREACT_UNIT, AQHREACT_UNIT_MODULE, unit);
|
||||
if (xunit)
|
||||
AQHREACT_Unit_List_Dump(xunit->unitList, buf, indent, "Sub Units:");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void _readProxyFromXml(GWEN_XMLNODE *xmlNode,
|
||||
MODULE_PROXY_DESCR_LIST *proxyDescrList,
|
||||
const char *mainGroupName,
|
||||
@@ -543,7 +561,7 @@ int _readParamFromXml(AQHREACT_UNIT *unit, GWEN_XMLNODE *paramNode)
|
||||
} /* if value */
|
||||
}
|
||||
else {
|
||||
DBG_ERROR(NULL, "No param name \"%s\" in unit", paramName);
|
||||
DBG_ERROR(NULL, "No param name \"%s\" in unit \"%s\"", paramName, AQHREACT_Unit_GetName(unit));
|
||||
return GWEN_ERROR_BAD_DATA;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user