diff --git a/src/ble/ble_service.c b/src/ble/ble_service.c index 41cef7f..af66d97 100644 --- a/src/ble/ble_service.c +++ b/src/ble/ble_service.c @@ -525,6 +525,7 @@ static void connected(struct bt_conn *conn, uint8_t err) conn_param_update_attempts = 0U; last_rx_conn_param_update_ms = 0; + k_work_schedule(&conn_param_update_work, K_MSEC(BLE_CONN_PARAM_FIRST_DELAY_MS)); #if IS_ENABLED(CONFIG_BT_SMP) err = bt_conn_set_security(conn, BLE_REQUIRED_SECURITY_LEVEL); @@ -596,6 +597,11 @@ static void le_param_updated(struct bt_conn *conn, uint16_t interval, { k_work_cancel_delayable(&conn_param_update_work); } + else if (conn_param_update_attempts < BLE_CONN_PARAM_MAX_ATTEMPTS) + { + k_work_schedule(&conn_param_update_work, + K_MSEC(BLE_CONN_PARAM_RETRY_INTERVAL_MS)); + } } #if IS_ENABLED(CONFIG_BT_SMP)