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, // Because serial open() is started in rxPacketLoop() asynchronously,
// FD can still be -1 here (startup race). Wait briefly before first TX burst. // FD can still be -1 here (startup race). Wait briefly before first TX burst.
if (!waitUntilSerialReady()) { 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 return@launch
} }
@@ -845,6 +848,7 @@ class MainViewModel @Inject constructor(
// tx SPRAY_DCD Write (DEFAULT VALUE) // tx SPRAY_DCD Write (DEFAULT VALUE)
txPacket(READ_WRITE.WRITE, CMD.SPRAY_DCD, sprayDcd.value.copy(status = 0x41)) txPacket(READ_WRITE.WRITE, CMD.SPRAY_DCD, sprayDcd.value.copy(status = 0x41))
} }
}
private suspend fun waitUntilSerialReady( private suspend fun waitUntilSerialReady(
timeoutMillis: Long = 2000L, timeoutMillis: Long = 2000L,