Update README.md

This commit is contained in:
IoTThinks.com 2023-06-07 16:56:22 +07:00 committed by GitHub
parent e318ff451f
commit e8b4297c49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -7,6 +7,7 @@ The below sample codecs are from external repositores and required to be fixed b
- From Dragino: https://www.dropbox.com/sh/sa4uitwn6xdku9u/AACUA890oj5dl8rETYO2icdBa?dl=0
- From RAK Wireless: https://github.com/RAKWireless/RAKwireless_Standardized_Payload
### Codec Format
A valid codec for Easy LoRaWAN Cloud is below:
```
// Decode uplink function.
@ -42,3 +43,22 @@ function encodeDownlink(input) {
return {bytes: []};
}
```
### Conversion of Codec Formats
If you have a codec for ChirpStack v3, you need to put the below wrapper function to convert a codec to ChirpStack v4.
Easy LoRaWAN uses ChirpStack v4
```
// V3
function Decode(fPort, bytes, variables) {
...
}
// V3 to V4 converter
function decodeUplink(input) {
// Wrapper function for ChirpStack v4
return {
data: Decode(input.fPort, input.bytes, input.variables)
};
}
```