From 7fb01e3968eca3ebaa81d7cfba0a6d8881fdb94a Mon Sep 17 00:00:00 2001 From: jhchun Date: Tue, 14 Jul 2026 14:44:15 +0900 Subject: [PATCH] =?UTF-8?q?DFU(SMP)=20=EC=A0=84=ED=99=98=20=EC=8B=9C=2010?= =?UTF-8?q?=EB=B6=84=20=ED=83=80=EC=9E=84=EC=95=84=EC=9B=83=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SMP UUID로 광고 시 일반 NUS 스캔이 불가능 - DFU가 시작되지 못한 채 방치되는 경우 대비 --- src/ble/ble_service.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ble/ble_service.c b/src/ble/ble_service.c index adb2e6d..2f51d10 100644 --- a/src/ble/ble_service.c +++ b/src/ble/ble_service.c @@ -406,7 +406,8 @@ static void adv_timeout_handler(struct k_work *work) { ARG_UNUSED(work); - if (!ble_connection_st && !advertising_unlimited && !dfu_advertising_mode) + // 미연결 상태에서만 발동하므로 DFU 광고도 동일하게 10분 후 종료(연결 중이면 발동 안 함) + if (!ble_connection_st && !advertising_unlimited) { DBG_PRINTF("[BLE] Advertising timeout\r\n"); (void)ble_advertising_stop(); @@ -558,7 +559,15 @@ static void disconnected(struct bt_conn *conn, uint8_t reason) } ble_connection_st = false; - advertising_unlimited = ble_disconnect_reason_uses_unlimited_adv(reason); + if (dfu_advertising_mode) + { + // DFU 광고는 미연결 10분 타임아웃 적용 + advertising_unlimited = false; + } + else + { + advertising_unlimited = ble_disconnect_reason_uses_unlimited_adv(reason); + } DBG_CORE("[BLE] Disconnected reason=0x%02x adv=%s\r\n", reason, advertising_unlimited ? "unlimited" : "10min"); @@ -747,7 +756,7 @@ int ble_advertising_start(void) } k_work_cancel_delayable(&adv_timeout_work); - if (!advertising_unlimited && !dfu_advertising_mode) + if (!advertising_unlimited) // DFU 광고 포함, 미연결 10분 시 전원 OFF { k_work_schedule(&adv_timeout_work, K_MSEC(APP_ADV_DURATION * 10)); }