Fix a bug in LRC

This commit is contained in:
parallelbgls
2017-05-24 16:48:44 +08:00
parent 4eea0231fc
commit d14c503dbd
3 changed files with 40 additions and 0 deletions

View File

@@ -176,6 +176,8 @@ namespace Modbus.Net
}
hexTotal = string.Concat(hexByte, hexTotal);
}
if (hexTotal.Length == 0) hexTotal = "00" + hexTotal;
if (hexTotal.Length == 1) hexTotal = "0" + hexTotal;
return hexTotal == checkString;
}