What does GAP_RATE_ANY mean?


  1. What does GAP_RATE_ANY mean?
    Does it means automatically change to 1mbps or 2mbps depending on the situation(tx/rx capability of the client) per connection?

    .tx_pref_rates = GAP_RATE_ANY,
    .rx_pref_rates = GAP_RATE_ANY

  2. In the hci example app, I can see the CFG_BLE_2MBPS definition in the preprocessor settings.
    Does it mean that tx and rx rates are set as 2mbps by default?


Hi Calvin,

Sorry for the delay getting back to you on this.

You are correct, the GAP data rate will be negotiated and set based on situation. Not all devices support the newer and faster data-rate, and some applications may prefer the lower speed. Setting gap_rate will select your devices preferred rate, but it may be forced change if the situation requires it.

/// Bit field use to select the preferred TX or RX LE PHY Rate. 0 means no preferences
enum gap_rate
    /// No preferred rate
    GAP_RATE_ANY               = 0x00,
    /// LE PHY 1mb/s preferred rate for an active link
    GAP_RATE_LE_1MBPS          = (1 << 0),
    /// LE PHY 2mb/s preferred rate for an active link
    GAP_RATE_LE_2MBPS          = (1 << 1),

The CFG_BLE_2MBPS definition is used to enable support for a 2Mbps PHY, otherwise the device will only support 1Mbps.

I hope this answers your questions, please let me know if you have any others.

1 Like