DCD 설정 관련 이슈 해결 #53
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -842,8 +845,9 @@ class MainViewModel @Inject constructor(
|
|||||||
// tx DCD_GAS Write (DEFAULT VALUE)
|
// tx DCD_GAS Write (DEFAULT VALUE)
|
||||||
txPacket(READ_WRITE.WRITE, CMD.DCD_GAS, dcdGas.value.copy(status = 0x50))
|
txPacket(READ_WRITE.WRITE, CMD.DCD_GAS, dcdGas.value.copy(status = 0x50))
|
||||||
|
|
||||||
// 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(
|
||||||
|
|||||||
Reference in New Issue
Block a user