Connection parameters configuration

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
parametrica
Offline
Last seen:1 year 2 months ago
加入:2019-07-17 07:57
Connection parameters configuration

Dear Dialog,

I'm looking at the ble_app_barebone example and have found that there are two places with connection parameters configuration:

static const struct gapm_configuration user_gapm_conf = {
...
.con_intv_min = MS_TO_DOUBLESLOTS(10),
.con_intv_max = MS_TO_DOUBLESLOTS(20),
.con_latency = 0,
.superv_to = MS_TO_TIMERUNITS(1000),
...
}

static const struct connection_param_configuration user_connection_param_conf = {
.intv_min = MS_TO_DOUBLESLOTS(10),
.intv_max = MS_TO_DOUBLESLOTS(20),
.latency = 0,
.time_out = MS_TO_TIMERUNITS(1250),
...
}

Can you please clarify why we need both of them?

Device:
PM_Dialog
Offline
Last seen:10 hours 49 min ago
工作人员
加入:2018-02-08 11:03
Hi parametrica

Hi parametrica

The peripheral device, which is advertising, assumes the role of a slave device, while the scanner device, which is searching for a device to connect to, assumes the role of a master device upon a connection process. The latter, is responsible for performing various mandatory actions including which channel to transmit and what event interval to use. However, following a successful connection, the slave device can propose its own preferred parameters (connection interval, supervision time-out etc) via an update connection parameter request. After that, the master responds to the slave if its demands has been approved. To do so, the peripheral device sends connection parameter update request, the negotiation procedure will happen over the air, if the commend is approved, a connection parameter updated event will take place. Please refer to Bluetooth LE specifications for getting more information regarding Update Connection Parameters.

The user_gapm_conf structure keeps the user’s configurations and the device upon connection will have the connection interval from this structure. The user_connection_param_conf keeps the connection parameter update configuration. The connection intervals are defined by the central, so what you can do, is to issue a connection update request and the central will decide if it will accept the connection parameters that you have requested. If the current parameters don’t match will send a request to the central in order to update the connection parameters (the request is sent 10 seconds after the connection is established), so if the central accepts the parameters the connection will change to the specified values in the user_connection_param_conf structure.

Thanks, PM_Dialog