DCD 설정 관련 이슈 해결 #53

Closed
steven wants to merge 9 commits from feature/ISSUE-51 into develop
Showing only changes of commit 56c516dec7 - Show all commits

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(