Arm Mbed OS support forum

Example on changing BLE connection parameters

I am having some trouble changing BLE connection parameters (mainly due to the connection handle).
Is there any working example that I can refer to, which explains how to change the connection parameters or access the connectionHandle? (I am using nrf52 DK)

My code is the following: if anyone can help me by looking at it…

thanks for the help.

What problems are you facing?
I was evaluating mbed OS5’s BLE and wrote the code below to request connection parameter updates. Not sure if this works for OS6. Soon after I wrote this, I switched to Nordic’s SDK and haven’t touched mbed’s BLE API since.

By the way, you can only “request” parameter updates. Central can ignore your requests.

// ...


static Gap::ConnectionParams_t fast; // change parameters to increase throughput

void connectionCallback(const Gap::ConnectionCallbackParams_t *params) {
    BLE::Instance().gap().updateConnectionParams(params->handle, &fast);

void bleInitComplete(BLE::InitializationCompleteCallbackContext *params) {
    BLE& ble = params->ble;;;
    fast.minConnectionInterval = GAP_CON_MIN_INTERVAL;
    fast.maxConnectionInterval = GAP_CON_MAX_INTERVAL;
    fast.slaveLatency = GAP_CON_SLAVE_LATENCY;;

    // ...

int main(void) {
    BLE &ble = BLE::Instance();

    // ...