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

adjusting ble_app_uart_c to receive four packets at con. event

Hello, I have adapted the ble_app_uart_c project for a custom board based on nrf52832. The application already works fine, however, my peripheral is sending four packets at a connection event, while in the UART terminal I am able to see the data of every third packet. Perhaps only the first packet of a connection event is processed and transferred to UART. I am sure the data of my device can be received well because I have done that in an Android application already.

Since I am not yet deeply familiar with the ble_app_uart_c application code, I would appreciate if I can get advice where exactly to modify the application and what to do to get all the four packets of each connection event well received.

  • Normally this has nothing to do with application code, BLE stack aka SoftDevice will take care about things such as how many Tx/Rx packets can be sent in one connection interval. You should get each packet in ble_nus_c_evt_handler function and if you place debug there carefully you will also see it. It seems that you are then transferring incoming packets over wired UART interface so it's very likely that you have throughput issue there (e.g. that one packet rewrites another as they come too quickly over BLE and you aren't able to transfer them over UART Tx fast enough. Try to buffer all packets from each event and then use e.g. scheduler to transfer all of them over UART.

  • Thanks for the great help - your clarification helped to solve the problem!

Related