From 7ab3d878e7d70291574d63b8283365421e82928c Mon Sep 17 00:00:00 2001 From: jjangddu Date: Thu, 23 Apr 2026 14:22:40 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20watchdog=20=EB=88=84=EB=9D=BD=20?= =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95=20+=20=EC=8B=9C?= =?UTF-8?q?=EC=9E=91=20=EB=A1=9C=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CCCD 없는 경로(no CCCD, no RX)에서도 startWatchdog() + startBatteryPolling() 호출 - watchdog 시작 시 WATCHDOG_STARTED 로그 기록 (실제 동작 확인용) Co-Authored-By: Claude Opus 4.6 (1M context) --- .../java/com/example/medilightv2android/ble/BleManager.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/example/medilightv2android/ble/BleManager.kt b/app/src/main/java/com/example/medilightv2android/ble/BleManager.kt index f9a4f0e..c799bf4 100644 --- a/app/src/main/java/com/example/medilightv2android/ble/BleManager.kt +++ b/app/src/main/java/com/example/medilightv2android/ble/BleManager.kt @@ -361,6 +361,7 @@ class BleManager private constructor(private val context: Context) { stopWatchdog() lastRxTimestamp = System.currentTimeMillis() watchdogRunning = true + debugLogger.info("WATCHDOG_STARTED timeout=${watchdogTimeoutMs}ms") watchdogJob = Thread({ while (watchdogRunning) { @@ -630,19 +631,21 @@ class BleManager private constructor(private val context: Context) { } } else { logw { "CCCD descriptor not found for RX characteristic" } - // No CCCD but still mark ready if characteristics exist handler.post { if (txCharacteristic != null && rxCharacteristic != null) { isServiceReady.value = true + startBatteryPolling() + startWatchdog() logd { "Service ready (no CCCD)" } } } } } ?: run { - // No RX characteristic, mark ready if TX exists handler.post { if (txCharacteristic != null) { isServiceReady.value = true + startBatteryPolling() + startWatchdog() logd { "Service ready (no RX)" } } }