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

How to connect two nrf DK boards through BLE

hi, i have a requirement to connect two nrf51(PCA10028) boards to connect each other.

1).if i turn on the Board1 should scan the bluetooth devices if any other bluetooth devices(other Board2(PCA10028)) present it should connect.

2).if i send any data using ble_nus_string_send by board1 PCA10028 the other board2 should receive the data.

3).is there any example code in sdk for the above functionality.

please provide any example code.

Thankyou

  • hi, i made my code peripheral to central

    1. if i turn on the the device it is connecting to what ever peripheral device is advertising.

    2)i want to restrict the central device only to connect with specified device name. how i can do this.

    3)if i send data from peripheral to central and displaying it in uart to termite(by pressing button (i handiled this button action)) it is working fine. unable to handle push button events in ble_app_uart_c example.

    4)where as if i send the data from central to peripheral it is only sending once after just connecting to the peripheral device. but by pressing button i am unable to send data using ble_nus_c_string_send().

  • 1/2: Then you need to have the name of the device in the advertising data and extract and compare this to your target device name on every BLE_GAP_EVT_ADV_REPORT event in your BLE event handler.

    I have added an example function that can extract the name in my original example above.

    3/4: Can you try to explain your problem in another way? I don't understand what you mean.

  • hey, sorry (i have flashed SDK12 ble_app_uart_c on nrf52 )

    the central device is keep on connecting and disconnecting to peripheral device which is PCA1001 & s110. it is restarting every time. but LED on the nRF52 is keep on glowing.

    how to maintain stable connection.

    the info in the UART is like this..

    Uart_c Scan started

    Connecting to target fd50cc82b8ca

    The device has the Nordic UART Service

    ////data which i am recieving from PCA1001

    <3-0:L1,R1>[00]<1-1,2-2,3-3>[00]<1-1,2-2,3-3>[00]

    Disconnected

    Connecting to target fd50cc82b8ca

    The device has the Nordic UART Service

    Disconnected

    Connecting to target fd50cc82b8ca

    The device has the Nordic UART Service

    Disconnected

    Connecting to target fd50cc82b8ca

    The device has the Nordic UART Servic

    ////data which i am recieving from PCA1001

    <3-0:L1,R1>[00]<1-1,2-2,3-3>[00]<1-1,2-2,3-3>[00]

    Disconnected

    Connecting to target fd50cc82b8ca

    The device has the Nordic UART Service

    Disconnected

  • It looks like it's your peripheral device that is restarting. This is usually due to an error resulting in a reset. Have you tried debugging your program to see where is stops?

Related