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

Question about racp_send(* p_gls,* p_racp_val) and STATE_RACP_RESPONSE_PENDING?

I'm studing the project of ble_app_gls/PCA10040/SDK11.0/ ,I have got some questions about the RACP indication pending and retransmittion mechnism. In this project(File ble_gls.c, Line 387), two conditions decide whether to set(STATE_RACP_RESPONSE_PENDING) or not;

  1. One condition is on err_code returned from sd_ble_gatts_hvx(...);When error_code==BLE_ERROR_NO_TX_PACKETS, set(STATE_RACP_RESPONSE_PENDING). But the SDK API reference said "a notification will consume an application buffer, and will therefore generate a BLE_EVT_TX_COMPLETE event when the packet has been transmitted. An indication on the other hand will use the standard server internal buffer and thus will only generate a BLE_GATTS_EVT_HVC event as soon as the confirmation has been received from the peer...BLE_ERROR_NO_TX_PACKETS applies only to notification... ". So in racp_send() function sd_ble_gatts_hvx() can't return a BLE_ERROR_NO_TX_PACKETS, and can't set (STATE_RACP_RESPONSE_PENDING) neither. Am I right?

2)Another condition is if ( (m_gls_state != STATE_RACP_RESPONSE_PENDING) && (m_racp_proc_records_reported_since_txcomplete > 0) ) then set(STATE_RACP_RESPONSE_PENDING). m_racp_proc_records_reported_since_txcomplete is increased when a measure result notification is queued. Since indication dosn't use the application buffer, why here pend an indication, it has no need to wait an application buffer.

Parents Reply Children
No Data
Related