Skip to content

Commit

Permalink
Update codec (#710)
Browse files Browse the repository at this point in the history
* add new nexelec devices

* format

* comment yaml

* run prettier : all files use prettier code style

* prettier check ok

* codec and product url updates

* codec update

---------

Co-authored-by: Jaime Trinidad <[email protected]>
  • Loading branch information
QuentinBNexelec and Jaime-Trinidad authored Dec 5, 2023
1 parent 4374d9e commit 1a67cbd
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions vendor/nexelec/sign-codec.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,6 @@ function decodeUplink(input)
else if(octetCalibrationActivate===1){return "Automatic calibration activated"};
}

function co2Threshold(octetCO2Threshold)
{
return {"value":octetCO2Threshold, "unit":"ppm"};
}

function active(octetActive)
{
if(octetActive===0){return "Non-active"}
Expand Down Expand Up @@ -436,21 +431,20 @@ function decodeUplink(input)
"redundancyOfRecord":data_repetition,
"co2":{"value":mesure,"unit":"ppm"},
}

return data
}

function historicalTemperatureDataOutput(stringHex)
{
var mesure = [];
var i = 0;
var offset_octet = 0;

var data_nombre_mesures = (parseInt(stringHex.substring(4,6),16)>>2)&0x3F;
var data_time_between_measurement_sec = ((parseInt(stringHex.substring(4,8),16)>>2)&0xFF);
var data_repetition = (parseInt(stringHex.substring(7,9),16))&0x3F;
var binary=hexToBinary(stringHex)

for(i=0;i<data_nombre_mesures;i++){

offset_binaire = 36 + (10*i);
Expand All @@ -468,8 +462,9 @@ function decodeUplink(input)
"periodBetweenRecord":{"value":data_time_between_measurement_sec,"unit":"minutes"},
"redundancyOfRecord":data_repetition,
"temperature":{"value":mesure,"unit":"°C"},
}

}

return data;
}

function productStatusDataOutput(stringHex)
Expand Down

0 comments on commit 1a67cbd

Please sign in to comment.