/// <summary> /// 补充校验码 /// </summary> /// <param name="address">地址码</param> /// <param name="func">功能码</param> /// <param name="data">数据</param> /// <returns> /// 16进制字符串 /// </returns> public static String CRC(String address, String func, String data) { return(CRC(HexUtils.HexStringToBytes(address + " " + func + " " + data), false, true)); }
/// <summary> /// 补充校验码 /// </summary> /// <param name="address">地址码</param> /// <param name="func">功能码</param> /// <param name="data">数据</param> /// <param name="crcOnly">是否只返回校验码</param> /// <param name="split">每个字节间是否使用空格分割</param> /// <returns> /// 16进制字符串 /// </returns> public static String CRC(String address, String func, String data, Boolean crcOnly, Boolean split) { return(CRC(HexUtils.HexStringToBytes(address + " " + func + " " + data), crcOnly, split)); }