Browse Source

1、修复读取温控出现指令错误。

dev
mh 4 months ago
parent
commit
88e1c3ea76
  1. 2
      user-service/src/main/java/com/mh/user/strategy/TempControlStrategy.java

2
user-service/src/main/java/com/mh/user/strategy/TempControlStrategy.java

@ -72,6 +72,8 @@ public class TempControlStrategy implements DeviceStrategy {
str = str + funCode + registerAddr + "0002" + "04" str = str + funCode + registerAddr + "0002" + "04"
+ ExchangeStringUtil.addZeroForNum(ExchangeStringUtil.decToHex(deviceCodeParamEntity.getDataValue()), 4) + ExchangeStringUtil.addZeroForNum(ExchangeStringUtil.decToHex(deviceCodeParamEntity.getDataValue()), 4)
+ "0001"; + "0001";
} else {
str=str+"0300000002";
} }
String checkWord = ExchangeStringUtil.getStrCRC16(str); //CRC16校验 String checkWord = ExchangeStringUtil.getStrCRC16(str); //CRC16校验
str = str + checkWord; str = str + checkWord;

Loading…
Cancel
Save