mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2025-12-10 07:44:41 +01:00
19 lines
942 B
Text
19 lines
942 B
Text
// Device ID as user name
|
|
const username = declare("DeviceID.ID", {value: 1}).value[0]
|
|
|
|
// Password will be fixed a given device because Math.random() is seeded with devcie ID by default.
|
|
const password = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER).toString(36);
|
|
|
|
const informInterval = 7200;
|
|
|
|
// Refresh values daily
|
|
const daily = Date.now(86400000);
|
|
|
|
// Unique inform offset per device for better load distribution
|
|
// const informTime = daily % 86400000;
|
|
|
|
declare("Device.ManagementServer.ConnectionRequestUsername", {value: daily}, {value: username});
|
|
declare("Device.ManagementServer.ConnectionRequestPassword", {value: daily}, {value: password});
|
|
declare("Device.ManagementServer.PeriodicInformEnable", {value: daily}, {value: true});
|
|
declare("Device.ManagementServer.PeriodicInformInterval", {value: daily}, {value: informInterval});
|
|
//declare("Device.ManagementServer.PeriodicInformTime", {value: daily}, {value: informTime});
|