How to Scaning Other Bluetooth Device Using nRF52833

Hi everyone,

I am new here. I wanna develope a module using nrf52833 for observing other bluetooth device like "nrf Connect For Desktop-> nrf connect for desktop bluetooth low energy standalone App" attached image. I have tried to run example projects(ble_app_uart_c_pca10100_s122 ) but i couldnt find i wanted. The codes waiting command from user as i understand. i am using nrf52 first time. Which example project is more similar to what I want? Many thanks.

Parents Reply Children
  • Hello,

    Thank you for clarifying, this is very helpful for me to know!

    In this case I recommend that you start out from any of the BLE central examples - like the BLE UART example you have already linked - and then remove the scan filters (along with any other functionality from the original example that you do not need), so that you will receive scan reports for all scanned advertisements, and then you can create a list to keep the 'present devices' in, to create the estimate.
    Please remember that devices might have privacy enabled, and so their address could change anytime during your scanning (which in this case would indicate 2 people present instead of 1).
    Then you could implement some kind of timeout or measure to remove devices from the list if you have not heard from them in the last x minutes, or similar.
    For instance, your present devices list could contain structs with the device id and a timestamp from the RTC, and then if the difference in the timestamp gets too large the device is considered gone or lost, and removed from the list.

    Would this be what you are after? 

    Best regards,
    Karl

  • Hello,

    thank you so much. that it what i want. I will do what you say and then report the result here.

    Regards.

  • Great, I am glad to hear that! :) 

    Please give this a try, and do not hesitate to let me know if you should encounter any issues or questions along the way.

    Best regards,
    Karl

  • Hi Again,

    I have edited scan_init function(removed scan filter) after that i have compiled and ran the project(ble_app_uart_c) and then i gave input(20 byte) from mobaxterm. the module printed logs as shown in below figure.  how can i see active device log?

  • Hello,

    I am glad to read that you are progressing with your design!
    You will also need to remove the NUS connection functionality since this is not going to be used in your case.
    Additionally, you will need to modify the 'scan_evt_handler' to print the device ID of the scanned devices from the scan reports, you should then start to see scan reports about the different devices in the vicinity.

    Best regards,
    Karl

Related