diff --git a/src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj b/src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj index 1e741c7..37e4798 100644 --- a/src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj +++ b/src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2;net472;netcoreapp3.0; + net472;netcoreapp3.0; true AnyCPU Exe diff --git a/src/JT808.Protocol.Benchmark/JT808SerializerContext.cs b/src/JT808.Protocol.Benchmark/JT808SerializerContext.cs index 983ff06..25a6a3f 100644 --- a/src/JT808.Protocol.Benchmark/JT808SerializerContext.cs +++ b/src/JT808.Protocol.Benchmark/JT808SerializerContext.cs @@ -164,7 +164,6 @@ namespace JT808.Protocol.Benchmark { public JT808SerializerConfig() { - Add(Job.Default.WithGcServer(false).With(CsProjCoreToolchain.NetCoreApp22).With(Platform.AnyCpu)); Add(Job.Default.WithGcServer(false).With(CsProjCoreToolchain.NetCoreApp30).With(Platform.AnyCpu)); } } diff --git a/src/JT808.Protocol.Test/Internal/JT808FormatterFactoryTest.cs b/src/JT808.Protocol.Test/Internal/JT808FormatterFactoryTest.cs new file mode 100644 index 0000000..2e5ed31 --- /dev/null +++ b/src/JT808.Protocol.Test/Internal/JT808FormatterFactoryTest.cs @@ -0,0 +1,27 @@ +using JT808.Protocol.Internal; +using JT808.Protocol.Test.MessageBody; +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; + +namespace JT808.Protocol.Test.Internal +{ + public class JT808FormatterFactoryTest + { + [Fact] + public void Test1() + { + JT808FormatterFactory jT808FormatterFactory = new JT808FormatterFactory(); + Assert.Contains(jT808FormatterFactory.FormatterDict, f => f.Key == typeof(JT808Package).GUID); + } + + [Fact] + public void Test2() + { + JT808FormatterFactory jT808FormatterFactory = new JT808FormatterFactory(); + jT808FormatterFactory.SetMap(); + Assert.Contains(jT808FormatterFactory.FormatterDict, f => f.Key == typeof(JT808_0x9999).GUID); + } + } +} diff --git a/src/JT808.Protocol.Test/Internal/JT808MsgIdFactoryTest.cs b/src/JT808.Protocol.Test/Internal/JT808MsgIdFactoryTest.cs index 1cf8002..e82f7ba 100644 --- a/src/JT808.Protocol.Test/Internal/JT808MsgIdFactoryTest.cs +++ b/src/JT808.Protocol.Test/Internal/JT808MsgIdFactoryTest.cs @@ -1,5 +1,4 @@ using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.Interfaces; using JT808.Protocol.Internal; using JT808.Protocol.MessageBody; diff --git a/src/JT808.Protocol.Test/JT808.Protocol.Test.csproj b/src/JT808.Protocol.Test/JT808.Protocol.Test.csproj index f1fa0a8..483375a 100644 --- a/src/JT808.Protocol.Test/JT808.Protocol.Test.csproj +++ b/src/JT808.Protocol.Test/JT808.Protocol.Test.csproj @@ -27,18 +27,12 @@ - - - - - - @@ -63,8 +57,6 @@ - - @@ -95,6 +87,7 @@ + diff --git a/src/JT808.Protocol.Test/MessageBody/JT808LocationAttachExtensions/JT808LocationAttachImpl0x06.cs b/src/JT808.Protocol.Test/MessageBody/JT808LocationAttachExtensions/JT808LocationAttachImpl0x06.cs index f2c6983..35698bd 100644 --- a/src/JT808.Protocol.Test/MessageBody/JT808LocationAttachExtensions/JT808LocationAttachImpl0x06.cs +++ b/src/JT808.Protocol.Test/MessageBody/JT808LocationAttachExtensions/JT808LocationAttachImpl0x06.cs @@ -1,6 +1,6 @@ -using JT808.Protocol.Attributes; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; -using JT808.Protocol.Test.JT808Formatters.MessageBodyFormatters.JT808LocationAttach; +using JT808.Protocol.MessagePack; namespace JT808.Protocol.Test.JT808LocationAttach { @@ -10,13 +10,31 @@ namespace JT808.Protocol.Test.JT808LocationAttach /// UserName-BCD(10) /// Gerder-byte-1 /// - [JT808Formatter(typeof(JT808_0x0200_0x06Formatter))] - public class JT808LocationAttachImpl0x06: JT808_0x0200_CustomBodyBase + public class JT808LocationAttachImpl0x06: JT808_0x0200_CustomBodyBase, IJT808MessagePackFormatter { public override byte AttachInfoId { get; set; } = 0x06; public override byte AttachInfoLength { get; set; } = 13; public int Age { get; set; } public byte Gender { get; set; } public string UserName { get; set; } + public JT808LocationAttachImpl0x06 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808LocationAttachImpl0x06 jT808LocationAttachImpl0x06 = new JT808LocationAttachImpl0x06(); + jT808LocationAttachImpl0x06.AttachInfoId = reader.ReadByte(); + jT808LocationAttachImpl0x06.AttachInfoLength = reader.ReadByte(); + jT808LocationAttachImpl0x06.Age = reader.ReadInt32(); + jT808LocationAttachImpl0x06.Gender = reader.ReadByte(); + jT808LocationAttachImpl0x06.UserName = reader.ReadRemainStringContent(); + return jT808LocationAttachImpl0x06; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808LocationAttachImpl0x06 value, IJT808Config config) + { + writer.WriteByte(value.AttachInfoId); + writer.WriteByte(value.AttachInfoLength); + writer.WriteInt32(value.Age); + writer.WriteByte(value.Gender); + writer.WriteString(value.UserName); + } } } diff --git a/src/JT808.Protocol.Test/MessageBody/JT808_0X8900_BodiesImpl/JT808_0X8900_Test_BodiesImpl.cs b/src/JT808.Protocol.Test/MessageBody/JT808_0X8900_BodiesImpl/JT808_0X8900_Test_BodiesImpl.cs index 6f4a803..6fac8f1 100644 --- a/src/JT808.Protocol.Test/MessageBody/JT808_0X8900_BodiesImpl/JT808_0X8900_Test_BodiesImpl.cs +++ b/src/JT808.Protocol.Test/MessageBody/JT808_0X8900_BodiesImpl/JT808_0X8900_Test_BodiesImpl.cs @@ -1,14 +1,26 @@ -using JT808.Protocol.Attributes; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; -using JT808.Protocol.Test.MessageBody.JT808Formatters; +using JT808.Protocol.MessagePack; namespace JT808.Protocol.Test.MessageBody.JT808_0X8900_BodiesImpl { - [JT808Formatter(typeof(JT808_0X8900_Test_BodiesImplFormatter))] - public class JT808_0X8900_Test_BodiesImpl: JT808_0x8900_BodyBase + public class JT808_0X8900_Test_BodiesImpl: JT808_0x8900_BodyBase, IJT808MessagePackFormatter { public uint Id { get; set; } public byte Sex { get; set; } + public JT808_0X8900_Test_BodiesImpl Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0X8900_Test_BodiesImpl jT808_0X8900_Test_BodiesImpl = new JT808_0X8900_Test_BodiesImpl(); + jT808_0X8900_Test_BodiesImpl.Id = reader.ReadUInt32(); + jT808_0X8900_Test_BodiesImpl.Sex = reader.ReadByte(); + return jT808_0X8900_Test_BodiesImpl; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0X8900_Test_BodiesImpl value, IJT808Config config) + { + writer.WriteUInt32(value.Id); + writer.WriteByte(value.Sex); + } } } diff --git a/src/JT808.Protocol.Test/MessageBody/JT808_0x0701BodiesImpl/JT808_0x0701TestBodiesImpl.cs b/src/JT808.Protocol.Test/MessageBody/JT808_0x0701BodiesImpl/JT808_0x0701TestBodiesImpl.cs index 0dccd65..6d9d61a 100644 --- a/src/JT808.Protocol.Test/MessageBody/JT808_0x0701BodiesImpl/JT808_0x0701TestBodiesImpl.cs +++ b/src/JT808.Protocol.Test/MessageBody/JT808_0x0701BodiesImpl/JT808_0x0701TestBodiesImpl.cs @@ -1,16 +1,33 @@ -using JT808.Protocol.Attributes; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; -using JT808.Protocol.Test.MessageBody.JT808Formatters; +using JT808.Protocol.MessagePack; namespace JT808.Protocol.Test.MessageBody.JT808_0x0701BodiesImpl { - [JT808Formatter(typeof(JT808_0x0701TestBodiesImplFormatter))] - public class JT808_0x0701TestBodiesImpl: JT808_0x0701_CustomBodyBase + public class JT808_0x0701TestBodiesImpl: JT808_0x0701_CustomBodyBase, IJT808MessagePackFormatter { public uint Id { get; set; } public ushort UserNameLength { get; set; } public string UserName { get; set; } + + public JT808_0x0701TestBodiesImpl Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x0701TestBodiesImpl jT808_0X0701TestBodiesImpl = new JT808_0x0701TestBodiesImpl(); + jT808_0X0701TestBodiesImpl.Id = reader.ReadUInt32(); + jT808_0X0701TestBodiesImpl.UserNameLength = reader.ReadUInt16(); + jT808_0X0701TestBodiesImpl.UserName = reader.ReadString(jT808_0X0701TestBodiesImpl.UserNameLength); + return jT808_0X0701TestBodiesImpl; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0701TestBodiesImpl value, IJT808Config config) + { + writer.WriteUInt32(value.Id); + writer.Skip(2, out int position); + writer.WriteString(value.UserName); + int strLength = writer.GetCurrentPosition() - position - 2; + writer.WriteUInt16Return((ushort)strLength, position); + } } } diff --git a/src/JT808.Protocol.Test/MessageBody/JT808_0x0900_BodiesImpl/JT808_0x0900_0x83.cs b/src/JT808.Protocol.Test/MessageBody/JT808_0x0900_BodiesImpl/JT808_0x0900_0x83.cs index d790946..f84e61d 100644 --- a/src/JT808.Protocol.Test/MessageBody/JT808_0x0900_BodiesImpl/JT808_0x0900_0x83.cs +++ b/src/JT808.Protocol.Test/MessageBody/JT808_0x0900_BodiesImpl/JT808_0x0900_0x83.cs @@ -1,15 +1,26 @@ -using JT808.Protocol.Attributes; +using JT808.Protocol.Formatters; using JT808.Protocol.MessageBody; -using JT808.Protocol.Test.MessageBody.JT808Formatters; +using JT808.Protocol.MessagePack; namespace JT808.Protocol.Test.JT808_0x0900_BodiesImpl { - [JT808Formatter(typeof(JT808_0x0900_0x83Formatter))] - public class JT808_0x0900_0x83 : JT808_0x0900_BodyBase + public class JT808_0x0900_0x83 : JT808_0x0900_BodyBase,IJT808MessagePackFormatter { /// /// 透传内容 /// public string PassthroughContent { get; set; } + + public JT808_0x0900_0x83 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x0900_0x83 jT808PassthroughType0x83 = new JT808_0x0900_0x83(); + jT808PassthroughType0x83.PassthroughContent = reader.ReadRemainStringContent(); + return jT808PassthroughType0x83; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0900_0x83 value, IJT808Config config) + { + writer.WriteString(value.PassthroughContent); + } } } diff --git a/src/JT808.Protocol.Test/MessageBody/JT808_0x9999.cs b/src/JT808.Protocol.Test/MessageBody/JT808_0x9999.cs new file mode 100644 index 0000000..a982f9c --- /dev/null +++ b/src/JT808.Protocol.Test/MessageBody/JT808_0x9999.cs @@ -0,0 +1,24 @@ +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Test.MessageBody +{ + public class JT808_0x9999 : JT808Bodies, IJT808MessagePackFormatter + { + public byte Sex { get; set; } + public JT808_0x9999 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x9999 jT808_0X9999 = new JT808_0x9999(); + jT808_0X9999.Sex = reader.ReadByte(); + return jT808_0X9999; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9999 value, IJT808Config config) + { + writer.WriteByte(value.Sex); + } + } +} diff --git a/src/JT808.Protocol.Test/MessagePack/JT808MessagePackReaderTest.cs b/src/JT808.Protocol.Test/MessagePack/JT808MessagePackReaderTest.cs index 1987ec7..8a745cd 100644 --- a/src/JT808.Protocol.Test/MessagePack/JT808MessagePackReaderTest.cs +++ b/src/JT808.Protocol.Test/MessagePack/JT808MessagePackReaderTest.cs @@ -187,10 +187,10 @@ namespace JT808.Protocol.Test.MessagePack { var bytes = "7e080123000138123456782032000a000205060708090a0bffc400b5100002010303020403050504040000017d0101020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffdd00040000ffda000c03010002110311003f006c6a2a755ce299a5c942e0f35281c5004aa72314a54e38a07b8841ef4840a0673de21b4ff498ee402038dade991fe7f4acc110f4a0cd8ef2f1405cd01d45f2e9360a062edc5745616a6dad511861cfccff0053499512e056cf1460e3348a0ed4b8e338fc2819cb5edbfd9ee648b18556f97fdd3d3f4aafb4d332ea433a6573e9550d3131d18c9c558031c0a4083a503039a60c42c2984e4f4a06260d370690098ef4751400c615132d021868a621431a33480ef235e05595403eb54cbb0b8e7069dc0e3a9a41b12a024f4a9d40f4a18c5651e951c88179268194ee614b989a2719461ffea35cfdcda4b6b2ed71c1e55874345c96ba91819a704c50217613db349b39031c9e945c66a69ba794713cebf30fb8be9ee6b540c1e948a48760e3a526d2dc77a0a144471d297cb623a71484646bb685234b81d01d8e7d018f43f9ff003ac16386c552225b8300c2a84c8c8c4ed247b502616cc0517e".ToHexBytes(); JT808MessagePackReader jT808MessagePackReader = new JT808MessagePackReader(bytes); - JT808PackageFormatter jT808PackageFormatter = new JT808PackageFormatter(); + JT808Package jT808Package = new JT808Package(); IJT808Config jT808Config = new DefaultGlobalConfig(); jT808Config.SkipCRCCode = true; - var package=jT808PackageFormatter.Deserialize(ref jT808MessagePackReader, jT808Config); + var package= jT808Package.Deserialize(ref jT808MessagePackReader, jT808Config); } [Theory] diff --git a/src/JT808.Protocol.Test/Simples/Demo4.cs b/src/JT808.Protocol.Test/Simples/Demo4.cs index 97bd6ab..fca4bcf 100644 --- a/src/JT808.Protocol.Test/Simples/Demo4.cs +++ b/src/JT808.Protocol.Test/Simples/Demo4.cs @@ -251,42 +251,14 @@ namespace JT808.Protocol.Test.Simples /// /// 设备类型1-对应消息协议0x81 /// - [JT808Formatter(typeof(JT808_0x0200_DT1_0x81Formatter))] - public class JT808_0x0200_DT1_0x81 : JT808_0x0200_CustomBodyBase + public class JT808_0x0200_DT1_0x81 : JT808_0x0200_CustomBodyBase, IJT808MessagePackFormatter { public override byte AttachInfoId { get; set; } = 0x81; public override byte AttachInfoLength { get; set; } = 13; public uint Age { get; set; } public byte Gender { get; set; } public string UserName { get; set; } - } - /// - /// 设备类型1-对应消息协议0x82 - /// - [JT808Formatter(typeof(JT808_0x0200_DT1_0x82Formatter))] - public class JT808_0x0200_DT1_0x82 : JT808_0x0200_CustomBodyBase - { - public override byte AttachInfoId { get; set; } = 0x82; - public override byte AttachInfoLength { get; set; } = 1; - public byte Gender1 { get; set; } - } - /// - /// 设备类型2-对应消息协议0x81 - /// - [JT808Formatter(typeof(JT808_0x0200_DT2_0x81Formatter))] - public class JT808_0x0200_DT2_0x81 : JT808_0x0200_CustomBodyBase - { - public override byte AttachInfoId { get; set; } = 0x81; - public override byte AttachInfoLength { get; set; } = 7; - public uint Age { get; set; } - public byte Gender { get; set; } - public ushort MsgNum { get; set; } - } - /// - /// 设备类型1-对应消息协议序列化器 0x81 - /// - public class JT808_0x0200_DT1_0x81Formatter : IJT808MessagePackFormatter - { + public JT808_0x0200_DT1_0x81 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) { JT808_0x0200_DT1_0x81 jT808_0X0200_DT1_0X81 = new JT808_0x0200_DT1_0x81(); @@ -307,10 +279,13 @@ namespace JT808.Protocol.Test.Simples } } /// - /// 设备类型1-对应消息协议序列化器 0x82 + /// 设备类型1-对应消息协议0x82 /// - public class JT808_0x0200_DT1_0x82Formatter : IJT808MessagePackFormatter + public class JT808_0x0200_DT1_0x82 : JT808_0x0200_CustomBodyBase, IJT808MessagePackFormatter { + public override byte AttachInfoId { get; set; } = 0x82; + public override byte AttachInfoLength { get; set; } = 1; + public byte Gender1 { get; set; } public JT808_0x0200_DT1_0x82 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) { JT808_0x0200_DT1_0x82 jT808_0X0200_DT1_0X82 = new JT808_0x0200_DT1_0x82(); @@ -328,10 +303,15 @@ namespace JT808.Protocol.Test.Simples } } /// - /// 设备类型2-对应消息协议序列化器 0x81 + /// 设备类型2-对应消息协议0x81 /// - public class JT808_0x0200_DT2_0x81Formatter : IJT808MessagePackFormatter + public class JT808_0x0200_DT2_0x81 : JT808_0x0200_CustomBodyBase, IJT808MessagePackFormatter { + public override byte AttachInfoId { get; set; } = 0x81; + public override byte AttachInfoLength { get; set; } = 7; + public uint Age { get; set; } + public byte Gender { get; set; } + public ushort MsgNum { get; set; } public JT808_0x0200_DT2_0x81 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) { JT808_0x0200_DT2_0x81 jT808_0X0200_DT2_0X81 = new JT808_0x0200_DT2_0x81(); diff --git a/src/JT808.Protocol.Test/Simples/Demo6.cs b/src/JT808.Protocol.Test/Simples/Demo6.cs index 3f8f8b3..a12fa38 100644 --- a/src/JT808.Protocol.Test/Simples/Demo6.cs +++ b/src/JT808.Protocol.Test/Simples/Demo6.cs @@ -83,22 +83,11 @@ namespace JT808.Protocol.Test.Simples } } - [JT808Formatter(typeof(DT1Demo6_Formatter))] - public class DT1Demo6 : JT808Bodies + public class DT1Demo6 : JT808Bodies, IJT808MessagePackFormatter { public byte Sex1 { get; set; } public ushort Age1 { get; set; } - } - [JT808Formatter(typeof(DT2Demo6_Formatter))] - public class DT2Demo6 : JT808Bodies - { - public byte Sex2 { get; set; } - - public ushort Age2 { get; set; } - } - public class DT1Demo6_Formatter : IJT808MessagePackFormatter - { public DT1Demo6 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) { DT1Demo6 dT1Demo6 = new DT1Demo6(); @@ -113,8 +102,12 @@ namespace JT808.Protocol.Test.Simples writer.WriteUInt16(value.Age1); } } - public class DT2Demo6_Formatter : IJT808MessagePackFormatter + + public class DT2Demo6 : JT808Bodies, IJT808MessagePackFormatter { + public byte Sex2 { get; set; } + + public ushort Age2 { get; set; } public DT2Demo6 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) { DT2Demo6 dT2Demo6 = new DT2Demo6(); diff --git a/src/JT808.Protocol/Enums/JT808MsgId.cs b/src/JT808.Protocol/Enums/JT808MsgId.cs index 68d7b57..e5e226e 100644 --- a/src/JT808.Protocol/Enums/JT808MsgId.cs +++ b/src/JT808.Protocol/Enums/JT808MsgId.cs @@ -64,25 +64,26 @@ namespace JT808.Protocol.Enums [JT808BodiesType(typeof(JT808_0x0102))] [JT808MsgIdDescription("0x0102", "终端鉴权")] 终端鉴权 = 0x0102, +#warning 设置终端参数 查询终端参数 查询终端参数应答 /// /// 设置终端参数 /// 0x8103 /// - [JT808BodiesType(typeof(JT808_0x8103))] + //[JT808BodiesType(typeof(JT808_0x8103))] [JT808MsgIdDescription("0x8103", "设置终端参数")] 设置终端参数 = 0x8103, /// /// 查询终端参数 /// 0x8104 /// - [JT808BodiesType(typeof(JT808_0x8104))] + //[JT808BodiesType(typeof(JT808_0x8104))] [JT808MsgIdDescription("0x8104", "查询终端参数")] 查询终端参数 = 0x8104, /// /// 查询终端参数应答 /// 0x0104 /// - [JT808BodiesType(typeof(JT808_0x0104))] + //[JT808BodiesType(typeof(JT808_0x0104))] [JT808MsgIdDescription("0x0104", "查询终端参数应答")] 查询终端参数应答 = 0x0104, /// @@ -302,7 +303,6 @@ namespace JT808.Protocol.Enums [JT808BodiesType(typeof(JT808_0x8607))] [JT808MsgIdDescription("0x8607", "删除路线")] 删除路线 = 0x8607, - ///// ///// 行驶记录仪数据采集命令 ///// 0x8700 diff --git a/src/JT808.Protocol/Extensions/JT808PackageExtensionsTemplate.cs b/src/JT808.Protocol/Extensions/JT808PackageExtensionsTemplate.cs index 0c79e71..84f46af 100644 --- a/src/JT808.Protocol/Extensions/JT808PackageExtensionsTemplate.cs +++ b/src/JT808.Protocol/Extensions/JT808PackageExtensionsTemplate.cs @@ -89,23 +89,23 @@ namespace JT808.Protocol.Extensions { return Create(msgId,terminalPhoneNo,bodies); } - /// - /// 0x0104 - 查询终端参数应答 - /// auto-generated - /// - public static JT808Package Create_查询终端参数应答(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x0104 bodies) - { - return Create(msgId,terminalPhoneNo,bodies); - } + ///// + ///// 0x0104 - 查询终端参数应答 + ///// auto-generated + ///// + // public static JT808Package Create_查询终端参数应答(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x0104 bodies) + //{ + // return Create(msgId,terminalPhoneNo,bodies); + //} /// /// 0x0104 - 查询终端参数应答 /// auto-generated /// - public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x0104 bodies) - { - return Create(msgId,terminalPhoneNo,bodies); - } + // public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x0104 bodies) + //{ + // return Create(msgId,terminalPhoneNo,bodies); + //} /// /// 0x0107 - 查询终端属性应答 /// auto-generated @@ -464,39 +464,22 @@ namespace JT808.Protocol.Extensions return Create(msgId,terminalPhoneNo,bodies); } /// - /// 0x8103 - 设置终端参数 - /// auto-generated - /// - public static JT808Package Create_设置终端参数(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8103 bodies) - { - return Create(msgId,terminalPhoneNo,bodies); - } - - /// - /// 0x8103 - 设置终端参数 - /// auto-generated - /// - public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8103 bodies) - { - return Create(msgId,terminalPhoneNo,bodies); - } - /// /// 0x8104 - 查询终端参数 /// auto-generated /// - public static JT808Package Create_查询终端参数(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8104 bodies) - { - return Create(msgId,terminalPhoneNo,bodies); - } + // public static JT808Package Create_查询终端参数(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8104 bodies) + //{ + // return Create(msgId,terminalPhoneNo,bodies); + //} /// /// 0x8104 - 查询终端参数 /// auto-generated /// - public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8104 bodies) - { - return Create(msgId,terminalPhoneNo,bodies); - } + // public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8104 bodies) + //{ + // return Create(msgId,terminalPhoneNo,bodies); + //} /// /// 0x8105 - 终端控制 /// auto-generated diff --git a/src/JT808.Protocol/Interfaces/GlobalConfigBase.cs b/src/JT808.Protocol/Interfaces/GlobalConfigBase.cs index f955374..b8d1fda 100644 --- a/src/JT808.Protocol/Interfaces/GlobalConfigBase.cs +++ b/src/JT808.Protocol/Interfaces/GlobalConfigBase.cs @@ -20,8 +20,8 @@ namespace JT808.Protocol.Interfaces FormatterFactory = new JT808FormatterFactory(); JT808_0X0200_Custom_Factory = new JT808_0x0200_Custom_Factory(); JT808_0X0200_Factory = new JT808_0x0200_Factory(); - JT808_0X8103_Custom_Factory = new JT808_0x8103_Custom_Factory(); - JT808_0X8103_Factory = new JT808_0x8103_Factory(); + //JT808_0X8103_Custom_Factory = new JT808_0x8103_Custom_Factory(); + //JT808_0X8103_Factory = new JT808_0x8103_Factory(); TerminalPhoneNoLength = 12; Trim = true; } @@ -46,8 +46,8 @@ namespace JT808.Protocol.Interfaces foreach (var easb in externalAssemblies) { FormatterFactory.Register(easb); - JT808_0X0200_Custom_Factory.Register(easb); - JT808_0X8103_Custom_Factory.Register(easb); + JT808_0X0200_Custom_Factory?.Register(easb); + JT808_0X8103_Custom_Factory?.Register(easb); } } return this; diff --git a/src/JT808.Protocol/Internal/JT808FormatterFactory.cs b/src/JT808.Protocol/Internal/JT808FormatterFactory.cs index ed7b2ed..7b1c900 100644 --- a/src/JT808.Protocol/Internal/JT808FormatterFactory.cs +++ b/src/JT808.Protocol/Internal/JT808FormatterFactory.cs @@ -10,7 +10,7 @@ using System.Text; namespace JT808.Protocol.Internal { - class JT808FormatterFactory : IJT808FormatterFactory + internal class JT808FormatterFactory : IJT808FormatterFactory { public Dictionary FormatterDict { get; } @@ -27,35 +27,26 @@ namespace JT808.Protocol.Internal var implTypes = type.GetInterfaces(); if(implTypes!=null && implTypes .Length>1) { - var firstType = implTypes.FirstOrDefault(); + var firstType = implTypes.FirstOrDefault(f=>f.Name== typeof(IJT808MessagePackFormatter<>).Name); var genericImplType = firstType.GetGenericArguments().FirstOrDefault(); - if (genericImplType == null) - { - throw new JT808Exception(JT808ErrorCode.GetFormatterAttributeError, genericImplType.FullName); - } - var attr = genericImplType.GetCustomAttribute(); - if (attr != null) + if (genericImplType != null) { if (!FormatterDict.ContainsKey(genericImplType.GUID)) { - FormatterDict.Add(genericImplType.GUID, Activator.CreateInstance(attr.FormatterType)); + FormatterDict.Add(genericImplType.GUID, Activator.CreateInstance(genericImplType)); } } } } } - public IJT808FormatterFactory SetMap() where TJT808Bodies : JT808Bodies + public IJT808FormatterFactory SetMap() + where TJT808Bodies:JT808Bodies { - Type bodiesType = typeof(TJT808Bodies); - var attr = bodiesType.GetTypeInfo().GetCustomAttribute(); - if (attr == null) - { - throw new JT808Exception(JT808ErrorCode.GetFormatterAttributeError, bodiesType.FullName); - } - if (!FormatterDict.ContainsKey(bodiesType.GUID)) + Type type = typeof(TJT808Bodies); + if (!FormatterDict.ContainsKey(type.GUID)) { - FormatterDict.Add(bodiesType.GUID, Activator.CreateInstance(attr.FormatterType)); + FormatterDict.Add(type.GUID, Activator.CreateInstance(type)); } return this; } diff --git a/src/JT808.Protocol/JT808.Protocol.csproj b/src/JT808.Protocol/JT808.Protocol.csproj index 74efb5e..713c008 100644 --- a/src/JT808.Protocol/JT808.Protocol.csproj +++ b/src/JT808.Protocol/JT808.Protocol.csproj @@ -29,8 +29,11 @@ + + + True @@ -39,11 +42,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/JT808.Protocol/JT808.Protocol.xml b/src/JT808.Protocol/JT808.Protocol.xml index 3c67eb6..86be106 100644 --- a/src/JT808.Protocol/JT808.Protocol.xml +++ b/src/JT808.Protocol/JT808.Protocol.xml @@ -984,18 +984,6 @@ auto-generated - - - 0x0104 - 查询终端参数应答 - auto-generated - - - - - 0x0104 - 查询终端参数应答 - auto-generated - - 0x0107 - 查询终端属性应答 @@ -1248,30 +1236,6 @@ auto-generated - - - 0x8103 - 设置终端参数 - auto-generated - - - - - 0x8103 - 设置终端参数 - auto-generated - - - - - 0x8104 - 查询终端参数 - auto-generated - - - - - 0x8104 - 查询终端参数 - auto-generated - - 0x8105 - 终端控制 @@ -1656,16 +1620,6 @@ auto-generated - - - JT808头部序列化器 - - - - - JT808包序列化器 - - 压缩接口 @@ -2445,27 +2399,6 @@ 鉴权码 - - - 查询终端参数应答 - - - - - 应答流水号 - 查询指定终端参数的流水号 - - - - - 应答参数个数 - - - - - 参数列表 - - 查询终端属性应答 @@ -3253,1323 +3186,6 @@ 只有在成功后才有该字段 - - - 设置终端参数 - - - - - 参数总数 - - - - - 参数列表 - - - - - 终端心跳发送间隔,单位为秒(s) - 0x8103_0x0001 - - - - - 数据 长度 - - - - - 终端心跳发送间隔,单位为秒(s) - - - - - TCP 消息应答超时时间,单位为秒(s) - 0x8103_0x0002 - - - - - 数据 长度 - - - - - TCP 消息应答超时时间,单位为秒(s) - - - - - TCP 消息重传次数 - 0x8103_0x0003 - - - - - 数据 长度 - - - - - TCP 消息重传次数 - - - - - UDP 消息应答超时时间,单位为秒(s) - 0x8103_0x0004 - - - - - 数据 长度 - - - - - UDP 消息应答超时时间,单位为秒(s) - - - - - UDP 消息重传次数 - 0x8103_0x0005 - - - - - 数据 长度 - - - - - UDP 消息重传次数 - - - - - SMS 消息应答超时时间,单位为秒(s) - 0x8103_0x0006 - - - - - 数据 长度 - - - - - SMS 消息应答超时时间,单位为秒(s) - - - - - SMS 消息重传次数 - 0x8103_0x0007 - - - - - 数据 长度 - - - - - SMS 消息重传次数 - - - - - 主服务器 APN,无线通信拨号访问点。若网络制式为 CDMA,则该处为PPP 拨号号码 - - - - - 数据 长度 - - - - - 主服务器 APN,无线通信拨号访问点。若网络制式为 CDMA,则该处为PPP 拨号号码 - - - - - 主服务器无线通信拨号用户名 - - - - - 数据 长度 - - - - - 主服务器无线通信拨号用户名 - - - - - 主服务器无线通信拨号密码 - - - - - 数据 长度 - - - - - 主服务器无线通信拨号密码 - - - - - 主服务器地址,IP 或域名 - - - - - 数据 长度 - - - - - 主服务器地址,IP 或域名 - - - - - 备份服务器 APN,无线通信拨号访问点 - - - - - 数据 长度 - - - - - 备份服务器 APN,无线通信拨号访问点 - - - - - 备份服务器无线通信拨号用户名 - - - - - 数据 长度 - - - - - 备份服务器无线通信拨号用户名 - - - - - 备份服务器无线通信拨号密码 - - - - - 数据 长度 - - - - - 备份服务器无线通信拨号密码 - - - - - 备份服务器地址,IP 或域名 - - - - - 数据 长度 - - - - - 备份服务器地址,IP 或域名 - - - - - 服务器 TCP 端口 - - - - - 数据 长度 - - - - - 服务器 TCP 端口 - - - - - 服务器 UDP 端口 - - - - - 数据 长度 - - - - - 服务器 TCP 端口 - - - - - 道路运输证 IC 卡认证主服务器 IP 地址或域名 - - - - - 数据 长度 - - - - - 道路运输证 IC 卡认证主服务器 IP 地址或域名 - - - - - 道路运输证 IC 卡认证主服务器 TCP 端口 - - - - - 数据 长度 - - - - - 道路运输证 IC 卡认证主服务器 TCP 端口 - - - - - 道路运输证 IC 卡认证主服务器 UDP 端口 - - - - - 数据 长度 - - - - - 道路运输证 IC 卡认证主服务器 UDP 端口 - - - - - 道路运输证 IC 卡认证备份服务器 IP 地址或域名,端口同主服务器 - - - - - 数据 长度 - - - - - 道路运输证 IC 卡认证备份服务器 IP 地址或域名,端口同主服务器 - - - - - 位置汇报策略,0:定时汇报;1:定距汇报;2:定时和定距汇报 - - - - - 数据 长度 - - - - - 位置汇报策略,0:定时汇报;1:定距汇报;2:定时和定距汇报 - - - - - 位置汇报方案,0:根据 ACC 状态; 1:根据登录状态和 ACC 状态,先判断登录状态,若登录再根据 ACC 状态 - - - - - 数据 长度 - - - - - 位置汇报方案,0:根据 ACC 状态; 1:根据登录状态和 ACC 状态,先判断登录状态,若登录再根据 ACC 状态 - - - - - 驾驶员未登录汇报时间间隔,单位为秒(s),>0 - - - - - 数据 长度 - - - - - 驾驶员未登录汇报时间间隔,单位为秒(s),>0 - - - - - 休眠时汇报时间间隔,单位为秒(s),>0 - - - - - 数据 长度 - - - - - 休眠时汇报时间间隔,单位为秒(s),>0 - - - - - 紧急报警时汇报时间间隔,单位为秒(s),>0 - - - - - 数据 长度 - - - - - 紧急报警时汇报时间间隔,单位为秒(s),>0 - - - - - 缺省时间汇报间隔,单位为秒(s),>0 - - - - - 数据 长度 - - - - - 缺省时间汇报间隔,单位为秒(s),>0 - - - - - 缺省距离汇报间隔,单位为米(m),>0 - - - - - 数据 长度 - - - - - 缺省距离汇报间隔,单位为米(m),>0 - - - - - 驾驶员未登录汇报距离间隔,单位为米(m),>0 - - - - - 数据 长度 - - - - - 驾驶员未登录汇报距离间隔,单位为米(m),>0 - - - - - 休眠时汇报距离间隔,单位为米(m),>0 - - - - - 数据 长度 - - - - - 休眠时汇报距离间隔,单位为米(m),>0 - - - - - 紧急报警时汇报距离间隔,单位为米(m),>0 - - - - - 数据 长度 - - - - - 紧急报警时汇报距离间隔,单位为米(m),>0 - - - - - - 数据 长度 - - - - - - 电子围栏半径(非法位移阈值),单位为米 - - - - - 数据 长度 - - - - - 电子围栏半径(非法位移阈值),单位为米 - - - - - 监控平台电话号码 - - - - - 数据 长度 - - - - - 监控平台电话号码 - - - - - 复位电话号码,可采用此电话号码拨打终端电话让终端复位 - - - - - 数据 长度 - - - - - 复位电话号码,可采用此电话号码拨打终端电话让终端复位 - - - - - 恢复出厂设置电话号码,可采用此电话号码拨打终端电话让终端恢复出厂设置 - - - - - 数据 长度 - - - - - 恢复出厂设置电话号码,可采用此电话号码拨打终端电话让终端恢复出厂设置 - - - - - 监控平台 SMS 电话号码 - - - - - 数据 长度 - - - - - 监控平台 SMS 电话号码 - - - - - 接收终端 SMS 文本报警号码 - - - - - 数据 长度 - - - - - 接收终端 SMS 文本报警号码 - - - - - 终端电话接听策略,0:自动接听;1:ACC ON 时自动接听,OFF 时手动接听 - - - - - 数据 长度 - - - - - 终端电话接听策略,0:自动接听;1:ACC ON 时自动接听,OFF 时手动接听 - - - - - 每次最长通话时间,单位为秒(s),0 为不允许通话,0xFFFFFFFF 为不限制 - - - - - 数据 长度 - - - - - 每次最长通话时间,单位为秒(s),0 为不允许通话,0xFFFFFFFF 为不限制 - - - - - 当月最长通话时间,单位为秒(s),0 为不允许通话,0xFFFFFFFF 为不限制 - - - - - 数据 长度 - - - - - 当月最长通话时间,单位为秒(s),0 为不允许通话,0xFFFFFFFF 为不限制 - - - - - 监听电话号码 - - - - - 数据 长度 - - - - - 监听电话号码 - - - - - 监管平台特权短信号码 - - - - - 数据 长度 - - - - - 监管平台特权短信号码 - - - - - 报警屏蔽字,与位置信息汇报消息中的报警标志相对应,相应位为 1则相应报警被屏蔽 - - - - - 数据 长度 - - - - - 报警屏蔽字,与位置信息汇报消息中的报警标志相对应,相应位为 1则相应报警被屏蔽 - - - - - 报警发送文本 SMS 开关,与位置信息汇报消息中的报警标志相对应,相应位为 1 则相应报警时发送文本 SMS - - - - - 数据 长度 - - - - - 报警发送文本 SMS 开关,与位置信息汇报消息中的报警标志相对应,相应位为 1 则相应报警时发送文本 SMS - - - - - 报警拍摄开关,与位置信息汇报消息中的报警标志相对应,相应位为1 则相应报警时摄像头拍摄 - - - - - 数据 长度 - - - - - 报警拍摄开关,与位置信息汇报消息中的报警标志相对应,相应位为1 则相应报警时摄像头拍摄 - - - - - 报警拍摄存储标志,与位置信息汇报消息中的报警标志相对应,相应位为 1 则对相应报警时拍的照片进行存储,否则实时上传 - - - - - 数据 长度 - - - - - 报警拍摄存储标志,与位置信息汇报消息中的报警标志相对应,相应位为 1 则对相应报警时拍的照片进行存储,否则实时上传 - - - - - 关键标志,与位置信息汇报消息中的报警标志相对应,相应位为 1 则对相应报警为关键报警 - - - - - 数据 长度 - - - - - 关键标志,与位置信息汇报消息中的报警标志相对应,相应位为 1 则对相应报警为关键报警 - - - - - 最高速度,单位为公里每小时(km/h) - - - - - 数据 长度 - - - - - 最高速度,单位为公里每小时(km/h) - - - - - 超速持续时间,单位为秒(s) - - - - - 数据 长度 - - - - - 超速持续时间,单位为秒(s) - - - - - 连续驾驶时间门限,单位为秒(s) - - - - - 数据 长度 - - - - - 连续驾驶时间门限,单位为秒(s) - - - - - 当天累计驾驶时间门限,单位为秒(s) - - - - - 数据 长度 - - - - - 当天累计驾驶时间门限,单位为秒(s) - - - - - 最小休息时间,单位为秒(s) - - - - - 数据 长度 - - - - - 最小休息时间,单位为秒(s) - - - - - 最长停车时间,单位为秒(s) - - - - - 数据 长度 - - - - - 最长停车时间,单位为秒(s) - - - - - 超速报警预警差值,单位为 1/10Km/h - - - - - 数据 长度 - - - - - 超速报警预警差值,单位为 1/10Km/h - - - - - 疲劳驾驶预警差值,单位为秒(s),>0 - - - - - 数据 长度 - - - - - 疲劳驾驶预警差值,单位为秒(s),>0 - - - - - 碰撞报警参数设置 - b7-b0: 碰撞时间,单位 4ms; - b15-b8:碰撞加速度,单位 0.1g,设置范围在:0-79 之间,默认为10。 - - - - - 数据 长度 - - - - - 碰撞报警参数设置 - b7-b0: 碰撞时间,单位 4ms; - b15-b8:碰撞加速度,单位 0.1g,设置范围在:0-79 之间,默认为10。 - - - - - 侧翻报警参数设置: - 侧翻角度,单位 1 度,默认为 30 度 - - - - - 数据 长度 - - - - - 侧翻报警参数设置: - 侧翻角度,单位 1 度,默认为 30 度 - - - - - 定时拍照控制,见 表 13 - - - - - 数据 长度 - - - - - 定时拍照控制,见 表 13 - - - - - 定距拍照控制,见 表 14 - - - - - 数据 长度 - - - - - 定距拍照控制,见 表 14 - - - - - 图像/视频质量,1-10,1 最好 - - - - - 数据 长度 - - - - - 图像/视频质量,1-10,1 最好 - - - - - 亮度,0-255 - - - - - 数据 长度 - - - - - 亮度,0-255 - - - - - 对比度,0-127 - - - - - 数据 长度 - - - - - 对比度,0-127 - - - - - 饱和度,0-127 - - - - - 数据 长度 - - - - - 饱和度,0-127 - - - - - 色度,0-255 - - - - - 数据 长度 - - - - - 饱和度,0-127 - - - - - 车辆里程表读数,1/10km - - - - - 数据 长度 - - - - - 车辆里程表读数,1/10km - - - - - 车辆所在的省域 ID - - - - - 数据 长度 - - - - - 车辆所在的省域 ID - - - - - 车辆所在的市域 ID - - - - - 数据 长度 - - - - - 车辆所在的市域 ID - - - - - 公安交通管理部门颁发的机动车号牌 - - - - - 数据 长度 - - - - - 公安交通管理部门颁发的机动车号牌 - - - - - 车牌颜色,按照 JT/T415-2006 的 5.4.12 - - - - - 数据 长度 - - - - - 车牌颜色,按照 JT/T415-2006 的 5.4.12 - - - - - GNSS 定位模式,定义如下: - bit0,0:禁用 GPS 定位, 1:启用 GPS 定位; - bit1,0:禁用北斗定位, 1:启用北斗定位; - bit2,0:禁用 GLONASS 定位, 1:启用 GLONASS 定位; - bit3,0:禁用 Galileo 定位, 1:启用 Galileo 定位。 - - - - - 数据 长度 - - - - - GNSS 定位模式,定义如下: - bit0,0:禁用 GPS 定位, 1:启用 GPS 定位; - bit1,0:禁用北斗定位, 1:启用北斗定位; - bit2,0:禁用 GLONASS 定位, 1:启用 GLONASS 定位; - bit3,0:禁用 Galileo 定位, 1:启用 Galileo 定位。 - - - - - GNSS 波特率,定义如下: - 0x00:4800;0x01:9600; - 0x02:19200;0x03:38400; - 0x04:57600;0x05:115200。 - - - - - 数据 长度 - - - - - GNSS 波特率,定义如下: - 0x00:4800;0x01:9600; - 0x02:19200;0x03:38400; - 0x04:57600;0x05:115200。 - - - - - GNSS 模块详细定位数据输出频率,定义如下: - 0x00:500ms;0x01:1000ms(默认值); - 0x02:2000ms;0x03:3000ms; - 0x04:4000ms。 - - - - - 数据 长度 - - - - - GNSS 模块详细定位数据输出频率,定义如下: - 0x00:500ms;0x01:1000ms(默认值); - 0x02:2000ms;0x03:3000ms; - 0x04:4000ms。 - - - - - GNSS 模块详细定位数据采集频率,单位为秒,默认为 1。 - - - - - 数据 长度 - - - - - GNSS 模块详细定位数据采集频率,单位为秒,默认为 1。 - - - - - GNSS 模块详细定位数据上传方式 - 0x00,本地存储,不上传(默认值); - 0x01,按时间间隔上传; - 0x02,按距离间隔上传; - 0x0B,按累计时间上传,达到传输时间后自动停止上传; - 0x0C,按累计距离上传,达到距离后自动停止上传; - 0x0D,按累计条数上传,达到上传条数后自动停止上传。 - - - - - 数据 长度 - - - - - GNSS 模块详细定位数据上传方式 - 0x00,本地存储,不上传(默认值); - 0x01,按时间间隔上传; - 0x02,按距离间隔上传; - 0x0B,按累计时间上传,达到传输时间后自动停止上传; - 0x0C,按累计距离上传,达到距离后自动停止上传; - 0x0D,按累计条数上传,达到上传条数后自动停止上传。 - - - - - GNSS 模块详细定位数据上传设置: - 上传方式为 0x01 时,单位为秒; - 上传方式为 0x02 时,单位为米; - 上传方式为 0x0B 时,单位为秒; - 上传方式为 0x0C 时,单位为米; - 上传方式为 0x0D 时,单位为条。 - - - - - 数据 长度 - - - - - GNSS 模块详细定位数据上传设置: - 上传方式为 0x01 时,单位为秒; - 上传方式为 0x02 时,单位为米; - 上传方式为 0x0B 时,单位为秒; - 上传方式为 0x0C 时,单位为米; - 上传方式为 0x0D 时,单位为条。 - - - - - CAN 总线通道 1 采集时间间隔(ms),0 表示不采集 - - - - - 数据 长度 - - - - - CAN 总线通道 1 采集时间间隔(ms),0 表示不采集 - - - - - CAN 总线通道 1 上传时间间隔(s),0 表示不上传 - - - - - 数据 长度 - - - - - CAN 总线通道 1 上传时间间隔(s),0 表示不上传 - - - - - CAN 总线通道 2 采集时间间隔(ms),0 表示不采集 - - - - - 数据 长度 - - - - - CAN 总线通道 2 采集时间间隔(ms),0 表示不采集 - - - - - CAN 总线通道 2 上传时间间隔(s),0 表示不上传 - - - - - 数据 长度 - - - - - CAN 总线通道 2 上传时间间隔(s),0 表示不上传 - - - - - CAN 总线 ID 单独采集设置: - bit63-bit32 表示此 ID 采集时间间隔(ms),0 表示不采集; - bit31 表示 CAN 通道号,0:CAN1,1:CAN2; - bit30 表示帧类型,0:标准帧,1:扩展帧; - bit29 表示数据采集方式,0:原始数据,1:采集区间的计算值; - bit28-bit0 表示 CAN 总线 ID。 - - - - - 数据 长度 - - - - - CAN 总线 ID 单独采集设置: - bit63-bit32 表示此 ID 采集时间间隔(ms),0 表示不采集; - bit31 表示 CAN 通道号,0:CAN1,1:CAN2; - bit30 表示帧类型,0:标准帧,1:扩展帧; - bit29 表示数据采集方式,0:原始数据,1:采集区间的计算值; - bit28-bit0 表示 CAN 总线 ID。 - - - - - 参数 ID - - - - - 参数长度 - - - - - 参数 ID - - - - - 参数长度 - - - - - 查询终端参数 - - - - - 跳过数据体序列化 - - 终端控制 diff --git a/src/JT808.Protocol/JT808Header.cs b/src/JT808.Protocol/JT808Header.cs index c5268eb..b560c00 100644 --- a/src/JT808.Protocol/JT808Header.cs +++ b/src/JT808.Protocol/JT808Header.cs @@ -1,13 +1,12 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; namespace JT808.Protocol { /// /// 头部 /// - [JT808Formatter(typeof(JT808HeaderFormatter))] - public class JT808Header + public class JT808Header : IJT808MessagePackFormatter { /// /// 消息ID @@ -35,5 +34,46 @@ namespace JT808.Protocol /// 报序号 从1开始 /// public ushort PackageIndex { get; set; } + + public JT808Header Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808Header jT808Header = new JT808Header(); + // 1.消息ID + jT808Header.MsgId = reader.ReadUInt16(); + // 2.消息体属性 + jT808Header.MessageBodyProperty = new JT808HeaderMessageBodyProperty(reader.ReadUInt16()); + // 3.终端手机号 + jT808Header.TerminalPhoneNo = reader.ReadBCD(config.TerminalPhoneNoLength, config.Trim); + jT808Header.MsgNum = reader.ReadUInt16(); + // 4.判断有无分包 + if (jT808Header.MessageBodyProperty.IsPackage) + { + //5.读取消息包总数 + jT808Header.PackgeCount = reader.ReadUInt16(); + //6.读取消息包序号 + jT808Header.PackageIndex = reader.ReadUInt16(); + } + return jT808Header; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808Header value, IJT808Config config) + { + // 1.消息ID + writer.WriteUInt16(value.MsgId); + // 2.消息体属性 + writer.WriteUInt16(value.MessageBodyProperty.Wrap()); + // 3.终端手机号 + writer.WriteBCD(value.TerminalPhoneNo, config.TerminalPhoneNoLength); + // 4.消息流水号 + writer.WriteUInt16(value.MsgNum); + // 5.判断是否分包 + if (value.MessageBodyProperty.IsPackage) + { + // 6.消息包总数 + writer.WriteUInt16(value.PackgeCount); + // 7.消息包序号 + writer.WriteUInt16(value.PackageIndex); + } + } } } diff --git a/src/JT808.Protocol/JT808HeaderPackage.cs b/src/JT808.Protocol/JT808HeaderPackage.cs index e648389..ec47319 100644 --- a/src/JT808.Protocol/JT808HeaderPackage.cs +++ b/src/JT808.Protocol/JT808HeaderPackage.cs @@ -1,13 +1,16 @@ using JT808.Protocol.Attributes; +using JT808.Protocol.Enums; +using JT808.Protocol.Exceptions; using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; +using System; namespace JT808.Protocol { /// /// JT808头部数据包 /// - [JT808Formatter(typeof(JT808HeaderPackageFormatter))] - public class JT808HeaderPackage + public class JT808HeaderPackage: IJT808MessagePackFormatter { /// /// 起始符 @@ -30,5 +33,58 @@ namespace JT808.Protocol /// 终止符 /// public byte End { get; set; } + + public JT808HeaderPackage Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + // 1. 验证校验和 + if (!config.SkipCRCCode) + { + if (!reader.CheckXorCodeVali) + { + throw new JT808Exception(JT808ErrorCode.CheckCodeNotEqual, $"{reader.RealCheckXorCode}!={reader.CalculateCheckXorCode}"); + } + } + JT808HeaderPackage jT808Package = new JT808HeaderPackage(); + // ---------------开始解包-------------- + // 2.读取起始位置 + jT808Package.Begin = reader.ReadStart(); + // 3.读取头部信息 + jT808Package.Header = new JT808Header(); + // 3.1.读取消息Id + jT808Package.Header.MsgId = reader.ReadUInt16(); + // 3.2.读取消息体属性 + ushort messageBodyPropertyValue = reader.ReadUInt16(); + // 3.2.1.解包消息体属性 + jT808Package.Header.MessageBodyProperty = new JT808HeaderMessageBodyProperty(messageBodyPropertyValue); + // 3.3.读取终端手机号 + jT808Package.Header.TerminalPhoneNo = reader.ReadBCD(config.TerminalPhoneNoLength, config.Trim); + // 3.4.读取消息流水号 + jT808Package.Header.MsgNum = reader.ReadUInt16(); + // 3.5.判断有无分包 + if (jT808Package.Header.MessageBodyProperty.IsPackage) + { + //3.5.1.读取消息包总数 + jT808Package.Header.PackgeCount = reader.ReadUInt16(); + //3.5.2.读取消息包序号 + jT808Package.Header.PackageIndex = reader.ReadUInt16(); + } + // 4.处理数据体 + // 4.1.判断有无数据体 + if (jT808Package.Header.MessageBodyProperty.DataLength > 0) + { + jT808Package.Bodies = reader.ReadContent().ToArray(); + } + // 5.读取校验码 + jT808Package.CheckCode = reader.ReadByte(); + // 6.读取终止位置 + jT808Package.End = reader.ReadEnd(); + // ---------------解包完成-------------- + return jT808Package; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808HeaderPackage value, IJT808Config config) + { + throw new NotImplementedException("只适用反序列化"); + } } } diff --git a/src/JT808.Protocol/JT808Package.cs b/src/JT808.Protocol/JT808Package.cs index 8951888..47af02c 100644 --- a/src/JT808.Protocol/JT808Package.cs +++ b/src/JT808.Protocol/JT808Package.cs @@ -1,13 +1,17 @@ using JT808.Protocol.Attributes; +using JT808.Protocol.Enums; +using JT808.Protocol.Exceptions; +using JT808.Protocol.Extensions; using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; +using System; namespace JT808.Protocol { /// /// JT808数据包 /// - [JT808Formatter(typeof(JT808PackageFormatter))] - public class JT808Package + public class JT808Package:IJT808MessagePackFormatter { /// /// 起始符 @@ -46,5 +50,147 @@ namespace JT808.Protocol /// 数据体 /// public JT808Bodies Bodies { get; set; } + + public JT808Package Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + // 1. 验证校验和 + if (!config.SkipCRCCode) + { + if (!reader.CheckXorCodeVali) + { + throw new JT808Exception(JT808ErrorCode.CheckCodeNotEqual, $"{reader.RealCheckXorCode}!={reader.CalculateCheckXorCode}"); + } + } + JT808Package jT808Package = new JT808Package(); + // ---------------开始解包-------------- + // 2.读取起始位置 + jT808Package.Begin = reader.ReadStart(); + // 3.读取头部信息 + jT808Package.Header = new JT808Header(); + // 3.1.读取消息Id + jT808Package.Header.MsgId = reader.ReadUInt16(); + // 3.2.读取消息体属性 + jT808Package.Header.MessageBodyProperty = new JT808HeaderMessageBodyProperty(reader.ReadUInt16()); + // 3.3.读取终端手机号 + jT808Package.Header.TerminalPhoneNo = reader.ReadBCD(config.TerminalPhoneNoLength, config.Trim); + // 3.4.读取消息流水号 + jT808Package.Header.MsgNum = reader.ReadUInt16(); + // 3.5.判断有无分包 + if (jT808Package.Header.MessageBodyProperty.IsPackage) + { + //3.5.1.读取消息包总数 + jT808Package.Header.PackgeCount = reader.ReadUInt16(); + //3.5.2.读取消息包序号 + jT808Package.Header.PackageIndex = reader.ReadUInt16(); + } + // 4.处理数据体 + // 4.1.判断有无数据体 + if (jT808Package.Header.MessageBodyProperty.DataLength > 0) + { + Type jT808BodiesImplType = config.MsgIdFactory.GetBodiesImplTypeByMsgId(jT808Package.Header.MsgId, jT808Package.Header.TerminalPhoneNo); + if (jT808BodiesImplType != null) + { + if (jT808Package.Header.MessageBodyProperty.IsPackage) + { + if (jT808Package.Header.PackageIndex > 1) + { + try + { + //4.2处理第二包之后的分包数据消息体 +#warning 2处理第二包之后的分包数据消息体 + JT808SplitPackageBodies jT808SplitPackageBodies = new JT808SplitPackageBodies(); + jT808Package.Bodies = jT808SplitPackageBodies.Deserialize(ref reader, config); + } + catch (Exception ex) + { + throw new JT808Exception(JT808ErrorCode.BodiesParseError, ex); + } + } + else + { + try + { + //4.2.处理消息体 + jT808Package.Bodies = JT808MessagePackFormatterResolverExtensions.JT808DynamicDeserialize( + config.GetMessagePackFormatterByType(jT808BodiesImplType), + ref reader, config); + } + catch (Exception ex) + { + throw new JT808Exception(JT808ErrorCode.BodiesParseError, ex); + } + } + } + else + { + try + { + //4.2.处理消息体 + jT808Package.Bodies = JT808MessagePackFormatterResolverExtensions.JT808DynamicDeserialize( + config.GetMessagePackFormatterByType(jT808BodiesImplType), + ref reader, config); + } + catch (Exception ex) + { + throw new JT808Exception(JT808ErrorCode.BodiesParseError, ex); + } + } + } + } + // 5.读取校验码 + jT808Package.CheckCode = reader.ReadByte(); + // 6.读取终止位置 + jT808Package.End = reader.ReadEnd(); + // ---------------解包完成-------------- + return jT808Package; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808Package value, IJT808Config config) + { + // ---------------开始组包-------------- + // 1.起始符 + writer.WriteStart(); + // 2.写入头部 //部分有带数据体的长度,那么先跳过写入头部部分 + // 2.1.消息ID + writer.WriteUInt16(value.Header.MsgId); + // 2.2.消息体属性(包含消息体长度所以先跳过) + writer.Skip(2, out int msgBodiesPropertyPosition); + // 2.3.终端手机号 (写死大陆手机号码) + writer.WriteBCD(value.Header.TerminalPhoneNo, config.TerminalPhoneNoLength); + value.Header.MsgNum = value.Header.MsgNum > 0 ? value.Header.MsgNum : config.MsgSNDistributed.Increment(); + // 2.4.消息流水号 + writer.WriteUInt16(value.Header.MsgNum); + // 2.5.判断是否分包 + if (value.Header.MessageBodyProperty.IsPackage) + { + // 2.5.1.消息包总数 + writer.WriteUInt16(value.Header.PackgeCount); + // 2.5.2.消息包序号 + writer.WriteUInt16(value.Header.PackageIndex); + } + int headerLength = writer.GetCurrentPosition(); + // 3.处理数据体部分 + if (value.Bodies != null) + { + if (!value.Bodies.SkipSerialization) + { + JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize( + config.GetMessagePackFormatterByType(value.Bodies.GetType()), + ref writer, value.Bodies, + config); + } + } + // 3.1.处理数据体长度 + value.Header.MessageBodyProperty = new JT808HeaderMessageBodyProperty((ushort)(writer.GetCurrentPosition() - headerLength)); + // 2.2.回写消息体属性 + writer.WriteUInt16Return(value.Header.MessageBodyProperty.Wrap(), msgBodiesPropertyPosition); + // 4.校验码 + writer.WriteXor(); + // 5.终止符 + writer.WriteEnd(); + // 6.编码 + writer.WriteEncode(); + // ---------------组包结束-------------- + } } } diff --git a/src/JT808.Protocol/JT808Serializer.cs b/src/JT808.Protocol/JT808Serializer.cs index b37b324..58fe85e 100644 --- a/src/JT808.Protocol/JT808Serializer.cs +++ b/src/JT808.Protocol/JT808Serializer.cs @@ -9,6 +9,10 @@ namespace JT808.Protocol { public class JT808Serializer { + private readonly static JT808HeaderPackage jT808HeaderPackage = new JT808HeaderPackage(); + + private readonly static JT808Package jT808Package = new JT808Package(); + public JT808Serializer(IJT808Config jT808Config) { this.jT808Config = jT808Config; @@ -29,7 +33,7 @@ namespace JT808.Protocol try { JT808MessagePackWriter jT808MessagePackWriter = new JT808MessagePackWriter(buffer); - JT808PackageFormatter.Instance.Serialize(ref jT808MessagePackWriter, jT808Package, jT808Config); + jT808Package.Serialize(ref jT808MessagePackWriter, jT808Package, jT808Config); return jT808MessagePackWriter.FlushAndGetEncodingArray(); } finally @@ -45,7 +49,7 @@ namespace JT808.Protocol { JT808MessagePackReader jT808MessagePackReader = new JT808MessagePackReader(bytes); jT808MessagePackReader.Decode(buffer); - return JT808PackageFormatter.Instance.Deserialize(ref jT808MessagePackReader, jT808Config); + return jT808Package.Deserialize(ref jT808MessagePackReader, jT808Config); } finally { @@ -104,7 +108,7 @@ namespace JT808.Protocol { JT808MessagePackReader jT808MessagePackReader = new JT808MessagePackReader(bytes); jT808MessagePackReader.Decode(buffer); - return JT808HeaderPackageFormatter.Instance.Deserialize(ref jT808MessagePackReader,jT808Config); + return jT808HeaderPackage.Deserialize(ref jT808MessagePackReader,jT808Config); } finally { diff --git a/src/JT808.Protocol/JT808SplitPackageBodies.cs b/src/JT808.Protocol/JT808SplitPackageBodies.cs index f72236f..bc32e8e 100644 --- a/src/JT808.Protocol/JT808SplitPackageBodies.cs +++ b/src/JT808.Protocol/JT808SplitPackageBodies.cs @@ -1,14 +1,28 @@ using JT808.Protocol.Attributes; using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; namespace JT808.Protocol { /// /// 统一分包数据体 /// - [JT808Formatter(typeof(JT808SplitPackageBodiesFormatter))] - public class JT808SplitPackageBodies : JT808Bodies + public class JT808SplitPackageBodies : JT808Bodies, IJT808MessagePackFormatter { public byte[] Data { get; set; } + + public JT808SplitPackageBodies Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808SplitPackageBodies jT808SplitPackageBodies = new JT808SplitPackageBodies + { + Data = reader.ReadContent().ToArray() + }; + return jT808SplitPackageBodies; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808SplitPackageBodies value, IJT808Config config) + { + writer.WriteArray(value.Data); + } } } diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0001.cs b/src/JT808.Protocol/MessageBody/JT808_0x0001.cs index 0b51fdf..674ec91 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0001.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0001.cs @@ -1,6 +1,4 @@ using JT808.Protocol.Enums; -using JT808.Protocol.Formatters.MessageBodyFormatters; -using JT808.Protocol.Attributes; using JT808.Protocol.MessagePack; using JT808.Protocol.Formatters; @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// /// 终端通用应答 /// - [JT808Formatter(typeof(JT808_0x0001_Formatter))] public class JT808_0x0001 : JT808Bodies,IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0100.cs b/src/JT808.Protocol/MessageBody/JT808_0x0100.cs index 240876e..4586aae 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0100.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0100.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -8,7 +6,6 @@ namespace JT808.Protocol.MessageBody /// /// 终端注册 /// - [JT808Formatter(typeof(JT808_0x0100_Formatter))] public class JT808_0x0100 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0102.cs b/src/JT808.Protocol/MessageBody/JT808_0x0102.cs index 634f4b1..5599795 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0102.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0102.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Formatters.MessageBodyFormatters; -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -8,7 +6,6 @@ namespace JT808.Protocol.MessageBody /// /// 终端鉴权 /// - [JT808Formatter(typeof(JT808_0x0102_Formatter))] public class JT808_0x0102 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0104.cs b/src/JT808.Protocol/MessageBody/JT808_0x0104.cs index 144e896..7d9bead 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0104.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0104.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions; +using JT808.Protocol.Extensions; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; @@ -11,7 +9,6 @@ namespace JT808.Protocol.MessageBody /// /// 查询终端参数应答 /// - [JT808Formatter(typeof(JT808_0x0104_Formatter))] public class JT808_0x0104 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0107.cs b/src/JT808.Protocol/MessageBody/JT808_0x0107.cs index af0a841..bc55eba 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0107.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0107.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -8,7 +6,6 @@ namespace JT808.Protocol.MessageBody /// /// 查询终端属性应答 /// - [JT808Formatter(typeof(JT808_0x0107_Formatter))] public class JT808_0x0107 : JT808Bodies,IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0108.cs b/src/JT808.Protocol/MessageBody/JT808_0x0108.cs index ab65f18..4792831 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0108.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0108.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Enums; +using JT808.Protocol.Enums; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// /// 终端升级结果通知 /// - [JT808Formatter(typeof(JT808_0x0108_Formatter))] public class JT808_0x0108 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200.cs index d2f6bee..ec4d21c 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200.cs @@ -1,9 +1,7 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Enums; +using JT808.Protocol.Enums; using JT808.Protocol.Exceptions; using JT808.Protocol.Extensions; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; @@ -13,7 +11,6 @@ namespace JT808.Protocol.MessageBody /// /// 位置信息汇报 /// - [JT808Formatter(typeof(JT808_0x0200_Formatter))] public class JT808_0x0200 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x01.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x01.cs index 54520a7..d38e25f 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x01.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x01.cs @@ -1,13 +1,9 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System.Runtime.Serialization; namespace JT808.Protocol.MessageBody { - - [JT808Formatter(typeof(JT808_0x0200_0x01_Formatter))] public class JT808_0x0200_0x01 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter { public override byte AttachInfoId { get; set; } = 0x01; diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x02.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x02.cs index 2459264..ff0b914 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x02.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x02.cs @@ -1,12 +1,9 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System.Runtime.Serialization; namespace JT808.Protocol.MessageBody { - [JT808Formatter(typeof(JT808_0x0200_0x02_Formatter))] public class JT808_0x0200_0x02 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x03.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x03.cs index 44bcffc..46a886c 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x03.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x03.cs @@ -1,13 +1,10 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System.Runtime.Serialization; namespace JT808.Protocol.MessageBody { - [JT808Formatter(typeof(JT808_0x0200_0x03_Formatter))] public class JT808_0x0200_0x03 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x04.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x04.cs index 03f5257..2382d37 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x04.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x04.cs @@ -1,11 +1,9 @@ using JT808.Protocol.Attributes; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody { - [JT808Formatter(typeof(JT808_0x0200_0x04_Formatter))] public class JT808_0x0200_0x04 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x11.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x11.cs index 06a027d..629bdcd 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x11.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x11.cs @@ -1,12 +1,9 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Enums; +using JT808.Protocol.Enums; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody { - [JT808Formatter(typeof(JT808_0x0200_0x11_Formatter))] public class JT808_0x0200_0x11 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x12.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x12.cs index 5bec96b..c2c147c 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x12.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x12.cs @@ -1,12 +1,9 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Enums; +using JT808.Protocol.Enums; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody { - [JT808Formatter(typeof(JT808_0x0200_0x12_Formatter))] public class JT808_0x0200_0x12 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x13.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x13.cs index 1eb95a7..8a8c4d6 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x13.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x13.cs @@ -1,13 +1,9 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Enums; +using JT808.Protocol.Enums; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody { - - [JT808Formatter(typeof(JT808_0x0200_0x13_Formatter))] public class JT808_0x0200_0x13 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter { public override byte AttachInfoId { get; set; } = 0x13; diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x25.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x25.cs index 3ad4fa4..9462f38 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x25.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x25.cs @@ -1,11 +1,8 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody { - [JT808Formatter(typeof(JT808_0x0200_0x25_Formatter))] public class JT808_0x0200_0x25 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x2A.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x2A.cs index d49847f..1113c38 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x2A.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x2A.cs @@ -1,11 +1,8 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody { - [JT808Formatter(typeof(JT808_0x0200_0x2A_Formatter))] public class JT808_0x0200_0x2A : JT808_0x0200_BodyBase, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x2B.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x2B.cs index 1ad662c..5cfd8c9 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x2B.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x2B.cs @@ -1,11 +1,9 @@ using JT808.Protocol.Attributes; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody { - [JT808Formatter(typeof(JT808_0x0200_0x2B_Formatter))] public class JT808_0x0200_0x2B : JT808_0x0200_BodyBase, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x30.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x30.cs index b3c14cf..a385648 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x30.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x30.cs @@ -1,11 +1,9 @@ using JT808.Protocol.Attributes; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody { - [JT808Formatter(typeof(JT808_0x0200_0x30_Formatter))] public class JT808_0x0200_0x30 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x31.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x31.cs index 740ebc0..048dc80 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_0x31.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_0x31.cs @@ -1,11 +1,8 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody { - [JT808Formatter(typeof(JT808_0x0200_0x31_Formatter))] public class JT808_0x0200_0x31 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0200_BodyBase.cs b/src/JT808.Protocol/MessageBody/JT808_0x0200_BodyBase.cs index 3596491..c33f307 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0200_BodyBase.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0200_BodyBase.cs @@ -1,5 +1,4 @@ -using JT808.Protocol.Formatters.MessageBodyFormatters; -using System; +using System; using System.Collections.Generic; namespace JT808.Protocol.MessageBody diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0201.cs b/src/JT808.Protocol/MessageBody/JT808_0x0201.cs index 2d219a7..7f2dfe2 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0201.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0201.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -8,7 +6,6 @@ namespace JT808.Protocol.MessageBody /// /// 位置信息查询应答 /// - [JT808Formatter(typeof(JT808_0x0201_Formatter))] public class JT808_0x0201 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0301.cs b/src/JT808.Protocol/MessageBody/JT808_0x0301.cs index d573d02..c00758e 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0301.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0301.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// 事件报告 /// 0x0301 /// - [JT808Formatter(typeof(JT808_0x0301_Formatter))] public class JT808_0x0301 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0302.cs b/src/JT808.Protocol/MessageBody/JT808_0x0302.cs index 4042c8e..8c2a6e8 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0302.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0302.cs @@ -1,6 +1,5 @@ using JT808.Protocol.Attributes; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 提问应答 /// 0x0302 /// - [JT808Formatter(typeof(JT808_0x0302_Formatter))] public class JT808_0x0302 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0303.cs b/src/JT808.Protocol/MessageBody/JT808_0x0303.cs index 3d577fc..36c165f 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0303.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0303.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// 信息点播/取消 /// 0x0303 /// - [JT808Formatter(typeof(JT808_0x0303_Formatter))] public class JT808_0x0303 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0500.cs b/src/JT808.Protocol/MessageBody/JT808_0x0500.cs index 214a026..3ab7162 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0500.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0500.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -8,7 +6,6 @@ namespace JT808.Protocol.MessageBody /// /// 车辆控制应答 /// - [JT808Formatter(typeof(JT808_0x0500_Formatter))] public class JT808_0x0500 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0701.cs b/src/JT808.Protocol/MessageBody/JT808_0x0701.cs index f8f2cd6..ebfa239 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0701.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0701.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions; +using JT808.Protocol.Extensions; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; using System; @@ -11,7 +9,6 @@ namespace JT808.Protocol.MessageBody /// 电子运单上报 /// 0x0701 /// - [JT808Formatter(typeof(JT808_0x0701_Formatter))] public class JT808_0x0701 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0701_CustomBodyBase.cs b/src/JT808.Protocol/MessageBody/JT808_0x0701_CustomBodyBase.cs index 2678763..3d74f36 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0701_CustomBodyBase.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0701_CustomBodyBase.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters.MessageBodyFormatters; -using System; +using System; namespace JT808.Protocol.MessageBody { diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0702.cs b/src/JT808.Protocol/MessageBody/JT808_0x0702.cs index 7bbc36f..a9f73e8 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0702.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0702.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Enums; +using JT808.Protocol.Enums; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; using System; @@ -10,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// /// 驾驶员身份信息采集上报 /// - [JT808Formatter(typeof(JT808_0x0702_Formatter))] public class JT808_0x0702 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0704.cs b/src/JT808.Protocol/MessageBody/JT808_0x0704.cs index dc01679..01f1a59 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0704.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0704.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; @@ -10,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// /// 定位数据批量上传 /// - [JT808Formatter(typeof(JT808_0x0704_Formatter))] public class JT808_0x0704 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0705.cs b/src/JT808.Protocol/MessageBody/JT808_0x0705.cs index 03009c4..1a0c859 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0705.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0705.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Exceptions; +using JT808.Protocol.Exceptions; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; using JT808.Protocol.Metadata; using System; @@ -13,7 +11,6 @@ namespace JT808.Protocol.MessageBody /// CAN 总线数据上传 /// 0x0705 /// - [JT808Formatter(typeof(JT808_0x0705_Formatter))] public class JT808_0x0705 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0800.cs b/src/JT808.Protocol/MessageBody/JT808_0x0800.cs index 3b9b62b..4026768 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0800.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0800.cs @@ -1,6 +1,5 @@ using JT808.Protocol.Attributes; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 多媒体事件信息上传 /// 0x0800 /// - [JT808Formatter(typeof(JT808_0x0800_Formatter))] public class JT808_0x0800 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0801.cs b/src/JT808.Protocol/MessageBody/JT808_0x0801.cs index 6263c08..c8b6f4d 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0801.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0801.cs @@ -1,6 +1,5 @@ using JT808.Protocol.Attributes; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 多媒体数据上传 /// 0x0801 /// - [JT808Formatter(typeof(JT808_0x0801_Formatter))] public class JT808_0x0801 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0802.cs b/src/JT808.Protocol/MessageBody/JT808_0x0802.cs index be2d3b3..cf77c14 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0802.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0802.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using JT808.Protocol.Metadata; using System.Collections.Generic; @@ -11,7 +9,6 @@ namespace JT808.Protocol.MessageBody /// 存储多媒体数据检索应答 /// 0x0802 /// - [JT808Formatter(typeof(JT808_0x0802_Formatter))] public class JT808_0x0802 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0805.cs b/src/JT808.Protocol/MessageBody/JT808_0x0805.cs index b69f25f..b2ec91d 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0805.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0805.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System.Collections.Generic; @@ -10,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 摄像头立即拍摄命令应答 /// 0x0805 /// - [JT808Formatter(typeof(JT808_0x0805_Formatter))] public class JT808_0x0805 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0900.cs b/src/JT808.Protocol/MessageBody/JT808_0x0900.cs index 409bdb7..2456b66 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0900.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0900.cs @@ -1,7 +1,6 @@ using JT808.Protocol.Attributes; using JT808.Protocol.Extensions; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// /// 数据上行透传 /// - [JT808Formatter(typeof(JT808_0x0900_Formatter))] public class JT808_0x0900 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0901.cs b/src/JT808.Protocol/MessageBody/JT808_0x0901.cs index f8a0717..c332d97 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0901.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0901.cs @@ -1,6 +1,5 @@ using JT808.Protocol.Attributes; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 数据压缩上报 /// 0x0901 /// - [JT808Formatter(typeof(JT808_0x0901_Formatter))] public class JT808_0x0901 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x0A00.cs b/src/JT808.Protocol/MessageBody/JT808_0x0A00.cs index 8d6aead..a071093 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x0A00.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x0A00.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Exceptions; +using JT808.Protocol.Exceptions; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -10,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 终端 RSA 公钥 /// 0x0A00 /// - [JT808Formatter(typeof(JT808_0x0A00_Formatter))] public class JT808_0x0A00 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8001.cs b/src/JT808.Protocol/MessageBody/JT808_0x8001.cs index a397ec5..5fc9d33 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8001.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8001.cs @@ -1,7 +1,6 @@ using JT808.Protocol.Attributes; using JT808.Protocol.Enums; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// /// 平台通用应答 /// - [JT808Formatter(typeof(JT808_0x8001_Formatter))] public class JT808_0x8001 : JT808Bodies, IJT808MessagePackFormatter { public ushort MsgNum { get; set; } diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8003.cs b/src/JT808.Protocol/MessageBody/JT808_0x8003.cs index 9c10d82..487d043 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8003.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8003.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// 补传分包请求 /// 0x8003 /// - [JT808Formatter(typeof(JT808_0x8003_Formatter))] public class JT808_0x8003 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8100.cs b/src/JT808.Protocol/MessageBody/JT808_0x8100.cs index 6a8b90f..0e3ff3e 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8100.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8100.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Enums; +using JT808.Protocol.Enums; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// /// 终端注册应答 /// - [JT808Formatter(typeof(JT808_0x8100_Formatter))] public class JT808_0x8100 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8105.cs b/src/JT808.Protocol/MessageBody/JT808_0x8105.cs index d9ad8a6..673315d 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8105.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8105.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System; @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// /// 终端控制 /// - [JT808Formatter(typeof(JT808_0x8105_Formatter))] public class JT808_0x8105 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8106.cs b/src/JT808.Protocol/MessageBody/JT808_0x8106.cs index 649aabd..c183f03 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8106.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8106.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System; @@ -10,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 查询指定终端参数 /// 0x8106 /// - [JT808Formatter(typeof(JT808_0x8106_Formatter))] public class JT808_0x8106 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8108.cs b/src/JT808.Protocol/MessageBody/JT808_0x8108.cs index 69b3925..b664b98 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8108.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8108.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Enums; +using JT808.Protocol.Enums; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// /// 下发终端升级包 /// - [JT808Formatter(typeof(JT808_0x8108_Formatter))] public class JT808_0x8108 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8202.cs b/src/JT808.Protocol/MessageBody/JT808_0x8202.cs index 9d1b49a..12ff628 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8202.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8202.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -8,7 +6,6 @@ namespace JT808.Protocol.MessageBody /// /// 临时位置跟踪控制 /// - [JT808Formatter(typeof(JT808_0x8202_Formatter))] public class JT808_0x8202 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8203.cs b/src/JT808.Protocol/MessageBody/JT808_0x8203.cs index 684ac00..1d54a67 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8203.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8203.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// 人工确认报警消息 /// 0x8203 /// - [JT808Formatter(typeof(JT808_0x8203_Formatter))] public class JT808_0x8203 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8300.cs b/src/JT808.Protocol/MessageBody/JT808_0x8300.cs index 7dcbf8a..0dcbbf6 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8300.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8300.cs @@ -1,6 +1,5 @@ using JT808.Protocol.Attributes; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -8,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// /// 文本信息下发 /// - [JT808Formatter(typeof(JT808_0x8300_Formatter))] public class JT808_0x8300 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8301.cs b/src/JT808.Protocol/MessageBody/JT808_0x8301.cs index 28737ea..74cbe57 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8301.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8301.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using JT808.Protocol.Metadata; using System.Collections.Generic; @@ -11,7 +9,6 @@ namespace JT808.Protocol.MessageBody /// 事件设置 /// 0x8301 /// - [JT808Formatter(typeof(JT808_0x8301_Formatter))] public class JT808_0x8301 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8302.cs b/src/JT808.Protocol/MessageBody/JT808_0x8302.cs index 0ce1755..c2097bf 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8302.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8302.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System; using System.Collections.Generic; @@ -11,7 +9,6 @@ namespace JT808.Protocol.MessageBody /// 提问下发 /// 0x8302 /// - [JT808Formatter(typeof(JT808_0x8302_Formatter))] public class JT808_0x8302 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8303.cs b/src/JT808.Protocol/MessageBody/JT808_0x8303.cs index 2638c4e..6cd992e 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8303.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8303.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using JT808.Protocol.Metadata; using System.Collections.Generic; @@ -11,7 +9,6 @@ namespace JT808.Protocol.MessageBody /// 信息点播菜单设置 /// 0x8303 /// - [JT808Formatter(typeof(JT808_0x8303_Formatter))] public class JT808_0x8303 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8304.cs b/src/JT808.Protocol/MessageBody/JT808_0x8304.cs index 8d22391..19f7a88 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8304.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8304.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// 信息服务 /// 0x8304 /// - [JT808Formatter(typeof(JT808_0x8304_Formatter))] public class JT808_0x8304 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8400.cs b/src/JT808.Protocol/MessageBody/JT808_0x8400.cs index f84a2a0..d71b070 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8400.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8400.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Enums; +using JT808.Protocol.Enums; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// /// 电话回拨 /// - [JT808Formatter(typeof(JT808_0x8400_Formatter))] public class JT808_0x8400 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8401.cs b/src/JT808.Protocol/MessageBody/JT808_0x8401.cs index ccc69ac..9e4b5e8 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8401.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8401.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Enums; +using JT808.Protocol.Enums; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; using JT808.Protocol.Metadata; using System.Collections.Generic; @@ -11,7 +9,6 @@ namespace JT808.Protocol.MessageBody /// /// 设置电话本 /// - [JT808Formatter(typeof(JT808_0x8401_Formatter))] public class JT808_0x8401 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8500.cs b/src/JT808.Protocol/MessageBody/JT808_0x8500.cs index 0efc718..76d08bb 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8500.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8500.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -8,7 +6,6 @@ namespace JT808.Protocol.MessageBody /// /// 车辆控制 /// - [JT808Formatter(typeof(JT808_0x8500_Formatter))] public class JT808_0x8500 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8600.cs b/src/JT808.Protocol/MessageBody/JT808_0x8600.cs index 5c5c138..8693df6 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8600.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8600.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using JT808.Protocol.Metadata; using System; @@ -13,7 +11,6 @@ namespace JT808.Protocol.MessageBody /// 0x8600 /// 注:本条消息协议支持周期时间范围,如要限制每天的8:30-18:00,起始/结束时间设为:00-00-00-08-30-00/00-00-00-18-00-00,其他以此类推 /// - [JT808Formatter(typeof(JT808_0x8600_Formatter))] public class JT808_0x8600 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8601.cs b/src/JT808.Protocol/MessageBody/JT808_0x8601.cs index 9c2fc46..4cc160a 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8601.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8601.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System.Collections.Generic; @@ -10,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 删除圆形区域 /// 0x8601 /// - [JT808Formatter(typeof(JT808_0x8601_Formatter))] public class JT808_0x8601 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8602.cs b/src/JT808.Protocol/MessageBody/JT808_0x8602.cs index 043f752..85ad2e3 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8602.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8602.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using JT808.Protocol.Metadata; using System; @@ -12,7 +10,6 @@ namespace JT808.Protocol.MessageBody /// 设置矩形区域 /// 0x8602 /// - [JT808Formatter(typeof(JT808_0x8602_Formatter))] public class JT808_0x8602 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8603.cs b/src/JT808.Protocol/MessageBody/JT808_0x8603.cs index 0ae4cd8..e714765 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8603.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8603.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System.Collections.Generic; @@ -10,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 删除矩形区域 /// 0x8603 /// - [JT808Formatter(typeof(JT808_0x8603_Formatter))] public class JT808_0x8603 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8604.cs b/src/JT808.Protocol/MessageBody/JT808_0x8604.cs index 918ad12..a23c872 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8604.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8604.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using JT808.Protocol.Metadata; using System; @@ -12,7 +10,6 @@ namespace JT808.Protocol.MessageBody /// 设置多边形区域 /// 0x8604 /// - [JT808Formatter(typeof(JT808_0x8604_Formatter))] public class JT808_0x8604 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8605.cs b/src/JT808.Protocol/MessageBody/JT808_0x8605.cs index 4cf6f0f..e231cf4 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8605.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8605.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System.Collections.Generic; @@ -10,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 删除多边形区域 /// 0x8605 /// - [JT808Formatter(typeof(JT808_0x8605_Formatter))] public class JT808_0x8605 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8606.cs b/src/JT808.Protocol/MessageBody/JT808_0x8606.cs index fd9975f..6d4480d 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8606.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8606.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using JT808.Protocol.Metadata; using System; @@ -12,7 +10,6 @@ namespace JT808.Protocol.MessageBody /// 设置路线 /// 0x8606 /// - [JT808Formatter(typeof(JT808_0x8606_Formatter))] public class JT808_0x8606 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8607.cs b/src/JT808.Protocol/MessageBody/JT808_0x8607.cs index 5aa2ead..1cc9c54 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8607.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8607.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System.Collections.Generic; @@ -10,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 删除路线 /// 0x8607 /// - [JT808Formatter(typeof(JT808_0x8607_Formatter))] public class JT808_0x8607 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8800.cs b/src/JT808.Protocol/MessageBody/JT808_0x8800.cs index 3b9ed3a..da5c7b4 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8800.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8800.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// 多媒体数据上传应答 /// 0x8800 /// - [JT808Formatter(typeof(JT808_0x8800_Formatter))] public class JT808_0x8800 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8801.cs b/src/JT808.Protocol/MessageBody/JT808_0x8801.cs index 4ee6c7f..3ddfed7 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8801.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8801.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// 摄像头立即拍摄命令 /// 0x8801 /// - [JT808Formatter(typeof(JT808_0x8801_Formatter))] public class JT808_0x8801 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8802.cs b/src/JT808.Protocol/MessageBody/JT808_0x8802.cs index 87bada8..aa5d1fb 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8802.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8802.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System; @@ -10,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 存储多媒体数据检索 /// 0x8802 /// - [JT808Formatter(typeof(JT808_0x8802_Formatter))] public class JT808_0x8802 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8803.cs b/src/JT808.Protocol/MessageBody/JT808_0x8803.cs index cb82629..43af07c 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8803.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8803.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; using System; @@ -10,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 存储多媒体数据上传命令 /// 0x8803 /// - [JT808Formatter(typeof(JT808_0x8803_Formatter))] public class JT808_0x8803 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8804.cs b/src/JT808.Protocol/MessageBody/JT808_0x8804.cs index 5e312e4..71829ba 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8804.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8804.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Enums; +using JT808.Protocol.Enums; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// /// 录音开始命令 /// - [JT808Formatter(typeof(JT808_0x8804_Formatter))] public class JT808_0x8804 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8805.cs b/src/JT808.Protocol/MessageBody/JT808_0x8805.cs index cf91e48..d4b344b 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8805.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8805.cs @@ -1,6 +1,4 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; +using JT808.Protocol.Formatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -8,7 +6,6 @@ namespace JT808.Protocol.MessageBody /// /// 单条存储多媒体数据检索上传命令 /// - [JT808Formatter(typeof(JT808_0x8805_Formatter))] public class JT808_0x8805 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8900.cs b/src/JT808.Protocol/MessageBody/JT808_0x8900.cs index 58c8315..1624603 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8900.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8900.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Extensions; +using JT808.Protocol.Extensions; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -9,7 +7,6 @@ namespace JT808.Protocol.MessageBody /// /// 数据下行透传 /// - [JT808Formatter(typeof(JT808_0x8900_Formatter))] public class JT808_0x8900 : JT808Bodies, IJT808MessagePackFormatter { /// diff --git a/src/JT808.Protocol/MessageBody/JT808_0x8A00.cs b/src/JT808.Protocol/MessageBody/JT808_0x8A00.cs index 36110ef..f5e6b65 100644 --- a/src/JT808.Protocol/MessageBody/JT808_0x8A00.cs +++ b/src/JT808.Protocol/MessageBody/JT808_0x8A00.cs @@ -1,7 +1,5 @@ -using JT808.Protocol.Attributes; -using JT808.Protocol.Exceptions; +using JT808.Protocol.Exceptions; using JT808.Protocol.Formatters; -using JT808.Protocol.Formatters.MessageBodyFormatters; using JT808.Protocol.MessagePack; namespace JT808.Protocol.MessageBody @@ -10,7 +8,6 @@ namespace JT808.Protocol.MessageBody /// 平台RSA公钥 /// 0x8A00 /// - [JT808Formatter(typeof(JT808_0x8A00_Formatter))] public class JT808_0x8A00 : JT808Bodies, IJT808MessagePackFormatter { ///