refactor(rs485): 拆分通讯单元参数和数据结构体

调整RS485配置结构体,将原CUData拆分为CUPara和CUData,修正多处引用的字段名,同时修复CommUnitAnalyze中的数据拷贝偏移和包长度计算错误
This commit is contained in:
2026-06-12 18:14:43 +08:00
parent 030c22472d
commit 21cb23d0b9
5 changed files with 44 additions and 24 deletions
+2 -2
View File
@@ -398,12 +398,12 @@ int GateWayRegister(uint8_t *TxBuff)
if(CatOne.GateWay->ConfigPara.Rs485Ch1.CommUnitEnable == true && CatOne.GateWay->ConfigPara.Rs485Ch1.Enable == true) {
UnitCommCnt++;
memcpy(&p[len], CatOne.GateWay->ConfigPara.Rs485Ch1.CUData.Para.Mac[0], 6);
memcpy(&p[len], CatOne.GateWay->ConfigPara.Rs485Ch1.CUPara.Para.Mac[0], 6);
len += 6;
}
if(CatOne.GateWay->ConfigPara.Rs485Ch2.CommUnitEnable == true && CatOne.GateWay->ConfigPara.Rs485Ch2.Enable == true) {
UnitCommCnt++;
memcpy(&p[len], CatOne.GateWay->ConfigPara.Rs485Ch2.CUData.Para.Mac[0], 6);
memcpy(&p[len], CatOne.GateWay->ConfigPara.Rs485Ch2.CUPara.Para.Mac[0], 6);
len += 6;
}
for(int i = 0; i < COMMUNIT_NUM_MAX; i++) {