script provision behaviour

Dan Morphis dan at milkcarton.com
Fri May 5 11:15:36 EDT 2017


See below 

-dan

> On May 5, 2017, at 3:22 AM, Miguel Ángel Sánchez Moragues <sanchez.moragues at gmail.com> wrote:
> 
> Sorry, I don't understand the behavior.
> 
> Another example with the following script which is execute every "2 PERIODIC" event:
> 
> 
> let now = Date.now();
> let serialNumber = declare("DeviceID.SerialNumber", {value: 1});
> 
> log('start refresh3 script SN=' + serialNumber.value[0]);
> 
> /*
> let credentials = ext('gateway', 'getPPPoE', serialNumber.value[0]);
> 
> if (credentials) {
> 	log('username = ' + credentials.username + ' , password = ' + credentials.password);
> }
> */
> 
> declare("InternetGatewayDevice.ManagementServer.PeriodicInformInterval", {value: now}, {value: 60});
> declare("InternetGatewayDevice.ManagementServer.PeriodicInformEnable", {value: now}, {value: true});
> declare("InternetGatewayDevice.ManagementServer.ConnectionRequestUsername", {value: now}, {value: "cpe"});
> 
> 
> The acs sends a GetParameterValues but doesn't send a SetParameterValues because the values are the same that in local bbdd. What is the change in this case?

The change is "{value: now}, {value: 60}", that's telling genie to verify the value for that parameter is 60 if the timestamp is older than now (which will always be the case). If you change it to value:1, then the parameter will be set only one time (because one one time will the timestamp be older than 1).


More information about the Users mailing list