diff --git a/.gitignore b/.gitignore index 5148e52..87082fc 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ jspm_packages # Optional REPL history .node_repl_history + +.idea diff --git a/methods.js b/methods.js index cc7b8be..1063dfc 100644 --- a/methods.js +++ b/methods.js @@ -9,7 +9,7 @@ const NAMESPACES = { "soap-env": "http://schemas.xmlsoap.org/soap/envelope/", "xsd": "http://www.w3.org/2001/XMLSchema", "xsi": "http://www.w3.org/2001/XMLSchema-instance", - "cwmp": "urn:dslforum-org:cwmp-1-0" + "cwmp": "urn:dslforum-org:cwmp-1-2" }; const INFORM_PARAMS = [ @@ -149,13 +149,15 @@ function GetParameterValues(device, xmlIn, xmlOut, callback) { for (let p of parameterNames) { let name = p.text(); - let value = device[name][1]; - let type = device[name][2]; - let valueStruct = parameterList.node("ParameterValueStruct"); - valueStruct.node("Name", name); - valueStruct.node("Value", device[name][1]).attr({ - "xsi:type": type - }); + if(device[name]){ + let value = device[name][1]; + let type = device[name][2]; + let valueStruct = parameterList.node("ParameterValueStruct"); + valueStruct.node("Name", name); + valueStruct.node("Value", device[name][1]).attr({ + "xsi:type": type + }); + } } return callback(xmlOut); diff --git a/simulator.js b/simulator.js index 78db4a1..d96e73c 100644 --- a/simulator.js +++ b/simulator.js @@ -9,7 +9,7 @@ const NAMESPACES = { "soap-env": "http://schemas.xmlsoap.org/soap/envelope/", "xsd": "http://www.w3.org/2001/XMLSchema", "xsi": "http://www.w3.org/2001/XMLSchema-instance", - "cwmp": "urn:dslforum-org:cwmp-1-0" + "cwmp": "urn:dslforum-org:cwmp-1-2" }; let nextInformTimeout = null;