@@ -1,5 +1,9 @@ | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Extensions; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System; | |||||
using System.Text.Json; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
@@ -7,7 +11,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// 多媒体数据上传应答 | /// 多媒体数据上传应答 | ||||
/// 0x8800 | /// 0x8800 | ||||
/// </summary> | /// </summary> | ||||
public class JT808_0x8800 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8800> | |||||
public class JT808_0x8800 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8800>, IJT808Analyze | |||||
{ | { | ||||
public override ushort MsgId { get; } = 0x8800; | public override ushort MsgId { get; } = 0x8800; | ||||
public override string Description => "多媒体数据上传应答"; | public override string Description => "多媒体数据上传应答"; | ||||
@@ -24,6 +28,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// 重传包序号顺序排列,如“包 ID1 包 ID2......包 IDn”。 | /// 重传包序号顺序排列,如“包 ID1 包 ID2......包 IDn”。 | ||||
/// </summary> | /// </summary> | ||||
public byte[] RetransmitPackageIds { get; set; } | public byte[] RetransmitPackageIds { get; set; } | ||||
public JT808_0x8800 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | public JT808_0x8800 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | ||||
{ | { | ||||
JT808_0x8800 jT808_0X8800 = new JT808_0x8800(); | JT808_0x8800 jT808_0X8800 = new JT808_0x8800(); | ||||
@@ -39,5 +44,24 @@ namespace JT808.Protocol.MessageBody | |||||
writer.WriteByte((byte)(value.RetransmitPackageIds.Length / 2)); | writer.WriteByte((byte)(value.RetransmitPackageIds.Length / 2)); | ||||
writer.WriteArray(value.RetransmitPackageIds); | writer.WriteArray(value.RetransmitPackageIds); | ||||
} | } | ||||
public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config) | |||||
{ | |||||
JT808_0x8800 value = new JT808_0x8800(); | |||||
value.MultimediaId = reader.ReadUInt32(); | |||||
value.RetransmitPackageCount = reader.ReadByte(); | |||||
value.RetransmitPackageIds = reader.ReadArray(value.RetransmitPackageCount * 2).ToArray(); | |||||
writer.WriteNumber($"[{ value.MultimediaId.ReadNumber()}]多媒体ID", value.MultimediaId); | |||||
writer.WriteNumber($"[{ value.RetransmitPackageCount.ReadNumber()}]重传包总数", value.RetransmitPackageCount); | |||||
writer.WriteString($"重传包", value.RetransmitPackageIds.ToHexString()); | |||||
writer.WriteStartArray($"重传包ID列表"); | |||||
ReadOnlySpan<byte> tmp = value.RetransmitPackageIds; | |||||
for(int i=0; i< value.RetransmitPackageCount; i++) | |||||
{ | |||||
writer.WriteString($"ID{i+1}", tmp.Slice(i * 2, 2).ToArray().ToHexString()); | |||||
} | |||||
writer.WriteEndArray(); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,8 @@ | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Extensions; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | using JT808.Protocol.Interfaces; | ||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System.Text.Json; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
@@ -8,7 +10,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// 摄像头立即拍摄命令 | /// 摄像头立即拍摄命令 | ||||
/// 0x8801 | /// 0x8801 | ||||
/// </summary> | /// </summary> | ||||
public class JT808_0x8801 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8801>, IJT808_2019_Version | |||||
public class JT808_0x8801 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8801>, IJT808Analyze, IJT808_2019_Version | |||||
{ | { | ||||
public override ushort MsgId { get; } = 0x8801; | public override ushort MsgId { get; } = 0x8801; | ||||
public override string Description => "摄像头立即拍摄命令"; | public override string Description => "摄像头立即拍摄命令"; | ||||
@@ -68,6 +70,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// 0-255 | /// 0-255 | ||||
/// </summary> | /// </summary> | ||||
public byte Chroma { get; set; } | public byte Chroma { get; set; } | ||||
public JT808_0x8801 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | public JT808_0x8801 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | ||||
{ | { | ||||
JT808_0x8801 jT808_0X8801 = new JT808_0x8801(); | JT808_0x8801 jT808_0X8801 = new JT808_0x8801(); | ||||
@@ -97,5 +100,31 @@ namespace JT808.Protocol.MessageBody | |||||
writer.WriteByte(value.Saturability); | writer.WriteByte(value.Saturability); | ||||
writer.WriteByte(value.Chroma); | writer.WriteByte(value.Chroma); | ||||
} | } | ||||
public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config) | |||||
{ | |||||
JT808_0x8801 value = new JT808_0x8801(); | |||||
value.ChannelId = reader.ReadByte(); | |||||
value.ShootingCommand = reader.ReadUInt16(); | |||||
value.VideoTime = reader.ReadUInt16(); | |||||
value.SaveFlag = reader.ReadByte(); | |||||
value.Resolution = reader.ReadByte(); | |||||
value.VideoQuality = reader.ReadByte(); | |||||
value.Lighting = reader.ReadByte(); | |||||
value.Contrast = reader.ReadByte(); | |||||
value.Saturability = reader.ReadByte(); | |||||
value.Chroma = reader.ReadByte(); | |||||
writer.WriteNumber($"[{ value.ChannelId.ReadNumber()}]通道ID", value.ChannelId.); | |||||
writer.WriteNumber($"[{ value.ShootingCommand.ReadNumber()}]拍摄命令", value.ShootingCommand); | |||||
writer.WriteNumber($"[{ value.VideoTime.ReadNumber()}]拍照间隔_录像时间", value.VideoTime); | |||||
writer.WriteNumber($"[{ value.SaveFlag.ReadNumber()}]保存标志", value.SaveFlag); | |||||
writer.WriteNumber($"[{ value.Resolution.ReadNumber()}]分辨率", value.Resolution); | |||||
writer.WriteNumber($"[{ value.VideoQuality.ReadNumber()}]图像_视频质量", value.VideoQuality); | |||||
writer.WriteNumber($"[{ value.Lighting.ReadNumber()}]亮度", value.Lighting); | |||||
writer.WriteNumber($"[{ value.Contrast.ReadNumber()}]对比度", value.Contrast); | |||||
writer.WriteNumber($"[{ value.Saturability.ReadNumber()}]饱和度", value.Saturability); | |||||
writer.WriteNumber($"[{ value.Chroma.ReadNumber()}]色度", value.Chroma); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,9 @@ | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Extensions; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System; | using System; | ||||
using System.Text.Json; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
@@ -8,7 +11,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// 存储多媒体数据检索 | /// 存储多媒体数据检索 | ||||
/// 0x8802 | /// 0x8802 | ||||
/// </summary> | /// </summary> | ||||
public class JT808_0x8802 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8802> | |||||
public class JT808_0x8802 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8802>, IJT808Analyze | |||||
{ | { | ||||
public override ushort MsgId { get; } = 0x8802; | public override ushort MsgId { get; } = 0x8802; | ||||
public override string Description => "存储多媒体数据检索"; | public override string Description => "存储多媒体数据检索"; | ||||
@@ -37,6 +40,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// YY-MM-DD-hh-mm-ss | /// YY-MM-DD-hh-mm-ss | ||||
/// </summary> | /// </summary> | ||||
public DateTime EndTime { get; set; } | public DateTime EndTime { get; set; } | ||||
public JT808_0x8802 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | public JT808_0x8802 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | ||||
{ | { | ||||
JT808_0x8802 jT808_0X8802 = new JT808_0x8802(); | JT808_0x8802 jT808_0X8802 = new JT808_0x8802(); | ||||
@@ -56,5 +60,21 @@ namespace JT808.Protocol.MessageBody | |||||
writer.WriteDateTime6(value.StartTime); | writer.WriteDateTime6(value.StartTime); | ||||
writer.WriteDateTime6(value.EndTime); | writer.WriteDateTime6(value.EndTime); | ||||
} | } | ||||
public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config) | |||||
{ | |||||
JT808_0x8802 value = new JT808_0x8802(); | |||||
value.MultimediaType = reader.ReadByte(); | |||||
value.ChannelId = reader.ReadByte(); | |||||
value.EventItemCoding = reader.ReadByte(); | |||||
value.StartTime = reader.ReadDateTime6(); | |||||
value.EndTime = reader.ReadDateTime6(); | |||||
writer.WriteNumber($"[{ value.MultimediaType.ReadNumber()}]多媒体类型", value.MultimediaType.); | |||||
writer.WriteNumber($"[{ value.ChannelId.ReadNumber()}]通道ID", value.ChannelId.); | |||||
writer.WriteNumber($"[{ value.EventItemCoding.ReadNumber()}]事件项编码", value.EventItemCoding.); | |||||
writer.WriteString($"[{ value.StartTime.ToString("yyMMddHHmmss")}]起始时间", value.StartTime.ToString("yyyy-MM-dd HH:mm:ss")); | |||||
writer.WriteString($"[{ value.EndTime.ToString("yyMMddHHmmss")}]结束时间", value.EndTime.ToString("yyyy-MM-dd HH:mm:ss")); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,9 @@ | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Extensions; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System; | using System; | ||||
using System.Text.Json; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
@@ -8,7 +11,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// 存储多媒体数据上传命令 | /// 存储多媒体数据上传命令 | ||||
/// 0x8803 | /// 0x8803 | ||||
/// </summary> | /// </summary> | ||||
public class JT808_0x8803 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8803> | |||||
public class JT808_0x8803 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8803>, IJT808Analyze | |||||
{ | { | ||||
public override ushort MsgId { get; } = 0x8803; | public override ushort MsgId { get; } = 0x8803; | ||||
public override string Description => "存储多媒体数据上传命令"; | public override string Description => "存储多媒体数据上传命令"; | ||||
@@ -43,6 +46,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// <see cref="JT808.Protocol.Enums.JT808MultimediaDeleted"/> | /// <see cref="JT808.Protocol.Enums.JT808MultimediaDeleted"/> | ||||
/// </summary> | /// </summary> | ||||
public byte MultimediaDeleted { get; set; } | public byte MultimediaDeleted { get; set; } | ||||
public JT808_0x8803 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | public JT808_0x8803 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | ||||
{ | { | ||||
JT808_0x8803 jT808_0X8803 = new JT808_0x8803(); | JT808_0x8803 jT808_0X8803 = new JT808_0x8803(); | ||||
@@ -64,5 +68,23 @@ namespace JT808.Protocol.MessageBody | |||||
writer.WriteDateTime6(value.EndTime); | writer.WriteDateTime6(value.EndTime); | ||||
writer.WriteByte(value.MultimediaDeleted); | writer.WriteByte(value.MultimediaDeleted); | ||||
} | } | ||||
public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config) | |||||
{ | |||||
JT808_0x8803 jT808_0X8803 = new JT808_0x8803(); | |||||
jT808_0X8803.MultimediaType = reader.ReadByte(); | |||||
jT808_0X8803.ChannelId = reader.ReadByte(); | |||||
jT808_0X8803.EventItemCoding = reader.ReadByte(); | |||||
jT808_0X8803.StartTime = reader.ReadDateTime6(); | |||||
jT808_0X8803.EndTime = reader.ReadDateTime6(); | |||||
jT808_0X8803.MultimediaDeleted = reader.ReadByte(); | |||||
writer.WriteNumber($"[{ jT808_0X8803.MultimediaType.ReadNumber()}]多媒体类型", jT808_0X8803.MultimediaType.); | |||||
writer.WriteNumber($"[{ jT808_0X8803.ChannelId.ReadNumber()}]通道ID", jT808_0X8803.ChannelId.); | |||||
writer.WriteNumber($"[{ jT808_0X8803.EventItemCoding.ReadNumber()}]事件项编码", jT808_0X8803.EventItemCoding.); | |||||
writer.WriteString($"[{ jT808_0X8803.StartTime.ToString("yyMMddHHmmss")}]起始时间", jT808_0X8803.StartTime.ToString("yyyy-MM-dd HH:mm:ss")); | |||||
writer.WriteString($"[{ jT808_0X8803.EndTime.ToString("yyMMddHHmmss")}]结束时间", jT808_0X8803.EndTime.ToString("yyyy-MM-dd HH:mm:ss")); | |||||
writer.WriteNumber($"[{ jT808_0X8803.MultimediaDeleted.ReadNumber()}]删除标志", jT808_0X8803.MultimediaDeleted.); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,13 +1,16 @@ | |||||
using JT808.Protocol.Enums; | using JT808.Protocol.Enums; | ||||
using JT808.Protocol.Extensions; | |||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System.Text.Json; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 录音开始命令 | /// 录音开始命令 | ||||
/// </summary> | /// </summary> | ||||
public class JT808_0x8804 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8804> | |||||
public class JT808_0x8804 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8804>, IJT808Analyze | |||||
{ | { | ||||
public override ushort MsgId { get; } = 0x8804; | public override ushort MsgId { get; } = 0x8804; | ||||
public override string Description => "录音开始命令"; | public override string Description => "录音开始命令"; | ||||
@@ -47,5 +50,18 @@ namespace JT808.Protocol.MessageBody | |||||
writer.WriteByte((byte)value.RecordSave); | writer.WriteByte((byte)value.RecordSave); | ||||
writer.WriteByte(value.AudioSampleRate); | writer.WriteByte(value.AudioSampleRate); | ||||
} | } | ||||
public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config) | |||||
{ | |||||
JT808_0x8804 jT808_0X8804 = new JT808_0x8804(); | |||||
jT808_0X8804.RecordCmd = (JT808RecordCmd)reader.ReadByte(); | |||||
jT808_0X8804.RecordTime = reader.ReadUInt16(); | |||||
jT808_0X8804.RecordSave = (JT808RecordSave)reader.ReadByte(); | |||||
jT808_0X8804.AudioSampleRate = reader.ReadByte(); | |||||
writer.WriteNumber($"[{ ((byte)(jT808_0X8804.RecordCmd)).ReadNumber()}]录音命令", (byte)jT808_0X8804.RecordCmd); | |||||
writer.WriteNumber($"[{jT808_0X8804.RecordTime.ReadNumber()}]单位为秒(s)", jT808_0X8804.RecordTime); | |||||
writer.WriteNumber($"[{((byte)jT808_0X8804.RecordSave).ReadNumber()}]保存标志", (byte)jT808_0X8804.RecordSave); | |||||
writer.WriteNumber($"[{jT808_0X8804.AudioSampleRate.ReadNumber()}]音频采样率", jT808_0X8804.AudioSampleRate); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,13 +1,15 @@ | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Extensions; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | using JT808.Protocol.Interfaces; | ||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System.Text.Json; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 单条存储多媒体数据检索上传命令 | /// 单条存储多媒体数据检索上传命令 | ||||
/// </summary> | /// </summary> | ||||
public class JT808_0x8805 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8805>,IJT808_2019_Version | |||||
public class JT808_0x8805 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8805>, IJT808Analyze, IJT808_2019_Version | |||||
{ | { | ||||
public override ushort MsgId { get; } = 0x8805; | public override ushort MsgId { get; } = 0x8805; | ||||
public override string Description => "单条存储多媒体数据检索上传命令"; | public override string Description => "单条存储多媒体数据检索上传命令"; | ||||
@@ -20,6 +22,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// <see cref="JT808.Protocol.Enums.JT808MultimediaDeleted"/> | /// <see cref="JT808.Protocol.Enums.JT808MultimediaDeleted"/> | ||||
/// </summary> | /// </summary> | ||||
public byte MultimediaDeleted { get; set; } | public byte MultimediaDeleted { get; set; } | ||||
public JT808_0x8805 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | public JT808_0x8805 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | ||||
{ | { | ||||
JT808_0x8805 jT808_0X8805 = new JT808_0x8805(); | JT808_0x8805 jT808_0X8805 = new JT808_0x8805(); | ||||
@@ -33,5 +36,14 @@ namespace JT808.Protocol.MessageBody | |||||
writer.WriteUInt32(value.MultimediaId); | writer.WriteUInt32(value.MultimediaId); | ||||
writer.WriteByte(value.MultimediaDeleted); | writer.WriteByte(value.MultimediaDeleted); | ||||
} | } | ||||
public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config) | |||||
{ | |||||
JT808_0x8805 jT808_0X8805 = new JT808_0x8805(); | |||||
jT808_0X8805.MultimediaId = reader.ReadUInt32(); | |||||
jT808_0X8805.MultimediaDeleted = reader.ReadByte(); | |||||
writer.WriteNumber($"[{jT808_0X8805.MultimediaId.ReadNumber()}]多媒体ID", jT808_0X8805.MultimediaId); | |||||
writer.WriteNumber($"[{jT808_0X8805.MultimediaId.ReadNumber()}]删除标志", jT808_0X8805.MultimediaDeleted); | |||||
} | |||||
} | } | ||||
} | } |
@@ -2,13 +2,14 @@ | |||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | using JT808.Protocol.Interfaces; | ||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System.Text.Json; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 数据下行透传 | /// 数据下行透传 | ||||
/// </summary> | /// </summary> | ||||
public class JT808_0x8900 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8900>, IJT808_2019_Version | |||||
public class JT808_0x8900 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8900>, IJT808Analyze, IJT808_2019_Version | |||||
{ | { | ||||
public override ushort MsgId { get; } = 0x8900; | public override ushort MsgId { get; } = 0x8900; | ||||
public override string Description => "数据下行透传"; | public override string Description => "数据下行透传"; | ||||
@@ -41,5 +42,14 @@ namespace JT808.Protocol.MessageBody | |||||
writer.WriteByte(value.PassthroughType); | writer.WriteByte(value.PassthroughType); | ||||
JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(value.JT808_0X8900_BodyBase, ref writer, value.JT808_0X8900_BodyBase, config); | JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(value.JT808_0X8900_BodyBase, ref writer, value.JT808_0X8900_BodyBase, config); | ||||
} | } | ||||
public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config) | |||||
{ | |||||
JT808_0x8900 jT808_0X8900 = new JT808_0x8900(); | |||||
jT808_0X8900.PassthroughType = reader.ReadByte(); | |||||
jT808_0X8900.PassthroughData = reader.ReadContent().ToArray(); | |||||
writer.WriteNumber($"[{jT808_0X8900.PassthroughType.ReadNumber()}]透传消息类型", jT808_0X8900.PassthroughType); | |||||
writer.WriteString($"透传消息内容", jT808_0X8900.PassthroughData.ToHexString()); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,9 @@ | |||||
using JT808.Protocol.Exceptions; | using JT808.Protocol.Exceptions; | ||||
using JT808.Protocol.Extensions; | |||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System.Text.Json; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
@@ -8,7 +11,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// 平台RSA公钥 | /// 平台RSA公钥 | ||||
/// 0x8A00 | /// 0x8A00 | ||||
/// </summary> | /// </summary> | ||||
public class JT808_0x8A00 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8A00> | |||||
public class JT808_0x8A00 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8A00>, IJT808Analyze | |||||
{ | { | ||||
public override ushort MsgId { get; } = 0x8A00; | public override ushort MsgId { get; } = 0x8A00; | ||||
public override string Description => "平台RSA公钥"; | public override string Description => "平台RSA公钥"; | ||||
@@ -40,5 +43,14 @@ namespace JT808.Protocol.MessageBody | |||||
} | } | ||||
writer.WriteArray(value.N); | writer.WriteArray(value.N); | ||||
} | } | ||||
public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config) | |||||
{ | |||||
JT808_0x8A00 jT808_0X8A00 = new JT808_0x8A00(); | |||||
jT808_0X8A00.E = reader.ReadUInt32(); | |||||
jT808_0X8A00.N = reader.ReadArray(128).ToArray(); | |||||
writer.WriteNumber($"[{jT808_0X8A00.E.ReadNumber()}]RSA公钥e", jT808_0X8A00.E); | |||||
writer.WriteString($"RSA公钥n", jT808_0X8A00.N.ToHexString()); | |||||
} | |||||
} | } | ||||
} | } |