public static string VerifyFlag(int len, string command, string type) { string verifyflag = string.Empty; switch (type) { default: string dl = ConvertUtilClass.IntToHex(len - 5); verifyflag = command.Substring(0, 4) + "" + dl; break; } return(verifyflag.ToUpper()); }
public static string Build_Command(int val) { string ss = ConvertUtilClass.IntToHex(val); if (ss.Length == 2) { ss = "00 " + ss; } if (ss.Length == 4) { ss = ss.Substring(0, 2) + " " + ss.Substring(2, 2); } return(ss); }