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

Purpose of APP_BLE_CONN_CFG_TAG in the function nrf_sdh_ble_default_cfg_set() when initializing the ble stack?

Hello, I am working with the nrf52832 and was trying to understand the steps for configuring the Bluetooth stack. Does anyone know what role the APP_BLE_CONN_CFG_TAG plays in the nrf_sdh_ble_default_cfg_set() function?

I thought it is just a tag associated with a particular connection, but if I change this tag to some other number the example program does not run.

I am working with the S132 softdevice.

Thanks,

  • Hi,

    The tag is used when you configure the SoftDevice. i.e. you configure how many connections it should support, connections roles, GAP event length, maximum ATT MTU, number of custom UUIDS, size of GATTS attribute table, etc. When creating a link (starting a connectable advertiser, or creating a central connection), which tag to use is passed to the SoftDevice.

    Multiple connections/links using the same tag is possible, and most, if not all BLE examples in the nRF5 SDK uses a single tag. But, with multiple tags, you can have different configurations for each link. Examples: 2 links with low throughput + one with high throughput, or 5 links, only one of them needs a large ATT MTU.

  • Hi,

    Thanks for your reply.

    so if I change the value of the tag to lets say from 1 to 2. The program should still compile and run---correct? The example code has 1 but since its a tag, what value it has doesn't really matter right?

    Is my understanding correct on this?

    Thanks

  • Ananye said:
    so if I change the value of the tag to lets say from 1 to 2. The program should still compile and run---correct?

    Correct.

    Ananye said:
    The example code has 1 but since its a tag, what value it has doesn't really matter right?

     Correct.

    Ananye said:
    Is my understanding correct on this?

     Yes.

    I did a quick test with the ble_app_hrs example, changing APP_BLE_CONN_CFG_TAG from 1 to 2, and everything worked as expected.

  • Multiple connections/links using the same tag is possible, and most, if not all BLE examples in the nRF5 SDK uses a single tag. But, with multiple tags, you can have different configurations for each link. Examples: 2 links with low throughput + one with high throughput, or 5 links, only one of them needs a large ATT MTU.

    Is there any example for multilink with different gap event length?

Related