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

how can we send a string over bluetooth

hello,

inorder to send a string over ble from a slave to master or master to slave what is to be done?? is there any function for us to pass the string??

  • There's a ble uart example in the dev kit which does exactly that- sends a string over bluetooth. You can use that as a starting point.

  • Hello There, Since I had a lot of difficulty with this I will try my best to explain everything I know in the easiest way I could :)

    For Bluetooth Low Energy (BLE) communication you have to follow a certain set of rules and regulations. Mainly GAP (for detecting the device and the initial handshake between the device and the client/ cellphone ) and GATT (for a full back and forth communication between the device and the slave) Take a look at this:

    learn.adafruit.com/.../gap

    It will help if you get yourself familiar with the term "protocol stack."

    www.youtube.com/watch

    Once you are done there take a look at the Nordic tutorial :

    devzone.nordicsemi.com/.../

    At the end what is responsible for sending information is the following function:

    ble_nus_string_send(&m_nus, data_array, index);

  • What i have understood is that in this function you cannot send more than a single character or 2,since the size of data is uint16(2 bytes).

    If we want to send like"hello world" what has to be done

  • Hey RK,

    I went through the ble uart program, in that there is some initialization with respect to UART and its pins and in the ble_nus_data_send function there is a call blcm_link_ctx_get(p_nus->p_link_ctx_storage, conn_handle, (void *) &p_client). So what does this function call and the program actually do?

    I am not able to run it on my board as some RAMcode error is getting popped up and letting me to download and debug the program.

    I want to send a string over bluetooth with the help of a characteristic and nothing else.

    Kindly help me with the required information so that i can follow the program and make use of it.

    Thanks & Regards

    Sudeep R J

Related