nRF51 SDK
|
Module for initiating and executing a connection parameters negotiation procedure.
Most use cases require what is referred to as Fast Connection Parameters as soon as a connection is established in order to ensure that service discovery and connection procedures happen quickly. However, continuing with these parameters through out the connection may be unnecessary drain of battery since many applications require a less frequent data exchange. Therefore, it is recommended that the peripheral applications request the master to update connection parameters. The Connection parameters negotiation library of the SDK provides the functionality to do so.
On initialization, the library can be provided with the desired connection parameters to be used for the link along with when the negotiation of connection parameters should start, how many times negotiation is to be attempted and what action to take if action if negotiation fails.
The library must be set up for negotiating the connection parameters on the link. This is done by calling the ble_conn_params_init API. The application should indicate when the first connection parameter request should be sent to the peer, how many times the library should attempt negotiating the parameters and what should be the time interval between each attempt. The application can also indicate if the library should initiate disconnection in case connection parameters could not be negotiated as desired by the application. Additionally, application can register with the library to be notified of events and errors.
This routine must be called when the application is disabling the SoftDevice or the application does not want the parameters to be negotiated any longer. This must be called to ensure the timers used by the library are not longer active.
In case application needs to renegotiate the connection parameters, it can do so using the ble_conn_params_change_conn_params API. This API could be requested multiple times when in connection. This procedure should not be initiated if a negotiation is already ongoing.