Hi.
I’m trying to write a decoder for the Lora plug-in from DZG, but can’t get any further.
I get the payload as Base64 and can convert it to HEX.
But I can’t get any further, unfortunately I don’t have any experience with Javascript.
I am grateful for any help.
At the moment I am using the following code to get from base64 to hex:
function toHexString(bytes) {
return bytes.map(function(byte) {
return ("00" + (byte & 0xFF).toString(16)).slice(-2)
}).join('')
}
function Decode(fPort, bytes) {
var tohex = toHexString(bytes);
return {
Hex_Daten_voll:tohex, // return = 0004a2b49e9d03dd21b3619941000000000000 (0004a2 b49e9d03 dd21b361 99410000 00000000)
};
}