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

Issue in using option "BT_LE_SCAN_OPT_FILTER_DUPLICATE" from version v1.3.0 to v1.4.0

Hello,

I am using NCS v1.3.0 and nrf52840 dk board. In the central_uart demo example, there is a macro called "BT_LE_SCAN_PASSIVE" which has an option set as  "BT_LE_SCAN_OPT_FILTER_DUPLICATE" which filters out the device address in the cb when multiple advertisement packets come from the same device address. I cross verified this by printing the device address in the "scan_device_found" routine which is available in scan.c file. (...\ncs\v1.3.0\nrf\subsys\bluetooth\scan.c)
Now, when I shifted to NCS 1.4.0 with the same board. In the central_uart example, there is a macro called "BT_LE_SCAN_PASSIVE" which has an option set as "BT_LE_SCAN_OPT_FILTER_DUPLICATE" which SHOULD have filtered out the device addresses. But I see the same result as "BT_LE_SCAN_OPT_NONE" option (which does not filter out the device addresses ). In order to see the expected results, I added this config option in the prj.conf file - "CONFIG_BT_LL_SW_SPLIT=y". After adding this option, I was able to see the filtering. In 1.4.0, "bt_le_scan_start" has "NULL" as it's callback so I modified the  scan.c file a little bit. 
Changes which I did:
1) line 1537 in scan.c - int err = bt_le_scan_start(&bt_scan.scan_param, NULL); - changed NULL to scan_device_found ( int err = bt_le_scan_start(&bt_scan.scan_param, scan_device_found);  and added the following function in the same file.
static void scan_device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type,
struct net_buf_simple *ad)
{
  printk("Coming in callback again and again\n");
}
2) comment line 1330 - // bt_le_scan_cb_register(&scan_cb);
 
You will see that the print statement will be printed continuously.
Now add the config option I mentioned above, and try the same procedure again which will only result in a couple of print statements proving that the callback is only called when the new device address is found which is the expected result with "BT_LE_SCAN_OPT_FILTER_DUPLICATE" option.
When I add this particular config option, I am changing the controller portion of the stack from Nordic to Zephyr and I am able to get the expected results.
Picture on the left is the one without setting config option and picture on the right is with config option.
So is this the correct way I am testing in v1.4.0, if not could you tell me how shall I test it? Is there an issue with the controller portion of the Nordic stack?
Thanks
 
 
Parents Reply Children
No Data
Related