Get value from Parameter name using JavaScript

79 views Asked by At

I'm trying to set up an automatic provisioning with ACS server that uses JavaScript to interact with the CPE. The CPE shows the parameters on list like this:

"DeviceID.Manufacturer" TP-Link "InternetGatewayDevice.DeviceInfo.UpTime" 629 "InternetGatewayDevice.ManagementServer.EnableCWMP" true

Search in server

For my automatic provisioning i want to use a parameter that it's stored in the server and not in the CPE, then do a simple IF to check if the value is right, the parameters are these two to be more precise.

"InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANPPPConnection.1.Username" pppoe1 "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANPPPConnection.1.Password" password1

I'm using Tags that are stored in the server to compare, but tags are stored like this (with boolean):

"Tags.pppoe1" true

"Tags.password1" true

Tag search

The text after "Tags." will change for every different CPE, so i want to store the value that comes after "Tags." and then compare it with the value of "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANPPPConnection.1.Username" and "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANPPPConnection.1.Password".

Is such thing possible? The software doesn't let me store "Tags" as strings, only boolean.

I tried this and similar variations, but I can't extract the value of what comes after "Tags." in any case.

let routerPpp = declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.3.Username", {value: 1});

let TagPpp = declare("Tags.*", {value: 1});

if (TagPpp !== routerPpp) {
 declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.3.Username"), {value: now}, {value: TagPpp};
}
0

There are 0 answers