This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to input a byte array in nRF Master Control Panel for android

I have a ble device and want to write a byte array in nRF Master Control Panel. Firstly, it can be written. But i don't know ho w to input it. My byte array is [-128, -64, 00, 00,00,00,00,00]. I tried many times with different format and It always report a red exclamatory point after input. Anyone can tell me its right format? thanks very much.

Parents
  • The attribute values are sent as 8-bit hex. So -128 is not possible I think you need to write them in hex and separated by by a dash '-'

    Example [-127, -64, 00, 00,00,00,00,00] is written as

    81-C0-00-00-00-00-00-00
    

    If you write this then the attribute will be written with value 0x0000000000000C81 (which is decimal 3201) and it is upto your application to properly declare it and interpret the value.

Reply
  • The attribute values are sent as 8-bit hex. So -128 is not possible I think you need to write them in hex and separated by by a dash '-'

    Example [-127, -64, 00, 00,00,00,00,00] is written as

    81-C0-00-00-00-00-00-00
    

    If you write this then the attribute will be written with value 0x0000000000000C81 (which is decimal 3201) and it is upto your application to properly declare it and interpret the value.

Children
Related