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

nRF51422 read devices in range without connection

Hi, I'm newbie developing with nRF51. I'm working in Firmware for a ble central role that can read all the macs of ble peripherals roles near. I want to event or function that returns to me the macs of peripherals without connected to them. Can i do this??. I don't found a example like this in SDK.

I think i can do this with on_ble_evt function but i can't know how.

Thanks for your support, and sorry for my english.

Best Regards.

Parents
  • Yes, you can do this with the on_ble_evt function. Just check out a central example(ble_central) in our 8.1.0 SDK, for example ble_app_hrs_c.

    After you have started a scan you will get an event with event id BLE_GAP_EVT_ADV_REPORT every time you receive an advertising packet from a peripheral. Then you can get the peripheral's address by from p_ble_evt->evt.gap_evt.params.adv_report.peer_addr

Reply
  • Yes, you can do this with the on_ble_evt function. Just check out a central example(ble_central) in our 8.1.0 SDK, for example ble_app_hrs_c.

    After you have started a scan you will get an event with event id BLE_GAP_EVT_ADV_REPORT every time you receive an advertising packet from a peripheral. Then you can get the peripheral's address by from p_ble_evt->evt.gap_evt.params.adv_report.peer_addr

Children
No Data
Related