nRF5340 DK
ncs 1.4.2
Zephyr 2.4.0
zephyr/samples/bluetooth/central (with modifications)
When scanning, specifying scan option BT_LE_SCAN_OPT_FILTER_DUPLICATE has no effect for both passive and active scanning.
Specifying options explicitly:
static void start_scan(void)
{
int err;
struct bt_le_scan_param scan_param =
{
.type = BT_LE_SCAN_TYPE_ACTIVE,
.options = BT_LE_SCAN_OPT_FILTER_DUPLICATE,
.interval = BT_GAP_SCAN_FAST_INTERVAL,
.window = BT_GAP_SCAN_FAST_WINDOW,
.timeout = 0
};
//
err = bt_le_scan_start(&san_param, device_found);
if (err) {
printk("Scanning failed to start (err %d)\n", err);
return;
}
printk("Scanning successfully started\n");
}
or using the pre-supplied macro:
static void start_scan(void)
{
int err;
//
err = bt_le_scan_start(BT_LE_SCAN_ACTIVE, device_found);
if (err) {
printk("Scanning failed to start (err %d)\n", err);
return;
}
printk("Scanning successfully started\n");
}
still results in all advertisements being forwarded to device_found(...):
static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type,
struct net_buf_simple *ad)
{
uint8_t base_addr[6] = { 0xb2, 0xfc, 0x69, 0x22, 0x91, 0xb0 };
char addr_str[BT_ADDR_LE_STR_LEN] = {0};
int err;
if (default_conn) {
return;
}
bt_addr_le_to_str(addr, addr_str, sizeof(addr_str));
if (!memcmp(&addr->a, base_addr, 6))
{
if (type == 0)
{
printk("Device found: %s (RSSI %d), %s\n", addr_str, rssi, "ADV_INT");
}
if (type == 4)
{
printk("Device found: %s (RSSI %d), %s\n", addr_str, rssi, "SCAN_RSP");
}
}
}

Changing from active scanning to passive:
err = bt_le_scan_start(BT_LE_SCAN_PASSIVE, device_found);
and the same issue (except, of course, only ADV_INT PDU's are being captured):

There is some prior chat on this forum regarding an identical problem with nRF52840 and SoftDevice but this is a Zephyr build.
Regards,
AC