Browse Source

减少搬砖量╮(╯▽╰)╭

tags/v2.2.0
SmallChi(Koike) 5 years ago
parent
commit
c57d42d9e6
93 changed files with 612 additions and 1790 deletions
  1. +1
    -1
      src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj
  2. +0
    -1
      src/JT808.Protocol.Benchmark/JT808SerializerContext.cs
  3. +27
    -0
      src/JT808.Protocol.Test/Internal/JT808FormatterFactoryTest.cs
  4. +0
    -1
      src/JT808.Protocol.Test/Internal/JT808MsgIdFactoryTest.cs
  5. +1
    -8
      src/JT808.Protocol.Test/JT808.Protocol.Test.csproj
  6. +22
    -4
      src/JT808.Protocol.Test/MessageBody/JT808LocationAttachExtensions/JT808LocationAttachImpl0x06.cs
  7. +16
    -4
      src/JT808.Protocol.Test/MessageBody/JT808_0X8900_BodiesImpl/JT808_0X8900_Test_BodiesImpl.cs
  8. +21
    -4
      src/JT808.Protocol.Test/MessageBody/JT808_0x0701BodiesImpl/JT808_0x0701TestBodiesImpl.cs
  9. +15
    -4
      src/JT808.Protocol.Test/MessageBody/JT808_0x0900_BodiesImpl/JT808_0x0900_0x83.cs
  10. +24
    -0
      src/JT808.Protocol.Test/MessageBody/JT808_0x9999.cs
  11. +2
    -2
      src/JT808.Protocol.Test/MessagePack/JT808MessagePackReaderTest.cs
  12. +14
    -34
      src/JT808.Protocol.Test/Simples/Demo4.cs
  13. +6
    -13
      src/JT808.Protocol.Test/Simples/Demo6.cs
  14. +4
    -4
      src/JT808.Protocol/Enums/JT808MsgId.cs
  15. +20
    -37
      src/JT808.Protocol/Extensions/JT808PackageExtensionsTemplate.cs
  16. +4
    -4
      src/JT808.Protocol/Interfaces/GlobalConfigBase.cs
  17. +9
    -18
      src/JT808.Protocol/Internal/JT808FormatterFactory.cs
  18. +95
    -0
      src/JT808.Protocol/JT808.Protocol.csproj
  19. +0
    -1384
      src/JT808.Protocol/JT808.Protocol.xml
  20. +44
    -4
      src/JT808.Protocol/JT808Header.cs
  21. +58
    -2
      src/JT808.Protocol/JT808HeaderPackage.cs
  22. +148
    -2
      src/JT808.Protocol/JT808Package.cs
  23. +7
    -3
      src/JT808.Protocol/JT808Serializer.cs
  24. +16
    -2
      src/JT808.Protocol/JT808SplitPackageBodies.cs
  25. +0
    -3
      src/JT808.Protocol/MessageBody/JT808_0x0001.cs
  26. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0100.cs
  27. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0102.cs
  28. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0104.cs
  29. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0107.cs
  30. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0108.cs
  31. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0200.cs
  32. +1
    -5
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x01.cs
  33. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x02.cs
  34. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x03.cs
  35. +0
    -2
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x04.cs
  36. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x11.cs
  37. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x12.cs
  38. +1
    -5
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x13.cs
  39. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x25.cs
  40. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x2A.cs
  41. +0
    -2
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x2B.cs
  42. +0
    -2
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x30.cs
  43. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x31.cs
  44. +1
    -2
      src/JT808.Protocol/MessageBody/JT808_0x0200_BodyBase.cs
  45. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0201.cs
  46. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0301.cs
  47. +0
    -2
      src/JT808.Protocol/MessageBody/JT808_0x0302.cs
  48. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0303.cs
  49. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0500.cs
  50. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0701.cs
  51. +1
    -3
      src/JT808.Protocol/MessageBody/JT808_0x0701_CustomBodyBase.cs
  52. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0702.cs
  53. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0704.cs
  54. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0705.cs
  55. +0
    -2
      src/JT808.Protocol/MessageBody/JT808_0x0800.cs
  56. +0
    -2
      src/JT808.Protocol/MessageBody/JT808_0x0801.cs
  57. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0802.cs
  58. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0805.cs
  59. +0
    -2
      src/JT808.Protocol/MessageBody/JT808_0x0900.cs
  60. +0
    -2
      src/JT808.Protocol/MessageBody/JT808_0x0901.cs
  61. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x0A00.cs
  62. +0
    -2
      src/JT808.Protocol/MessageBody/JT808_0x8001.cs
  63. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8003.cs
  64. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8100.cs
  65. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8105.cs
  66. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8106.cs
  67. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8108.cs
  68. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8202.cs
  69. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8203.cs
  70. +0
    -2
      src/JT808.Protocol/MessageBody/JT808_0x8300.cs
  71. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8301.cs
  72. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8302.cs
  73. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8303.cs
  74. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8304.cs
  75. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8400.cs
  76. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8401.cs
  77. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8500.cs
  78. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8600.cs
  79. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8601.cs
  80. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8602.cs
  81. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8603.cs
  82. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8604.cs
  83. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8605.cs
  84. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8606.cs
  85. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8607.cs
  86. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8800.cs
  87. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8801.cs
  88. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8802.cs
  89. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8803.cs
  90. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8804.cs
  91. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8805.cs
  92. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8900.cs
  93. +1
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8A00.cs

+ 1
- 1
src/JT808.Protocol.Benchmark/JT808.Protocol.Benchmark.csproj View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2;net472;netcoreapp3.0;</TargetFrameworks>
<TargetFrameworks>net472;netcoreapp3.0;</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputType>Exe</OutputType>


+ 0
- 1
src/JT808.Protocol.Benchmark/JT808SerializerContext.cs View File

@@ -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));
}
}


+ 27
- 0
src/JT808.Protocol.Test/Internal/JT808FormatterFactoryTest.cs View File

@@ -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<JT808_0x9999>();
Assert.Contains(jT808FormatterFactory.FormatterDict, f => f.Key == typeof(JT808_0x9999).GUID);
}
}
}

+ 0
- 1
src/JT808.Protocol.Test/Internal/JT808MsgIdFactoryTest.cs View File

@@ -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;


+ 1
- 8
src/JT808.Protocol.Test/JT808.Protocol.Test.csproj View File

@@ -27,18 +27,12 @@
<ItemGroup>
<Compile Include="Extensions\JT808EnumExtensionsTest.cs" />
<Compile Include="Extensions\JT808PackageExtensionsTest.cs" />
<Compile Include="MessageBody\JT808Formatters\JT808_0x0200_0x06Formatter.cs" />
<Compile Include="MessageBody\JT808Formatters\JT808_0x0701TestBodiesImplFormatter.cs" />
<Compile Include="MessageBody\JT808Formatters\JT808_0x0900_0x83Formatter.cs" />
<Compile Include="MessageBody\JT808Formatters\JT808_0x8103_0x0075_Formatter.cs" />
<Compile Include="MessageBody\JT808Formatters\JT808_0X8900_Test_BodiesImplFormatter.cs" />
<Compile Include="MessageBody\JT808LocationAttachExtensions\JT808LocationAttachImpl0x06.cs" />
<Compile Include="MessageBody\JT808_0x0001Test.cs" />
<Compile Include="MessageBody\JT808_0x0002Test.cs" />
<Compile Include="MessageBody\JT808_0x0003Test.cs" />
<Compile Include="MessageBody\JT808_0x0100Test.cs" />
<Compile Include="MessageBody\JT808_0x0102Test.cs" />
<Compile Include="MessageBody\JT808_0x0104Test.cs" />
<Compile Include="MessageBody\JT808_0x0107Test.cs" />
<Compile Include="MessageBody\JT808_0x0108Test.cs" />
<Compile Include="MessageBody\JT808_0x0200Test.cs" />
@@ -63,8 +57,6 @@
<Compile Include="MessageBody\JT808_0x8001Test.cs" />
<Compile Include="MessageBody\JT808_0x8003Test.cs" />
<Compile Include="MessageBody\JT808_0x8100Test.cs" />
<Compile Include="MessageBody\JT808_0x8103CustomIdExtensions\JT808_0x8103_0x0075.cs" />
<Compile Include="MessageBody\JT808_0x8103Test.cs" />
<Compile Include="MessageBody\JT808_0x8104Test.cs" />
<Compile Include="MessageBody\JT808_0x8105Test.cs" />
<Compile Include="MessageBody\JT808_0x8106Test.cs" />
@@ -95,6 +87,7 @@
<Compile Include="MessageBody\JT808_0x8900Test.cs" />
<Compile Include="MessageBody\JT808_0X8900_BodiesImpl\JT808_0X8900_Test_BodiesImpl.cs" />
<Compile Include="MessageBody\JT808_0x8A00Test.cs" />
<Compile Include="MessageBody\JT808_0x9999.cs" />
</ItemGroup>

<ItemGroup>


+ 22
- 4
src/JT808.Protocol.Test/MessageBody/JT808LocationAttachExtensions/JT808LocationAttachImpl0x06.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x0200_0x06Formatter))]
public class JT808LocationAttachImpl0x06: JT808_0x0200_CustomBodyBase
public class JT808LocationAttachImpl0x06: JT808_0x0200_CustomBodyBase, IJT808MessagePackFormatter<JT808LocationAttachImpl0x06>
{
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);
}
}
}

+ 16
- 4
src/JT808.Protocol.Test/MessageBody/JT808_0X8900_BodiesImpl/JT808_0X8900_Test_BodiesImpl.cs View File

@@ -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<JT808_0X8900_Test_BodiesImpl>
{
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);
}
}
}

+ 21
- 4
src/JT808.Protocol.Test/MessageBody/JT808_0x0701BodiesImpl/JT808_0x0701TestBodiesImpl.cs View File

@@ -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<JT808_0x0701TestBodiesImpl>
{
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);
}
}
}

+ 15
- 4
src/JT808.Protocol.Test/MessageBody/JT808_0x0900_BodiesImpl/JT808_0x0900_0x83.cs View File

@@ -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<JT808_0x0900_0x83>
{
/// <summary>
/// 透传内容
/// </summary>
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);
}
}
}

+ 24
- 0
src/JT808.Protocol.Test/MessageBody/JT808_0x9999.cs View File

@@ -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<JT808_0x9999>
{
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);
}
}
}

+ 2
- 2
src/JT808.Protocol.Test/MessagePack/JT808MessagePackReaderTest.cs View File

@@ -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]


+ 14
- 34
src/JT808.Protocol.Test/Simples/Demo4.cs View File

@@ -251,42 +251,14 @@ namespace JT808.Protocol.Test.Simples
/// <summary>
/// 设备类型1-对应消息协议0x81
/// </summary>
[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<JT808_0x0200_DT1_0x81>
{
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; }
}
/// <summary>
/// 设备类型1-对应消息协议0x82
/// </summary>
[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; }
}
/// <summary>
/// 设备类型2-对应消息协议0x81
/// </summary>
[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; }
}
/// <summary>
/// 设备类型1-对应消息协议序列化器 0x81
/// </summary>
public class JT808_0x0200_DT1_0x81Formatter : IJT808MessagePackFormatter<JT808_0x0200_DT1_0x81>
{

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
}
}
/// <summary>
/// 设备类型1-对应消息协议序列化器 0x82
/// 设备类型1-对应消息协议0x82
/// </summary>
public class JT808_0x0200_DT1_0x82Formatter : IJT808MessagePackFormatter<JT808_0x0200_DT1_0x82>
public class JT808_0x0200_DT1_0x82 : JT808_0x0200_CustomBodyBase, IJT808MessagePackFormatter<JT808_0x0200_DT1_0x82>
{
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
}
}
/// <summary>
/// 设备类型2-对应消息协议序列化器 0x81
/// 设备类型2-对应消息协议0x81
/// </summary>
public class JT808_0x0200_DT2_0x81Formatter : IJT808MessagePackFormatter<JT808_0x0200_DT2_0x81>
public class JT808_0x0200_DT2_0x81 : JT808_0x0200_CustomBodyBase, IJT808MessagePackFormatter<JT808_0x0200_DT2_0x81>
{
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();


+ 6
- 13
src/JT808.Protocol.Test/Simples/Demo6.cs View File

@@ -83,22 +83,11 @@ namespace JT808.Protocol.Test.Simples
}
}

[JT808Formatter(typeof(DT1Demo6_Formatter))]
public class DT1Demo6 : JT808Bodies
public class DT1Demo6 : JT808Bodies, IJT808MessagePackFormatter<DT1Demo6>
{
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<DT1Demo6>
{
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<DT2Demo6>

public class DT2Demo6 : JT808Bodies, IJT808MessagePackFormatter<DT2Demo6>
{
public byte Sex2 { get; set; }

public ushort Age2 { get; set; }
public DT2Demo6 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
{
DT2Demo6 dT2Demo6 = new DT2Demo6();


+ 4
- 4
src/JT808.Protocol/Enums/JT808MsgId.cs View File

@@ -64,25 +64,26 @@ namespace JT808.Protocol.Enums
[JT808BodiesType(typeof(JT808_0x0102))]
[JT808MsgIdDescription("0x0102", "终端鉴权")]
终端鉴权 = 0x0102,
#warning 设置终端参数 查询终端参数 查询终端参数应答
/// <summary>
/// 设置终端参数
/// 0x8103
/// </summary>
[JT808BodiesType(typeof(JT808_0x8103))]
//[JT808BodiesType(typeof(JT808_0x8103))]
[JT808MsgIdDescription("0x8103", "设置终端参数")]
设置终端参数 = 0x8103,
/// <summary>
/// 查询终端参数
/// 0x8104
/// </summary>
[JT808BodiesType(typeof(JT808_0x8104))]
//[JT808BodiesType(typeof(JT808_0x8104))]
[JT808MsgIdDescription("0x8104", "查询终端参数")]
查询终端参数 = 0x8104,
/// <summary>
/// 查询终端参数应答
/// 0x0104
/// </summary>
[JT808BodiesType(typeof(JT808_0x0104))]
//[JT808BodiesType(typeof(JT808_0x0104))]
[JT808MsgIdDescription("0x0104", "查询终端参数应答")]
查询终端参数应答 = 0x0104,
/// <summary>
@@ -302,7 +303,6 @@ namespace JT808.Protocol.Enums
[JT808BodiesType(typeof(JT808_0x8607))]
[JT808MsgIdDescription("0x8607", "删除路线")]
删除路线 = 0x8607,

///// <summary>
///// 行驶记录仪数据采集命令
///// 0x8700


+ 20
- 37
src/JT808.Protocol/Extensions/JT808PackageExtensionsTemplate.cs View File

@@ -89,23 +89,23 @@ namespace JT808.Protocol.Extensions
{
return Create<JT808.Protocol.MessageBody.JT808_0x0102>(msgId,terminalPhoneNo,bodies);
}
/// <summary>
/// 0x0104 - 查询终端参数应答
/// auto-generated
/// </summary>
public static JT808Package Create_查询终端参数应答(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x0104 bodies)
{
return Create<JT808.Protocol.MessageBody.JT808_0x0104>(msgId,terminalPhoneNo,bodies);
}
///// <summary>
///// 0x0104 - 查询终端参数应答
///// auto-generated
///// </summary>
// public static JT808Package Create_查询终端参数应答(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x0104 bodies)
//{
// return Create<JT808.Protocol.MessageBody.JT808_0x0104>(msgId,terminalPhoneNo,bodies);
//}

/// <summary>
/// 0x0104 - 查询终端参数应答
/// auto-generated
/// </summary>
public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x0104 bodies)
{
return Create<JT808.Protocol.MessageBody.JT808_0x0104>(msgId,terminalPhoneNo,bodies);
}
// public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x0104 bodies)
//{
// return Create<JT808.Protocol.MessageBody.JT808_0x0104>(msgId,terminalPhoneNo,bodies);
//}
/// <summary>
/// 0x0107 - 查询终端属性应答
/// auto-generated
@@ -464,39 +464,22 @@ namespace JT808.Protocol.Extensions
return Create<JT808.Protocol.MessageBody.JT808_0x8100>(msgId,terminalPhoneNo,bodies);
}
/// <summary>
/// 0x8103 - 设置终端参数
/// auto-generated
/// </summary>
public static JT808Package Create_设置终端参数(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8103 bodies)
{
return Create<JT808.Protocol.MessageBody.JT808_0x8103>(msgId,terminalPhoneNo,bodies);
}

/// <summary>
/// 0x8103 - 设置终端参数
/// auto-generated
/// </summary>
public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8103 bodies)
{
return Create<JT808.Protocol.MessageBody.JT808_0x8103>(msgId,terminalPhoneNo,bodies);
}
/// <summary>
/// 0x8104 - 查询终端参数
/// auto-generated
/// </summary>
public static JT808Package Create_查询终端参数(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8104 bodies)
{
return Create<JT808.Protocol.MessageBody.JT808_0x8104>(msgId,terminalPhoneNo,bodies);
}
// public static JT808Package Create_查询终端参数(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8104 bodies)
//{
// return Create<JT808.Protocol.MessageBody.JT808_0x8104>(msgId,terminalPhoneNo,bodies);
//}

/// <summary>
/// 0x8104 - 查询终端参数
/// auto-generated
/// </summary>
public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8104 bodies)
{
return Create<JT808.Protocol.MessageBody.JT808_0x8104>(msgId,terminalPhoneNo,bodies);
}
// public static JT808Package Create(this JT808MsgId msgId, string terminalPhoneNo,JT808.Protocol.MessageBody.JT808_0x8104 bodies)
//{
// return Create<JT808.Protocol.MessageBody.JT808_0x8104>(msgId,terminalPhoneNo,bodies);
//}
/// <summary>
/// 0x8105 - 终端控制
/// auto-generated


+ 4
- 4
src/JT808.Protocol/Interfaces/GlobalConfigBase.cs View File

@@ -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;


+ 9
- 18
src/JT808.Protocol/Internal/JT808FormatterFactory.cs View File

@@ -10,7 +10,7 @@ using System.Text;

namespace JT808.Protocol.Internal
{
class JT808FormatterFactory : IJT808FormatterFactory
internal class JT808FormatterFactory : IJT808FormatterFactory
{
public Dictionary<Guid, object> 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<JT808FormatterAttribute>();
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<TJT808Bodies>() where TJT808Bodies : JT808Bodies
public IJT808FormatterFactory SetMap<TJT808Bodies>()
where TJT808Bodies:JT808Bodies
{
Type bodiesType = typeof(TJT808Bodies);
var attr = bodiesType.GetTypeInfo().GetCustomAttribute<JT808FormatterAttribute>();
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;
}


+ 95
- 0
src/JT808.Protocol/JT808.Protocol.csproj View File

@@ -29,8 +29,11 @@
<OutputPath />
</PropertyGroup>
<ItemGroup>
<Compile Remove="Formatters\MessageBodyFormatters\**" />
<Compile Remove="Metadata\JT808LocationAttachProperties\**" />
<EmbeddedResource Remove="Formatters\MessageBodyFormatters\**" />
<EmbeddedResource Remove="Metadata\JT808LocationAttachProperties\**" />
<None Remove="Formatters\MessageBodyFormatters\**" />
<None Remove="Metadata\JT808LocationAttachProperties\**" />
<None Include="..\..\LICENSE">
<Pack>True</Pack>
@@ -39,11 +42,103 @@
</ItemGroup>

<ItemGroup>
<Compile Remove="Formatters\JT808HeaderFormatter.cs" />
<Compile Remove="Formatters\JT808HeaderPackageFormatter.cs" />
<Compile Remove="Formatters\JT808PackageFormatter.cs" />
<Compile Remove="Formatters\JT808SplitPackageBodiesFormatter.cs" />
<Compile Remove="IJT808BufferedEntity.cs" />
<Compile Remove="IJT808Properties.cs" />
<Compile Remove="Internal\JT808_0x8103_Custom_Factory.cs" />
<Compile Remove="Internal\JT808_0x8103_Factory.cs" />
<Compile Remove="JT808BufferedEntityBase.cs" />
<Compile Remove="JT808GlobalConfig.cs" />
<Compile Remove="JT808MessageBodyFactory.cs" />
<Compile Remove="MessageBody\JT808_0x0104.cs" />
<Compile Remove="MessageBody\JT808_0x8103.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0001.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0002.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0003.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0004.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0005.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0006.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0007.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0010.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0011.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0012.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0013.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0014.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0015.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0016.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0017.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0018.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0019.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x001A.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x001B.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x001C.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x001D.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0020.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0021.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0022.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0027.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0028.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0029.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x002C.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x002D.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x002E.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x002F.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0030.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0031.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0040.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0041.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0042.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0043.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0044.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0045.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0046.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0047.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0048.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0049.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0050.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0051.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0052.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0053.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0054.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0055.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0056.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0057.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0058.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0059.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x005A.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x005B.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x005C.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x005D.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x005E.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0064.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0065.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0070.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0071.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0072.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0073.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0074.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0080.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0081.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0082.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0083.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0084.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0090.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0091.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0092.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0093.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0094.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0095.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0100.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0101.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0102.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0103.cs" />
<Compile Remove="MessageBody\JT808_0x8103_0x0110.cs" />
<Compile Remove="MessageBody\JT808_0x8103_BodyBase.cs" />
<Compile Remove="MessageBody\JT808_0x8103_CustomBodyBase.cs" />
<Compile Remove="MessageBody\JT808_0x8104.cs" />
<Compile Remove="Metadata\JT808TerminalLoginRequestProperty.cs" />
<Compile Remove="Metadata\JT808UploadLocationRequestProperty.cs" />
</ItemGroup>


+ 0
- 1384
src/JT808.Protocol/JT808.Protocol.xml
File diff suppressed because it is too large
View File


+ 44
- 4
src/JT808.Protocol/JT808Header.cs View File

@@ -1,13 +1,12 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.Formatters;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol
{
/// <summary>
/// 头部
/// </summary>
[JT808Formatter(typeof(JT808HeaderFormatter))]
public class JT808Header
public class JT808Header : IJT808MessagePackFormatter<JT808Header>
{
/// <summary>
/// 消息ID
@@ -35,5 +34,46 @@ namespace JT808.Protocol
/// 报序号 从1开始
/// </summary>
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);
}
}
}
}

+ 58
- 2
src/JT808.Protocol/JT808HeaderPackage.cs View File

@@ -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
{
/// <summary>
/// JT808头部数据包
/// </summary>
[JT808Formatter(typeof(JT808HeaderPackageFormatter))]
public class JT808HeaderPackage
public class JT808HeaderPackage: IJT808MessagePackFormatter<JT808HeaderPackage>
{
/// <summary>
/// 起始符
@@ -30,5 +33,58 @@ namespace JT808.Protocol
/// 终止符
/// </summary>
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("只适用反序列化");
}
}
}

+ 148
- 2
src/JT808.Protocol/JT808Package.cs View File

@@ -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
{
/// <summary>
/// JT808数据包
/// </summary>
[JT808Formatter(typeof(JT808PackageFormatter))]
public class JT808Package
public class JT808Package:IJT808MessagePackFormatter<JT808Package>
{
/// <summary>
/// 起始符
@@ -46,5 +50,147 @@ namespace JT808.Protocol
/// 数据体
/// </summary>
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();
// ---------------组包结束--------------
}
}
}

+ 7
- 3
src/JT808.Protocol/JT808Serializer.cs View File

@@ -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
{


+ 16
- 2
src/JT808.Protocol/JT808SplitPackageBodies.cs View File

@@ -1,14 +1,28 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol
{
/// <summary>
/// 统一分包数据体
/// </summary>
[JT808Formatter(typeof(JT808SplitPackageBodiesFormatter))]
public class JT808SplitPackageBodies : JT808Bodies
public class JT808SplitPackageBodies : JT808Bodies, IJT808MessagePackFormatter<JT808SplitPackageBodies>
{
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);
}
}
}

+ 0
- 3
src/JT808.Protocol/MessageBody/JT808_0x0001.cs View File

@@ -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
/// <summary>
/// 终端通用应答
/// </summary>
[JT808Formatter(typeof(JT808_0x0001_Formatter))]
public class JT808_0x0001 : JT808Bodies,IJT808MessagePackFormatter<JT808_0x0001>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0100.cs View File

@@ -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
/// <summary>
/// 终端注册
/// </summary>
[JT808Formatter(typeof(JT808_0x0100_Formatter))]
public class JT808_0x0100 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0100>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0102.cs View File

@@ -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
/// <summary>
/// 终端鉴权
/// </summary>
[JT808Formatter(typeof(JT808_0x0102_Formatter))]
public class JT808_0x0102 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0102>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0104.cs View File

@@ -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
/// <summary>
/// 查询终端参数应答
/// </summary>
[JT808Formatter(typeof(JT808_0x0104_Formatter))]
public class JT808_0x0104 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0104>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0107.cs View File

@@ -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
/// <summary>
/// 查询终端属性应答
/// </summary>
[JT808Formatter(typeof(JT808_0x0107_Formatter))]
public class JT808_0x0107 : JT808Bodies,IJT808MessagePackFormatter<JT808_0x0107>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0108.cs View File

@@ -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
/// <summary>
/// 终端升级结果通知
/// </summary>
[JT808Formatter(typeof(JT808_0x0108_Formatter))]
public class JT808_0x0108 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0108>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0200.cs View File

@@ -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
/// <summary>
/// 位置信息汇报
/// </summary>
[JT808Formatter(typeof(JT808_0x0200_Formatter))]
public class JT808_0x0200 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0200>
{
/// <summary>


+ 1
- 5
src/JT808.Protocol/MessageBody/JT808_0x0200_0x01.cs View File

@@ -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<JT808_0x0200_0x01>
{
public override byte AttachInfoId { get; set; } = 0x01;


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0200_0x02.cs View File

@@ -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<JT808_0x0200_0x02>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0200_0x03.cs View File

@@ -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<JT808_0x0200_0x03>
{
/// <summary>


+ 0
- 2
src/JT808.Protocol/MessageBody/JT808_0x0200_0x04.cs View File

@@ -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<JT808_0x0200_0x04>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0200_0x11.cs View File

@@ -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<JT808_0x0200_0x11>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0200_0x12.cs View File

@@ -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<JT808_0x0200_0x12>
{
/// <summary>


+ 1
- 5
src/JT808.Protocol/MessageBody/JT808_0x0200_0x13.cs View File

@@ -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<JT808_0x0200_0x13>
{
public override byte AttachInfoId { get; set; } = 0x13;


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0200_0x25.cs View File

@@ -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<JT808_0x0200_0x25>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0200_0x2A.cs View File

@@ -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<JT808_0x0200_0x2A>
{
/// <summary>


+ 0
- 2
src/JT808.Protocol/MessageBody/JT808_0x0200_0x2B.cs View File

@@ -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<JT808_0x0200_0x2B>
{
/// <summary>


+ 0
- 2
src/JT808.Protocol/MessageBody/JT808_0x0200_0x30.cs View File

@@ -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<JT808_0x0200_0x30>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0200_0x31.cs View File

@@ -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<JT808_0x0200_0x31>
{
/// <summary>


+ 1
- 2
src/JT808.Protocol/MessageBody/JT808_0x0200_BodyBase.cs View File

@@ -1,5 +1,4 @@
using JT808.Protocol.Formatters.MessageBodyFormatters;
using System;
using System;
using System.Collections.Generic;

namespace JT808.Protocol.MessageBody


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0201.cs View File

@@ -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
/// <summary>
/// 位置信息查询应答
/// </summary>
[JT808Formatter(typeof(JT808_0x0201_Formatter))]
public class JT808_0x0201 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0201>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0301.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x0301_Formatter))]
public class JT808_0x0301 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0301>
{
/// <summary>


+ 0
- 2
src/JT808.Protocol/MessageBody/JT808_0x0302.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x0302_Formatter))]
public class JT808_0x0302 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0302>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0303.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x0303_Formatter))]
public class JT808_0x0303 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0303>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0500.cs View File

@@ -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
/// <summary>
/// 车辆控制应答
/// </summary>
[JT808Formatter(typeof(JT808_0x0500_Formatter))]
public class JT808_0x0500 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0500>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0701.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x0701_Formatter))]
public class JT808_0x0701 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0701>
{
/// <summary>


+ 1
- 3
src/JT808.Protocol/MessageBody/JT808_0x0701_CustomBodyBase.cs View File

@@ -1,6 +1,4 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters.MessageBodyFormatters;
using System;
using System;

namespace JT808.Protocol.MessageBody
{


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0702.cs View File

@@ -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
/// <summary>
/// 驾驶员身份信息采集上报
/// </summary>
[JT808Formatter(typeof(JT808_0x0702_Formatter))]
public class JT808_0x0702 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0702>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0704.cs View File

@@ -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
/// <summary>
/// 定位数据批量上传
/// </summary>
[JT808Formatter(typeof(JT808_0x0704_Formatter))]
public class JT808_0x0704 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0704>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0705.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x0705_Formatter))]
public class JT808_0x0705 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0705>
{
/// <summary>


+ 0
- 2
src/JT808.Protocol/MessageBody/JT808_0x0800.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x0800_Formatter))]
public class JT808_0x0800 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0800>
{
/// <summary>


+ 0
- 2
src/JT808.Protocol/MessageBody/JT808_0x0801.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x0801_Formatter))]
public class JT808_0x0801 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0801>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0802.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x0802_Formatter))]
public class JT808_0x0802 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0802>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0805.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x0805_Formatter))]
public class JT808_0x0805 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0805>
{
/// <summary>


+ 0
- 2
src/JT808.Protocol/MessageBody/JT808_0x0900.cs View File

@@ -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
/// <summary>
/// 数据上行透传
/// </summary>
[JT808Formatter(typeof(JT808_0x0900_Formatter))]
public class JT808_0x0900 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0900>
{
/// <summary>


+ 0
- 2
src/JT808.Protocol/MessageBody/JT808_0x0901.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x0901_Formatter))]
public class JT808_0x0901 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0901>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x0A00.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x0A00_Formatter))]
public class JT808_0x0A00 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0A00>
{
/// <summary>


+ 0
- 2
src/JT808.Protocol/MessageBody/JT808_0x8001.cs View File

@@ -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
/// <summary>
/// 平台通用应答
/// </summary>
[JT808Formatter(typeof(JT808_0x8001_Formatter))]
public class JT808_0x8001 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8001>
{
public ushort MsgNum { get; set; }


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8003.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8003_Formatter))]
public class JT808_0x8003 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8003>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8100.cs View File

@@ -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
/// <summary>
/// 终端注册应答
/// </summary>
[JT808Formatter(typeof(JT808_0x8100_Formatter))]
public class JT808_0x8100 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8100>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8105.cs View File

@@ -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
/// <summary>
/// 终端控制
/// </summary>
[JT808Formatter(typeof(JT808_0x8105_Formatter))]
public class JT808_0x8105 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8105>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8106.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8106_Formatter))]
public class JT808_0x8106 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8106>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8108.cs View File

@@ -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
/// <summary>
/// 下发终端升级包
/// </summary>
[JT808Formatter(typeof(JT808_0x8108_Formatter))]
public class JT808_0x8108 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8108>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8202.cs View File

@@ -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
/// <summary>
/// 临时位置跟踪控制
/// </summary>
[JT808Formatter(typeof(JT808_0x8202_Formatter))]
public class JT808_0x8202 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8202>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8203.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8203_Formatter))]
public class JT808_0x8203 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8203>
{
/// <summary>


+ 0
- 2
src/JT808.Protocol/MessageBody/JT808_0x8300.cs View File

@@ -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
/// <summary>
/// 文本信息下发
/// </summary>
[JT808Formatter(typeof(JT808_0x8300_Formatter))]
public class JT808_0x8300 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8300>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8301.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8301_Formatter))]
public class JT808_0x8301 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8301>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8302.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8302_Formatter))]
public class JT808_0x8302 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8302>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8303.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8303_Formatter))]
public class JT808_0x8303 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8303>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8304.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8304_Formatter))]
public class JT808_0x8304 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8304>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8400.cs View File

@@ -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
/// <summary>
/// 电话回拨
/// </summary>
[JT808Formatter(typeof(JT808_0x8400_Formatter))]
public class JT808_0x8400 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8400>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8401.cs View File

@@ -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
/// <summary>
/// 设置电话本
/// </summary>
[JT808Formatter(typeof(JT808_0x8401_Formatter))]
public class JT808_0x8401 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8401>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8500.cs View File

@@ -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
/// <summary>
/// 车辆控制
/// </summary>
[JT808Formatter(typeof(JT808_0x8500_Formatter))]
public class JT808_0x8500 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8500>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8600.cs View File

@@ -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,其他以此类推
/// </summary>
[JT808Formatter(typeof(JT808_0x8600_Formatter))]
public class JT808_0x8600 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8600>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8601.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8601_Formatter))]
public class JT808_0x8601 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8601>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8602.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8602_Formatter))]
public class JT808_0x8602 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8602>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8603.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8603_Formatter))]
public class JT808_0x8603 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8603>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8604.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8604_Formatter))]
public class JT808_0x8604 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8604>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8605.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8605_Formatter))]
public class JT808_0x8605 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8605>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8606.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8606_Formatter))]
public class JT808_0x8606 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8606>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8607.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8607_Formatter))]
public class JT808_0x8607 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8607>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8800.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8800_Formatter))]
public class JT808_0x8800 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8800>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8801.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8801_Formatter))]
public class JT808_0x8801 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8801>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8802.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8802_Formatter))]
public class JT808_0x8802 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8802>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8803.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8803_Formatter))]
public class JT808_0x8803 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8803>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8804.cs View File

@@ -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
/// <summary>
/// 录音开始命令
/// </summary>
[JT808Formatter(typeof(JT808_0x8804_Formatter))]
public class JT808_0x8804 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8804>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8805.cs View File

@@ -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
/// <summary>
/// 单条存储多媒体数据检索上传命令
/// </summary>
[JT808Formatter(typeof(JT808_0x8805_Formatter))]
public class JT808_0x8805 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8805>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8900.cs View File

@@ -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
/// <summary>
/// 数据下行透传
/// </summary>
[JT808Formatter(typeof(JT808_0x8900_Formatter))]
public class JT808_0x8900 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8900>
{
/// <summary>


+ 1
- 4
src/JT808.Protocol/MessageBody/JT808_0x8A00.cs View File

@@ -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
/// </summary>
[JT808Formatter(typeof(JT808_0x8A00_Formatter))]
public class JT808_0x8A00 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8A00>
{
/// <summary>


Loading…
Cancel
Save