feat: BLE stability fixes, NIRS streaming improvements, catheter count feature
- Fix BLE API deprecation warnings with API 33+ version checks - Move isServiceReady to onDescriptorWrite for reliable CCCD setup - Fix battery polling: immediate query on connect, pause during NIRS streaming - Add mcj retry mechanism for NIRS streaming reliability - Add debug logging to BLE, NIRS parsing, and processing pipeline - Add catheter count feature to Piezo monitoring (persistent count, add dialog, auto-decrement on catheterize) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,14 @@ class NirsManager private constructor() {
|
||||
currentOxy.value = result.oxyFiltered
|
||||
sampleCount.intValue++
|
||||
|
||||
if (sampleCount.intValue <= 3 || sampleCount.intValue % 50 == 0) {
|
||||
android.util.Log.d("NirsManager", "Sample #${sampleCount.intValue}: " +
|
||||
"hasGain=${calcEngine.hasGain}, " +
|
||||
"led[0..5]=${packet.ledValues.take(6)}, " +
|
||||
"degain[0..2]=${result.degain.take(3).map { "%.2f".format(it) }}, " +
|
||||
"oxy=StO2:${"%.1f".format(result.oxyFiltered.stO2)} HbO2:${"%.1f".format(result.oxyFiltered.hbO2)} HHb:${"%.1f".format(result.oxyFiltered.hb)}")
|
||||
}
|
||||
|
||||
appendTrimming(oxyHbO2History, result.oxyFiltered.hbO2)
|
||||
appendTrimming(oxyHbHistory, result.oxyFiltered.hb)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user