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

Non Connectable Scanning Example

Dear Nordic Team,

Thanks for supporting.

My application is central act as a non connectable scanner and display the advertising packet through UART without fail. Please suggest any example code.

I want to display advertiser Mac ID and RSSI value.

Thanks in advance.

Parents
  • Hi,

    When your device is operating in central mode, you are never connectable. The central is the one initiating a connection to a peripheral. I guess what you want to implement is an observer device.

    We don't have any observer-only examples in our SDK, but any of the central examples should easily be adoptable to this purpose by removing the code related to connections. I would recommend that you start with the Nordic UART Service Client example, as you want to transmitt data from the advertisement packages over UART.

    Inside the on_ble_evt() function you should change the BLE_GAP_EVT_ADV_REPORT case to transmitt the data you require over UART using printf() function. The peer address is already shown in the example. RSSI can be fetched from the advertisement package in the same way: p_adv_report->rssi.

    You need to remove the call to sd_ble_gap_connect(), to avoid connections to devices advertising the Nordic UART service (NUS). You can also remove the other cases within the on_ble_evt() function, as these are related to connections.

    Best regards,

    Jørgen

  • Yes, i am checked with sniffer it was capturing every second. I am not doing any modification in UART Service Client example code. My SDK is 11.0. Also i am not modify the scan interval setting.

Reply Children
No Data
Related