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

Explanation of BLE_GAP_TX_POWER_ROLES for SD 6 needed

Hi I've found the documentation around BLE_GAP_TX_POWER_ROLES to be a bit sparse. I was wondering if someone could please give me some more info on them

Three roles have been introduced for sd_ble_gap_tx_power_set() in softdevice version 6. They are

enum BLE_GAP_TX_POWER_ROLES
{
  BLE_GAP_TX_POWER_ROLE_ADV       = 1,           /**< Advertiser role. */
  BLE_GAP_TX_POWER_ROLE_SCAN_INIT = 2,           /**< Scanner and initiator role. */
  BLE_GAP_TX_POWER_ROLE_CONN      = 3,           /**< Connection role. */
};

Does this mean that the tx power set with

  • BLE_GAP_TX_POWER_ROLE_ADV will only happen when advertising?
  • BLE_GAP_TX_POWER_ROLE_SCAN_INIT will only happen when Scanning and initialising connections?
  • BLE_GAP_TX_POWER_ROLE_CONN   will only happen when connected?

Since I have to specify a connection handle with BLE_GAP_TX_POWER_ROLE_CONN , can I use BLE_CONN_HANDLE_ALL  or do I have to call sd_ble_gap_tx_power_set everytime a new device connects?

If I want the same behaviour  as soft devices v5, do I need to call sd_ble_gap_tx_power_set() with all 3 roles?

Thanks

Parents
  • Hi Goldwake,

    You got it correct.

    Those defines were introduced in an attempt to set the TX power in more controlled way per role.

    You are also correct that using BLE_GAP_TX_POWER_ROLE_CONN will not accept BLE_CONN_HANDLE_ALL, it needs to specify specific connection handle for every connection. Would be a nice feature to accept BLE_CONN_HANDLE_ALL for setting tx power for all connections. I will notify the softdevice team about this, but for now, you need to do this for all connections. Best place is to do this when you get the CONNECTED event from the softdevice.

Reply
  • Hi Goldwake,

    You got it correct.

    Those defines were introduced in an attempt to set the TX power in more controlled way per role.

    You are also correct that using BLE_GAP_TX_POWER_ROLE_CONN will not accept BLE_CONN_HANDLE_ALL, it needs to specify specific connection handle for every connection. Would be a nice feature to accept BLE_CONN_HANDLE_ALL for setting tx power for all connections. I will notify the softdevice team about this, but for now, you need to do this for all connections. Best place is to do this when you get the CONNECTED event from the softdevice.

Children
No Data
Related