OutgoingMessageBase.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using Edge.Core.Parser.BinaryParser.Attributes;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace VeederRoot_ATG_Console.MessageEntity.Outgoing
  6. {
  7. /// <summary>
  8. /// SOH + SecurityCode(optional) + FunctionCode + DataField(optional)
  9. /// </summary>
  10. public abstract class OutgoingMessageBase : MessageBase
  11. {
  12. /// <summary>
  13. /// Init an outgoing message, 3 parameters construct a complete FunctionCode, like i20101, S50500
  14. /// </summary>
  15. /// <param name="messageFormat">Display or Command</param>
  16. /// <param name="functionCode">Function code, 3 digts</param>
  17. /// <param name="functionCodeAppendix">2 digits with ASCII encoding chars, like 00 in S50500, if input null, then PadRight with two '0'</param>
  18. public OutgoingMessageBase(MessageFormat messageFormat,
  19. FuncCode functionCode, string functionCodeAppendix)
  20. {
  21. base.FunctionCode =
  22. new Tuple<MessageFormat, FuncCode, string>(
  23. messageFormat,
  24. functionCode,
  25. functionCodeAppendix);
  26. }
  27. [EnumerableFormat(6, -9998)]
  28. public List<byte> SecurityCode { get; set; }
  29. [EnumerableFormat("%cascade", -8000)]
  30. public List<byte> DataField { get; set; }
  31. }
  32. }