This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

How to config mode of directed high duty to back connection after BLE disconnect.

Hi All,

In application, I want to config mode of directed high duty to back connection after BLE disconnect for my hid keyboard. So I modify based on this example: "nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_hids_keyboard\pca10040e\s112\arm5_no_packs". 

I did a test: First, I connect the device with PC and pairing and bonding, then disconnect and change the MAC address broadcast, and then restore the original of MAC address to directional broadcast connection by pressing the key switch.It can back connected,but the broadcast can be scan of other phones and  the log show" <info> app: Fast advertising with whitelist." not "High Duty Directed advertising."  So how to config mode of directed high duty to back connection after BLE disconnect and the log can show  "High Duty Directed advertising."

My code of advertising_init:

static void advertising_init(void)
{
uint32_t err_code;
uint8_t adv_flags;
ble_advertising_init_t init;

memset(&init, 0, sizeof(init));

adv_flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
init.advdata.name_type = BLE_ADVDATA_FULL_NAME;
init.advdata.include_appearance = true;
init.advdata.flags = adv_flags;
init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
init.advdata.uuids_complete.p_uuids = m_adv_uuids;
init.config.ble_adv_on_disconnect_disabled = true; //

init.config.ble_adv_whitelist_enabled = true; //true;
init.config.ble_adv_directed_high_duty_enabled = true; //true;
init.config.ble_adv_directed_enabled = false;
init.config.ble_adv_directed_interval = 0; //0;
init.config.ble_adv_directed_timeout = 0; //0;
init.config.ble_adv_fast_enabled = true;
init.config.ble_adv_fast_interval = APP_ADV_FAST_INTERVAL;
init.config.ble_adv_fast_timeout = APP_ADV_FAST_DURATION;
init.config.ble_adv_slow_enabled = true;
init.config.ble_adv_slow_interval = APP_ADV_SLOW_INTERVAL;
init.config.ble_adv_slow_timeout = APP_ADV_SLOW_DURATION;

init.evt_handler = on_adv_evt;
init.error_handler = ble_advertising_error_handler;

err_code = ble_advertising_init(&m_advertising, &init);
APP_ERROR_CHECK(err_code);

ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
}

Directional back connect code:
"
err_code = set_adv_mode_directed_high_duty(p_advertising, &p_advertising->adv_params);
APP_ERROR_CHECK(err_code);
whitelist_set(PM_PEER_ID_LIST_SKIP_NO_ID_ADDR);
err_code = ble_advertising_start(p_advertising, BLE_ADV_MODE_DIRECTED_HIGH_DUTY);
APP_ERROR_CHECK(err_code);
"
Thanks!
Pany

Parents
  • Hi Pany

    In high duty cycle directed advertising mode, the time between the start of two consecutive ADV_DIRECT_IND PDUs sent within an advertising event shall be less than or equal to 3.75ms. Please refer to the BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E section 7.8 regarding high duty cycle connectable directed advertising.

    Please also note that you can not use extended advertising when using high duty cycle and that the directed advertising with high duty cycle timeout is 1.28 s.

    Best regards,

    Simon

Reply
  • Hi Pany

    In high duty cycle directed advertising mode, the time between the start of two consecutive ADV_DIRECT_IND PDUs sent within an advertising event shall be less than or equal to 3.75ms. Please refer to the BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E section 7.8 regarding high duty cycle connectable directed advertising.

    Please also note that you can not use extended advertising when using high duty cycle and that the directed advertising with high duty cycle timeout is 1.28 s.

    Best regards,

    Simon

Children
Related