This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// xref https://www.thethingsindustries.com/docs/integrations/payload-formatters/javascript/uplink/ | |
// code for uplink formatter for The Things Industries LoRaWAN for the Rejeee SL 300 CO2 sensor. | |
// based on code in the Rejee documentation | |
// Convert a hex string to a byte array | |
// from https://stackoverflow.com/a/34356351/40387 | |
function hexToBytes(hex) { | |
for (var bytes = [], c = 0; c < hex.length; c += 2) |