feat: 6채널 미만 수신 시 자동 retry (패킷 드랍 대응)

onMultiChannelComplete에서 receivedCount < 6이면:
- 자동 retry (collector reset + 재전송)
- 최대 2회 재시도 (maxMeasureRetries)
- INCOMPLETE_SCAN 로그 기록
- 6채널 온전히 수신된 경우만 BV 파이프라인 진행

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-27 16:04:22 +09:00
parent 1c5707ebf7
commit 01637ce503
@@ -107,6 +107,17 @@ fun PiezoMonitoringView(appState: AppState) {
bleManager.piezoCollector.onMultiChannelComplete = { channels -> bleManager.piezoCollector.onMultiChannelComplete = { channels ->
handler.post { handler.post {
// 6채널 미만 수신 → 자동 retry (패킷 드랍 대응)
val receivedCount = channels.count { it.buffer.isNotEmpty() }
if (receivedCount < 6 && measureRetryCount < maxMeasureRetries) {
measureRetryCount++
Log.w("PiezoMonitor", "Incomplete: $receivedCount/6 channels — retry $measureRetryCount")
bleManager.debugLogger.warn("INCOMPLETE_SCAN $receivedCount/6 — retry $measureRetryCount")
bleManager.piezoCollector.reset()
bleManager.sendChannelsOnly()
return@post
}
lastMultiChannelResult.clear() lastMultiChannelResult.clear()
lastMultiChannelResult.addAll(channels) lastMultiChannelResult.addAll(channels)