fix(ble): 기기 응답 없음 배너 tolerance 5→12초 (흔들림 false positive 차단)

## 문제
기기를 흔들면 "감지중" (posture UNKNOWN) 후 "기기 응답 없음" 배너 flap.

## 원인
FirmwareWarningBanner 의 deviceAlive 기준이 5초로 너무 타이트:
1. 흔들면 BLE 안테나 wobbling → 짧은 disconnect
2. onConnectionStateChange → firmwareVersion.value = "" reset
3. 재연결 후 mid/mfv 재요청 응답 지연 → 8초 후 timedOut=true
4. 동시에 mim? 응답 몇 개 놓쳐 5초 초과 → deviceAlive=false
5. showTimedOut = timedOut && !deviceAlive → 배너 표시

## 수정
deviceAlive 5→12초. Watchdog 자체가 15초 timeout 이라, 12초 내 재개되는
transient 스톨은 배너로 알리지 않고 조용히 대기. 진짜 disconnect 는
watchdog 이 처리.

## 참고
"감지중" (posture UNKNOWN) 은 acc mag > 1.2g 정상 동작 (흔들 때 acc gate
초과 → classifier UNKNOWN). 이미 3연속 hysteresis 있어 순간 튐엔 반응 X.
수정 대상 아님.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-03 10:57:55 +09:00
parent 506d50d2c6
commit 7a2abfa65b
@@ -69,8 +69,11 @@ fun FirmwareWarningBanner(bleManager: BleManager, modifier: Modifier = Modifier)
}
}
@Suppress("UNUSED_EXPRESSION") tick
// 최근 5초 내 BLE 데이터 수신 있으면 기기 alive — "기기 응답 없음" false positive 차단.
val deviceAlive = lastRxAt > 0 && (System.currentTimeMillis() - lastRxAt) < 5_000
// 최근 12초 내 BLE 데이터 수신 있으면 기기 alive — "기기 응답 없음" false positive 차단.
// 2026-07-03: 5→12초 완화. 기기를 흔들 때 BLE 안테나 wobbling 으로 3~5초 응답 스톨 시
// 재연결 → firmwareVersion reset → 8초 후 timedOut → 배너 flap 현상.
// Watchdog 15초 timeout 이 진짜 disconnect 판정하므로 12초까지는 조용히 대기.
val deviceAlive = lastRxAt > 0 && (System.currentTimeMillis() - lastRxAt) < 12_000
val outdated = bleManager.isFirmwareOutdated
val showTimedOut = timedOut && !deviceAlive