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

Disabling AFH (Adaptive Frequency Hopping)

Please tell me about AFH (Adaptive Frequency Hopping).

SDK:15.3.0
例:ble_app_multirole_lesc
DeviceA:EYSHJNZWZ(nRF52832)

In AFH (Adaptive Frequency Hopping), the frequency is switched between 0 to 36 CH when connected and 37 to 39 CH when advertised.
Is it possible to disable AFH?
In other words, is it possible to fix to any channel?
Please tell me if there is a way.

Parents Reply
  • I believe it's possible, I can't say for sure. Try to mask all but one channel:

     ble_opt_t opt;
     memset(&opt, 0, sizeof(opt));
     opt.gap_opt.ch_map.ch_map[0] = 0xFE; // ch.1
     opt.gap_opt.ch_map.ch_map[1] = 0xFF;
     opt.gap_opt.ch_map.ch_map[2] = 0xFF;
     opt.gap_opt.ch_map.ch_map[3] = 0xFF;
     opt.gap_opt.ch_map.ch_map[4] = 0x1F;
    sd_ble_opt_set(BLE_GAP_OPT_CH_MAP, &opt);
    Can I disable AFH in the same way when advertising as a peripheral device?

    There is no AFH when advertising, instead, device is advertising sequentially on all 3 channels. Yes, you can change advertising channel mask in ble_gap_adv_params_t.

Children
Related