From 6a9e4c1dca9d98f29e5755406d80b7c52681bbf1 Mon Sep 17 00:00:00 2001 From: "SmallChi(Koike)" <564952747@qq.com> Date: Tue, 26 Nov 2019 09:18:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89808=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8C=96=E5=99=A8=E4=BE=9D=E8=B5=96=EF=BC=8C=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=8D=87=E7=BA=A7808=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JT808_0x8103CustomId.cs | 2 +- .../DependencyInjectionExtensions.cs | 31 ---------- .../Formatters/JT808_0x0200_0x14_Formatter.cs | 29 --------- .../Formatters/JT808_0x0200_0x15_Formatter.cs | 29 --------- .../Formatters/JT808_0x0200_0x16_Formatter.cs | 29 --------- .../Formatters/JT808_0x0200_0x17_Formatter.cs | 29 --------- .../Formatters/JT808_0x0200_0x18_Formatter.cs | 29 --------- .../Formatters/JT808_0x1003_Formatter.cs | 41 ------------- .../Formatters/JT808_0x1005_Formatter.cs | 31 ---------- .../JT808_0x1205_AVResouce_Formatter.cs | 39 ------------ .../Formatters/JT808_0x1205_Formatter.cs | 46 -------------- .../Formatters/JT808_0x1206_Formatter.cs | 27 -------- .../JT808_0x8103_0x0075_Formatter.cs | 51 ---------------- ...8103_0x0076_AVChannelRefTable_Formatter.cs | 31 ---------- .../JT808_0x8103_0x0076_Formatter.cs | 51 ---------------- .../JT808_0x8103_0x0077_Formatter.cs | 46 -------------- ...8_0x8103_0x0077_SignalChannel_Formatter.cs | 47 -------------- .../JT808_0x8103_0x0079_Formatter.cs | 34 ----------- .../JT808_0x8103_0x007A_Formatter.cs | 30 --------- .../JT808_0x8103_0x007B_Formatter.cs | 32 ---------- .../JT808_0x8103_0x007C_Formatter.cs | 37 ----------- ...3_0x007C_TimerWakeDayParamter_Formatter.cs | 42 ------------- .../Formatters/JT808_0x9101_Formatter.cs | 38 ------------ .../Formatters/JT808_0x9102_Formatter.cs | 31 ---------- .../Formatters/JT808_0x9105_Formatter.cs | 27 -------- .../Formatters/JT808_0x9201_Formatter.cs | 50 --------------- .../Formatters/JT808_0x9202_Formatter.cs | 31 ---------- .../Formatters/JT808_0x9205_Formatter.cs | 37 ----------- .../Formatters/JT808_0x9206_Formatter.cs | 61 ------------------- .../Formatters/JT808_0x9207_Formatter.cs | 27 -------- .../Formatters/JT808_0x9301_Formatter.cs | 29 --------- .../Formatters/JT808_0x9302_Formatter.cs | 27 -------- .../Formatters/JT808_0x9303_Formatter.cs | 27 -------- .../Formatters/JT808_0x9304_Formatter.cs | 27 -------- .../Formatters/JT808_0x9305_Formatter.cs | 27 -------- .../Formatters/JT808_0x9306_Formatter.cs | 27 -------- .../JT808.Protocol.Extensions.JT1078.csproj | 4 +- .../MessageBody/JT808_0x0200_0x14.cs | 23 +++++-- .../MessageBody/JT808_0x0200_0x15.cs | 23 +++++-- .../MessageBody/JT808_0x0200_0x16.cs | 23 +++++-- .../MessageBody/JT808_0x0200_0x17.cs | 23 +++++-- .../MessageBody/JT808_0x0200_0x18.cs | 22 +++++-- .../MessageBody/JT808_0x1003.cs | 37 +++++++++-- .../MessageBody/JT808_0x1005.cs | 26 ++++++-- .../MessageBody/JT808_0x1205.cs | 41 +++++++++++-- .../MessageBody/JT808_0x1205_AVResouce.cs | 33 ++++++++-- .../MessageBody/JT808_0x1206.cs | 21 +++++-- .../MessageBody/JT808_0x8103_0x0075.cs | 45 ++++++++++++-- .../MessageBody/JT808_0x8103_0x0076.cs | 48 +++++++++++++-- .../JT808_0x8103_0x0076_AVChannelRefTable.cs | 25 ++++++-- .../MessageBody/JT808_0x8103_0x0077.cs | 42 +++++++++++-- .../JT808_0x8103_0x0077_SignalChannel.cs | 40 ++++++++++-- .../MessageBody/JT808_0x8103_0x0079.cs | 27 ++++++-- .../MessageBody/JT808_0x8103_0x007A.cs | 22 +++++-- .../MessageBody/JT808_0x8103_0x007B.cs | 25 ++++++-- .../MessageBody/JT808_0x8103_0x007C.cs | 30 +++++++-- ...T808_0x8103_0x007C_TimerWakeDayParamter.cs | 35 +++++++++-- .../MessageBody/JT808_0x9003.cs | 5 +- .../MessageBody/JT808_0x9101.cs | 33 ++++++++-- .../MessageBody/JT808_0x9102.cs | 26 ++++++-- .../MessageBody/JT808_0x9105.cs | 22 +++++-- .../MessageBody/JT808_0x9201.cs | 45 ++++++++++++-- .../MessageBody/JT808_0x9202.cs | 26 ++++++-- .../MessageBody/JT808_0x9205.cs | 32 ++++++++-- .../MessageBody/JT808_0x9206.cs | 56 +++++++++++++++-- .../MessageBody/JT808_0x9207.cs | 21 +++++-- .../MessageBody/JT808_0x9301.cs | 26 ++++++-- .../MessageBody/JT808_0x9302.cs | 24 ++++++-- .../MessageBody/JT808_0x9303.cs | 23 +++++-- .../MessageBody/JT808_0x9304.cs | 23 +++++-- .../MessageBody/JT808_0x9305.cs | 23 +++++-- .../MessageBody/JT808_0x9306.cs | 24 ++++++-- 72 files changed, 876 insertions(+), 1377 deletions(-) delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x14_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x15_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x16_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x17_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x18_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1003_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1005_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1205_AVResouce_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1205_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1206_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0075_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0076_AVChannelRefTable_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0076_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0077_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0077_SignalChannel_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0079_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007A_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007B_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007C_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007C_TimerWakeDayParamter_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9101_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9102_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9105_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9201_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9202_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9205_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9206_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9207_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9301_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9302_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9303_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9304_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9305_Formatter.cs delete mode 100644 src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9306_Formatter.cs diff --git a/src/JT808.Protocol.Extensions.JT1078.Test/JT808_0x8103CustomId.cs b/src/JT808.Protocol.Extensions.JT1078.Test/JT808_0x8103CustomId.cs index 759ab1e..297b038 100644 --- a/src/JT808.Protocol.Extensions.JT1078.Test/JT808_0x8103CustomId.cs +++ b/src/JT808.Protocol.Extensions.JT1078.Test/JT808_0x8103CustomId.cs @@ -288,6 +288,6 @@ namespace JT808.Protocol.Extensions.JT1078.Test } class DefaultGlobalConfig : GlobalConfigBase { - public override string ConfigId => "Default"; + public override string ConfigId { protected set; get; } = "Default"; } } diff --git a/src/JT808.Protocol.Extensions.JT1078/DependencyInjectionExtensions.cs b/src/JT808.Protocol.Extensions.JT1078/DependencyInjectionExtensions.cs index 39ebdfa..c188a55 100644 --- a/src/JT808.Protocol.Extensions.JT1078/DependencyInjectionExtensions.cs +++ b/src/JT808.Protocol.Extensions.JT1078/DependencyInjectionExtensions.cs @@ -14,37 +14,6 @@ namespace JT808.Protocol.Extensions.JT1078 public static IJT808Builder AddJT1078Configure(this IJT808Builder jT808Builder) { jT808Builder.Config.Register(Assembly.GetExecutingAssembly()); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x1003>((ushort)JT808_JT1078_MsgId.终端上传音视频属性, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x1005>((ushort)JT808_JT1078_MsgId.终端上传乘客流量, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x1205>((ushort)JT808_JT1078_MsgId.终端上传音视频资源列表, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x1206>((ushort)JT808_JT1078_MsgId.文件上传完成通知, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9003>((ushort)JT808_JT1078_MsgId.查询终端音视频属性, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9101>((ushort)JT808_JT1078_MsgId.实时音视频传输请求, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9102>((ushort)JT808_JT1078_MsgId.音视频实时传输控制, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9105>((ushort)JT808_JT1078_MsgId.实时音视频传输状态通知, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9201>((ushort)JT808_JT1078_MsgId.平台下发远程录像回放请求, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9202>((ushort)JT808_JT1078_MsgId.平台下发远程录像回放控制, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9205>((ushort)JT808_JT1078_MsgId.查询资源列表, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9206>((ushort)JT808_JT1078_MsgId.文件上传指令, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9207>((ushort)JT808_JT1078_MsgId.文件上传控制, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9301>((ushort)JT808_JT1078_MsgId.云台旋转, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9302>((ushort)JT808_JT1078_MsgId.云台调整焦距控制, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9303>((ushort)JT808_JT1078_MsgId.云台调整光圈控制, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9304>((ushort)JT808_JT1078_MsgId.云台雨刷控制, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9305>((ushort)JT808_JT1078_MsgId.红外补光控制, ""); - jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9306>((ushort)JT808_JT1078_MsgId.云台变倍控制, ""); - jT808Builder.Config.JT808_0X0200_Factory.JT808LocationAttachMethod.Add(JT808_JT1078_Constants.JT808_0X0200_0x14, typeof(JT808_0x0200_0x14)); - jT808Builder.Config.JT808_0X0200_Factory.JT808LocationAttachMethod.Add(JT808_JT1078_Constants.JT808_0X0200_0x15, typeof(JT808_0x0200_0x15)); - jT808Builder.Config.JT808_0X0200_Factory.JT808LocationAttachMethod.Add(JT808_JT1078_Constants.JT808_0X0200_0x16, typeof(JT808_0x0200_0x16)); - jT808Builder.Config.JT808_0X0200_Factory.JT808LocationAttachMethod.Add(JT808_JT1078_Constants.JT808_0X0200_0x17, typeof(JT808_0x0200_0x17)); - jT808Builder.Config.JT808_0X0200_Factory.JT808LocationAttachMethod.Add(JT808_JT1078_Constants.JT808_0X0200_0x18, typeof(JT808_0x0200_0x18)); - jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x0075, typeof(JT808_0x8103_0x0075)); - jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x0076, typeof(JT808_0x8103_0x0076)); - jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x0077, typeof(JT808_0x8103_0x0077)); - jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x0079, typeof(JT808_0x8103_0x0079)); - jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x007A, typeof(JT808_0x8103_0x007A)); - jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x007B, typeof(JT808_0x8103_0x007B)); - jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x007C, typeof(JT808_0x8103_0x007C)); return jT808Builder; } } diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x14_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x14_Formatter.cs deleted file mode 100644 index bc0a4c4..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x14_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x0200_0x14_Formatter : IJT808MessagePackFormatter<JT808_0x0200_0x14> - { - public JT808_0x0200_0x14 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x14 jT808_0x0200_0x14 = new JT808_0x0200_0x14(); - jT808_0x0200_0x14.AttachInfoId = reader.ReadByte(); - jT808_0x0200_0x14.AttachInfoLength = reader.ReadByte(); - jT808_0x0200_0x14.VideoRelateAlarm = reader.ReadUInt32(); - return jT808_0x0200_0x14; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x14 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteUInt32(value.VideoRelateAlarm); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x15_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x15_Formatter.cs deleted file mode 100644 index 33bad9b..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x15_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x0200_0x15_Formatter : IJT808MessagePackFormatter<JT808_0x0200_0x15> - { - public JT808_0x0200_0x15 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x15 jT808_0x0200_0x15 = new JT808_0x0200_0x15(); - jT808_0x0200_0x15.AttachInfoId = reader.ReadByte(); - jT808_0x0200_0x15.AttachInfoLength = reader.ReadByte(); - jT808_0x0200_0x15.VideoSignalLoseAlarmStatus = reader.ReadUInt32(); - return jT808_0x0200_0x15; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x15 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteUInt32(value.VideoSignalLoseAlarmStatus); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x16_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x16_Formatter.cs deleted file mode 100644 index d1c2318..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x16_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x0200_0x16_Formatter : IJT808MessagePackFormatter<JT808_0x0200_0x16> - { - public JT808_0x0200_0x16 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x16 jT808_0x0200_0x16 = new JT808_0x0200_0x16(); - jT808_0x0200_0x16.AttachInfoId = reader.ReadByte(); - jT808_0x0200_0x16.AttachInfoLength = reader.ReadByte(); - jT808_0x0200_0x16.VideoSignalOcclusionAlarmStatus = reader.ReadUInt32(); - return jT808_0x0200_0x16; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x16 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteUInt32(value.VideoSignalOcclusionAlarmStatus); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x17_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x17_Formatter.cs deleted file mode 100644 index 8d2903f..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x17_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x0200_0x17_Formatter : IJT808MessagePackFormatter<JT808_0x0200_0x17> - { - public JT808_0x0200_0x17 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x17 jT808_0x0200_0x17 = new JT808_0x0200_0x17(); - jT808_0x0200_0x17.AttachInfoId = reader.ReadByte(); - jT808_0x0200_0x17.AttachInfoLength = reader.ReadByte(); - jT808_0x0200_0x17.StorageFaultAlarmStatus = reader.ReadUInt16(); - return jT808_0x0200_0x17; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x17 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteUInt16(value.StorageFaultAlarmStatus); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x18_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x18_Formatter.cs deleted file mode 100644 index fd46ff7..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x0200_0x18_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x0200_0x18_Formatter : IJT808MessagePackFormatter<JT808_0x0200_0x18> - { - public JT808_0x0200_0x18 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x0200_0x18 jT808_0x0200_0x18 = new JT808_0x0200_0x18(); - jT808_0x0200_0x18.AttachInfoId = reader.ReadByte(); - jT808_0x0200_0x18.AttachInfoLength = reader.ReadByte(); - jT808_0x0200_0x18.AbnormalDrivingBehaviorAlarmInfo = reader.ReadUInt16(); - return jT808_0x0200_0x18; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x18 value, IJT808Config config) - { - writer.WriteByte(value.AttachInfoId); - writer.WriteByte(value.AttachInfoLength); - writer.WriteUInt16(value.AbnormalDrivingBehaviorAlarmInfo); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1003_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1003_Formatter.cs deleted file mode 100644 index 992895d..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1003_Formatter.cs +++ /dev/null @@ -1,41 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x1003_Formatter : IJT808MessagePackFormatter<JT808_0x1003> - { - public JT808_0x1003 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x1003 jT808_0x1003 = new JT808_0x1003(); - jT808_0x1003.EnterAudioEncoding = reader.ReadByte(); - jT808_0x1003.EnterAudioChannelsNumber = reader.ReadByte(); - jT808_0x1003.EnterAudioSampleRate = reader.ReadByte(); - jT808_0x1003.EnterAudioSampleDigits = reader.ReadByte(); - jT808_0x1003.AudioFrameLength = reader.ReadUInt16(); - jT808_0x1003.IsSupportedAudioOutput = reader.ReadByte(); - jT808_0x1003.VideoEncoding = reader.ReadByte(); - jT808_0x1003.TerminalSupportedMaxNumberOfAudioPhysicalChannels = reader.ReadByte(); - jT808_0x1003.TerminalSupportedMaxNumberOfVideoPhysicalChannels = reader.ReadByte(); - return jT808_0x1003; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1003 value, IJT808Config config) - { - writer.WriteByte(value.EnterAudioEncoding); - writer.WriteByte(value.EnterAudioChannelsNumber); - writer.WriteByte(value.EnterAudioSampleRate); - writer.WriteByte(value.EnterAudioSampleDigits); - writer.WriteUInt16(value.AudioFrameLength); - writer.WriteByte(value.IsSupportedAudioOutput); - writer.WriteByte(value.VideoEncoding); - writer.WriteByte(value.TerminalSupportedMaxNumberOfAudioPhysicalChannels); - writer.WriteByte(value.TerminalSupportedMaxNumberOfVideoPhysicalChannels); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1005_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1005_Formatter.cs deleted file mode 100644 index 334f7ab..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1005_Formatter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x1005_Formatter : IJT808MessagePackFormatter<JT808_0x1005> - { - public JT808_0x1005 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x1005 jT808_0x1005 = new JT808_0x1005(); - jT808_0x1005.BeginTime = reader.ReadDateTime6(); - jT808_0x1005.EndTime = reader.ReadDateTime6(); - jT808_0x1005.GettingOnNumber = reader.ReadUInt16(); - jT808_0x1005.GettingOffNumber = reader.ReadUInt16(); - return jT808_0x1005; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1005 value, IJT808Config config) - { - writer.WriteDateTime6(value.BeginTime); - writer.WriteDateTime6(value.EndTime); - writer.WriteUInt16(value.GettingOnNumber); - writer.WriteUInt16(value.GettingOffNumber); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1205_AVResouce_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1205_AVResouce_Formatter.cs deleted file mode 100644 index 829636a..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1205_AVResouce_Formatter.cs +++ /dev/null @@ -1,39 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x1205_AVResouce_Formatter : IJT808MessagePackFormatter<JT808_0x1205_AVResouce> - { - public JT808_0x1205_AVResouce Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x1205_AVResouce jT808_0x1205_AVResouce = new JT808_0x1205_AVResouce(); - jT808_0x1205_AVResouce.LogicChannelNo = reader.ReadByte(); - jT808_0x1205_AVResouce.BeginTime = reader.ReadDateTime6(); - jT808_0x1205_AVResouce.EndTime = reader.ReadDateTime6(); - jT808_0x1205_AVResouce.AlarmFlag = reader.ReadUInt32(); - jT808_0x1205_AVResouce.AVResourceType = reader.ReadByte(); - jT808_0x1205_AVResouce.StreamType = reader.ReadByte(); - jT808_0x1205_AVResouce.MemoryType = reader.ReadByte(); - jT808_0x1205_AVResouce.FileSize = reader.ReadUInt32(); - return jT808_0x1205_AVResouce; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1205_AVResouce value, IJT808Config config) - { - writer.WriteByte(value.LogicChannelNo); - writer.WriteDateTime6(value.BeginTime); - writer.WriteDateTime6(value.EndTime); - writer.WriteUInt32(value.AlarmFlag); - writer.WriteByte(value.AVResourceType); - writer.WriteByte(value.StreamType); - writer.WriteByte(value.MemoryType); - writer.WriteUInt32(value.FileSize); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1205_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1205_Formatter.cs deleted file mode 100644 index 3246163..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1205_Formatter.cs +++ /dev/null @@ -1,46 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x1205_Formatter : IJT808MessagePackFormatter<JT808_0x1205> - { - public JT808_0x1205 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x1205 jT808_0x1205 = new JT808_0x1205(); - jT808_0x1205.MsgNum = reader.ReadUInt16(); - jT808_0x1205.AVResouceTotal = reader.ReadUInt32(); - var channelTotal = jT808_0x1205.AVResouceTotal;//音视频资源总数 - if (channelTotal > 0) - { - jT808_0x1205.AVResouces =new List<JT808_0x1205_AVResouce>(); - var formatter = config.GetMessagePackFormatter<JT808_0x1205_AVResouce>(); - for (int i = 0; i < channelTotal; i++) - { - jT808_0x1205.AVResouces.Add(formatter.Deserialize(ref reader, config)); - } - } - return jT808_0x1205; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1205 value, IJT808Config config) - { - writer.WriteUInt16(value.MsgNum); - writer.WriteUInt32(value.AVResouceTotal); - if (value.AVResouces.Any()) - { - var formatter = config.GetMessagePackFormatter<JT808_0x1205_AVResouce>(); - foreach (var AVResouce in value.AVResouces) - { - formatter.Serialize(ref writer, AVResouce, config); - } - } - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1206_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1206_Formatter.cs deleted file mode 100644 index b34958e..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x1206_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x1206_Formatter : IJT808MessagePackFormatter<JT808_0x1206> - { - public JT808_0x1206 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x1206 jT808_0x1206 = new JT808_0x1206(); - jT808_0x1206.MsgNum = reader.ReadUInt16(); - jT808_0x1206.Result = reader.ReadByte(); - return jT808_0x1206; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1206 value, IJT808Config config) - { - writer.WriteUInt16(value.MsgNum); - writer.WriteByte(value.Result); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0075_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0075_Formatter.cs deleted file mode 100644 index 5be2884..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0075_Formatter.cs +++ /dev/null @@ -1,51 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x8103_0x0075_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x0075> - { - public JT808_0x8103_0x0075 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0075 jT808_0X8103_0X0075 = new JT808_0x8103_0x0075(); - jT808_0X8103_0X0075.ParamId = reader.ReadUInt32(); - jT808_0X8103_0X0075.ParamLength = reader.ReadByte(); - jT808_0X8103_0X0075.RTS_EncodeMode = reader.ReadByte(); - jT808_0X8103_0X0075.RTS_Resolution = reader.ReadByte(); - jT808_0X8103_0X0075.RTS_KF_Interval = reader.ReadUInt16(); - jT808_0X8103_0X0075.RTS_Target_FPS = reader.ReadByte(); - jT808_0X8103_0X0075.RTS_Target_CodeRate = reader.ReadUInt32(); - jT808_0X8103_0X0075.StreamStore_EncodeMode = reader.ReadByte(); - jT808_0X8103_0X0075.StreamStore_Resolution = reader.ReadByte(); - jT808_0X8103_0X0075.StreamStore_KF_Interval = reader.ReadUInt16(); - jT808_0X8103_0X0075.StreamStore_Target_FPS = reader.ReadByte(); - jT808_0X8103_0X0075.StreamStore_Target_CodeRate = reader.ReadUInt32(); - jT808_0X8103_0X0075.OSD = reader.ReadUInt16(); - jT808_0X8103_0X0075.AudioOutputEnabled = reader.ReadByte(); - return jT808_0X8103_0X0075; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0075 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteByte(value.RTS_EncodeMode); - writer.WriteByte(value.RTS_Resolution); - writer.WriteUInt16(value.RTS_KF_Interval); - writer.WriteByte(value.RTS_Target_FPS); - writer.WriteUInt32(value.RTS_Target_CodeRate); - writer.WriteByte(value.StreamStore_EncodeMode); - writer.WriteByte(value.StreamStore_Resolution); - writer.WriteUInt16(value.StreamStore_KF_Interval); - writer.WriteByte(value.StreamStore_Target_FPS); - writer.WriteUInt32(value.StreamStore_Target_CodeRate); - writer.WriteUInt16(value.OSD); - writer.WriteByte(value.AudioOutputEnabled); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0076_AVChannelRefTable_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0076_AVChannelRefTable_Formatter.cs deleted file mode 100644 index f7ef183..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0076_AVChannelRefTable_Formatter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x8103_0x0076_AVChannelRefTable_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x0076_AVChannelRefTable> - { - public JT808_0x8103_0x0076_AVChannelRefTable Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0076_AVChannelRefTable jT808_0X8103_0X0076_AVChannelRefTable = new JT808_0x8103_0x0076_AVChannelRefTable(); - jT808_0X8103_0X0076_AVChannelRefTable.PhysicalChannelNo = reader.ReadByte(); - jT808_0X8103_0X0076_AVChannelRefTable.LogicChannelNo = reader.ReadByte(); - jT808_0X8103_0X0076_AVChannelRefTable.ChannelType = reader.ReadByte(); - jT808_0X8103_0X0076_AVChannelRefTable.IsConnectCloudPlat = reader.ReadByte(); - return jT808_0X8103_0X0076_AVChannelRefTable; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0076_AVChannelRefTable value, IJT808Config config) - { - writer.WriteByte(value.PhysicalChannelNo); - writer.WriteByte(value.LogicChannelNo); - writer.WriteByte(value.ChannelType); - writer.WriteByte(value.IsConnectCloudPlat); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0076_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0076_Formatter.cs deleted file mode 100644 index 232776c..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0076_Formatter.cs +++ /dev/null @@ -1,51 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x8103_0x0076_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x0076> - { - public JT808_0x8103_0x0076 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0076 jT808_0X8103_0X0076 = new JT808_0x8103_0x0076(); - jT808_0X8103_0X0076.ParamId = reader.ReadUInt32(); - jT808_0X8103_0X0076.ParamLength = reader.ReadByte(); - jT808_0X8103_0X0076.AVChannelTotal = reader.ReadByte(); - jT808_0X8103_0X0076.AudioChannelTotal = reader.ReadByte(); - jT808_0X8103_0X0076.VudioChannelTotal = reader.ReadByte(); - var channelTotal = jT808_0X8103_0X0076.AVChannelTotal + jT808_0X8103_0X0076.AudioChannelTotal + jT808_0X8103_0X0076.VudioChannelTotal;//通道总数 - if (channelTotal > 0) { - jT808_0X8103_0X0076.AVChannelRefTables = new List<JT808_0x8103_0x0076_AVChannelRefTable>(); - var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0076_AVChannelRefTable>(); - for (int i = 0; i < channelTotal; i++) - { - jT808_0X8103_0X0076.AVChannelRefTables.Add(formatter.Deserialize(ref reader, config)); - } - } - return jT808_0X8103_0X0076; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0076 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1,out int position); - writer.WriteByte(value.AVChannelTotal); - writer.WriteByte(value.AudioChannelTotal); - writer.WriteByte(value.VudioChannelTotal); - if (value.AVChannelRefTables.Any()) { - var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0076_AVChannelRefTable>(); - foreach (var AVChannelRefTable in value.AVChannelRefTables) - { - formatter.Serialize(ref writer, AVChannelRefTable, config); - } - } - writer.WriteByteReturn((byte)(writer.GetCurrentPosition()- position-1), position); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0077_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0077_Formatter.cs deleted file mode 100644 index 411af86..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0077_Formatter.cs +++ /dev/null @@ -1,46 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x8103_0x0077_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x0077> - { - public JT808_0x8103_0x0077 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0077 jT808_0X8103_0X0077 = new JT808_0x8103_0x0077(); - jT808_0X8103_0X0077.ParamId = reader.ReadUInt32(); - jT808_0X8103_0X0077.ParamLength = reader.ReadByte(); - jT808_0X8103_0X0077.NeedSetChannelTotal = reader.ReadByte(); - if (jT808_0X8103_0X0077.NeedSetChannelTotal > 0) { - jT808_0X8103_0X0077.SignalChannels = new List<JT808_0x8103_0x0077_SignalChannel>(); - var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0077_SignalChannel>(); - for (int i = 0; i < jT808_0X8103_0X0077.NeedSetChannelTotal; i++) - { - jT808_0X8103_0X0077.SignalChannels.Add(formatter.Deserialize(ref reader, config)); - } - } - return jT808_0X8103_0X0077; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0077 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1,out var position); - writer.WriteByte(value.NeedSetChannelTotal); - if (value.SignalChannels.Any()) { - var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0077_SignalChannel>(); - foreach (var signalChannel in value.SignalChannels) - { - formatter.Serialize(ref writer, signalChannel, config); - } - } - writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0077_SignalChannel_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0077_SignalChannel_Formatter.cs deleted file mode 100644 index 3d8f545..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0077_SignalChannel_Formatter.cs +++ /dev/null @@ -1,47 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x8103_0x0077_SignalChannel_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x0077_SignalChannel> - { - public JT808_0x8103_0x0077_SignalChannel Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0077_SignalChannel jT808_0X8103_0X0077_SignalChannel = new JT808_0x8103_0x0077_SignalChannel(); - jT808_0X8103_0X0077_SignalChannel.LogicChannelNo= reader.ReadByte(); - jT808_0X8103_0X0077_SignalChannel.RTS_EncodeMode = reader.ReadByte(); - jT808_0X8103_0X0077_SignalChannel.RTS_Resolution = reader.ReadByte(); - jT808_0X8103_0X0077_SignalChannel.RTS_KF_Interval = reader.ReadUInt16(); - jT808_0X8103_0X0077_SignalChannel.RTS_Target_FPS = reader.ReadByte(); - jT808_0X8103_0X0077_SignalChannel.RTS_Target_CodeRate = reader.ReadUInt32(); - jT808_0X8103_0X0077_SignalChannel.StreamStore_EncodeMode = reader.ReadByte(); - jT808_0X8103_0X0077_SignalChannel.StreamStore_Resolution = reader.ReadByte(); - jT808_0X8103_0X0077_SignalChannel.StreamStore_KF_Interval = reader.ReadUInt16(); - jT808_0X8103_0X0077_SignalChannel.StreamStore_Target_FPS = reader.ReadByte(); - jT808_0X8103_0X0077_SignalChannel.StreamStore_Target_CodeRate = reader.ReadUInt32(); - jT808_0X8103_0X0077_SignalChannel.OSD = reader.ReadUInt16(); - return jT808_0X8103_0X0077_SignalChannel; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0077_SignalChannel value, IJT808Config config) - { - writer.WriteByte(value.LogicChannelNo); - writer.WriteByte(value.RTS_EncodeMode); - writer.WriteByte(value.RTS_Resolution); - writer.WriteUInt16(value.RTS_KF_Interval); - writer.WriteByte(value.RTS_Target_FPS); - writer.WriteUInt32(value.RTS_Target_CodeRate); - writer.WriteByte(value.StreamStore_EncodeMode); - writer.WriteByte(value.StreamStore_Resolution); - writer.WriteUInt16(value.StreamStore_KF_Interval); - writer.WriteByte(value.StreamStore_Target_FPS); - writer.WriteUInt32(value.StreamStore_Target_CodeRate); - writer.WriteUInt16(value.OSD); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0079_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0079_Formatter.cs deleted file mode 100644 index fac6539..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x0079_Formatter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x8103_0x0079_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x0079> - { - public JT808_0x8103_0x0079 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x0079 jT808_0x8103_0x0079 = new JT808_0x8103_0x0079(); - jT808_0x8103_0x0079.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x0079.ParamLength = reader.ReadByte(); - jT808_0x8103_0x0079.StorageThresholds = reader.ReadByte(); - jT808_0x8103_0x0079.Duration = reader.ReadByte(); - jT808_0x8103_0x0079.BeginMinute = reader.ReadByte(); - return jT808_0x8103_0x0079; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0079 value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteByte(value.StorageThresholds); - writer.WriteByte(value.Duration); - writer.WriteByte(value.BeginMinute); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007A_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007A_Formatter.cs deleted file mode 100644 index deb93e0..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007A_Formatter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x8103_0x007A_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x007A> - { - public JT808_0x8103_0x007A Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x007A jT808_0x8103_0x007A = new JT808_0x8103_0x007A(); - jT808_0x8103_0x007A.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x007A.ParamLength = reader.ReadByte(); - jT808_0x8103_0x007A.AlarmShielding = reader.ReadUInt32(); - return jT808_0x8103_0x007A; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007A value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteUInt32(value.AlarmShielding); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007B_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007B_Formatter.cs deleted file mode 100644 index 73248f3..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007B_Formatter.cs +++ /dev/null @@ -1,32 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x8103_0x007B_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x007B> - { - public JT808_0x8103_0x007B Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x007B jT808_0x8103_0x007B = new JT808_0x8103_0x007B(); - jT808_0x8103_0x007B.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x007B.ParamLength = reader.ReadByte(); - jT808_0x8103_0x007B.NuclearLoadNumber = reader.ReadByte(); - jT808_0x8103_0x007B.FatigueThreshold = reader.ReadByte(); - return jT808_0x8103_0x007B; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007B value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.WriteByte(value.ParamLength); - writer.WriteByte(value.NuclearLoadNumber); - writer.WriteByte(value.FatigueThreshold); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007C_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007C_Formatter.cs deleted file mode 100644 index 34ef5e2..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007C_Formatter.cs +++ /dev/null @@ -1,37 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x8103_0x007C_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x007C> - { - public JT808_0x8103_0x007C Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x007C jT808_0x8103_0x007C = new JT808_0x8103_0x007C(); - jT808_0x8103_0x007C.ParamId = reader.ReadUInt32(); - jT808_0x8103_0x007C.ParamLength = reader.ReadByte(); - jT808_0x8103_0x007C.SleepWakeMode = reader.ReadByte(); - jT808_0x8103_0x007C.WakeConditionType = reader.ReadByte(); - jT808_0x8103_0x007C.TimerWakeDaySet = reader.ReadByte(); - jT808_0x8103_0x007C.TimerWakeDayParamter = config.GetMessagePackFormatter<JT808_0x8103_0x007C_TimerWakeDayParamter>().Deserialize(ref reader, config); - return jT808_0x8103_0x007C; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007C value, IJT808Config config) - { - writer.WriteUInt32(value.ParamId); - writer.Skip(1, out var position); - writer.WriteByte(value.SleepWakeMode); - writer.WriteByte(value.WakeConditionType); - writer.WriteByte(value.TimerWakeDaySet); - config.GetMessagePackFormatter<JT808_0x8103_0x007C_TimerWakeDayParamter>().Serialize(ref writer, value.TimerWakeDayParamter, config); - writer.WriteByteReturn((byte)(writer.GetCurrentPosition()-position-1),position); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007C_TimerWakeDayParamter_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007C_TimerWakeDayParamter_Formatter.cs deleted file mode 100644 index e6a8103..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x8103_0x007C_TimerWakeDayParamter_Formatter.cs +++ /dev/null @@ -1,42 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x8103_0x007C_TimerWakeDayParamter_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x007C_TimerWakeDayParamter> - { - public JT808_0x8103_0x007C_TimerWakeDayParamter Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x8103_0x007C_TimerWakeDayParamter jT808_0x8103_0x007C_TimerWakeDayParamter = new JT808_0x8103_0x007C_TimerWakeDayParamter(); - jT808_0x8103_0x007C_TimerWakeDayParamter.TimerWakeEnableFlag = reader.ReadByte(); - jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod1WakeTime = reader.ReadBCD(4); - jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod1CloseTime = reader.ReadBCD(4); - jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod2WakeTime = reader.ReadBCD(4); - jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod2CloseTime = reader.ReadBCD(4); - jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod3WakeTime = reader.ReadBCD(4); - jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod3CloseTime = reader.ReadBCD(4); - jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod4WakeTime = reader.ReadBCD(4); - jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod4CloseTime = reader.ReadBCD(4); - return jT808_0x8103_0x007C_TimerWakeDayParamter; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007C_TimerWakeDayParamter value, IJT808Config config) - { - writer.WriteByte(value.TimerWakeEnableFlag); - writer.WriteBCD(value.TimePeriod1WakeTime, 4); - writer.WriteBCD(value.TimePeriod1CloseTime, 4); - writer.WriteBCD(value.TimePeriod2WakeTime, 4); - writer.WriteBCD(value.TimePeriod2CloseTime, 4); - writer.WriteBCD(value.TimePeriod3WakeTime, 4); - writer.WriteBCD(value.TimePeriod3CloseTime, 4); - writer.WriteBCD(value.TimePeriod4WakeTime, 4); - writer.WriteBCD(value.TimePeriod4CloseTime, 4); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9101_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9101_Formatter.cs deleted file mode 100644 index 9539979..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9101_Formatter.cs +++ /dev/null @@ -1,38 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9101_Formatter : IJT808MessagePackFormatter<JT808_0x9101> - { - public JT808_0x9101 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9101 jT808_0X9101 = new JT808_0x9101(); - jT808_0X9101.ServerIPAddressLength = reader.ReadByte(); - jT808_0X9101.ServerIPAddress = reader.ReadString(jT808_0X9101.ServerIPAddressLength); - jT808_0X9101.ServerVideoChannelTcpPort = reader.ReadUInt16(); - jT808_0X9101.ServerVideoChannelUdpPort = reader.ReadUInt16(); - jT808_0X9101.LogicalChannelNo = reader.ReadByte(); - jT808_0X9101.DataType = reader.ReadByte(); - jT808_0X9101.StreamType = reader.ReadByte(); - return jT808_0X9101; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9101 value, IJT808Config config) - { - writer.Skip(1, out int position); - writer.WriteString(value.ServerIPAddress); - writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); - writer.WriteUInt16(value.ServerVideoChannelTcpPort); - writer.WriteUInt16(value.ServerVideoChannelUdpPort); - writer.WriteByte(value.LogicalChannelNo); - writer.WriteByte(value.DataType); - writer.WriteByte(value.StreamType); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9102_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9102_Formatter.cs deleted file mode 100644 index 74ace62..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9102_Formatter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9102_Formatter : IJT808MessagePackFormatter<JT808_0x9102> - { - public JT808_0x9102 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9102 jT808_0X9102 = new JT808_0x9102(); - jT808_0X9102.LogicalChannelNo = reader.ReadByte(); - jT808_0X9102.ControlCmd = reader.ReadByte(); - jT808_0X9102.CloseAVData = reader.ReadByte(); - jT808_0X9102.SwitchStreamType = reader.ReadByte(); - return jT808_0X9102; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9102 value, IJT808Config config) - { - writer.WriteByte(value.LogicalChannelNo); - writer.WriteByte(value.ControlCmd); - writer.WriteByte(value.CloseAVData); - writer.WriteByte(value.SwitchStreamType); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9105_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9105_Formatter.cs deleted file mode 100644 index 755178b..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9105_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9105_Formatter : IJT808MessagePackFormatter<JT808_0x9105> - { - public JT808_0x9105 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9105 jT808_0x9105 = new JT808_0x9105(); - jT808_0x9105.LogicChannelNo = reader.ReadByte(); - jT808_0x9105.DropRate = reader.ReadByte(); - return jT808_0x9105; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9105 value, IJT808Config config) - { - writer.WriteByte(value.LogicChannelNo); - writer.WriteByte(value.DropRate); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9201_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9201_Formatter.cs deleted file mode 100644 index 70b6550..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9201_Formatter.cs +++ /dev/null @@ -1,50 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9201_Formatter : IJT808MessagePackFormatter<JT808_0x9201> - { - public JT808_0x9201 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9201 jT808_0x9201 = new JT808_0x9201(); - jT808_0x9201.ServerIpLength = reader.ReadByte(); - jT808_0x9201.ServerIp = reader.ReadString(jT808_0x9201.ServerIpLength); - jT808_0x9201.TcpPort = reader.ReadUInt16(); - jT808_0x9201.UdpPort = reader.ReadUInt16(); - jT808_0x9201.LogicChannelNo = reader.ReadByte(); - jT808_0x9201.AVItemType = reader.ReadByte(); - jT808_0x9201.StreamType = reader.ReadByte(); - jT808_0x9201.MemType = reader.ReadByte(); - jT808_0x9201.PlayBackWay = reader.ReadByte(); - jT808_0x9201.FastForwardOrFastRewindMultiples1 = reader.ReadByte(); - jT808_0x9201.FastForwardOrFastRewindMultiples2 = reader.ReadByte(); - jT808_0x9201.BeginTime = reader.ReadDateTime6(); - jT808_0x9201.EndTime = reader.ReadDateTime6(); - return jT808_0x9201; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9201 value, IJT808Config config) - { - writer.Skip(1,out int position); - writer.WriteString(value.ServerIp); - writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position);//计算完字符串后,回写字符串长度 - writer.WriteUInt16(value.TcpPort); - writer.WriteUInt16(value.UdpPort); - writer.WriteByte(value.LogicChannelNo); - writer.WriteByte(value.AVItemType); - writer.WriteByte(value.StreamType); - writer.WriteByte(value.MemType); - writer.WriteByte(value.PlayBackWay); - writer.WriteByte(value.FastForwardOrFastRewindMultiples1); - writer.WriteByte(value.FastForwardOrFastRewindMultiples2); - writer.WriteDateTime6(value.BeginTime); - writer.WriteDateTime6(value.EndTime); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9202_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9202_Formatter.cs deleted file mode 100644 index ae42bb7..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9202_Formatter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9202_Formatter : IJT808MessagePackFormatter<JT808_0x9202> - { - public JT808_0x9202 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9202 jT808_0x9202 = new JT808_0x9202(); - jT808_0x9202.AVChannelNo = reader.ReadByte(); - jT808_0x9202.PlayBackControl = reader.ReadByte(); - jT808_0x9202.FastForwardOrFastRewindMultiples = reader.ReadByte(); - jT808_0x9202.DragPlaybackPosition = reader.ReadDateTime6(); - return jT808_0x9202; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9202 value, IJT808Config config) - { - writer.WriteByte(value.AVChannelNo); - writer.WriteByte(value.PlayBackControl); - writer.WriteByte(value.FastForwardOrFastRewindMultiples); - writer.WriteDateTime6(value.DragPlaybackPosition); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9205_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9205_Formatter.cs deleted file mode 100644 index aafd189..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9205_Formatter.cs +++ /dev/null @@ -1,37 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9205_Formatter : IJT808MessagePackFormatter<JT808_0x9205> - { - public JT808_0x9205 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9205 jT808_0x9205 = new JT808_0x9205(); - jT808_0x9205.LogicChannelNo = reader.ReadByte(); - jT808_0x9205.BeginTime = reader.ReadDateTime6(); - jT808_0x9205.EndTime = reader.ReadDateTime6(); - jT808_0x9205.AlarmFlag = reader.ReadUInt32(); - jT808_0x9205.AVResourceType = reader.ReadByte(); - jT808_0x9205.StreamType = reader.ReadByte(); - jT808_0x9205.MemoryType = reader.ReadByte(); - return jT808_0x9205; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9205 value, IJT808Config config) - { - writer.WriteByte(value.LogicChannelNo); - writer.WriteDateTime6(value.BeginTime); - writer.WriteDateTime6(value.EndTime); - writer.WriteUInt32(value.AlarmFlag); - writer.WriteByte(value.AVResourceType); - writer.WriteByte(value.StreamType); - writer.WriteByte(value.MemoryType); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9206_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9206_Formatter.cs deleted file mode 100644 index 9859aa4..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9206_Formatter.cs +++ /dev/null @@ -1,61 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9206_Formatter : IJT808MessagePackFormatter<JT808_0x9206> - { - public JT808_0x9206 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9206 jT808_0x9206 = new JT808_0x9206(); - jT808_0x9206.ServerIpLength = reader.ReadByte(); - jT808_0x9206.ServerIp = reader.ReadString(jT808_0x9206.ServerIpLength); - jT808_0x9206.Port = reader.ReadUInt16(); - jT808_0x9206.UserNameLength = reader.ReadByte(); - jT808_0x9206.UserName = reader.ReadString(jT808_0x9206.UserNameLength); - jT808_0x9206.PasswordLength = reader.ReadByte(); - jT808_0x9206.Password = reader.ReadString(jT808_0x9206.PasswordLength); - jT808_0x9206.FileUploadPathLength = reader.ReadByte(); - jT808_0x9206.FileUploadPath = reader.ReadString(jT808_0x9206.FileUploadPathLength); - jT808_0x9206.LogicChannelNo = reader.ReadByte(); - jT808_0x9206.BeginTime = reader.ReadDateTime6(); - jT808_0x9206.EndTime = reader.ReadDateTime6(); - jT808_0x9206.AlarmFlag = reader.ReadUInt32(); - jT808_0x9206.AVResourceType = reader.ReadByte(); - jT808_0x9206.StreamType = reader.ReadByte(); - jT808_0x9206.MemoryPositon = reader.ReadByte(); - jT808_0x9206.TaskExcuteCondition = reader.ReadByte(); - return jT808_0x9206; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9206 value, IJT808Config config) - { - writer.Skip(1, out int serverIpLengthposition); - writer.WriteString(value.ServerIp); - writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - serverIpLengthposition - 1), serverIpLengthposition); - writer.WriteUInt16(value.Port); - writer.Skip(1, out int userNameLengthposition); - writer.WriteString(value.UserName); - writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - userNameLengthposition - 1), userNameLengthposition); - writer.Skip(1, out int passwordLengthLengthposition); - writer.WriteString(value.Password); - writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - passwordLengthLengthposition - 1), passwordLengthLengthposition); - writer.Skip(1, out int fileUploadPathLengthLengthposition); - writer.WriteString(value.FileUploadPath); - writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - fileUploadPathLengthLengthposition - 1), fileUploadPathLengthLengthposition); - writer.WriteByte(value.LogicChannelNo); - writer.WriteDateTime6(value.BeginTime); - writer.WriteDateTime6(value.EndTime); - writer.WriteUInt32(value.AlarmFlag); - writer.WriteByte(value.AVResourceType); - writer.WriteByte(value.StreamType); - writer.WriteByte(value.MemoryPositon); - writer.WriteByte(value.TaskExcuteCondition); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9207_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9207_Formatter.cs deleted file mode 100644 index de43bea..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9207_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9207_Formatter : IJT808MessagePackFormatter<JT808_0x9207> - { - public JT808_0x9207 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9207 jT808_0x9207 = new JT808_0x9207(); - jT808_0x9207.MgsNum = reader.ReadUInt16(); - jT808_0x9207.UploadControl = reader.ReadByte(); - return jT808_0x9207; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9207 value, IJT808Config config) - { - writer.WriteUInt16(value.MgsNum); - writer.WriteByte(value.UploadControl); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9301_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9301_Formatter.cs deleted file mode 100644 index 9a68ce3..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9301_Formatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9301_Formatter : IJT808MessagePackFormatter<JT808_0x9301> - { - public JT808_0x9301 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9301 jT808_0x9301 = new JT808_0x9301(); - jT808_0x9301.LogicChannelNo = reader.ReadByte(); - jT808_0x9301.Direction = reader.ReadByte(); - jT808_0x9301.Speed = reader.ReadByte(); - return jT808_0x9301; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9301 value, IJT808Config config) - { - writer.WriteByte(value.LogicChannelNo); - writer.WriteByte(value.Direction); - writer.WriteByte(value.Speed); - } - } -} diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9302_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9302_Formatter.cs deleted file mode 100644 index 3fc1c3d..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9302_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9302_Formatter : IJT808MessagePackFormatter<JT808_0x9302> - { - public JT808_0x9302 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9302 jT808_0x9302 = new JT808_0x9302(); - jT808_0x9302.LogicChannelNo = reader.ReadByte(); - jT808_0x9302.FocusAdjustmentDirection = reader.ReadByte(); - return jT808_0x9302; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9302 value, IJT808Config config) - { - writer.WriteByte(value.LogicChannelNo); - writer.WriteByte(value.FocusAdjustmentDirection); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9303_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9303_Formatter.cs deleted file mode 100644 index 40b5062..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9303_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9303_Formatter : IJT808MessagePackFormatter<JT808_0x9303> - { - public JT808_0x9303 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9303 jT808_0x9303 = new JT808_0x9303(); - jT808_0x9303.LogicChannelNo = reader.ReadByte(); - jT808_0x9303.IrisAdjustment = reader.ReadByte(); - return jT808_0x9303; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9303 value, IJT808Config config) - { - writer.WriteByte(value.LogicChannelNo); - writer.WriteByte(value.IrisAdjustment); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9304_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9304_Formatter.cs deleted file mode 100644 index 95af20d..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9304_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9304_Formatter : IJT808MessagePackFormatter<JT808_0x9304> - { - public JT808_0x9304 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9304 jT808_0x9304 = new JT808_0x9304(); - jT808_0x9304.LogicChannelNo = reader.ReadByte(); - jT808_0x9304.StartOrStop = reader.ReadByte(); - return jT808_0x9304; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9304 value, IJT808Config config) - { - writer.WriteByte(value.LogicChannelNo); - writer.WriteByte(value.StartOrStop); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9305_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9305_Formatter.cs deleted file mode 100644 index 0786b17..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9305_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9305_Formatter : IJT808MessagePackFormatter<JT808_0x9305> - { - public JT808_0x9305 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9305 jT808_0x9305 = new JT808_0x9305(); - jT808_0x9305.LogicChannelNo = reader.ReadByte(); - jT808_0x9305.StartOrStop = reader.ReadByte(); - return jT808_0x9305; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9305 value, IJT808Config config) - { - writer.WriteByte(value.LogicChannelNo); - writer.WriteByte(value.StartOrStop); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9306_Formatter.cs b/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9306_Formatter.cs deleted file mode 100644 index 7eb674c..0000000 --- a/src/JT808.Protocol.Extensions.JT1078/Formatters/JT808_0x9306_Formatter.cs +++ /dev/null @@ -1,27 +0,0 @@ -using JT808.Protocol.Extensions.JT1078.MessageBody; -using JT808.Protocol.Formatters; -using JT808.Protocol.Interfaces; -using JT808.Protocol.MessagePack; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JT808.Protocol.Extensions.JT1078.Formatters -{ - public class JT808_0x9306_Formatter : IJT808MessagePackFormatter<JT808_0x9306> - { - public JT808_0x9306 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) - { - JT808_0x9306 jT808_0x9306 = new JT808_0x9306(); - jT808_0x9306.LogicChannelNo = reader.ReadByte(); - jT808_0x9306.ChangeMultipleControl = reader.ReadByte(); - return jT808_0x9306; - } - - public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9306 value, IJT808Config config) - { - writer.WriteByte(value.LogicChannelNo); - writer.WriteByte(value.ChangeMultipleControl); - } - } -} \ No newline at end of file diff --git a/src/JT808.Protocol.Extensions.JT1078/JT808.Protocol.Extensions.JT1078.csproj b/src/JT808.Protocol.Extensions.JT1078/JT808.Protocol.Extensions.JT1078.csproj index b7cb34e..ec47c67 100644 --- a/src/JT808.Protocol.Extensions.JT1078/JT808.Protocol.Extensions.JT1078.csproj +++ b/src/JT808.Protocol.Extensions.JT1078/JT808.Protocol.Extensions.JT1078.csproj @@ -15,7 +15,7 @@ <licenseUrl>https://github.com/SmallChi/JT1078/blob/master/LICENSE</licenseUrl> <license>https://github.com/SmallChi/JT1078/blob/master/LICENSE</license> <GeneratePackageOnBuild>false</GeneratePackageOnBuild> - <Version>2.1.7</Version> + <Version>2.2.0-preview1</Version> <PackageLicenseFile>LICENSE</PackageLicenseFile> </PropertyGroup> @@ -28,7 +28,7 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="JT808" Version="2.1.7" /> + <PackageReference Include="JT808" Version="2.2.0-preview2" /> </ItemGroup> <ItemGroup> diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x14.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x14.cs index 8d19913..53e7179 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x14.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x14.cs @@ -1,6 +1,6 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; namespace JT808.Protocol.Extensions.JT1078.MessageBody { @@ -8,8 +8,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 视频相关报警 /// 0x0200_0x14 /// </summary> - [JT808Formatter(typeof(JT808_0x0200_0x14_Formatter))] - public class JT808_0x0200_0x14 : JT808_0x0200_BodyBase + public class JT808_0x0200_0x14 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter<JT808_0x0200_0x14> { public override byte AttachInfoId { get; set; } = 0x14; /// <summary> @@ -20,5 +19,21 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 视频相关报警 /// </summary> public uint VideoRelateAlarm { get; set; } + + public JT808_0x0200_0x14 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x0200_0x14 jT808_0x0200_0x14 = new JT808_0x0200_0x14(); + jT808_0x0200_0x14.AttachInfoId = reader.ReadByte(); + jT808_0x0200_0x14.AttachInfoLength = reader.ReadByte(); + jT808_0x0200_0x14.VideoRelateAlarm = reader.ReadUInt32(); + return jT808_0x0200_0x14; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x14 value, IJT808Config config) + { + writer.WriteByte(value.AttachInfoId); + writer.WriteByte(value.AttachInfoLength); + writer.WriteUInt32(value.VideoRelateAlarm); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x15.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x15.cs index a193972..8283e3d 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x15.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x15.cs @@ -1,6 +1,6 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; namespace JT808.Protocol.Extensions.JT1078.MessageBody { @@ -8,8 +8,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 视频信号丢失报警状态 /// 0x0200_0x15 /// </summary> - [JT808Formatter(typeof(JT808_0x0200_0x15_Formatter))] - public class JT808_0x0200_0x15 : JT808_0x0200_BodyBase + public class JT808_0x0200_0x15 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter<JT808_0x0200_0x15> { public override byte AttachInfoId { get; set; } = 0x15; /// <summary> @@ -20,5 +19,21 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 视频信号丢失报警状态 /// </summary> public uint VideoSignalLoseAlarmStatus { get; set; } + + public JT808_0x0200_0x15 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x0200_0x15 jT808_0x0200_0x15 = new JT808_0x0200_0x15(); + jT808_0x0200_0x15.AttachInfoId = reader.ReadByte(); + jT808_0x0200_0x15.AttachInfoLength = reader.ReadByte(); + jT808_0x0200_0x15.VideoSignalLoseAlarmStatus = reader.ReadUInt32(); + return jT808_0x0200_0x15; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x15 value, IJT808Config config) + { + writer.WriteByte(value.AttachInfoId); + writer.WriteByte(value.AttachInfoLength); + writer.WriteUInt32(value.VideoSignalLoseAlarmStatus); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x16.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x16.cs index af7f542..036d968 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x16.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x16.cs @@ -1,6 +1,6 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; namespace JT808.Protocol.Extensions.JT1078.MessageBody { @@ -8,8 +8,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 视频信号遮挡报警状态 /// 0x0200_0x16 /// </summary> - [JT808Formatter(typeof(JT808_0x0200_0x16_Formatter))] - public class JT808_0x0200_0x16 : JT808_0x0200_BodyBase + public class JT808_0x0200_0x16 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter<JT808_0x0200_0x16> { public override byte AttachInfoId { get; set; } = 0x16; /// <summary> @@ -20,5 +19,21 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 视频信号遮挡报警状态 /// </summary> public uint VideoSignalOcclusionAlarmStatus { get; set; } + + public JT808_0x0200_0x16 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x0200_0x16 jT808_0x0200_0x16 = new JT808_0x0200_0x16(); + jT808_0x0200_0x16.AttachInfoId = reader.ReadByte(); + jT808_0x0200_0x16.AttachInfoLength = reader.ReadByte(); + jT808_0x0200_0x16.VideoSignalOcclusionAlarmStatus = reader.ReadUInt32(); + return jT808_0x0200_0x16; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x16 value, IJT808Config config) + { + writer.WriteByte(value.AttachInfoId); + writer.WriteByte(value.AttachInfoLength); + writer.WriteUInt32(value.VideoSignalOcclusionAlarmStatus); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x17.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x17.cs index 374cfc7..0890082 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x17.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x17.cs @@ -1,6 +1,6 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; namespace JT808.Protocol.Extensions.JT1078.MessageBody { @@ -8,8 +8,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 存储器故障报警状态 /// 0x0200_0x17 /// </summary> - [JT808Formatter(typeof(JT808_0x0200_0x17_Formatter))] - public class JT808_0x0200_0x17 : JT808_0x0200_BodyBase + public class JT808_0x0200_0x17 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter<JT808_0x0200_0x17> { public override byte AttachInfoId { get; set; } = 0x17; /// <summary> @@ -20,5 +19,21 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 存储器故障报警状态 /// </summary> public ushort StorageFaultAlarmStatus{ get; set; } + + public JT808_0x0200_0x17 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x0200_0x17 jT808_0x0200_0x17 = new JT808_0x0200_0x17(); + jT808_0x0200_0x17.AttachInfoId = reader.ReadByte(); + jT808_0x0200_0x17.AttachInfoLength = reader.ReadByte(); + jT808_0x0200_0x17.StorageFaultAlarmStatus = reader.ReadUInt16(); + return jT808_0x0200_0x17; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x17 value, IJT808Config config) + { + writer.WriteByte(value.AttachInfoId); + writer.WriteByte(value.AttachInfoLength); + writer.WriteUInt16(value.StorageFaultAlarmStatus); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x18.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x18.cs index 111cc4f..80bc2f6 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x18.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x0200_0x18.cs @@ -1,6 +1,6 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; namespace JT808.Protocol.Extensions.JT1078.MessageBody { @@ -8,8 +8,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 异常驾驶行为报警详细描述 /// 0x0200_0x18 /// </summary> - [JT808Formatter(typeof(JT808_0x0200_0x18_Formatter))] - public class JT808_0x0200_0x18 : JT808_0x0200_BodyBase + public class JT808_0x0200_0x18 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter<JT808_0x0200_0x18> { public override byte AttachInfoId { get; set; } = 0x18; /// <summary> @@ -20,5 +19,20 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 异常驾驶行为报警详细描述 /// </summary> public ushort AbnormalDrivingBehaviorAlarmInfo { get; set; } + public JT808_0x0200_0x18 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x0200_0x18 jT808_0x0200_0x18 = new JT808_0x0200_0x18(); + jT808_0x0200_0x18.AttachInfoId = reader.ReadByte(); + jT808_0x0200_0x18.AttachInfoLength = reader.ReadByte(); + jT808_0x0200_0x18.AbnormalDrivingBehaviorAlarmInfo = reader.ReadUInt16(); + return jT808_0x0200_0x18; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x18 value, IJT808Config config) + { + writer.WriteByte(value.AttachInfoId); + writer.WriteByte(value.AttachInfoLength); + writer.WriteUInt16(value.AbnormalDrivingBehaviorAlarmInfo); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1003.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1003.cs index 6179d83..01adef8 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1003.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1003.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 终端上传音视频属性 /// </summary> - [JT808Formatter(typeof(JT808_0x1003_Formatter))] - public class JT808_0x1003 : JT808Bodies + public class JT808_0x1003 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x1003> { /// <summary> /// 输入音频编码方式 @@ -48,5 +47,35 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 终端支持的最大视频物理通道数量 /// </summary> public byte TerminalSupportedMaxNumberOfVideoPhysicalChannels { get; set; } + + public override ushort MsgId => 0x1003; + + public JT808_0x1003 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x1003 jT808_0x1003 = new JT808_0x1003(); + jT808_0x1003.EnterAudioEncoding = reader.ReadByte(); + jT808_0x1003.EnterAudioChannelsNumber = reader.ReadByte(); + jT808_0x1003.EnterAudioSampleRate = reader.ReadByte(); + jT808_0x1003.EnterAudioSampleDigits = reader.ReadByte(); + jT808_0x1003.AudioFrameLength = reader.ReadUInt16(); + jT808_0x1003.IsSupportedAudioOutput = reader.ReadByte(); + jT808_0x1003.VideoEncoding = reader.ReadByte(); + jT808_0x1003.TerminalSupportedMaxNumberOfAudioPhysicalChannels = reader.ReadByte(); + jT808_0x1003.TerminalSupportedMaxNumberOfVideoPhysicalChannels = reader.ReadByte(); + return jT808_0x1003; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1003 value, IJT808Config config) + { + writer.WriteByte(value.EnterAudioEncoding); + writer.WriteByte(value.EnterAudioChannelsNumber); + writer.WriteByte(value.EnterAudioSampleRate); + writer.WriteByte(value.EnterAudioSampleDigits); + writer.WriteUInt16(value.AudioFrameLength); + writer.WriteByte(value.IsSupportedAudioOutput); + writer.WriteByte(value.VideoEncoding); + writer.WriteByte(value.TerminalSupportedMaxNumberOfAudioPhysicalChannels); + writer.WriteByte(value.TerminalSupportedMaxNumberOfVideoPhysicalChannels); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1005.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1005.cs index c76712e..5e97c45 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1005.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1005.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 终端上传乘客流量 /// </summary> - [JT808Formatter(typeof(JT808_0x1005_Formatter))] - public class JT808_0x1005 : JT808Bodies + public class JT808_0x1005 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x1005> { + public override ushort MsgId => 0x1005; /// <summary> /// 起始时间 /// </summary> @@ -28,5 +28,23 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 下车人数 /// </summary> public ushort GettingOffNumber { get; set; } + + public JT808_0x1005 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x1005 jT808_0x1005 = new JT808_0x1005(); + jT808_0x1005.BeginTime = reader.ReadDateTime6(); + jT808_0x1005.EndTime = reader.ReadDateTime6(); + jT808_0x1005.GettingOnNumber = reader.ReadUInt16(); + jT808_0x1005.GettingOffNumber = reader.ReadUInt16(); + return jT808_0x1005; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1005 value, IJT808Config config) + { + writer.WriteDateTime6(value.BeginTime); + writer.WriteDateTime6(value.EndTime); + writer.WriteUInt16(value.GettingOnNumber); + writer.WriteUInt16(value.GettingOffNumber); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1205.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1205.cs index 0b52577..70ef1ba 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1205.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1205.cs @@ -1,7 +1,8 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; +using System.Linq; using System.Text; namespace JT808.Protocol.Extensions.JT1078.MessageBody @@ -9,9 +10,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 终端上传音视频资源列表 /// </summary> - [JT808Formatter(typeof(JT808_0x1205_Formatter))] - public class JT808_0x1205 : JT808Bodies + public class JT808_0x1205 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x1205> { + public override ushort MsgId => 0x1205; /// <summary> /// 流水号 /// </summary> @@ -24,5 +25,37 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 音视频资源列表 /// </summary> public List<JT808_0x1205_AVResouce> AVResouces { get; set; } + + public JT808_0x1205 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x1205 jT808_0x1205 = new JT808_0x1205(); + jT808_0x1205.MsgNum = reader.ReadUInt16(); + jT808_0x1205.AVResouceTotal = reader.ReadUInt32(); + var channelTotal = jT808_0x1205.AVResouceTotal;//音视频资源总数 + if (channelTotal > 0) + { + jT808_0x1205.AVResouces = new List<JT808_0x1205_AVResouce>(); + var formatter = config.GetMessagePackFormatter<JT808_0x1205_AVResouce>(); + for (int i = 0; i < channelTotal; i++) + { + jT808_0x1205.AVResouces.Add(formatter.Deserialize(ref reader, config)); + } + } + return jT808_0x1205; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1205 value, IJT808Config config) + { + writer.WriteUInt16(value.MsgNum); + writer.WriteUInt32(value.AVResouceTotal); + if (value.AVResouces.Any()) + { + var formatter = config.GetMessagePackFormatter<JT808_0x1205_AVResouce>(); + foreach (var AVResouce in value.AVResouces) + { + formatter.Serialize(ref writer, AVResouce, config); + } + } + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1205_AVResouce.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1205_AVResouce.cs index 8abcb01..a600899 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1205_AVResouce.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1205_AVResouce.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 终端上传音视频资源列表 /// </summary> - [JT808Formatter(typeof(JT808_0x1205_AVResouce_Formatter))] - public class JT808_0x1205_AVResouce + public class JT808_0x1205_AVResouce:IJT808MessagePackFormatter<JT808_0x1205_AVResouce> { /// <summary> /// 逻辑通道号 @@ -44,5 +43,31 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 文件大小 /// </summary> public uint FileSize { get; set; } + + public JT808_0x1205_AVResouce Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x1205_AVResouce jT808_0x1205_AVResouce = new JT808_0x1205_AVResouce(); + jT808_0x1205_AVResouce.LogicChannelNo = reader.ReadByte(); + jT808_0x1205_AVResouce.BeginTime = reader.ReadDateTime6(); + jT808_0x1205_AVResouce.EndTime = reader.ReadDateTime6(); + jT808_0x1205_AVResouce.AlarmFlag = reader.ReadUInt32(); + jT808_0x1205_AVResouce.AVResourceType = reader.ReadByte(); + jT808_0x1205_AVResouce.StreamType = reader.ReadByte(); + jT808_0x1205_AVResouce.MemoryType = reader.ReadByte(); + jT808_0x1205_AVResouce.FileSize = reader.ReadUInt32(); + return jT808_0x1205_AVResouce; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1205_AVResouce value, IJT808Config config) + { + writer.WriteByte(value.LogicChannelNo); + writer.WriteDateTime6(value.BeginTime); + writer.WriteDateTime6(value.EndTime); + writer.WriteUInt32(value.AlarmFlag); + writer.WriteByte(value.AVResourceType); + writer.WriteByte(value.StreamType); + writer.WriteByte(value.MemoryType); + writer.WriteUInt32(value.FileSize); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1206.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1206.cs index b8f603a..5011b1b 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1206.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x1206.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 文件上传完成通知 /// </summary> - [JT808Formatter(typeof(JT808_0x1206_Formatter))] - public class JT808_0x1206 : JT808Bodies + public class JT808_0x1206 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x1206> { + public override ushort MsgId => 0x1206; /// <summary> /// 流水号 /// </summary> @@ -20,5 +20,18 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 结果 /// </summary> public byte Result{ get; set; } + public JT808_0x1206 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x1206 jT808_0x1206 = new JT808_0x1206(); + jT808_0x1206.MsgNum = reader.ReadUInt16(); + jT808_0x1206.Result = reader.ReadByte(); + return jT808_0x1206; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1206 value, IJT808Config config) + { + writer.WriteUInt16(value.MsgNum); + writer.WriteByte(value.Result); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0075.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0075.cs index d4a16b3..6f85381 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0075.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0075.cs @@ -1,6 +1,6 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; namespace JT808.Protocol.Extensions.JT1078.MessageBody { @@ -8,8 +8,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 音视频参数设置 /// 0x8103_0x0075 /// </summary> - [JT808Formatter(typeof(JT808_0x8103_0x0075_Formatter))] - public class JT808_0x8103_0x0075 : JT808_0x8103_BodyBase + public class JT808_0x8103_0x0075 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0075> { public override uint ParamId { get; set; } = 0x0075; /// <summary> @@ -70,5 +69,43 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody ///1:启用 /// </summary> public byte AudioOutputEnabled { get; set; } + + public JT808_0x8103_0x0075 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0x0075 jT808_0X8103_0X0075 = new JT808_0x8103_0x0075(); + jT808_0X8103_0X0075.ParamId = reader.ReadUInt32(); + jT808_0X8103_0X0075.ParamLength = reader.ReadByte(); + jT808_0X8103_0X0075.RTS_EncodeMode = reader.ReadByte(); + jT808_0X8103_0X0075.RTS_Resolution = reader.ReadByte(); + jT808_0X8103_0X0075.RTS_KF_Interval = reader.ReadUInt16(); + jT808_0X8103_0X0075.RTS_Target_FPS = reader.ReadByte(); + jT808_0X8103_0X0075.RTS_Target_CodeRate = reader.ReadUInt32(); + jT808_0X8103_0X0075.StreamStore_EncodeMode = reader.ReadByte(); + jT808_0X8103_0X0075.StreamStore_Resolution = reader.ReadByte(); + jT808_0X8103_0X0075.StreamStore_KF_Interval = reader.ReadUInt16(); + jT808_0X8103_0X0075.StreamStore_Target_FPS = reader.ReadByte(); + jT808_0X8103_0X0075.StreamStore_Target_CodeRate = reader.ReadUInt32(); + jT808_0X8103_0X0075.OSD = reader.ReadUInt16(); + jT808_0X8103_0X0075.AudioOutputEnabled = reader.ReadByte(); + return jT808_0X8103_0X0075; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0075 value, IJT808Config config) + { + writer.WriteUInt32(value.ParamId); + writer.WriteByte(value.ParamLength); + writer.WriteByte(value.RTS_EncodeMode); + writer.WriteByte(value.RTS_Resolution); + writer.WriteUInt16(value.RTS_KF_Interval); + writer.WriteByte(value.RTS_Target_FPS); + writer.WriteUInt32(value.RTS_Target_CodeRate); + writer.WriteByte(value.StreamStore_EncodeMode); + writer.WriteByte(value.StreamStore_Resolution); + writer.WriteUInt16(value.StreamStore_KF_Interval); + writer.WriteByte(value.StreamStore_Target_FPS); + writer.WriteUInt32(value.StreamStore_Target_CodeRate); + writer.WriteUInt16(value.OSD); + writer.WriteByte(value.AudioOutputEnabled); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0076.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0076.cs index a05b74a..2c75697 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0076.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0076.cs @@ -1,17 +1,16 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; using System.Collections.Generic; +using System.Linq; namespace JT808.Protocol.Extensions.JT1078.MessageBody { -#warning todo:继承非自定义类的时候,没有添加到相应的字典中 /// <summary> /// 音视频通道列表设置 /// 0x8103_0x0076 /// </summary> - [JT808Formatter(typeof(JT808_0x8103_0x0076_Formatter))] - public class JT808_0x8103_0x0076 : JT808_0x8103_BodyBase + public class JT808_0x8103_0x0076 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0076> { public override uint ParamId { get; set; } = 0x0076; /// <summary> @@ -38,5 +37,44 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 4*(l+m+n) /// </summary> public List<JT808_0x8103_0x0076_AVChannelRefTable> AVChannelRefTables { get; set; } + + public JT808_0x8103_0x0076 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0x0076 jT808_0X8103_0X0076 = new JT808_0x8103_0x0076(); + jT808_0X8103_0X0076.ParamId = reader.ReadUInt32(); + jT808_0X8103_0X0076.ParamLength = reader.ReadByte(); + jT808_0X8103_0X0076.AVChannelTotal = reader.ReadByte(); + jT808_0X8103_0X0076.AudioChannelTotal = reader.ReadByte(); + jT808_0X8103_0X0076.VudioChannelTotal = reader.ReadByte(); + var channelTotal = jT808_0X8103_0X0076.AVChannelTotal + jT808_0X8103_0X0076.AudioChannelTotal + jT808_0X8103_0X0076.VudioChannelTotal;//通道总数 + if (channelTotal > 0) + { + jT808_0X8103_0X0076.AVChannelRefTables = new List<JT808_0x8103_0x0076_AVChannelRefTable>(); + var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0076_AVChannelRefTable>(); + for (int i = 0; i < channelTotal; i++) + { + jT808_0X8103_0X0076.AVChannelRefTables.Add(formatter.Deserialize(ref reader, config)); + } + } + return jT808_0X8103_0X0076; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0076 value, IJT808Config config) + { + writer.WriteUInt32(value.ParamId); + writer.Skip(1, out int position); + writer.WriteByte(value.AVChannelTotal); + writer.WriteByte(value.AudioChannelTotal); + writer.WriteByte(value.VudioChannelTotal); + if (value.AVChannelRefTables.Any()) + { + var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0076_AVChannelRefTable>(); + foreach (var AVChannelRefTable in value.AVChannelRefTables) + { + formatter.Serialize(ref writer, AVChannelRefTable, config); + } + } + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0076_AVChannelRefTable.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0076_AVChannelRefTable.cs index dd0c5a6..da630a8 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0076_AVChannelRefTable.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0076_AVChannelRefTable.cs @@ -1,6 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; -using JT808.Protocol.MessageBody; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; namespace JT808.Protocol.Extensions.JT1078.MessageBody { @@ -8,8 +7,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 音视频通道列表设置 /// 0x8103_0x0076_AVChannelRefTable /// </summary> - [JT808Formatter(typeof(JT808_0x8103_0x0076_AVChannelRefTable_Formatter))] - public class JT808_0x8103_0x0076_AVChannelRefTable + public class JT808_0x8103_0x0076_AVChannelRefTable: IJT808MessagePackFormatter<JT808_0x8103_0x0076_AVChannelRefTable> { /// <summary> /// 物理通道号 @@ -27,5 +25,22 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 是否链接云台 /// </summary> public byte IsConnectCloudPlat { get; set; } + public JT808_0x8103_0x0076_AVChannelRefTable Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0x0076_AVChannelRefTable jT808_0X8103_0X0076_AVChannelRefTable = new JT808_0x8103_0x0076_AVChannelRefTable(); + jT808_0X8103_0X0076_AVChannelRefTable.PhysicalChannelNo = reader.ReadByte(); + jT808_0X8103_0X0076_AVChannelRefTable.LogicChannelNo = reader.ReadByte(); + jT808_0X8103_0X0076_AVChannelRefTable.ChannelType = reader.ReadByte(); + jT808_0X8103_0X0076_AVChannelRefTable.IsConnectCloudPlat = reader.ReadByte(); + return jT808_0X8103_0X0076_AVChannelRefTable; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0076_AVChannelRefTable value, IJT808Config config) + { + writer.WriteByte(value.PhysicalChannelNo); + writer.WriteByte(value.LogicChannelNo); + writer.WriteByte(value.ChannelType); + writer.WriteByte(value.IsConnectCloudPlat); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0077.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0077.cs index cc1b21b..a557dc3 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0077.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0077.cs @@ -1,7 +1,8 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; using System.Collections.Generic; +using System.Linq; namespace JT808.Protocol.Extensions.JT1078.MessageBody { @@ -9,8 +10,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody ///单独视频通道参数设置 /// 0x8103_0x0077 /// </summary> - [JT808Formatter(typeof(JT808_0x8103_0x0077_Formatter))] - public class JT808_0x8103_0x0077 : JT808_0x8103_BodyBase + public class JT808_0x8103_0x0077 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0077> { public override uint ParamId { get; set; } = 0x0077; /// <summary> @@ -23,5 +23,39 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody public byte NeedSetChannelTotal { get; set; } public List<JT808_0x8103_0x0077_SignalChannel> SignalChannels { get; set; } + + public JT808_0x8103_0x0077 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0x0077 jT808_0X8103_0X0077 = new JT808_0x8103_0x0077(); + jT808_0X8103_0X0077.ParamId = reader.ReadUInt32(); + jT808_0X8103_0X0077.ParamLength = reader.ReadByte(); + jT808_0X8103_0X0077.NeedSetChannelTotal = reader.ReadByte(); + if (jT808_0X8103_0X0077.NeedSetChannelTotal > 0) + { + jT808_0X8103_0X0077.SignalChannels = new List<JT808_0x8103_0x0077_SignalChannel>(); + var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0077_SignalChannel>(); + for (int i = 0; i < jT808_0X8103_0X0077.NeedSetChannelTotal; i++) + { + jT808_0X8103_0X0077.SignalChannels.Add(formatter.Deserialize(ref reader, config)); + } + } + return jT808_0X8103_0X0077; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0077 value, IJT808Config config) + { + writer.WriteUInt32(value.ParamId); + writer.Skip(1, out var position); + writer.WriteByte(value.NeedSetChannelTotal); + if (value.SignalChannels.Any()) + { + var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0077_SignalChannel>(); + foreach (var signalChannel in value.SignalChannels) + { + formatter.Serialize(ref writer, signalChannel, config); + } + } + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0077_SignalChannel.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0077_SignalChannel.cs index 754e824..5ded134 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0077_SignalChannel.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0077_SignalChannel.cs @@ -1,13 +1,12 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; namespace JT808.Protocol.Extensions.JT1078.MessageBody { - [JT808Formatter(typeof(JT808_0x8103_0x0077_SignalChannel_Formatter))] - public class JT808_0x8103_0x0077_SignalChannel + public class JT808_0x8103_0x0077_SignalChannel: IJT808MessagePackFormatter<JT808_0x8103_0x0077_SignalChannel> { /// <summary> /// 逻辑通道号 @@ -61,5 +60,38 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody ///OSD字幕叠加设置 /// </summary> public ushort OSD { get; set; } + public JT808_0x8103_0x0077_SignalChannel Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0x0077_SignalChannel jT808_0X8103_0X0077_SignalChannel = new JT808_0x8103_0x0077_SignalChannel(); + jT808_0X8103_0X0077_SignalChannel.LogicChannelNo = reader.ReadByte(); + jT808_0X8103_0X0077_SignalChannel.RTS_EncodeMode = reader.ReadByte(); + jT808_0X8103_0X0077_SignalChannel.RTS_Resolution = reader.ReadByte(); + jT808_0X8103_0X0077_SignalChannel.RTS_KF_Interval = reader.ReadUInt16(); + jT808_0X8103_0X0077_SignalChannel.RTS_Target_FPS = reader.ReadByte(); + jT808_0X8103_0X0077_SignalChannel.RTS_Target_CodeRate = reader.ReadUInt32(); + jT808_0X8103_0X0077_SignalChannel.StreamStore_EncodeMode = reader.ReadByte(); + jT808_0X8103_0X0077_SignalChannel.StreamStore_Resolution = reader.ReadByte(); + jT808_0X8103_0X0077_SignalChannel.StreamStore_KF_Interval = reader.ReadUInt16(); + jT808_0X8103_0X0077_SignalChannel.StreamStore_Target_FPS = reader.ReadByte(); + jT808_0X8103_0X0077_SignalChannel.StreamStore_Target_CodeRate = reader.ReadUInt32(); + jT808_0X8103_0X0077_SignalChannel.OSD = reader.ReadUInt16(); + return jT808_0X8103_0X0077_SignalChannel; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0077_SignalChannel value, IJT808Config config) + { + writer.WriteByte(value.LogicChannelNo); + writer.WriteByte(value.RTS_EncodeMode); + writer.WriteByte(value.RTS_Resolution); + writer.WriteUInt16(value.RTS_KF_Interval); + writer.WriteByte(value.RTS_Target_FPS); + writer.WriteUInt32(value.RTS_Target_CodeRate); + writer.WriteByte(value.StreamStore_EncodeMode); + writer.WriteByte(value.StreamStore_Resolution); + writer.WriteUInt16(value.StreamStore_KF_Interval); + writer.WriteByte(value.StreamStore_Target_FPS); + writer.WriteUInt32(value.StreamStore_Target_CodeRate); + writer.WriteUInt16(value.OSD); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0079.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0079.cs index 0d68be1..2a9ea19 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0079.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x0079.cs @@ -1,6 +1,6 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; using System.Collections.Generic; namespace JT808.Protocol.Extensions.JT1078.MessageBody @@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 特殊报警录像参数设置 /// 0x8103_0x0079 /// </summary> - [JT808Formatter(typeof(JT808_0x8103_0x0079_Formatter))] - public class JT808_0x8103_0x0079 : JT808_0x8103_BodyBase + public class JT808_0x8103_0x0079 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0079> { public override uint ParamId { get; set; } = 0x0079; /// <summary> @@ -30,5 +29,25 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 分钟min /// </summary> public byte BeginMinute { get; set; } + + public JT808_0x8103_0x0079 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0x0079 jT808_0x8103_0x0079 = new JT808_0x8103_0x0079(); + jT808_0x8103_0x0079.ParamId = reader.ReadUInt32(); + jT808_0x8103_0x0079.ParamLength = reader.ReadByte(); + jT808_0x8103_0x0079.StorageThresholds = reader.ReadByte(); + jT808_0x8103_0x0079.Duration = reader.ReadByte(); + jT808_0x8103_0x0079.BeginMinute = reader.ReadByte(); + return jT808_0x8103_0x0079; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0079 value, IJT808Config config) + { + writer.WriteUInt32(value.ParamId); + writer.WriteByte(value.ParamLength); + writer.WriteByte(value.StorageThresholds); + writer.WriteByte(value.Duration); + writer.WriteByte(value.BeginMinute); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007A.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007A.cs index a911ca5..b9d0002 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007A.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007A.cs @@ -1,6 +1,6 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; using System.Collections.Generic; namespace JT808.Protocol.Extensions.JT1078.MessageBody @@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 视频相关报警屏蔽字 /// 0x8103_0x007A /// </summary> - [JT808Formatter(typeof(JT808_0x8103_0x007A_Formatter))] - public class JT808_0x8103_0x007A : JT808_0x8103_BodyBase + public class JT808_0x8103_0x007A : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x007A> { public override uint ParamId { get; set; } = 0x007A; /// <summary> @@ -21,5 +20,20 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 视频相关屏蔽报警字 /// </summary> public uint AlarmShielding { get; set; } + public JT808_0x8103_0x007A Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0x007A jT808_0x8103_0x007A = new JT808_0x8103_0x007A(); + jT808_0x8103_0x007A.ParamId = reader.ReadUInt32(); + jT808_0x8103_0x007A.ParamLength = reader.ReadByte(); + jT808_0x8103_0x007A.AlarmShielding = reader.ReadUInt32(); + return jT808_0x8103_0x007A; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007A value, IJT808Config config) + { + writer.WriteUInt32(value.ParamId); + writer.WriteByte(value.ParamLength); + writer.WriteUInt32(value.AlarmShielding); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007B.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007B.cs index 38d99f6..8c6bc0b 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007B.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007B.cs @@ -1,6 +1,6 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; using System.Collections.Generic; namespace JT808.Protocol.Extensions.JT1078.MessageBody @@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 图像分析报警参数设置 /// 0x8103_0x007B /// </summary> - [JT808Formatter(typeof(JT808_0x8103_0x007B_Formatter))] - public class JT808_0x8103_0x007B : JT808_0x8103_BodyBase + public class JT808_0x8103_0x007B : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x007B> { public override uint ParamId { get; set; } = 0x007B; /// <summary> @@ -25,5 +24,23 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 疲劳程度阈值 /// </summary> public byte FatigueThreshold { get; set; } + + public JT808_0x8103_0x007B Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0x007B jT808_0x8103_0x007B = new JT808_0x8103_0x007B(); + jT808_0x8103_0x007B.ParamId = reader.ReadUInt32(); + jT808_0x8103_0x007B.ParamLength = reader.ReadByte(); + jT808_0x8103_0x007B.NuclearLoadNumber = reader.ReadByte(); + jT808_0x8103_0x007B.FatigueThreshold = reader.ReadByte(); + return jT808_0x8103_0x007B; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007B value, IJT808Config config) + { + writer.WriteUInt32(value.ParamId); + writer.WriteByte(value.ParamLength); + writer.WriteByte(value.NuclearLoadNumber); + writer.WriteByte(value.FatigueThreshold); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007C.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007C.cs index e2b1214..b42aac5 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007C.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007C.cs @@ -1,6 +1,6 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; using System.Collections.Generic; namespace JT808.Protocol.Extensions.JT1078.MessageBody @@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody ///终端休眠模式唤醒设置 /// 0x8103_0x007C /// </summary> - [JT808Formatter(typeof(JT808_0x8103_0x007C_Formatter))] - public class JT808_0x8103_0x007C : JT808_0x8103_BodyBase + public class JT808_0x8103_0x007C : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x007C> { public override uint ParamId { get; set; } = 0x007C; /// <summary> @@ -33,5 +32,28 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 日定时唤醒参数列表 /// </summary> public JT808_0x8103_0x007C_TimerWakeDayParamter TimerWakeDayParamter { get; set; } + + public JT808_0x8103_0x007C Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0x007C jT808_0x8103_0x007C = new JT808_0x8103_0x007C(); + jT808_0x8103_0x007C.ParamId = reader.ReadUInt32(); + jT808_0x8103_0x007C.ParamLength = reader.ReadByte(); + jT808_0x8103_0x007C.SleepWakeMode = reader.ReadByte(); + jT808_0x8103_0x007C.WakeConditionType = reader.ReadByte(); + jT808_0x8103_0x007C.TimerWakeDaySet = reader.ReadByte(); + jT808_0x8103_0x007C.TimerWakeDayParamter = config.GetMessagePackFormatter<JT808_0x8103_0x007C_TimerWakeDayParamter>().Deserialize(ref reader, config); + return jT808_0x8103_0x007C; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007C value, IJT808Config config) + { + writer.WriteUInt32(value.ParamId); + writer.Skip(1, out var position); + writer.WriteByte(value.SleepWakeMode); + writer.WriteByte(value.WakeConditionType); + writer.WriteByte(value.TimerWakeDaySet); + config.GetMessagePackFormatter<JT808_0x8103_0x007C_TimerWakeDayParamter>().Serialize(ref writer, value.TimerWakeDayParamter, config); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007C_TimerWakeDayParamter.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007C_TimerWakeDayParamter.cs index 2737967..46f7129 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007C_TimerWakeDayParamter.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x8103_0x007C_TimerWakeDayParamter.cs @@ -1,6 +1,6 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; +using JT808.Protocol.MessagePack; using System.Collections.Generic; namespace JT808.Protocol.Extensions.JT1078.MessageBody @@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody ///终端休眠模式唤醒设置 /// 0x8103_0x007C /// </summary> - [JT808Formatter(typeof(JT808_0x8103_0x007C_TimerWakeDayParamter_Formatter))] - public class JT808_0x8103_0x007C_TimerWakeDayParamter + public class JT808_0x8103_0x007C_TimerWakeDayParamter:IJT808MessagePackFormatter<JT808_0x8103_0x007C_TimerWakeDayParamter> { /// <summary> /// 定时唤醒启用标志 @@ -56,5 +55,33 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 2 /// </summary> public string TimePeriod4CloseTime { get; set; } + + public JT808_0x8103_0x007C_TimerWakeDayParamter Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0x007C_TimerWakeDayParamter jT808_0x8103_0x007C_TimerWakeDayParamter = new JT808_0x8103_0x007C_TimerWakeDayParamter(); + jT808_0x8103_0x007C_TimerWakeDayParamter.TimerWakeEnableFlag = reader.ReadByte(); + jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod1WakeTime = reader.ReadBCD(4); + jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod1CloseTime = reader.ReadBCD(4); + jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod2WakeTime = reader.ReadBCD(4); + jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod2CloseTime = reader.ReadBCD(4); + jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod3WakeTime = reader.ReadBCD(4); + jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod3CloseTime = reader.ReadBCD(4); + jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod4WakeTime = reader.ReadBCD(4); + jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod4CloseTime = reader.ReadBCD(4); + return jT808_0x8103_0x007C_TimerWakeDayParamter; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007C_TimerWakeDayParamter value, IJT808Config config) + { + writer.WriteByte(value.TimerWakeEnableFlag); + writer.WriteBCD(value.TimePeriod1WakeTime, 4); + writer.WriteBCD(value.TimePeriod1CloseTime, 4); + writer.WriteBCD(value.TimePeriod2WakeTime, 4); + writer.WriteBCD(value.TimePeriod2CloseTime, 4); + writer.WriteBCD(value.TimePeriod3WakeTime, 4); + writer.WriteBCD(value.TimePeriod3CloseTime, 4); + writer.WriteBCD(value.TimePeriod4WakeTime, 4); + writer.WriteBCD(value.TimePeriod4CloseTime, 4); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9003.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9003.cs index 1947714..3cd0445 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9003.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9003.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; -using System; +using System; using System.Collections.Generic; using System.Text; @@ -11,6 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// </summary> public class JT808_0x9003:JT808Bodies { + public override ushort MsgId => 0x9003; public override bool SkipSerialization { get; set; } = true; } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9101.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9101.cs index e632360..dfee440 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9101.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9101.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 实时音视频传输请求 /// </summary> - [JT808Formatter(typeof(JT808_0x9101_Formatter))] - public class JT808_0x9101:JT808Bodies + public class JT808_0x9101:JT808Bodies, IJT808MessagePackFormatter<JT808_0x9101> { + public override ushort MsgId => 0x9101; /// <summary> /// 服务器IP地址长度 /// </summary> @@ -48,5 +48,30 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 1:子码流 /// </summary> public byte StreamType { get; set; } + + public JT808_0x9101 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9101 jT808_0X9101 = new JT808_0x9101(); + jT808_0X9101.ServerIPAddressLength = reader.ReadByte(); + jT808_0X9101.ServerIPAddress = reader.ReadString(jT808_0X9101.ServerIPAddressLength); + jT808_0X9101.ServerVideoChannelTcpPort = reader.ReadUInt16(); + jT808_0X9101.ServerVideoChannelUdpPort = reader.ReadUInt16(); + jT808_0X9101.LogicalChannelNo = reader.ReadByte(); + jT808_0X9101.DataType = reader.ReadByte(); + jT808_0X9101.StreamType = reader.ReadByte(); + return jT808_0X9101; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9101 value, IJT808Config config) + { + writer.Skip(1, out int position); + writer.WriteString(value.ServerIPAddress); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); + writer.WriteUInt16(value.ServerVideoChannelTcpPort); + writer.WriteUInt16(value.ServerVideoChannelUdpPort); + writer.WriteByte(value.LogicalChannelNo); + writer.WriteByte(value.DataType); + writer.WriteByte(value.StreamType); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9102.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9102.cs index 3d8718d..229d356 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9102.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9102.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 音视频实时传输控制 /// </summary> - [JT808Formatter(typeof(JT808_0x9102_Formatter))] - public class JT808_0x9102:JT808Bodies + public class JT808_0x9102:JT808Bodies, IJT808MessagePackFormatter<JT808_0x9102> { + public override ushort MsgId => 0x9102; /// <summary> /// 逻辑通道号 /// </summary> @@ -41,5 +41,23 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 1:子码流 /// </summary> public byte SwitchStreamType { get; set; } + + public JT808_0x9102 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9102 jT808_0X9102 = new JT808_0x9102(); + jT808_0X9102.LogicalChannelNo = reader.ReadByte(); + jT808_0X9102.ControlCmd = reader.ReadByte(); + jT808_0X9102.CloseAVData = reader.ReadByte(); + jT808_0X9102.SwitchStreamType = reader.ReadByte(); + return jT808_0X9102; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9102 value, IJT808Config config) + { + writer.WriteByte(value.LogicalChannelNo); + writer.WriteByte(value.ControlCmd); + writer.WriteByte(value.CloseAVData); + writer.WriteByte(value.SwitchStreamType); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9105.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9105.cs index fa14385..cc9436c 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9105.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9105.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 实时音视频传输状态通知 /// </summary> - [JT808Formatter(typeof(JT808_0x9105_Formatter))] - public class JT808_0x9105 : JT808Bodies + public class JT808_0x9105 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9105> { + public override ushort MsgId => 0x9105; /// <summary> /// 逻辑通道号 /// </summary> @@ -20,5 +20,19 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 丢包率 /// </summary> public byte DropRate { get; set; } + + public JT808_0x9105 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9105 jT808_0x9105 = new JT808_0x9105(); + jT808_0x9105.LogicChannelNo = reader.ReadByte(); + jT808_0x9105.DropRate = reader.ReadByte(); + return jT808_0x9105; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9105 value, IJT808Config config) + { + writer.WriteByte(value.LogicChannelNo); + writer.WriteByte(value.DropRate); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9201.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9201.cs index 1d48b02..e39cd18 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9201.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9201.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 平台下发远程录像回放请求 /// </summary> - [JT808Formatter(typeof(JT808_0x9201_Formatter))] - public class JT808_0x9201 : JT808Bodies + public class JT808_0x9201 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9201> { + public override ushort MsgId => 0x9201; /// <summary> /// 服务器IP地址服务 /// </summary> @@ -64,5 +64,42 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 结束时间 /// </summary> public DateTime EndTime { get; set; } + + public JT808_0x9201 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9201 jT808_0x9201 = new JT808_0x9201(); + jT808_0x9201.ServerIpLength = reader.ReadByte(); + jT808_0x9201.ServerIp = reader.ReadString(jT808_0x9201.ServerIpLength); + jT808_0x9201.TcpPort = reader.ReadUInt16(); + jT808_0x9201.UdpPort = reader.ReadUInt16(); + jT808_0x9201.LogicChannelNo = reader.ReadByte(); + jT808_0x9201.AVItemType = reader.ReadByte(); + jT808_0x9201.StreamType = reader.ReadByte(); + jT808_0x9201.MemType = reader.ReadByte(); + jT808_0x9201.PlayBackWay = reader.ReadByte(); + jT808_0x9201.FastForwardOrFastRewindMultiples1 = reader.ReadByte(); + jT808_0x9201.FastForwardOrFastRewindMultiples2 = reader.ReadByte(); + jT808_0x9201.BeginTime = reader.ReadDateTime6(); + jT808_0x9201.EndTime = reader.ReadDateTime6(); + return jT808_0x9201; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9201 value, IJT808Config config) + { + writer.Skip(1, out int position); + writer.WriteString(value.ServerIp); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position);//计算完字符串后,回写字符串长度 + writer.WriteUInt16(value.TcpPort); + writer.WriteUInt16(value.UdpPort); + writer.WriteByte(value.LogicChannelNo); + writer.WriteByte(value.AVItemType); + writer.WriteByte(value.StreamType); + writer.WriteByte(value.MemType); + writer.WriteByte(value.PlayBackWay); + writer.WriteByte(value.FastForwardOrFastRewindMultiples1); + writer.WriteByte(value.FastForwardOrFastRewindMultiples2); + writer.WriteDateTime6(value.BeginTime); + writer.WriteDateTime6(value.EndTime); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9202.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9202.cs index 40a3b60..a842792 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9202.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9202.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 平台下发远程录像回放控制 /// </summary> - [JT808Formatter(typeof(JT808_0x9202_Formatter))] - public class JT808_0x9202 : JT808Bodies + public class JT808_0x9202 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9202> { + public override ushort MsgId => 0x9202; /// <summary> /// 音视频通道号 /// </summary> @@ -28,5 +28,23 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 拖动回放位置 /// </summary> public DateTime DragPlaybackPosition { get; set; } + + public JT808_0x9202 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9202 jT808_0x9202 = new JT808_0x9202(); + jT808_0x9202.AVChannelNo = reader.ReadByte(); + jT808_0x9202.PlayBackControl = reader.ReadByte(); + jT808_0x9202.FastForwardOrFastRewindMultiples = reader.ReadByte(); + jT808_0x9202.DragPlaybackPosition = reader.ReadDateTime6(); + return jT808_0x9202; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9202 value, IJT808Config config) + { + writer.WriteByte(value.AVChannelNo); + writer.WriteByte(value.PlayBackControl); + writer.WriteByte(value.FastForwardOrFastRewindMultiples); + writer.WriteDateTime6(value.DragPlaybackPosition); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9205.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9205.cs index 6c241e9..8568539 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9205.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9205.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 查询资源列表 /// </summary> - [JT808Formatter(typeof(JT808_0x9205_Formatter))] - public class JT808_0x9205 : JT808Bodies + public class JT808_0x9205 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9205> { + public override ushort MsgId => 0x9205; /// <summary> /// 逻辑通道号 /// </summary> @@ -40,5 +40,29 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 存储器类型 /// </summary> public byte MemoryType { get; set; } + + public JT808_0x9205 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9205 jT808_0x9205 = new JT808_0x9205(); + jT808_0x9205.LogicChannelNo = reader.ReadByte(); + jT808_0x9205.BeginTime = reader.ReadDateTime6(); + jT808_0x9205.EndTime = reader.ReadDateTime6(); + jT808_0x9205.AlarmFlag = reader.ReadUInt32(); + jT808_0x9205.AVResourceType = reader.ReadByte(); + jT808_0x9205.StreamType = reader.ReadByte(); + jT808_0x9205.MemoryType = reader.ReadByte(); + return jT808_0x9205; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9205 value, IJT808Config config) + { + writer.WriteByte(value.LogicChannelNo); + writer.WriteDateTime6(value.BeginTime); + writer.WriteDateTime6(value.EndTime); + writer.WriteUInt32(value.AlarmFlag); + writer.WriteByte(value.AVResourceType); + writer.WriteByte(value.StreamType); + writer.WriteByte(value.MemoryType); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9206.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9206.cs index dc9092d..99de97d 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9206.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9206.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 文件上传指令 /// </summary> - [JT808Formatter(typeof(JT808_0x9206_Formatter))] - public class JT808_0x9206 : JT808Bodies + public class JT808_0x9206 : JT808Bodies,IJT808MessagePackFormatter<JT808_0x9206> { + public override ushort MsgId => 0x9206; /// <summary> /// 服务器IP地址服务 /// </summary> @@ -80,5 +80,53 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 任务执行条件 /// </summary> public byte TaskExcuteCondition { get; set; } + + public JT808_0x9206 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9206 jT808_0x9206 = new JT808_0x9206(); + jT808_0x9206.ServerIpLength = reader.ReadByte(); + jT808_0x9206.ServerIp = reader.ReadString(jT808_0x9206.ServerIpLength); + jT808_0x9206.Port = reader.ReadUInt16(); + jT808_0x9206.UserNameLength = reader.ReadByte(); + jT808_0x9206.UserName = reader.ReadString(jT808_0x9206.UserNameLength); + jT808_0x9206.PasswordLength = reader.ReadByte(); + jT808_0x9206.Password = reader.ReadString(jT808_0x9206.PasswordLength); + jT808_0x9206.FileUploadPathLength = reader.ReadByte(); + jT808_0x9206.FileUploadPath = reader.ReadString(jT808_0x9206.FileUploadPathLength); + jT808_0x9206.LogicChannelNo = reader.ReadByte(); + jT808_0x9206.BeginTime = reader.ReadDateTime6(); + jT808_0x9206.EndTime = reader.ReadDateTime6(); + jT808_0x9206.AlarmFlag = reader.ReadUInt32(); + jT808_0x9206.AVResourceType = reader.ReadByte(); + jT808_0x9206.StreamType = reader.ReadByte(); + jT808_0x9206.MemoryPositon = reader.ReadByte(); + jT808_0x9206.TaskExcuteCondition = reader.ReadByte(); + return jT808_0x9206; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9206 value, IJT808Config config) + { + writer.Skip(1, out int serverIpLengthposition); + writer.WriteString(value.ServerIp); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - serverIpLengthposition - 1), serverIpLengthposition); + writer.WriteUInt16(value.Port); + writer.Skip(1, out int userNameLengthposition); + writer.WriteString(value.UserName); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - userNameLengthposition - 1), userNameLengthposition); + writer.Skip(1, out int passwordLengthLengthposition); + writer.WriteString(value.Password); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - passwordLengthLengthposition - 1), passwordLengthLengthposition); + writer.Skip(1, out int fileUploadPathLengthLengthposition); + writer.WriteString(value.FileUploadPath); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - fileUploadPathLengthLengthposition - 1), fileUploadPathLengthLengthposition); + writer.WriteByte(value.LogicChannelNo); + writer.WriteDateTime6(value.BeginTime); + writer.WriteDateTime6(value.EndTime); + writer.WriteUInt32(value.AlarmFlag); + writer.WriteByte(value.AVResourceType); + writer.WriteByte(value.StreamType); + writer.WriteByte(value.MemoryPositon); + writer.WriteByte(value.TaskExcuteCondition); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9207.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9207.cs index ef51707..8debf5d 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9207.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9207.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 文件上传控制 /// </summary> - [JT808Formatter(typeof(JT808_0x9207_Formatter))] - public class JT808_0x9207 : JT808Bodies + public class JT808_0x9207 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9207> { + public override ushort MsgId => 0x9207; /// <summary> /// 流水号 /// </summary> @@ -20,5 +20,18 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 上传控制 /// </summary> public byte UploadControl { get; set; } + public JT808_0x9207 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9207 jT808_0x9207 = new JT808_0x9207(); + jT808_0x9207.MgsNum = reader.ReadUInt16(); + jT808_0x9207.UploadControl = reader.ReadByte(); + return jT808_0x9207; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9207 value, IJT808Config config) + { + writer.WriteUInt16(value.MgsNum); + writer.WriteByte(value.UploadControl); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9301.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9301.cs index 6ed163c..17ad26b 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9301.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9301.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,10 +9,10 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 云台旋转 /// </summary> - [JT808Formatter(typeof(JT808_0x9301_Formatter))] - public class JT808_0x9301 : JT808Bodies + public class JT808_0x9301 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9301> { - /// <summary> + public override ushort MsgId => 0x9301; + /// <summary> /// 逻辑通道号 /// </summary> public byte LogicChannelNo { get; set; } @@ -24,5 +24,21 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 速度 /// </summary> public byte Speed { get; set; } + + public JT808_0x9301 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9301 jT808_0x9301 = new JT808_0x9301(); + jT808_0x9301.LogicChannelNo = reader.ReadByte(); + jT808_0x9301.Direction = reader.ReadByte(); + jT808_0x9301.Speed = reader.ReadByte(); + return jT808_0x9301; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9301 value, IJT808Config config) + { + writer.WriteByte(value.LogicChannelNo); + writer.WriteByte(value.Direction); + writer.WriteByte(value.Speed); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9302.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9302.cs index 5b6525d..f2a481b 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9302.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9302.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,10 +9,10 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 云台调整焦距控制 /// </summary> - [JT808Formatter(typeof(JT808_0x9302_Formatter))] - public class JT808_0x9302 : JT808Bodies + public class JT808_0x9302 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9302> { - /// <summary> + public override ushort MsgId => 0x9302; + /// <summary> /// 逻辑通道号 /// </summary> public byte LogicChannelNo { get; set; } @@ -20,5 +20,19 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 焦距调整方向 /// </summary> public byte FocusAdjustmentDirection { get; set; } + + public JT808_0x9302 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9302 jT808_0x9302 = new JT808_0x9302(); + jT808_0x9302.LogicChannelNo = reader.ReadByte(); + jT808_0x9302.FocusAdjustmentDirection = reader.ReadByte(); + return jT808_0x9302; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9302 value, IJT808Config config) + { + writer.WriteByte(value.LogicChannelNo); + writer.WriteByte(value.FocusAdjustmentDirection); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9303.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9303.cs index ffbbf53..61a332c 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9303.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9303.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,10 +9,10 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 云台调整光圈控制 /// </summary> - [JT808Formatter(typeof(JT808_0x9303_Formatter))] - public class JT808_0x9303 : JT808Bodies + public class JT808_0x9303 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9303> { - /// <summary> + public override ushort MsgId => 0x9303; + /// <summary> /// 逻辑通道号 /// </summary> public byte LogicChannelNo { get; set; } @@ -20,5 +20,18 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 光圈调整方式 /// </summary> public byte IrisAdjustment { get; set; } + public JT808_0x9303 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9303 jT808_0x9303 = new JT808_0x9303(); + jT808_0x9303.LogicChannelNo = reader.ReadByte(); + jT808_0x9303.IrisAdjustment = reader.ReadByte(); + return jT808_0x9303; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9303 value, IJT808Config config) + { + writer.WriteByte(value.LogicChannelNo); + writer.WriteByte(value.IrisAdjustment); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9304.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9304.cs index 7cc1d73..56d8b25 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9304.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9304.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,10 +9,10 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 云台雨刷控制 /// </summary> - [JT808Formatter(typeof(JT808_0x9304_Formatter))] - public class JT808_0x9304 : JT808Bodies + public class JT808_0x9304 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9304> { - /// <summary> + public override ushort MsgId => 0x9304; + /// <summary> /// 逻辑通道号 /// </summary> public byte LogicChannelNo { get; set; } @@ -20,5 +20,18 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 启停标识 /// </summary> public byte StartOrStop { get; set; } + public JT808_0x9304 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9304 jT808_0x9304 = new JT808_0x9304(); + jT808_0x9304.LogicChannelNo = reader.ReadByte(); + jT808_0x9304.StartOrStop = reader.ReadByte(); + return jT808_0x9304; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9304 value, IJT808Config config) + { + writer.WriteByte(value.LogicChannelNo); + writer.WriteByte(value.StartOrStop); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9305.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9305.cs index d6268a9..1f638d4 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9305.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9305.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,10 +9,10 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 红外补光控制 /// </summary> - [JT808Formatter(typeof(JT808_0x9305_Formatter))] - public class JT808_0x9305 : JT808Bodies + public class JT808_0x9305 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9305> { - /// <summary> + public override ushort MsgId => 0x9305; + /// <summary> /// 逻辑通道号 /// </summary> public byte LogicChannelNo { get; set; } @@ -20,5 +20,18 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 启停标识 /// </summary> public byte StartOrStop { get; set; } + public JT808_0x9305 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9305 jT808_0x9305 = new JT808_0x9305(); + jT808_0x9305.LogicChannelNo = reader.ReadByte(); + jT808_0x9305.StartOrStop = reader.ReadByte(); + return jT808_0x9305; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9305 value, IJT808Config config) + { + writer.WriteByte(value.LogicChannelNo); + writer.WriteByte(value.StartOrStop); + } } } diff --git a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9306.cs b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9306.cs index ec42fc9..a962ac3 100644 --- a/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9306.cs +++ b/src/JT808.Protocol.Extensions.JT1078/MessageBody/JT808_0x9306.cs @@ -1,5 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions.JT1078.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; using System.Text; @@ -9,10 +9,10 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// <summary> /// 云台变倍控制 /// </summary> - [JT808Formatter(typeof(JT808_0x9306_Formatter))] - public class JT808_0x9306 : JT808Bodies + public class JT808_0x9306 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9306> { - /// <summary> + public override ushort MsgId => 0x9306; + /// <summary> /// 逻辑通道号 /// </summary> public byte LogicChannelNo { get; set; } @@ -20,5 +20,19 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody /// 变倍控制 /// </summary> public byte ChangeMultipleControl { get; set; } + + public JT808_0x9306 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9306 jT808_0x9306 = new JT808_0x9306(); + jT808_0x9306.LogicChannelNo = reader.ReadByte(); + jT808_0x9306.ChangeMultipleControl = reader.ReadByte(); + return jT808_0x9306; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9306 value, IJT808Config config) + { + writer.WriteByte(value.LogicChannelNo); + writer.WriteByte(value.ChangeMultipleControl); + } } }