Update unified_decoder.js to work also with ChirpStack V4

ChirpStack V4 needs decodeUplink, this wraps the Decoder with it
pull/9/head
Stephan Martin 2024-03-11 20:26:40 +01:00 zatwierdzone przez GitHub
rodzic 00cec9c130
commit 88e52f18b5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -5,6 +5,7 @@
// Accuracy is a dummy value required by some Integrations.
// Battery is 1/100 of a volt, offset by 2v for a range of 2.00 to 4.56 volts.
//
function Decoder(bytes, port) {
var decoded = {};
@ -60,4 +61,11 @@ function Decoder(bytes, port) {
}
return decoded;
}
}
// Wrapper for ChirpStack V4:
function decodeUplink(input) {
return {
data: Decoder(input.bytes, input.fPort)
};
}