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

Disable scan response

I would like to reduce current consumption on my beacon and I wonder if it is possible to disable sending scan response. I know that it is not a huge difference in a single advertising event, but when you have short advertising period it makes difference in the longer period of time.

I use SD110 version 8.0.0.

My advertising type is BLE_GAP_ADV_TYPE_ADV_IND. I wonder if I use BLE_GAP_ADV_FP_FILTER_SCANREQ filter policy and then in the whitelist I can supply one random address, will my beacon send scan response packets?

EDIT:

 /* Some random address */
ble_gap_addr_t scan_req_addr = {
	.addr_type = BLE_GAP_ADDR_TYPE_RANDOM_STATIC,
	.addr[0] = 0xC8,
	.addr[1] = 0xD2,
	.addr[2] = 0xEF,
	.addr[3] = 0x12,
	.addr[4] = 0x11,
	.addr[5] = 0xC8,
};

ble_gap_addr_t *filter_addrs[1] = {&scan_req_addr};

ble_gap_whitelist_t  whitelist = {
	.pp_addrs = filter_addrs,
	.addr_count = 1,
	.pp_irks = NULL,
	.irk_count = 0,
};

	/// Initialize advertising parameters structure
	/// Initially, advertising is fastened
	memset(&m_adv_params, 0, sizeof(m_adv_params));
	m_adv_params.type = 		BLE_GAP_ADV_TYPE_ADV_IND;
	m_adv_params.p_peer_addr = 	NULL;
//	m_adv_params.fp = 			BLE_GAP_ADV_FP_ANY;
	m_adv_params.fp = BLE_GAP_ADV_FP_FILTER_SCANREQ;
	m_adv_params.p_whitelist = &whitelist;
//	m_adv_params.p_whitelist = 	NULL;
	m_adv_params.interval = 	ADVERTISING_INTERVAL_FASTENED;
	m_adv_params.timeout = 		ADVERTISING_TIMEOUT;

sd_ble_gap_adv_start()

returns erro code 0x3201. When using commented out fp and whitelist pointer everything works OK.

Parents
  • Hi,

    You probably want to avoid Rx window after each Advertisement Tx packet, providing random address to the whitelist won't help you (Soft Device will still be listening). In that case you must use BLE_GAP_ADV_TYPE_ADV_NONCONN_IND (see this answer for more) but it has some side effects:

    • Soft Device won't allow you to set lower adv. interval then 100ms (in-line with BT SIG Core specification).
    • Soft Device won't listen for connection (again in-line with BT SIG Core).

    If you don't like this variant, then you would need other BLE stack then Nordic Soft Device (and probably customize it as it might be enforcing these BT SIG rules as well).

    Cheers

  • I do not want to avoid Rx window, I want to avoid sending scan response packet. I thought that when I use filter for scan request with random address then my beacon will send scan response packet only to that one specific address. Now my beacon sends scan response to every device that issue scan request. Am I wrong?

Reply Children
No Data
Related