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

Send / return a message to acknowledge that my peripheral is successfully connected

I am having some issues figuring out how to send a simple string or character to my central.

What I want is the peripheral to send an acknowledgement back to the central that it is connected.

I am building on the ble_app_uart example in ble_peripherals

I figured that it needs to happen in the BLE_GAP_EVT_CONNECTED case in on_ble_evt, and I need to use the ble_nus_string_send(&m_nus, data_array, index); function, however I can't figure out how to make it send a string out of this, I imagined it would be sufficient to replace data_array with for example connected_message = "yay, connected!"; and set index = sizeof(connected_message); but it doesnt work.. Some help please ? :)

Related