Hi,
Implemented a payload decoder. Looking to test my payload decoder using a testing framework. Creating a testing file using Jest testing framework; for integrity checks.
On the payload decoder page you can manually input a single test case however I would like to automate this with lots of different test cases. As TTN is based on Node JS I’ve setup a Node JS local Environment.
I’m currently having an issue referencing input.bytes[0] through my testing framework.
What format should my data structures be to simulate payload ? In order reference the payload in the same way ttn passes the payload to the decoder.
The docs (linked bottom right of every console page) show the two part object of a byte array and the port number: Uplink | The Things Stack for LoRaWAN
Be careful when digging in to the detail of the PF - it’s vanilla JS, no imports, no XHR, run using a JavaScript ECMAScript 5.1 runtime. It will be terminated if it runs for more than 100ms.
The device doesn’t run JavaScript so not at all. The document is about how the payload could be decoded on the LNS - which isn’t hugely recommended, it’s a convenience function.