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

Scanner and advertising options questions

Hi,

I'm wrapping up a project which uses an nRF5340 as both a Bluetooth peripheral to advertise etc and also as a Bluetooth central to scan for devices (not both at the same time, though). This project currently uses NCS v1.7.1.

My customer requested some options that don't seem to be available in the library, and I just wanted to confirm that these options are not possible before I tell them so:

1) Bluetooth peripheral - when advertising: They wanted a mode where the device will advertise using the 1MBPS phy and then change to whatever PHY a connecting device uses when a connection is established (I'm using NUS once connected). I don't see an option to do this automatically - is this possible?

2) Bluetooth central - when scanning, they want to be able to choose some phy specifics as follows:

   a) Scan using the 1 MBPS phy.  -- I don't see an option to specify this.

   b) Scan using the 2MBPS phy for the "secondary extended advertising portion".   -- I'm not sure what that means - does this apply to scanning at all? Maybe they mean the scan response?

   c) Scan using the Coded phy   -- no problem here - I found the option bit for this, BT_LE_SCAN_OPT_CODED

   d) Automatically scan through the various PHY modes. -- I don't think the auto scanning thing is provided by the library - is there any way to do this?

3)  They want to be able to set which advertising channel the scanner is scanning, 37, 38, or 39. There are options for picking your channel when advertising (BT_LE_ADV_OPT_DISABLE_CHAN_38), but I don't see these options for scanning. Is this possible?

Thanks,

Glen

  • Hi Glen,

    1) Bluetooth peripheral - when advertising: They wanted a mode where the device will advertise using the 1MBPS phy and then change to whatever PHY a connecting device uses when a connection is established (I'm using NUS once connected). I don't see an option to do this automatically - is this possible?

    There should be nothing preventing the change of the phy after the connection has been established. bt_conn_get_info gives information from where it is possible to check (info->le->phy) which physical in ON on tx and rx. Additionally, it is possible to update to a different physical after the connection is established using bt_conn_le_phy_update.


    2) Bluetooth central - when scanning, they want to be able to choose some phy specifics as follows:

       a) Scan using the 1 MBPS phy.  -- I don't see an option to specify this.

       b) Scan using the 2MBPS phy for the "secondary extended advertising portion".   -- I'm not sure what that means - does this apply to scanning at all? Maybe they mean the scan response?

       c) Scan using the Coded phy   -- no problem here - I found the option bit for this, BT_LE_SCAN_OPT_CODED

       d) Automatically scan through the various PHY modes. -- I don't think the auto scanning thing is provided by the library - is there any way to do this?


    These are available enumerators

    enum {
    /** Convenience value when no options are specified. */
    BT_LE_SCAN_OPT_NONE = 0,
    /** Filter duplicates. */
    BT_LE_SCAN_OPT_FILTER_DUPLICATE = BIT(0),
    /** Filter using filter accept list. */
    BT_LE_SCAN_OPT_FILTER_ACCEPT_LIST = BIT(1),
    /** Enable scan on coded PHY (Long Range).*/
    BT_LE_SCAN_OPT_CODED = BIT(2),
    /**
    * @brief Disable scan on 1M phy.
    *
    * @note Requires @ref BT_LE_SCAN_OPT_CODED.
    */
    BT_LE_SCAN_OPT_NO_1M = BIT(3),
    };

    * @brief Helper macro to enable active scanning to discover new devices.
    * Include scanning on Coded PHY in addition to 1M PHY.
    */
    #define BT_LE_SCAN_CODED_ACTIVE \
    BT_LE_SCAN_PARAM(BT_LE_SCAN_TYPE_ACTIVE, \
    BT_LE_SCAN_OPT_CODED | \
    BT_LE_SCAN_OPT_FILTER_DUPLICATE, \
    BT_GAP_SCAN_FAST_INTERVAL, \
    BT_GAP_SCAN_FAST_WINDOW)


    There are following Kconfig options
    CONFIG_BT_CTLR_PHY_2M=y    (2Mbps PHY support in the controller)
    CONFIG_BT_CTLR_PHY_CODED=y   (coded phy support in the controller)

    3)  They want to be able to set which advertising channel the scanner is scanning, 37, 38, or 39. There are options for picking your channel when advertising (BT_LE_ADV_OPT_DISABLE_CHAN_38), but I don't see these options for scanning. Is this possible?

    It is not possible to set advertising channel which scanner should scan.

    Best regards;
    Dejan

Related