|
|
@ -98,9 +98,16 @@ public class SerialPortSingle2 { |
|
|
|
//截取去掉FE
|
|
|
|
//截取去掉FE
|
|
|
|
String deviceType = deviceCodeParamEntity.getDeviceType(); |
|
|
|
String deviceType = deviceCodeParamEntity.getDeviceType(); |
|
|
|
String deviceAddr = deviceCodeParamEntity.getDeviceAddr(); |
|
|
|
String deviceAddr = deviceCodeParamEntity.getDeviceAddr(); |
|
|
|
String dataStr = receiveData; |
|
|
|
String dataStr = ""; |
|
|
|
if ("水表".equals(deviceType) || "电表".equals(deviceType)) { |
|
|
|
// if ("水表".equals(deviceType) || "电表".equals(deviceType)) {
|
|
|
|
dataStr = receiveData.replace("FE", ""); |
|
|
|
// dataStr = receiveData.replace("FE", "");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
if (receiveData.length() > 8 && ("水表".equals(deviceType) || "电表".equals(deviceType))) { |
|
|
|
|
|
|
|
String str1 = receiveData.substring(0, 8); |
|
|
|
|
|
|
|
String str2 = receiveData.substring(8); |
|
|
|
|
|
|
|
dataStr = str1.replace("FE", "") + str2; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
dataStr = receiveData; |
|
|
|
} |
|
|
|
} |
|
|
|
String registerAddr = deviceCodeParamEntity.getRegisterAddr(); |
|
|
|
String registerAddr = deviceCodeParamEntity.getRegisterAddr(); |
|
|
|
String brand = deviceCodeParamEntity.getBrand(); |
|
|
|
String brand = deviceCodeParamEntity.getBrand(); |
|
|
|