nrf52832 + scanner + single channel + ncs 1.8.0

Hello Team,

We have an application where we send 3 adv packets every 5 minutes. We listen to these adv packets on the scanner side with scan interval and scan window set to equal to ensure that, we are always scanning.

On both side we use nrf52832 + ncs v1.8.0

We miss some of the packets on the scanner side with this setup. As per our understanding, it can be because of interference and/or channel switching.

To rule out channel switching, is it possible to configure the scanner (nrf52832 + ncsv1.8.0) to listen on only 1 channel always (e.g. 37)? 

TIA!

Parents
  • Hello,

    Yes, it is possible to advertise only on one channel in NCS.. You can disable advertising on a specific channel using the following options when you set the advertising parameters..

      /** Disable advertising on channel index 37. */
        BT_LE_ADV_OPT_DISABLE_CHAN_37 = BIT(15),
     
        /** Disable advertising on channel index 38. */
        BT_LE_ADV_OPT_DISABLE_CHAN_38 = BIT(16),
     
        /** Disable advertising on channel index 39. */
        BT_LE_ADV_OPT_DISABLE_CHAN_39 = BIT(17),

    For example, if you want to advertise only on channel 37, you can do the following:

    struct bt_le_adv_param *my_adv_param =
        BT_LE_ADV_PARAM(
    
                BT_LE_ADV_OPT_CONNECTABLE,
    
                BT_GAP_ADV_FAST_INT_MIN_2,
                BT_GAP_ADV_FAST_INT_MAX_2,
                NULL);
     
        my_adv_param->options |= BT_LE_ADV_OPT_DISABLE_CHAN_38;
        my_adv_param->options |= BT_LE_ADV_OPT_DISABLE_CHAN_39;
     
        err = bt_le_adv_start(my_adv_param, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));

    Hope this helps.

    Regards,

    Swathy

  • Hi Swathy

    does this mean we can not repeat sending in the same channel for three times?

    thanks

Reply Children
No Data
Related