Ticket Created
over 3 years ago

CIQQA-650

ByteArray instance methods encode/decodeNumber can never be found

I'm trying to decode a number and alway get a Symbol Not Found Error, I have set up other examples with encodeNumber and get the same error. Does this happen for anyone else? is this being implemented wrong?

var buf = [21, 20, 196, 30, 118, 70, 115, 64];
return buf.decodeNumber(Lang.NUMBER_FORMAT_UINT32, {:offset => pos, :endianness => Lang.ENDIAN_LITTLE});

The above code always returns this;

Error: Symbol Not Found Error
Details: Could not find symbol 'decodeNumber'

Any advice on why this is occurring, I have changed sdk versions and still get the issue.

  • You're not declaring it as a byte array.  Instead of

    var buf = [21, 20, 196, 30, 118, 70, 115, 64]; //(normal array)

    you need

    var buf = [21, 20, 196, 30, 118, 70, 115, 64]b; //byte array

    I use these all the time with CIQ BLE apps, as this is how you read/write characteristics.