DtuCmdGenetor.cs 855B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using DotNettyFrom.generatecmd;
  7. using DotNettyFrom.util;
  8. namespace DotNettyFrom.generatecmd
  9. {
  10. public class DtuCmdGenetor : CmdGenetor
  11. {
  12. public override string GetLoginCmd( string ccid)
  13. {
  14. string cmd = DeviceId + "820014" + ccid;
  15. cmd = "7e7e7e" + CmdUtil.CalcCrcCode(cmd);
  16. return cmd;
  17. }
  18. public override string GetHeartbeat()
  19. {
  20. //7e7e7e00000000000184000085
  21. string cmd = DeviceId + "840000";
  22. cmd = "7e7e7e" + CmdUtil.CalcCrcCode(cmd);
  23. return cmd.ToUpper();
  24. }
  25. public override string GetReplyCmd(string receiveCmd)
  26. {
  27. throw new NotImplementedException();
  28. }
  29. }
  30. }