Merge remote-tracking branch 'origin/feature/ISSUE-51' into feature/ISSUE-51

# Conflicts:
#	app/src/main/java/com/laseroptek/raman/ui/screens/main/MainViewModel.kt
This commit is contained in:
StevenBuzzi
2026-03-06 11:46:46 +09:00

View File

@@ -819,7 +819,10 @@ class MainViewModel @Inject constructor(
// Because serial open() is started in rxPacketLoop() asynchronously,
// FD can still be -1 here (startup race). Wait briefly before first TX burst.
if (!waitUntilSerialReady()) {
Timber.e("txPacketOnce skipped: serial port is not ready (fd=%d)", serialPortRepository.getFD())
Timber.e(
"txPacketOnce skipped: serial port is not ready (fd=%d)",
serialPortRepository.getFD()
)
return@launch
}
@@ -842,8 +845,9 @@ class MainViewModel @Inject constructor(
// tx DCD_GAS Write (DEFAULT VALUE)
txPacket(READ_WRITE.WRITE, CMD.DCD_GAS, dcdGas.value.copy(status = 0x50))
// tx SPRAY_DCD Write (DEFAULT VALUE)
txPacket(READ_WRITE.WRITE, CMD.SPRAY_DCD, sprayDcd.value.copy(status = 0x41))
// tx SPRAY_DCD Write (DEFAULT VALUE)
txPacket(READ_WRITE.WRITE, CMD.SPRAY_DCD, sprayDcd.value.copy(status = 0x41))
}
}
private suspend fun waitUntilSerialReady(