wiki:decoderupload
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wiki:decoderupload [2023/07/28 17:56] – mbrauer | wiki:decoderupload [2023/07/28 18:10] (current) – mbrauer | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Custom JavaScript Decoder Upload Requirements ====== | ====== Custom JavaScript Decoder Upload Requirements ====== | ||
| - | To ensure compatibility, | + | To ensure compatibility, |
| ===== Example Custom Decoder Function ===== | ===== Example Custom Decoder Function ===== | ||
| Line 17: | Line 17: | ||
| // Your decoding logic here | // Your decoding logic here | ||
| let decodedResult = {}; //empty object that holds all UDT tag values | let decodedResult = {}; //empty object that holds all UDT tag values | ||
| - | decodedResult.Measurement = bytes[1] | + | decodedResult.Measurement = bytes[0] |
| - | decodedResult.BatteryLevel = bytes[2] | + | decodedResult.BatteryLevel = bytes[1] |
| - | decodedResult.Temperature = bytes[3] | + | decodedResult.Temperature = bytes[2] |
| return decodedResult; | return decodedResult; | ||
| } | } | ||
| Line 27: | Line 27: | ||
| *** Function Signature**: | *** Function Signature**: | ||
| - | * Other functions can be used in the file can called from the Decoder function, but the Decoder(...) function acts as the main function. | + | * Other functions can be used in the file can called from the Decoder function, but the Decoder function acts as the main function. |
| - | | + | |
| - | ==Function Arguments== | + | * **bytes**: This parameter represents the input data that needs to be decoded. It is an array of bytes that is gathered from an uplink' |
| - | * bytes: This parameter | + | * **port**: This parameter |
| - | * port: This parameter denotes | + | - **Runtime Limitations**: Be aware of the runtime limitations and constraints of GraalVM. For example, certain features or APIs available in other JavaScript engines may not be present in GraalVM. Refer to the GraalVM documentation for any restrictions you should consider while uploading your custom |
| - | - **Dependency Management**: | + | - **Testing**: |
| - | + | ||
| - | - **Runtime Limitations**: | + | |
| - | + | ||
| - | - **Testing**: | + | |
wiki/decoderupload.1690566962.txt.gz · Last modified: 2023/07/28 17:56 by mbrauer