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

gap_conn_cfg vs role_count_cfg

I would like to use twenty concurrent connections. As I understand I should set ble_cfg.gap_cfg.role_count_cfg.periph_role_count = 20 and ble_cfg.conn_cfg.params.gap_conn_cfg.conn_count = 20. What is the difference between these two parameters? What happens if I put different values in these two configuration options?

My environment: S132 v4.0.2, SDK v13.0.0.

Parents
  • Hi Neo!

    ble_cfg.gap_cfg.role_count_cfg.periph_role_count = 20;
    

    Defines maximum number of connections concurrently acting as peripherals.

    ble_cfg.conn_cfg.params.gap_conn_cfg.conn_count = 20;  
    

    Defines the number of concurrent connections the application can create with this configuration.

    Regards
    Joakim

  • The default value of the conn_count is 1, so you would have to provide a new value to be able to have more than one concurrent connection. And it only makes sense to use periph_role_count + central_role_count, as that is the number of concurrent connections you want. You can take a look at how it is done in the multilink example, where there is defined two variables for the number of peripheral/central connections:

    #define CENTRAL_LINK_COUNT         8
    #define PERIPHERAL_LINK_COUNT    0
    

    This is later used to set the values for the number of connections:

    ble_cfg.gap_cfg.role_count_cfg.periph_role_count  = PERIPHERAL_LINK_COUNT;
    ble_cfg.gap_cfg.role_count_cfg.central_role_count = CENTRAL_LINK_COUNT;
    ble_cfg.conn_cfg.params.gap_conn_cfg.conn_count     = PERIPHERAL_LINK_COUNT + CENTRAL_LINK_COUNT;
    
Reply
  • The default value of the conn_count is 1, so you would have to provide a new value to be able to have more than one concurrent connection. And it only makes sense to use periph_role_count + central_role_count, as that is the number of concurrent connections you want. You can take a look at how it is done in the multilink example, where there is defined two variables for the number of peripheral/central connections:

    #define CENTRAL_LINK_COUNT         8
    #define PERIPHERAL_LINK_COUNT    0
    

    This is later used to set the values for the number of connections:

    ble_cfg.gap_cfg.role_count_cfg.periph_role_count  = PERIPHERAL_LINK_COUNT;
    ble_cfg.gap_cfg.role_count_cfg.central_role_count = CENTRAL_LINK_COUNT;
    ble_cfg.conn_cfg.params.gap_conn_cfg.conn_count     = PERIPHERAL_LINK_COUNT + CENTRAL_LINK_COUNT;
    
Children
No Data
Related