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

NUS UART Service - Getting confirmation after writing to the gatt queue?

Hi,

I am new to the SoftDevice and I am using NUS UART example (nRF5_SDK_16.0.0_98a08e2\examples\ble_central\ble_app_uart_c\pca10040\s132\ses). In server side, after writing to the gatt characteristic (ble_nus_c_string_send), how can confirm that the other device read the data? I am not sure the example uses indication or notification.

Thanks

Ras

Parents Reply Children
  • Hi, 

    The idea behind the indication is that has to be confirmed by the application, the SoftDevice won't do it for you.

    To do so you have to call the sd_ble_gattc_hv_confirm(..) function, after receiving the BLE_GATTC_EVT_HVX event.

    The main purpose of indications is to allow the application to confirm the packet only after it has fully processed the data, and completed any operations associated with it.
    If quick and efficient data transfer is more important I would recommend using notifications instead, you still have a link layer ACK to avoid packet loss/corruption.

    -Amanda H.

Related