How to send Advertising packet with non-connectable and non-scannable

NCS v2.9.0

nRF52832 DK

peripheral_uart sample

"Online Power Profiler for Bluetooth LE" 

 Online Power Profiler for Bluetooth LE 

has a BLE role to send non-connectable, non-scannable packet,

I want to send this kind of advertising packet to test current consumption,

	err = bt_le_adv_start(BT_LE_ADV_NCONN, ad, ARRAY_SIZE(ad), sd,
			      ARRAY_SIZE(sd));
	if (err) {
		LOG_ERR("Advertising failed to start (err %d)", err);
		return 0;
	}

use BT_LE_ADV_NCONN parameter send ADV_SCAN_IND type advertising,

it seems wrong, which parameter of 

bt_le_adv_start()

is correct for non-connectable, non-scannable advertising packet?

Parents
  • Hi, 

    If you want non-scannable, simply don't add a scan response packet to the advertising. 

    Regards,
    Amanda H.

  • Hi,

    1) Non-connectable and non-scannable (ADV_NONCONN_IND)where the device does not need to switch the radio to receiver mode since they do not allow receiving any data, which in turn reduces battery consumption.

    It is what I need, TX only and non-RX, you can also see the same situation on the graph on the web.

    2) Nordic AI suggests the following parameters, but I can't get the ADV_NONCONN_IND advertising packet in the wireshark, there is not any advertising packet.

    ===

    To make this non-connectable (ADV_NONCONN_IND), you need to modify the `adv_param` as follows:


    static struct bt_le_adv_param *adv_param = BT_LE_ADV_PARAM(
    BT_LE_ADV_OPT_USE_IDENTITY | BT_LE_ADV_OPT_USE_NAME | BT_LE_ADV_OPT_NO_2M,
    BT_GAP_ADV_FAST_INT_MIN_2,
    BT_GAP_ADV_FAST_INT_MAX_2,
    NULL);

    The key here is adding the `BT_LE_ADV_OPT_NO_2M` option, which makes the advertising non-connectable.

    Then, start advertising with:


    err = bt_le_adv_start(adv_param, ad, ARRAY_SIZE(ad), NULL, 0);

    This configuration will set up non-connectable, non-scannable advertising, which corresponds to the ADV_NONCONN_IND type in NCS.

    ===

Reply
  • Hi,

    1) Non-connectable and non-scannable (ADV_NONCONN_IND)where the device does not need to switch the radio to receiver mode since they do not allow receiving any data, which in turn reduces battery consumption.

    It is what I need, TX only and non-RX, you can also see the same situation on the graph on the web.

    2) Nordic AI suggests the following parameters, but I can't get the ADV_NONCONN_IND advertising packet in the wireshark, there is not any advertising packet.

    ===

    To make this non-connectable (ADV_NONCONN_IND), you need to modify the `adv_param` as follows:


    static struct bt_le_adv_param *adv_param = BT_LE_ADV_PARAM(
    BT_LE_ADV_OPT_USE_IDENTITY | BT_LE_ADV_OPT_USE_NAME | BT_LE_ADV_OPT_NO_2M,
    BT_GAP_ADV_FAST_INT_MIN_2,
    BT_GAP_ADV_FAST_INT_MAX_2,
    NULL);

    The key here is adding the `BT_LE_ADV_OPT_NO_2M` option, which makes the advertising non-connectable.

    Then, start advertising with:


    err = bt_le_adv_start(adv_param, ad, ARRAY_SIZE(ad), NULL, 0);

    This configuration will set up non-connectable, non-scannable advertising, which corresponds to the ADV_NONCONN_IND type in NCS.

    ===

Children
Related