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.

40 regels
1.4 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. /// 终端心跳发送间隔,单位为秒(s)
  8. /// 0x8103_0x0001
  9. /// </summary>
  10. public class JT808_0x8103_0x0001 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0001>
  11. {
  12. public override uint ParamId { get; set; } = 0x0001;
  13. /// <summary>
  14. /// 数据 长度
  15. /// </summary>
  16. public override byte ParamLength { get; set; } = 4;
  17. /// <summary>
  18. /// 终端心跳发送间隔,单位为秒(s)
  19. /// </summary>
  20. public uint ParamValue { get; set; }
  21. public JT808_0x8103_0x0001 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
  22. {
  23. JT808_0x8103_0x0001 jT808_0x8103_0x0001 = new JT808_0x8103_0x0001();
  24. jT808_0x8103_0x0001.ParamId = reader.ReadUInt32();
  25. jT808_0x8103_0x0001.ParamLength = reader.ReadByte();
  26. jT808_0x8103_0x0001.ParamValue = reader.ReadUInt32();
  27. return jT808_0x8103_0x0001;
  28. }
  29. public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0001 value, IJT808Config config)
  30. {
  31. writer.WriteUInt32(value.ParamId);
  32. writer.WriteByte(value.ParamLength);
  33. writer.WriteUInt32(value.ParamValue);
  34. }
  35. }
  36. }