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

maximum length of data over ble

I want to send a data of length 1024 bytes over the ble UART , but the maximum length of data is 20 bytes at a time. Is it possible to increase the data length per instance. Is that the only method to send long data over ble is to split into 20bytes.

Parents
  • Hey,

    One way of doing this is to implement long write. Just search the dev zone for questions on this topic as there are a lot. Follow this github example but repeat the steps for UART service: github.com/.../ble_app_hrs---LongWrite

    -It shouldnt be hard to implement this and BLE UART module in nRF toolbox for android will support this.

    However in some cases splitting the data into 20 byte packets is better. When doing a long write you will need to declare a buffer to store the read and this takes up a lot of ram. In your case to send 1024 bytes of data you might be looking at 1400 byte buffer because there is also overhead. And then you will need to parse the received buffer to extract your actual data.

    -Mike

Reply
  • Hey,

    One way of doing this is to implement long write. Just search the dev zone for questions on this topic as there are a lot. Follow this github example but repeat the steps for UART service: github.com/.../ble_app_hrs---LongWrite

    -It shouldnt be hard to implement this and BLE UART module in nRF toolbox for android will support this.

    However in some cases splitting the data into 20 byte packets is better. When doing a long write you will need to declare a buffer to store the read and this takes up a lot of ram. In your case to send 1024 bytes of data you might be looking at 1400 byte buffer because there is also overhead. And then you will need to parse the received buffer to extract your actual data.

    -Mike

Children
Related