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

Multiple Scan.

Hi all,

in Central mode I would like to retrieve the list of all the devices present.

I have developped a litle USB dongle, and I need to list alls peripherals, but after namy test I can't

B.Regards.

Parents
  • I was not able to find any examples/libraries for nRF51 that does what you are asking about (However if you switch to nRF52 and SKD 15.2, it can be achieved easily: link), but it is possible to write the code yourself.

    • I would start by making a structure type device, which represents a device and its fields (e.g. a field for the name and the UUID).
    • Then I would add some code in the function that receives and handles ble events (for example the function on_ble_evt(..) in the ble_app_uart central example in sdk 12.3)
    • The BLE event has a field that contains the advertising data (name, UUIDs and flags), and this link explains how to decode the advertisement data in the payload
    • Then you declare a new variable (using the device type) and put it into an array/list, every time a new name appears
    • Now you have a list of the devices present, and can display it however you want to

    Here is a link that may help you.

    Best regards, Simon

Reply
  • I was not able to find any examples/libraries for nRF51 that does what you are asking about (However if you switch to nRF52 and SKD 15.2, it can be achieved easily: link), but it is possible to write the code yourself.

    • I would start by making a structure type device, which represents a device and its fields (e.g. a field for the name and the UUID).
    • Then I would add some code in the function that receives and handles ble events (for example the function on_ble_evt(..) in the ble_app_uart central example in sdk 12.3)
    • The BLE event has a field that contains the advertising data (name, UUIDs and flags), and this link explains how to decode the advertisement data in the payload
    • Then you declare a new variable (using the device type) and put it into an array/list, every time a new name appears
    • Now you have a list of the devices present, and can display it however you want to

    Here is a link that may help you.

    Best regards, Simon

Children
No Data
Related