Decoding payload from a table in JS

Am stuck decoding a payload in JS using the manufacturers manual
This is the sample of payload am trying to decode, ignore the error

This the table am trying to decode from

This is the code i have been trying to edit to decode

Basically from bit 0-11, i have no need for
From bit 12-15, i need to convert them to their respective strings
For bit 16, that needs to converted also, there isnt any given example from the manufacturer, apart from what bosch have

each byte consists of 8 bits (0 to 7)
operate with bytes separately and with bits inside the byte.

1 Like

Am totally new to JavaScripts, but i found this repo on github
If anyone can help me run it on chripstack would really appreciate it

This is third party utility and can’t run as decoder function in the chirpstack environment.
Make decision for yourself, what are you want.

  1. proceed the payload by chirpstack side.
  2. proceed the payload by the own application side.

we all were totally new in something once. Learn JS :slight_smile:

1 Like

Thank you so much, the code isnt perfect but it works for the data i need to decode

Then i have to encode a command downlink, on bytes arrays , am not sure if i should assign decimal, hexadecimal or pure binary to the arrays.