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

sd_ble_gatts_hvx vs. ble_nus_data_send

As I'm new to the BLE, I'm trying to make use of examples enclosed in the nRF5 SDK.

Now, I found that there exist several functions that seem like do similar things and they make me confusing...

Is there any difference between sd_ble_gatts_hvx() and ble_nus_data_send()?

I think the former gets input as ble_gatts_hvx_params_t struct and the latter gets ble_nus_t struct and some more.

If they do the same thing, data transmission via Bluetooth, then why there are two functions with different types of input?

Parents Reply Children
  • Thanks for your reply!

    I found ble_nus_data_send() function in ble_peripheral/ble_app_uart example and it seems like the function is used to send data over BLE.

    After that, I found another example in ble_central_and_peripheral/experimental/ble_app_att_mtu_throughput. Though it was not explicit, I think nrf_ble_amts_notif_spam(&m_amts) function in the example takes charge of data transmitting. And inside the function, sd_ble_gatts_hvx() is the one transmit data, right?

    So, I thought the two functions are doing the same thing, but it seems not according to Henry_Chou's comment. But it still confuses me...

    Is there any reference explain what they do?

Related