one Thread use sd_ble_gatts_hvx() send many package

hyw gravatar image

asked 2017-08-12 02:42:18 +0100

how to save a problem,if one Thread use sd_ble_gatts_hvx() send many package ,but i use vTaskDelay(50)( the freertos delay api ) when one package send ,then send another package . but
some packgae lost data .At the same time other Thread use sd_ble_gatts_hvx() send package ,if someone package lost data ,how i seek the problem and save the problem...

edit retag flag offensive close delete report spam

1 answer

Sort by ยป oldest newest most voted
run_ar gravatar image

answered 2017-08-14 11:22:46 +0100

rols gravatar image

updated 2017-08-14 14:24:24 +0100

Each bluetooth connection will have dedicated buffers. So even when you use sd_ble_gatts_hvx to send packets from different treads, the packets will be placed in the same buffer. The packets in the buffer will be (re)transmitted until it is acknoledged on the Link Layer (NESN, SN is updated) or until the connection is disconnected. Note that you have to check the error code returned by sd_ble_gatts_hvx to make sure the packet was successfully placed in the tx buffer. If it is not, you might end up losing data.

edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

User menu

    or sign up

Recent questions

Question Tools

1 follower


Asked: 2017-08-12 02:42:18 +0100

Seen: 60 times

Last updated: aug. 14