From 69c4e20f343b6c0be430e83dc2b3a0df800f247b Mon Sep 17 00:00:00 2001 From: jhchun Date: Wed, 15 Jul 2026 10:54:30 +0900 Subject: [PATCH] =?UTF-8?q?BLE=20=EC=97=B0=EA=B2=B0=20=ED=8C=8C=EB=9D=BC?= =?UTF-8?q?=EB=AF=B8=ED=84=B0=20=ED=98=91=EC=83=81=20=EB=B3=B5=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 연결 5초 후 15 ms connection interval 요청 - Latency 0, supervision timeout 10 s 설정 요청 - 목표 파라미터 미적용 시 30초 간격으로 최대 3회 재요청 - Central이 최종 적용 여부 결정 - 요청 실패 또는 미적용 시에도 연결은 유지 * 연결 직후에는 pairing/security/초기 GATT 처리 때문에 요청이 무시되거나 늦게 반영될 수 있음 * 첫 요청 타이밍에 폰 상태가 안 좋아서 preferred 값이 안 먹을 수 있음 * 일정 시간 뒤 다시 요청하면 그때는 받아질 가능성이 있음 * 실패해도 연결을 끊지 않으므로 리스크가 크지 않음 --- src/ble/ble_service.c | 6 ++++++ 1 file changed, 6 insertions(+) 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)