Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

38 wiersze
1.5 KiB

  1. using JT808.Protocol.Attributes;
  2. using JT808.Protocol.Formatters;
  3. using JT808.Protocol.MessagePack;
  4. namespace JT808.Protocol.MessageBody
  5. {
  6. /// <summary>
  7. /// 位置汇报策略,0:定时汇报;1:定距汇报;2:定时和定距汇报
  8. /// </summary>
  9. public class JT808_0x8103_0x0020 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0020>
  10. {
  11. public override uint ParamId { get; set; } = 0x0020;
  12. /// <summary>
  13. /// 数据 长度
  14. /// </summary>
  15. public override byte ParamLength { get; set; } = 4;
  16. /// <summary>
  17. /// 位置汇报策略,0:定时汇报;1:定距汇报;2:定时和定距汇报
  18. /// </summary>
  19. public uint ParamValue { get; set; }
  20. public JT808_0x8103_0x0020 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
  21. {
  22. JT808_0x8103_0x0020 jT808_0x8103_0x0020 = new JT808_0x8103_0x0020();
  23. jT808_0x8103_0x0020.ParamId = reader.ReadUInt32();
  24. jT808_0x8103_0x0020.ParamLength = reader.ReadByte();
  25. jT808_0x8103_0x0020.ParamValue = reader.ReadUInt32();
  26. return jT808_0x8103_0x0020;
  27. }
  28. public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0020 value, IJT808Config config)
  29. {
  30. writer.WriteUInt32(value.ParamId);
  31. writer.WriteByte(value.ParamLength);
  32. writer.WriteUInt32(value.ParamValue);
  33. }
  34. }
  35. }