This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Clear a buffer and timer

Hello,

i'm using a nrf52832 dk and i'm using the example ble app uart.

I saw the packets that are send for rx or tx but with packets of 20 bytes

I saw this post, https://devzone.nordicsemi.com/f/nordic-q-a/71414/how-to-clear-memory-buffer-which-stores-the-received-data-over-ble-uart-after-each-transmission 

My problem is that if I'm trying to send 307 bytes my buffer is full and the info is send partially, 

First i would like to know what can i modified to not be in obligation to use an enter button and secondly have the info that is send fully. 

For example i want to send this : "azertyujhgdikzklkelzlkkzkkeeklzkezlkeezkeeaooazoaieoieeiieaiaeaaieiavcmmmm563dz8f53e6v58dfbvjihajzovb vajojijnakoazertyujhgdikzklkelzlkkzkkeeklzkezlkeezkeeaooazoaieoieeiieaiaeaaieiavcmmmm563dz8f53e6v58dfbvjihajzovbvajojijnakoazertyujhgdikzklkelzlkkzkkeeklzkezlkeezkeeaooazoaieoieeiieaiaeaaieiavcmmmm563dz8f53" there is  307 characters, there is packets of 20 bytes but i would like to have little packets that can send my info fully. because when i arrived at 300bytes the last 7 bytes  are not seeN. I can see them if I'm sending other infos... and this is not what i want thank you in advance

Parents
  • I guess there are many ways this can be solved.

    You can make the UART data available globally in main.c by declaring data_array[] it on top of main.c (instead of in uart_event_handle()).

    You can now use the uart_event_handle() to fill up the data_array[], but don't send data using ble_nus_data_send() from uart_event_handle().

    You can for instance create an app_timer using APP_TIMER_DEF() that you start in main(), this app_timer can for instance be timeout every 1ms.

    In the app_timer timeout handler you can call ble_nus_data_send() to send any received data in data_array[].

    Something like that,
    Kenneth

Reply
  • I guess there are many ways this can be solved.

    You can make the UART data available globally in main.c by declaring data_array[] it on top of main.c (instead of in uart_event_handle()).

    You can now use the uart_event_handle() to fill up the data_array[], but don't send data using ble_nus_data_send() from uart_event_handle().

    You can for instance create an app_timer using APP_TIMER_DEF() that you start in main(), this app_timer can for instance be timeout every 1ms.

    In the app_timer timeout handler you can call ble_nus_data_send() to send any received data in data_array[].

    Something like that,
    Kenneth

Children
Related