This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RSSI scan filter

I use nRF5340 DK as Central, iPhone as Peripheral.

I start a scan with no filters and in scan_filter_no_match() I check if RSSI is good enough "RSSI > -40" and initialize the connection.

It's working but searching the specific device takes too long, average 600ms.

Is there any way to speed up the scan?

Is it possible to set some RSSI filter, if there is any, to receive only advertisements from devices with a strong RSSI and ignore the rest?

Power consumption is not a problem, the board will be connected to power all the time.

Thanks in advance.

  • Is there any way to speed up the scan?

    Try to change the scan window and interval.

    Try e.g. something like this in scan_init(), snippet:

    struct bt_le_scan_param scan_param = {
    		.type = BT_LE_SCAN_TYPE_ACTIVE,
    		.options = BT_LE_SCAN_OPT_FILTER_DUPLICATE,
    		.interval = 0x0010,
    		.window = 0x0010,
    	};
    
    	struct bt_scan_init_param scan_init = {
    		.connect_if_match = 1,
    		.scan_param = &scan_param,
    		.conn_param = BT_LE_CONN_PARAM_DEFAULT,
    	};
    
    	bt_scan_init(&scan_init);

  • Thanks for the help, now it is working faster, but can you help mi with the second question?

    "Is it possible to set some RSSI filter, if there is any, to receive only advertisements from devices with a strong RSSI and ignore the rest?"

  • Stjepan Brlecic said:
    Thanks for the help, now it is working faster,

    Good!

    Stjepan Brlecic said:
    "Is it possible to set some RSSI filter, if there is any, to receive only advertisements from devices with a strong RSSI and ignore the rest?"

    The scan module does not have a RSSI filter. http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.7.1/nrf/libraries/bluetooth_services/scan.html#filter-types

    So this is something you have to handle in your application. If you are using one of the other filers(Name, Short Name, Address, UUID or Apperance), then maybe set .connect_if_match = 0 when you start scanning, and then in scan_filter_match(), you also check the RSSI. And then if the RSSI is good, then you connect using bt_conn_le_create()

Related