The SIG BLE standard says that the central devices decides the specific value of connection parameters, such as connection interval, time out, and peripheral latency. But most low power applications on the peripheral side need to keep the connection and save themselves power, so they don’t want frequent high-power wakeups. I’ll explain how to achieve this on the peripheral side.
Referring to chapter 126.96.36.199.5 Update Connection Parameters in the RSL10 Firmware Reference, you will find there is a command named GAPC_ParamUpdateCmd. Next I’ll lead you through how to implement this with our peripheral_server sample code.
First, in the ble_std.h file, add this definition:
extern void GAPC_ParamUpdateCmd (uint8_t conidx, uint16_t intv_min, uint16_t intv_max, uint16_t latency, uint16_t time_out, uint16_t ce_len_min, uint16_t ce_len_max);
second, in the ble_std.c file, add the function below:
the last step, you just call the function in what you want. for example I call it when connection built.
Connect with the BLE dongle, and you will find the parameter changes.