You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

34 lines
934 B

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.InteropServices;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using static HBLDevice.IceCream.MessageDefine;
  8. namespace HBLDevice.IceCream
  9. {
  10. [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
  11. public class ICMSG_MODE_UP
  12. {
  13. public byte Header1;
  14. public byte Header2;
  15. public IC_CMD Cmd;
  16. public MORKI_MODE Mode;
  17. public short CalcCode;
  18. public ICMSG_MODE_UP() {
  19. Header1 = MessageDefine.HEADER1;
  20. Header2 = MessageDefine.HEADER2_DW;
  21. Cmd = IC_CMD.MODE;
  22. }
  23. public static ICMSG_MODE_DW Build(MORKI_MODE mode) {
  24. ICMSG_MODE_DW temp = new ICMSG_MODE_DW();
  25. temp.Mode = mode;
  26. temp.CalcCode = (short)((byte)temp.Cmd + (byte)temp.Mode);
  27. return temp;
  28. }
  29. }
  30. }