/*****************************************************************************/
//Generic definition for an agent. An agent needs :
//objPath : a DBus path to access it
/*****************************************************************************/
//Generic definition for an agent. An agent needs :
//objPath : a DBus path to access it
var result;
var methodId = arguments[0];
var callDict = {};
// affectation of callDict in eval, otherwise dictionary(='{}') interpreted as block of code by eval
eval("callDict = " + arguments[1]);
try {
var result;
var methodId = arguments[0];
var callDict = {};
// affectation of callDict in eval, otherwise dictionary(='{}') interpreted as block of code by eval
eval("callDict = " + arguments[1]);
try {
service._returnMethod(methodId, callDict.callIndex, true, result);
}
catch (e) {
service._returnMethod(methodId, callDict.callIndex, true, result);
}
catch (e) {
service._returnMethod(methodId, callDict.callIndex, false, errorStr);
}
};
service._returnMethod(methodId, callDict.callIndex, false, errorStr);
}
};
- agent.jsHdl.methodId[agent.objectPath].push(methodId);
- this.wampSession.subscribe(methodId, agent.jsHdl.wrapperFunc[method]);
+ agent.handler.methodId[agent.objectPath].push(methodId);
+ this.wampSession.subscribe(methodId, agent.handler.wrapperFunc[method]);
- if (agent.jsHdl.interfaceProxies && agent.jsHdl.interfaceProxies[ifName])
- if (agent.jsHdl.interfaceProxies[ifName][signal]) {
+ if (agent.handler.interfaceProxies && agent.handler.interfaceProxies[ifName])
+ if (agent.handler.interfaceProxies[ifName][signal]) {
- if ((agent.jsHdl[signal] == undefined || agent.jsHdl[signal] == null) && !methodExist)
- agent.jsHdl[signal] = function() {
+ if ((agent.handler[signal] == undefined || agent.handler[signal] == null) && !methodExist)
+ agent.handler[signal] = function() {
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(agent.xml, "text/xml");
var ifXml = xmlDoc.getElementsByTagName("interface");
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(agent.xml, "text/xml");
var ifXml = xmlDoc.getElementsByTagName("interface");
- agent.jsHdl.wrapperFunc = {};
- agent.jsHdl.methodId = {};
- agent.jsHdl.methodId[agent.objectPath] = [];
+ agent.handler.wrapperFunc = {};
+ agent.handler.methodId = {};
+ agent.handler.methodId[agent.objectPath] = [];
for (var i=0; i < ifXml.length; i++) {
var ifName = ifXml[i].attributes.getNamedItem("name").value;
var ifChild = ifXml[i].firstChild;
for (var i=0; i < ifXml.length; i++) {
var ifName = ifXml[i].attributes.getNamedItem("name").value;
var ifChild = ifXml[i].firstChild;
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(str, "text/xml");
var nodes = xmlDoc.getElementsByTagName("node");
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(str, "text/xml");
var nodes = xmlDoc.getElementsByTagName("node");
- self.childNodeNames = [];
- var l = nodes.length;
- //there will always be 1 node, the parent/head node
- for(var i = 1; i < l; i++){
+ // first node is the parent/head node
+ for(var i=1; i < nodes.length; i++)
var interfaces = xmlDoc.getElementsByTagName("interface");
self.propInterfaces = [];
var supportDBusProperties = false;
var interfaces = xmlDoc.getElementsByTagName("interface");
self.propInterfaces = [];
var supportDBusProperties = false;