I've got a project based off of the DSPS example, and on the central device I was wondering: what is the length of time between user_symble_client_data_tx_cfm_handler firing and the data actually being sent over the air? I've noticed that if I have a breakpoint in the handler (or if my code disconnects too soon after the handler fires) my message is not received by the peripheral. I'm OK putting a short delay after that handler, but I just need to know what I should set it to to ensure the message is sent.
Or is there some other indicator that actually indicates the data has been transmitted?
Device:
Hi mark.bloechl,
When
user_sps_ble_client_data_tx_cfm_handler
is called, it means the previous packet has been sent to the air. In the handler, next packet, if any, to be sent to the air is prepared and is then sent to the sps client task, considered as another thread, which actually passes packets to the BLE stack when scheduled. The BLE stack waits for next connection event and sends out the packet. Once sent,user_sps_ble_client_data_tx_cfm_handler
gets called again. So on and so forth.It's not easy to measure the exact time for the moment. If packet is not ready at the BLE stack before next connection event occurs, device will have to wait for the one after that. And that will add some more delay in between.
A break point placed in the handler stops the system from running anything, including the scheduler. The sps client task will not be scheduled either. And none of the aforementioned process will happen.