You show the input parameters of the V2 Decoder() function and then what appears to be the return part of the V3 decodeUplink() function, these two are unrelated.
bytes is just an example (provided in the default template) of how to return the input.bytes data undecoded. You can return any elements in ‘data’ as needed.
V2: input parameters: ‘bytes’ and ‘port’
V3: input parameter: ‘input’ (input.bytes and input.fPort)
The default JavaScript decoder function template does not make clear that data.bytes is just an example and also does not mention input.fPort as example.
Thank you for the details, I did not through my question was unclear at the point to take so much time to explain me how unclear it was … By the way, I’m trying to make a documentation to make the migration clear for all others.
My original question was:
What is the structure format the decodeUplink function is supposed to returned ?
is that :
{
data: {
},
warnings: [],
errors: []
};
Or this structure is just and example ?
In the previous version there was no structure (this is why I printed the code, because no structure was a bit complicated to quote).
Thank you for other points I did not asked for but really useful to know.
Paul
I appreciate this seems a bit passive-aggressive as an answer and I’m sorry if our banter was out of place but we are all learning alongside each other here.
I’d interpret this as “the structure is not just an example, it’s how to do it”
Thank you it’s clear and exactly what I was looking for,
I did not found the documentation on my own.
(A link in the ttn-v3 portal could be really nice)
@descartes - passive/agressive what not targeting you.
I know what you mean, I spent the afternoon putting a starter web interface on the Data Storage - I now speak basic TTI API documentation - took me over an hour to join up all the dots between the API docs, the subtle difference in the URL for data storage and what the web console sends as requests.
As I said, early days but plenty of updates in the last fortnight from TTI, so we are getting there.