电子药箱通讯服务端
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ClockResponseProtocol.cs 1.0KB

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. namespace Rdh.SocketServer.Client.Models
  8. {
  9. /// <summary>
  10. /// 服务端返回时钟的数据协议类
  11. /// </summary>
  12. public class ClockResponseProtocol : EleMedKitProtocol
  13. {
  14. public ClockResponseProtocol()
  15. {
  16. base.Command = EleMedKitCommand.RepsonseClock;
  17. CountFlag = 1.ToString();
  18. }
  19. public override string GetContent()
  20. {
  21. DateTime now = DateTime.Now;
  22. return base.GetContent()
  23. + AddLineContent(now.ToString("yy")
  24. + AddBlockContent(now.ToString("MM"))
  25. + AddBlockContent(now.ToString("dd"))
  26. + AddBlockContent(now.ToString("HH"))
  27. + AddBlockContent(now.ToString("mm"))
  28. + AddBlockContent(now.ToString("ss")))
  29. + AddLineContent(CountFlag);
  30. }
  31. }
  32. }