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

data transfer using timer

HI,all, MERRY CHRISTMAS!!!! i have an issue when i want to try the data transfer using timer

i have a idea about it , but i do not know how to achieve it.

-my project is the nus project

-and i have two nrf eva board.

-one for client and one for server

-i don't mean that some kind people to help me to code, but a method to try my idea. i am now confused ,

thank you all .

1 i want to init the timer first.

2 the data received from usart

3 when the number of the data reached 300 byte, the timer enabled and transfer the data, after transferring the data, the timer should hang up for the next 300 bytes data.

4 if the number of data don't reaches 300 byte,the timer enabled and transfer the data.

  • Hi Bernerd,

    I don't see any problem with your approach.

    What you can do is either maintain your own buffer to collect data from uart (like what we have with data_array) then wait either when it reach 300 bytes or when the timer timeout to send the data (calling ble_nus_string_send). You would need to truncate the long data into 20 bytes trunks and send them separately.

    The other option, and maybe better one is to configure the size of the uart characteristic to be 300 so that you don't have to handle the truncating on application but let the stack does it for you.

Related