Hi, I am trying to achieve the maximum throughput when using the nRF51822.As far as I know, the minimum connection interval is 7.5ms and the maximum packets per interval are 6. So, I want to configure my application with these parameters. The setup that I am using is as below. SDK: nRF5_SDK_12.3.0 Softdevice: S130 V2.0. IDE:keil5 To achieve the maximum throughput, first of all, the connection intervals and slave latency are set to 7.5 ms and 0, respectively, for both Central and Peripheral below.
define MIN_CONN_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS) define MAX_CONN_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS) define SLAVE_LATENCY 0
From this Post:devzone.nordicsemi.com/.../ I know that the firmware of the Central, by default, connections as a Central will be set to medium bandwidth and connections as a Peripheral will be set to high bandwidth. (11.4 BLE role configuration in S130_SDS_v2.0.pdf (page 38))
So I modified the content of ble_enable_paramsbecause this variable is used by function softdevice_enable(ble_enable_params_t *ble_enable_params) to enable the BLE. By default,function softdevice_enable_get_default_config(CENTRAL_LINK_COUNT, PERIPHERAL_LINK_COUNT, &ble_enable_params) is used to configure ble_enable_params.But the item of common_enable_params in that struct isn't configured, so I defined another variable and passed its address to ble_enable_params. common_enable_params like follows:
ble_enable_params_t ble_enable_params;
err_code = softdevice_enable_get_default_config(CENTRAL_LINK_COUNT,
PERIPHERAL_LINK_COUNT,
&ble_enable_params);
// define another variable
ble_conn_bw_counts_t conn_bw_counts = {
.tx_counts = {.high_count = 1, .mid_count = 0, .low_count = 0},
.rx_counts = {.high_count = 1, .mid_count = 0, .low_count = 0}
};
//Configure conn_bw_counts in enable_params (along with others)
ble_enable_params.common_enable_params.p_conn_bw_counts = &conn_bw_counts;
But when function softdevice_enable(&ble_enable_params) is executed,it returns error NRF_ERROR_INVALID_PARAM(NRF_ERROR_BASE_NUM + 7). I don't know why this situation can occur, who can help me? Thank you in advance.
Best regards