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

Maximum number of bytes transmitted from own service and characteristic

Hi,

I am currently working with the nrf52840, ble_app_uart example under the ble_peripheral folder. Using the tutorial below:

https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial

I was able to add my own service and characteristic. However, the issue I am facing is that, when I transmit data from my own characteristic over bluetooth, I am getting unnecessary characters at the end. Under step 2.H the parameter  'attr_char_value.max_len = 42' in  my code. (I arbitrarily chose this value, to make sure its large enough)

Then, under step 3E I call, our_temperature_characteristic_update() and pass in the desired length of my actual data. I set that value to p_len. In my case, this value is set to 35.

So, ideally I should be observing only 35 bytes displayed but I see extra data displayed which I don't want.

Would appreciate any suggestions to resolve this.

Thanks

Parents Reply Children
  • It's a usual technique for some case in char. format..

    Your case :

     end words method ( as \r\n 0x0d 0x0a) :

    00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f

    10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f

    20 21 22 0d 0a ff  ff ff ff ff

    First byte for length

     23  00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e

     0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e

    1f 20 21 22 ff ff ff ff ff ff

Related