Release v1.1.1.2: Fix FW update reply and update Anti-Theft error 0x4000 alarm display
- Fix FW update freezing at first 128B by setting ReplyFlag=true in RequestFlashWrite and handling FW Update timeouts in csUartThread - Update Operating Status: remove Anti-Theft from Status (0x0004 -> TRIP) and display TRIP (Anti-Theft) in Alarm when errorCode is 0x4000 - Sync Status/Alarm string mapping in csLog for CSV data logging - Bump assembly version to v1.1.1.2
This commit is contained in:
@@ -213,7 +213,29 @@ namespace LFP_Manager.Threads
|
||||
public void SetWriteReg(ushort WriteAddr, byte[] WriteData, bool ReplyFlag)
|
||||
{
|
||||
if (WriteData == null) return;
|
||||
TUartTxItem item = new TUartTxItem(UartTxType.WriteReg, SystemId, WriteAddr, (ushort)WriteData.Length, WriteData, ReplyFlag, Config.RecvWaitTime);
|
||||
|
||||
UartTxType txType = UartTxType.WriteReg;
|
||||
int timeoutMs = Config.RecvWaitTime;
|
||||
bool expectReply = ReplyFlag;
|
||||
|
||||
// FW 업데이트 패킷 감지 (Target ID: 0x7F 또는 FW 명령어)
|
||||
if (WriteData.Length >= 2 && WriteData[0] == 0x7F)
|
||||
{
|
||||
txType = UartTxType.FwUpdate;
|
||||
byte cmd = WriteData[1];
|
||||
if (cmd == csSerialCommFunction.FW_FLASH_ERASE_CMD) // 0x43 Erase
|
||||
{
|
||||
expectReply = true;
|
||||
timeoutMs = Math.Max(Config.RecvWaitTime, 5000); // Flash Erase 대기시간 (섹터 지우기 최대 수 초 소요)
|
||||
}
|
||||
else if (cmd == csSerialCommFunction.FW_FLASH_WRITE_CMD) // 0x31 Write
|
||||
{
|
||||
expectReply = true;
|
||||
timeoutMs = Math.Max(Config.RecvWaitTime, 2000); // Flash Write 128B 응답 대기
|
||||
}
|
||||
}
|
||||
|
||||
TUartTxItem item = new TUartTxItem(txType, SystemId, WriteAddr, (ushort)WriteData.Length, WriteData, expectReply, timeoutMs);
|
||||
EnqueueTx(item);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user