Error Error("json: unsupported value: NaN")

Hello,
I want to compare values of bytes array to e.g. 0xF.

if (bytes[2]  === 0xF)
    {
      values[0] = retValue.x1 - 65536;
    }

However I get this error: Error(“json: unsupported value: NaN”)
I couldn’t find an existing topic to this problem with comparing values.

What is the problem?

Thanks
Martin

The error is not in the lines you posted, but is thrown when TTN tries to convert the return value of your Decoder function into a JSON text representation. So, we’d need to see all code to guess what’s wrong.

(Aside: also note that 0xF is really the same as 0x0F; probably not the if condition you really want.)