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

Changing the GAP parameters and advertising interval at run time from Peripheral device side(which is advertising)

Hi Nordic Team,

In my BLE project I am trying to change the GAP parameters like

gap_connection_param.min_conn_interval = MIN_CONN_INTERVAL;
gap_connection_param.max_conn_interval = MAX_CONN_INTERVAL;
gap_connection_param.slave_latency = SLAVE_LATENCY;
gap_connection_param.conn_sup_timeout = CONN_SUP_TIMEOUT;

Above, the parameters are set but these are hard coded in the code.

Please share a logic to change these parameters at run time dynamically.

Also share logic to change the advertising interval at run time. 

and again initialized these values again.

Please help as soon as possible.

Thanks & Regards,

Aswati

Parents
  • Hi Aswati, 

    I'd recommend using the Connection Parameters Negotiation module to manage the connection parameter negotiation with the central. It includes APIs that let you request new connection parameter at runtime. 

    Also share logic to change the advertising interval at run time. 

    The Advertising Module already includes a fast and slow advertising mode allowing you to specify two different intervals and durations. The fast mode is usually set with a short timeout and short interval when both modes are enabled. The module switches over to "slow" advertising when fast advertising times out. The SD advertising API must be accessed directly if you need a more flexible solution. 

Reply
  • Hi Aswati, 

    I'd recommend using the Connection Parameters Negotiation module to manage the connection parameter negotiation with the central. It includes APIs that let you request new connection parameter at runtime. 

    Also share logic to change the advertising interval at run time. 

    The Advertising Module already includes a fast and slow advertising mode allowing you to specify two different intervals and durations. The fast mode is usually set with a short timeout and short interval when both modes are enabled. The module switches over to "slow" advertising when fast advertising times out. The SD advertising API must be accessed directly if you need a more flexible solution. 

Children
Related