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

Need help: Scan, Display names of nearby devices and Connect

Hello,

I am working on example nRF5_SDK_14.2.0_17b948a\nRF5_SDK_14.2.0_17b948a\examples\ble_central\ble_app_uart_c
pca10040\s132\arm5_no_packs/ble_app_uart_c_pca10040_s132.

I have two different peripheral 1 is sending sensor data as notification and peripheral 2 is used for UART communication. Individually when I am connecting both are working fine to do so I just change the UUID respectively.

But my task is to connect both peripherals to one central and I should be able to send data over UART and get sensor updated value also.

or

Central should Scan all available devices nearby, display names and then we can choose to which device we have to connect(just like our smartphones).

First thing I need to achieve with central is Scan all nearby devices and display names.

I haven't tried anything yet, please help me how to start.If anything is not clear please ask.

Thanks

Parents
  • Second alternative is simplest to implement.

    I'm assuming you by display mean send over uart to a terminal.

    In ble_app_uart_c you should start my modifying the handling of BLE_GAP_EVT_ADV_REPORT in ble_evt_handler(). Here you can see that it is checking if the UUID is present in the advertisement (is_uuid_present()) you should instead extract the advertising name from the advertisement and print it. Then you need some way to select which peer to connect to, for example by using buttons or UART. Then you call sd_ble_gap_connect() with the peer address that maps to the selected advertising name.

  • Hi Petter,

    Display name is done, Now I want to print Raw advertising data(Full hex string including all parameter) coming from peripheral.

    Can u help me in that, where is that array or struct from i can take full raw data.

    Thank you

Reply Children
No Data
Related