Adafruit_Learning_System_Gu.../pi_radio/ttn_decoder_lorawan.js
2018-12-31 11:59:20 -05:00

12 lines
No EOL
250 B
JavaScript

// TinyLoRa - Raspberry Pi CPU Load Decoder
function Decoder(bytes, port) {
var decoded = {};
// Decode bytes to int
var CPU_Load = (bytes[0] << 8) | bytes[1];
// Decode int to float
decoded.CPU_Load = CPU_Load / 100;
return decoded;
}