-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Object has no member 'slice' at decodeUplink #52
Comments
Hi, My assumption is that the ttn side implementation no longer has E.g.: Array.prototype.slice.call(bytes, x, x + 1) in your case and see if that works? If not, then we'll need to provide a slice implementation or manually pick the right bytes. |
Many thanks @joscha for the (indirect) hint, I found the error! function decodeUplink(bytes) {
throw new Error(JSON.stringify(bytes))
} shows the passed {
"bytes": [1, 2, 3],
"fPort":10
} Now we can convert them using data.fPort = uint8(bytes.bytes.slice(x, x + 1)); BR, Christian :-) |
I see, great! Did you copy that sample from somewhere in the docs? If yes, would you mind opening a PR to fix it, please? |
No, the uint8(bytes.slice(x, x + 1)) // 10 I can however create a PR to replace the |
Yes please!
…On Thu, 20 Oct 2022, 10:45 Christian, ***@***.***> wrote:
No, the bytes data sample was from one of my tests. I just used the
converter snippets from the README.md
<https://github.com/thesolarnomad/lora-serialization/blob/master/README.md>,
like:
uint8(bytes.slice(x, x + 1)) // 10
I can however create a PR to replace the bytes with bytes.bytes or
probably more understandable payload.bytes, if you want.
—
Reply to this email directly, view it on GitHub
<#52 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABN5BXSRGDHNRA5NITR2VLWEEIELANCNFSM6AAAAAARI2CVQI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi!
First off, thanks for the Library, works great on Arduino / ESP Side. However I have still troubles decoding the data on the TTN side.
For the uplink formatter I have got the example code as such:
However upon testing I am receiving the above error:
TypeError: Object has no member 'slice' at decodeUplink (<eval>:5:32(15))
Does the
bytes
object need to be converted first, in order to useslice()
or should I use it differently?Thanks & BR :)
The text was updated successfully, but these errors were encountered: