Hi,
I am using nrf SDK 1.9.0 and want to receive extended advertisements on a device (nrf52832) but I didn't got any example. Do you have any sample?
Hi,
I am using nrf SDK 1.9.0 and want to receive extended advertisements on a device (nrf52832) but I didn't got any example. Do you have any sample?
Hi Ashish,
Which feature of extended advertising are you planning to do ?
You just need to add CONFIG_BT_EXT_ADV=y in the project config to allow scanning in extended advertising.
You would also need .type = BT_LE_SCAN_TYPE_ACTIVE if you plan to do active scanning.
I would suggest to have a look at the central_hr_coded example. In the example we scan for CODED PHY extended advertising.
I just wanted to send around 60 bytes in the secondary channel.
I modify the example "periodic_adv" and setting the data as bt_le_ext_adv_set_data(adv, NULL, 0, ad, ARRAY_SIZE(ad))
I can not see data using central_hr_coded as I assume it need to be connected.
Whereas, this would be broadcast extended messages.
Hi Ashish,
I attached here the code I modified to show how extended advertising can be scan. I based on the central_hr_coded but the advertising is on 1Mbps not CODED PHY. You can testing using nRF52832 dk.
You should see something like this in the log of the central:
Note that nRF Sniffer and many phones can scan for extended advertising. Please check your phone capability.
Hi Hung,
Thanks for the code and verification. I see I have the same output. However to understand it better with compare to periodic_adv example, I see we need to add filtering using bt_scan_filter_add() and you added it based on UUID.
So, I have one question:
1) Why do we need this filtering? Is it not possible to get a message call back for all the messages received by this device? And can we just send the BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, 40) in the advertisement (similar to periodic_adv example) without the filtering?
Hi Ashish,
The scan filter was there in the original code so I didn't modify it. The reason I kept the filter code is that there are many advertisers in my work so I need some filter otherwise I won't be able to see the advertising packet I want to see.
If you don't plan to use a filter you can use "scan_filter_no_match" callback.
I have a blog post here that you may want to have a look. Quoted from the blog:
If you are scanning without filter, then you need to define a "scan_filter_no_match" callback and you will receive a call back for every single advertising packet received.
Hi Hung,
I worked with your code and this works fine.
However, when I want to use Zephyr Controller by enabling CONFIG_BT_LL_SW_SPLIT=y
The device is unable to start the scan and fails at bt_hci_cmd_send_sync() returning -EIO.
Is there a way I can use the Zephyr controller enabled scanner?