Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

44 rader
1.5 KiB

  1. using JT808.Protocol.Extensions;
  2. using JT808.Protocol.Formatters;
  3. using JT808.Protocol.MessagePack;
  4. namespace JT808.Protocol.MessageBody
  5. {
  6. /// <summary>
  7. /// 数据下行透传
  8. /// </summary>
  9. public class JT808_0x8900 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8900>
  10. {
  11. public override ushort MsgId { get; } = 0x8900;
  12. /// <summary>
  13. /// 透传消息类型
  14. /// 透传消息类型定义见 表 93
  15. /// </summary>
  16. public byte PassthroughType { get; set; }
  17. /// <summary>
  18. /// 数据下行透传数据
  19. /// </summary>
  20. public byte[] PassthroughData { get; set; }
  21. /// <summary>
  22. /// 透传消息内容
  23. /// </summary>
  24. public JT808_0x8900_BodyBase JT808_0X8900_BodyBase { get; set; }
  25. public JT808_0x8900 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
  26. {
  27. JT808_0x8900 jT808_0X8900 = new JT808_0x8900();
  28. jT808_0X8900.PassthroughType = reader.ReadByte();
  29. jT808_0X8900.PassthroughData = reader.ReadContent().ToArray();
  30. return jT808_0X8900;
  31. }
  32. public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8900 value, IJT808Config config)
  33. {
  34. writer.WriteByte(value.PassthroughType);
  35. JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(value.JT808_0X8900_BodyBase, ref writer, value.JT808_0X8900_BodyBase, config);
  36. }
  37. }
  38. }