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

BLE_NUS_MAX_DATA_LEN and buffer size question

Hi!

What's the difference between UART_TX_BUF_SIZE and BLE_NUS_MAX_DATA_LEN in case of ble_app_uart example?

As I have noticed BLE_NUS_MAX_DATA_LEN determines maximum length of data sent over BLE, for example BLE_NUS_MAX_DATA_LEN=244, I can send up to 244 bytes.

But I don't know how does buffer size affect performance, maximum length and so on. Why is it set to =256 (along with RX_buffer) by default, and not =8?

Parents
  • Hi, 

    UART_TX_BUF_SIZE is the SW FIFO buffer allocated to the UART interface, while BLE_NUS_MAX_DATA_LEN defines the max. data length for BLE packets as you already pointed out.

    Throughput is typically higher on the UART interface compared to the BLE link so it may make sense to have a larger buffer for the UART in order to keep data while waiting for it to be transmitted over BLE.  

      

Reply
  • Hi, 

    UART_TX_BUF_SIZE is the SW FIFO buffer allocated to the UART interface, while BLE_NUS_MAX_DATA_LEN defines the max. data length for BLE packets as you already pointed out.

    Throughput is typically higher on the UART interface compared to the BLE link so it may make sense to have a larger buffer for the UART in order to keep data while waiting for it to be transmitted over BLE.  

      

Children
Related