2022-04-06 20:18:32 +00:00
|
|
|
// This must return the name of the ADR algorithm.
|
|
|
|
export function name() {
|
|
|
|
return "Example plugin";
|
|
|
|
}
|
|
|
|
|
|
|
|
// This must return the id of the ADR algorithm.
|
|
|
|
export function id() {
|
|
|
|
return "example_id";
|
|
|
|
}
|
|
|
|
|
|
|
|
// This handles the ADR request.
|
|
|
|
//
|
|
|
|
// Input object example:
|
|
|
|
// {
|
2023-01-09 12:04:10 +00:00
|
|
|
// regionConfigId: "eu868",
|
2022-04-06 20:18:32 +00:00
|
|
|
// regionCommonName: "EU868",
|
|
|
|
// devEui: "0102030405060708",
|
|
|
|
// macVersion: "1.0.3",
|
|
|
|
// regParamsRevision: "A",
|
|
|
|
// adr: true,
|
|
|
|
// dr: 1,
|
|
|
|
// txPowerIndex: 0,
|
|
|
|
// nbTrans: 1,
|
|
|
|
// maxTxPowerIndex: 15,
|
|
|
|
// requiredSnrForDr: -17.5,
|
|
|
|
// installationMargin: 10,
|
|
|
|
// minDr: 0,
|
|
|
|
// maxDr: 5,
|
2023-10-09 09:55:43 +00:00
|
|
|
// skipFCntCheck: false,
|
|
|
|
// deviceVariables: {
|
|
|
|
// "varA": "value1",
|
|
|
|
// "varB": "value2",
|
|
|
|
// },
|
2022-04-06 20:18:32 +00:00
|
|
|
// uplinkHistory: [
|
|
|
|
// {
|
|
|
|
// "fCnt": 10,
|
|
|
|
// "maxSnr": 7.5,
|
|
|
|
// "maxRssi": -110,
|
|
|
|
// "txPowerIndex": 0,
|
|
|
|
// "gatewayCount": 3
|
|
|
|
// }
|
|
|
|
// ]
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// This function must return an object, example:
|
|
|
|
// {
|
|
|
|
// dr: 2,
|
|
|
|
// txPowerIndex: 1,
|
|
|
|
// nbTrans: 1
|
|
|
|
// }
|
|
|
|
export function handle(req) {
|
|
|
|
return {
|
|
|
|
dr: req.dr,
|
|
|
|
txPowerIndex: req.txPowerIndex,
|
|
|
|
nbTrans: req.nbTrans
|
|
|
|
};
|
|
|
|
}
|