fix(firmware): 진입 시 메인 앱 BLE 연결 자동 해제 — 스캔 미검출 해결 (cloud-mvp bc46b7f 이식)

문제: 이미 프로브에 BLE 연결된 상태로 펌웨어 업데이트 화면 진입 → 스캔해도
     프로브가 목록에 안 뜸.

원인: BLE peripheral (VBT 프로브) 는 central 과 연결 중일 때 광고 중단
     (표준 BLE 동작). DfuManager 의 새 BleScanner 는 광고를 못 잡음.

해결: FirmwareUpdateScreen 진입 시 LaunchedEffect 안에서 메인 앱의
     BleManager.getInstance(context).disconnect() 호출.
     → 연결 해제 → 프로브 다시 광고 → DfuManager 스캔에서 검출 가능.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 15:09:06 +09:00
parent 984fe2c939
commit 47317b3c5d
@@ -91,6 +91,11 @@ fun FirmwareUpdateScreen(onBack: () -> Unit, modifier: Modifier = Modifier) {
) { result -> granted = result.values.all { it } } ) { result -> granted = result.values.all { it } }
LaunchedEffect(Unit) { LaunchedEffect(Unit) {
// 진입 시 메인 앱 BLE 연결 해제 — 프로브가 연결 중이면 광고 중단되어
// DfuManager 스캔에서 안 보이는 문제 해결 (2026-08-03).
runCatching {
com.medithings.vesiscan.ble.BleManager.getInstance(context).disconnect()
}
manager.loadFirmware() manager.loadFirmware()
if (!granted) launcher.launch(perms) if (!granted) launcher.launch(perms)
} }