Procházet zdrojové kódy

增加2019版本808协议的位置附加和终端参数设置

tags/v2.2.0
SmallChi(Koike) před 5 roky
rodič
revize
0db02ce928
35 změnil soubory, kde provedl 582 přidání a 63 odebrání
  1. +10
    -9
      README.md
  2. binární
      doc/JTT.808-2019.PDF
  3. +2
    -0
      src/JT808.Protocol.Test/MessageBody/JT808_0x8103Test.cs
  4. +12
    -0
      src/JT808.Protocol.Test/MessagePack/JT808MessagePackWriterTest.cs
  5. +13
    -0
      src/JT808.Protocol/Interfaces/IJT808_2019_Version.cs
  6. +2
    -2
      src/JT808.Protocol/JT808.Protocol.csproj
  7. +123
    -7
      src/JT808.Protocol/JT808.Protocol.xml
  8. +4
    -2
      src/JT808.Protocol/MessageBody/JT808_0x0004.cs
  9. +2
    -1
      src/JT808.Protocol/MessageBody/JT808_0x0005.cs
  10. +2
    -1
      src/JT808.Protocol/MessageBody/JT808_0x0100.cs
  11. +2
    -1
      src/JT808.Protocol/MessageBody/JT808_0x0102.cs
  12. +37
    -14
      src/JT808.Protocol/MessageBody/JT808_0x0107.cs
  13. +37
    -0
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x05.cs
  14. +37
    -0
      src/JT808.Protocol/MessageBody/JT808_0x0200_0x06.cs
  15. +4
    -1
      src/JT808.Protocol/MessageBody/JT808_0x0301.cs
  16. +4
    -1
      src/JT808.Protocol/MessageBody/JT808_0x0302.cs
  17. +4
    -1
      src/JT808.Protocol/MessageBody/JT808_0x0303.cs
  18. +2
    -1
      src/JT808.Protocol/MessageBody/JT808_0x8004.cs
  19. +9
    -6
      src/JT808.Protocol/MessageBody/JT808_0x8103_0x0018.cs
  20. +9
    -6
      src/JT808.Protocol/MessageBody/JT808_0x8103_0x0019.cs
  21. +41
    -0
      src/JT808.Protocol/MessageBody/JT808_0x8103_0x0023.cs
  22. +41
    -0
      src/JT808.Protocol/MessageBody/JT808_0x8103_0x0024.cs
  23. +41
    -0
      src/JT808.Protocol/MessageBody/JT808_0x8103_0x0025.cs
  24. +41
    -0
      src/JT808.Protocol/MessageBody/JT808_0x8103_0x0026.cs
  25. +38
    -0
      src/JT808.Protocol/MessageBody/JT808_0x8103_0x0032.cs
  26. +2
    -1
      src/JT808.Protocol/MessageBody/JT808_0x8103_0x0084.cs
  27. +2
    -1
      src/JT808.Protocol/MessageBody/JT808_0x8105.cs
  28. +20
    -4
      src/JT808.Protocol/MessageBody/JT808_0x8108.cs
  29. +17
    -0
      src/JT808.Protocol/MessageBody/JT808_0x8204.cs
  30. +4
    -1
      src/JT808.Protocol/MessageBody/JT808_0x8301.cs
  31. +3
    -1
      src/JT808.Protocol/MessageBody/JT808_0x8302.cs
  32. +4
    -1
      src/JT808.Protocol/MessageBody/JT808_0x8303.cs
  33. +4
    -1
      src/JT808.Protocol/MessageBody/JT808_0x8304.cs
  34. +4
    -0
      src/JT808.Protocol/MessagePack/JT808MessagePackReader.cs
  35. +5
    -0
      src/JT808.Protocol/MessagePack/JT808MessagePackWriter.cs

+ 10
- 9
README.md Zobrazit soubor

@@ -316,7 +316,7 @@ Platform=AnyCpu Server=False Toolchain=.NET Core 3.0
| 6 | 0x8100 | √ | √ | 终端注册应答 |
| 7 | 0x0003 | √ | √ | 终端注销 |
| 8 | 0x0102 | √ | √ | 终端鉴权 |修改|
| 9 | 0x8103 | √ | x | 设置终端参数 |修改且增加|
| 9 | 0x8103 | √ | | 设置终端参数 |修改且增加|
| 10 | 0x8104 | √ | √ | 查询终端参数 |
| 11 | 0x0104 | √ | √ | 查询终端参数应答 |
| 12 | 0x8105 | √ | √ | 终端控制 |
@@ -325,19 +325,19 @@ Platform=AnyCpu Server=False Toolchain=.NET Core 3.0
| 15 | 0x0107 | √ | √ | 查询终端属性应答 |
| 16 | 0x8108 | √ | √ | 下发终端升级包 |
| 17 | 0x0108 | √ | √ | 终端升级结果通知 |
| 18 | 0x0200 | √ | √ | 位置信息汇报 |
| 18 | 0x0200 | √ | √ | 位置信息汇报 |增加附加信息|
| 19 | 0x8201 | √ | √ | 位置信息查询 |
| 20 | 0x0201 | √ | √ | 位置信息查询应答 |
| 21 | 0x8202 | √ | √ | 临时位置跟踪控制 |
| 22 | 0x8203 | √ | √ | 人工确认报警消息 |
| 23 | 0x8300 | √ | √ | 文本信息下发 |
| 24 | 0x8301 | √ | √ | 事件设置 |
| 25 | 0x0301 | √ | √ | 事件报告 |
| 26 | 0x8302 | √ | √ | 提问下发 |
| 27 | 0x0302 | √ | √ | 提问应答 |
| 28 | 0x8303 | √ | √ | 信息点播菜单设置 |
| 29 | 0x0303 | √ | √ | 信息点播/取消 |
| 30 | 0x8304 | √ | √ | 信息服务 |
| 24 | 0x8301 | √ | √ | 事件设置 |删除|
| 25 | 0x0301 | √ | √ | 事件报告 |删除|
| 26 | 0x8302 | √ | √ | 提问下发 |删除|
| 27 | 0x0302 | √ | √ | 提问应答 |删除|
| 28 | 0x8303 | √ | √ | 信息点播菜单设置 |删除|
| 29 | 0x0303 | √ | √ | 信息点播/取消 |删除|
| 30 | 0x8304 | √ | √ | 信息服务 |删除|
| 31 | 0x8400 | √ | √ | 电话回拨 |
| 32 | 0x8401 | √ | √ | 设置电话本 |
| 33 | 0x8500 | √ | √ | 车辆控制 |
@@ -378,3 +378,4 @@ Platform=AnyCpu Server=False Toolchain=.NET Core 3.0
| 68 | 0x0004 | √ | √ | 查询服务器时间请求 |新增|
| 69 | 0x8004 | √ | √ | 查询服务器时间应答 |新增|
| 70 | 0x0005 | √ | √ | 终端补传分包请求 |新增|
| 71 | 0x8204 | √ | √ | 链路检测 |新增|

binární
doc/JTT.808-2019.PDF Zobrazit soubor


+ 2
- 0
src/JT808.Protocol.Test/MessageBody/JT808_0x8103Test.cs Zobrazit soubor

@@ -162,5 +162,7 @@ namespace JT808.Protocol.Test.MessageBody

Assert.Equal(customParams, Newtonsoft.Json.JsonConvert.SerializeObject(jT808_0X8103.CustomParamList));
}


}
}

+ 12
- 0
src/JT808.Protocol.Test/MessagePack/JT808MessagePackWriterTest.cs Zobrazit soubor

@@ -6,6 +6,7 @@ using System.Text;
using Xunit;
using System.Buffers;
using JT808.Protocol.Enums;
using System.Buffers.Binary;

namespace JT808.Protocol.Test.MessagePack
{
@@ -468,5 +469,16 @@ namespace JT808.Protocol.Test.MessagePack
msgpackWriter.Version = JT808Version.JTT2019;
Assert.Equal(JT808Version.JTT2019, msgpackWriter.Version);
}

[Fact]
public void WriteInt16Test1()
{
byte[] array1 = new byte[2];
byte[] array2= new byte[2];
BinaryPrimitives.WriteInt16BigEndian(array1, -1233);
short a = -1233;
BinaryPrimitives.WriteUInt16BigEndian(array2, (ushort)a);
Assert.Equal(array1, array2);
}
}
}

+ 13
- 0
src/JT808.Protocol/Interfaces/IJT808_2019_Version.cs Zobrazit soubor

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace JT808.Protocol.Interfaces
{
/// <summary>
/// 只用来标识2019版本增删改情况
/// </summary>
public interface IJT808_2019_Version
{
}
}

+ 2
- 2
src/JT808.Protocol/JT808.Protocol.csproj Zobrazit soubor

@@ -65,13 +65,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CSharp" Version="4.6.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.6.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.0.1" />
</ItemGroup>
<ItemGroup>


+ 123
- 7
src/JT808.Protocol/JT808.Protocol.xml Zobrazit soubor

@@ -1661,6 +1661,11 @@
注意:处理808的分包读取完流需要先进行转义在进行分包
</summary>
</member>
<member name="T:JT808.Protocol.Interfaces.IJT808_2019_Version">
<summary>
只用来标识2019版本增删改情况
</summary>
</member>
<member name="P:JT808.Protocol.IJT808Config.MsgSNDistributed">
<summary>
消息流水号
@@ -2538,26 +2543,29 @@
<member name="P:JT808.Protocol.MessageBody.JT808_0x0107.MakerId">
<summary>
制造商 ID
5 个字节,终端制造商编码
2013版本 5 个字节,终端制造商编码
2019版本 11 个字节,终端制造商编码
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x0107.TerminalModel">
<summary>
终端型号
BYTE[20]
20 个字节,此终端型号由制造商自行定义,位数不足时,后补“0X00”。
BYTE[20] 20 个字节,此终端型号由制造商自行定义,位数不足时,后补“0X00”。
2019版本
BYTE[30] 30 个字节,此终端型号由制造商自行定义,位数不足时,后补“0X00”。
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x0107.TerminalId">
<summary>
终端ID
BYTE[7]
7 个字节,由大写字母和数字组成,此终端 ID 由制造商自行定义,位数不足时,后补“0X00”
BYTE[7] 7 个字节,由大写字母和数字组成,此终端 ID 由制造商自行定义,位数不足时,后补“0X00”
2019版本
BYTE[30] 30 个字节,由大写字母和数字组成,此终端 ID 由制造商自行定义,位数不足时,后补“0X00”
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x0107.Terminal_SIM_ICCID">
<summary>
终端 SIM 卡 ICCID
终端 SIM 卡 ICCID
BCD[10]
</summary>
</member>
@@ -2729,6 +2737,28 @@
需要人工确认报警事件的 ID,从 1 开始计数
</summary>
</member>
<member name="T:JT808.Protocol.MessageBody.JT808_0x0200_0x05">
<summary>
胎压
2019版本
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x0200_0x05.TirePressure">
<summary>
胎压
</summary>
</member>
<member name="T:JT808.Protocol.MessageBody.JT808_0x0200_0x06">
<summary>
胎压
2019版本
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x0200_0x06.CarTemperature">
<summary>
车厢温度
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x0200_0x11.JT808PositionType">
<summary>
超速报警附加信息
@@ -3694,6 +3724,70 @@
驾驶员未登录汇报时间间隔,单位为秒(s),>0
</summary>
</member>
<member name="T:JT808.Protocol.MessageBody.JT808_0x8103_0x0023">
<summary>
从服务器APN。该值为空时,终端应使用主服务器相同配置
2019版本
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x8103_0x0023.ParamLength">
<summary>
数据 长度
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x8103_0x0023.ParamValue">
<summary>
</summary>
</member>
<member name="T:JT808.Protocol.MessageBody.JT808_0x8103_0x0024">
<summary>
从服务器无线通信拨号用户名。该值为空时,终端应使用主服务器相同配置
2019版本
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x8103_0x0024.ParamLength">
<summary>
数据 长度
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x8103_0x0024.ParamValue">
<summary>
</summary>
</member>
<member name="T:JT808.Protocol.MessageBody.JT808_0x8103_0x0025">
<summary>
从服务器无线通信拨号密码。该值为空,终端应使用主服务器相同配置
2019版本
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x8103_0x0025.ParamLength">
<summary>
数据 长度
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x8103_0x0025.ParamValue">
<summary>
</summary>
</member>
<member name="T:JT808.Protocol.MessageBody.JT808_0x8103_0x0026">
<summary>
从服务器无线通信拨号密码。该值为空,终端应使用主服务器相同配置
2019版本
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x8103_0x0026.ParamLength">
<summary>
数据 长度
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x8103_0x0026.ParamValue">
<summary>
</summary>
</member>
<member name="T:JT808.Protocol.MessageBody.JT808_0x8103_0x0027">
<summary>
休眠时汇报时间间隔,单位为秒(s),>0
@@ -3821,6 +3915,21 @@
电子围栏半径(非法位移阈值),单位为米
</summary>
</member>
<member name="T:JT808.Protocol.MessageBody.JT808_0x8103_0x0032">
<summary>
违规行驶时段范围
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x8103_0x0032.ParamLength">
<summary>
数据 长度
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x8103_0x0032.ParamValue">
<summary>
电子围栏半径(非法位移阈值),单位为米
</summary>
</member>
<member name="T:JT808.Protocol.MessageBody.JT808_0x8103_0x0040">
<summary>
监控平台电话号码
@@ -4768,7 +4877,8 @@
<member name="P:JT808.Protocol.MessageBody.JT808_0x8108.MakerId">
<summary>
制造商 ID
5 个字节,终端制造商编码
2013版本 5 个字节,终端制造商编码
2019版本 11 个字节,终端制造商编码
</summary>
</member>
<member name="P:JT808.Protocol.MessageBody.JT808_0x8108.VersionNumLength">
@@ -4835,6 +4945,12 @@
人工确认报警类型
</summary>
</member>
<member name="T:JT808.Protocol.MessageBody.JT808_0x8204">
<summary>
链路检测
2019版本
</summary>
</member>
<member name="T:JT808.Protocol.MessageBody.JT808_0x8300">
<summary>
文本信息下发


+ 4
- 2
src/JT808.Protocol/MessageBody/JT808_0x0004.cs Zobrazit soubor

@@ -1,10 +1,12 @@
namespace JT808.Protocol.MessageBody
using JT808.Protocol.Interfaces;

namespace JT808.Protocol.MessageBody
{
/// <summary>
/// 查询服务器时间请求
/// 2019版本
/// </summary>
public class JT808_0x0004 : JT808Bodies
public class JT808_0x0004 : JT808Bodies, IJT808_2019_Version
{
/// <summary>
/// 跳过数据体序列化


+ 2
- 1
src/JT808.Protocol/MessageBody/JT808_0x0005.cs Zobrazit soubor

@@ -1,4 +1,5 @@
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
@@ -7,7 +8,7 @@ namespace JT808.Protocol.MessageBody
/// 终端补传分包请求
/// 2019版本
/// </summary>
public class JT808_0x0005 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0005>
public class JT808_0x0005 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0005>, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x0005;
/// <summary>


+ 2
- 1
src/JT808.Protocol/MessageBody/JT808_0x0100.cs Zobrazit soubor

@@ -1,5 +1,6 @@
using JT808.Protocol.Enums;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
@@ -7,7 +8,7 @@ namespace JT808.Protocol.MessageBody
/// <summary>
/// 终端注册
/// </summary>
public class JT808_0x0100 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0100>
public class JT808_0x0100 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0100>, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x0100;
/// <summary>


+ 2
- 1
src/JT808.Protocol/MessageBody/JT808_0x0102.cs Zobrazit soubor

@@ -1,5 +1,6 @@
using JT808.Protocol.Enums;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
@@ -7,7 +8,7 @@ namespace JT808.Protocol.MessageBody
/// <summary>
/// 终端鉴权
/// </summary>
public class JT808_0x0102 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0102>
public class JT808_0x0102 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0102>, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x0102;
/// <summary>


+ 37
- 14
src/JT808.Protocol/MessageBody/JT808_0x0107.cs Zobrazit soubor

@@ -1,4 +1,6 @@
using JT808.Protocol.Formatters;
using JT808.Protocol.Enums;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
@@ -6,7 +8,7 @@ namespace JT808.Protocol.MessageBody
/// <summary>
/// 查询终端属性应答
/// </summary>
public class JT808_0x0107 : JT808Bodies,IJT808MessagePackFormatter<JT808_0x0107>
public class JT808_0x0107 : JT808Bodies,IJT808MessagePackFormatter<JT808_0x0107>, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x0107;
/// <summary>
@@ -21,23 +23,26 @@ namespace JT808.Protocol.MessageBody
public ushort TerminalType { get; set; }
/// <summary>
/// 制造商 ID
/// 5 个字节,终端制造商编码
/// 2013版本 5 个字节,终端制造商编码
/// 2019版本 11 个字节,终端制造商编码
/// </summary>
public string MakerId { get; set; }
/// <summary>
/// 终端型号
/// BYTE[20]
/// 20 个字节,此终端型号由制造商自行定义,位数不足时,后补“0X00”。
/// BYTE[20] 20 个字节,此终端型号由制造商自行定义,位数不足时,后补“0X00”。
/// 2019版本
/// BYTE[30] 30 个字节,此终端型号由制造商自行定义,位数不足时,后补“0X00”。
/// </summary>
public string TerminalModel { get; set; }
/// <summary>
/// 终端ID
/// BYTE[7]
/// 7 个字节,由大写字母和数字组成,此终端 ID 由制造商自行定义,位数不足时,后补“0X00”
/// BYTE[7] 7 个字节,由大写字母和数字组成,此终端 ID 由制造商自行定义,位数不足时,后补“0X00”
/// 2019版本
/// BYTE[30] 30 个字节,由大写字母和数字组成,此终端 ID 由制造商自行定义,位数不足时,后补“0X00”
/// </summary>
public string TerminalId { get; set; }
/// <summary>
/// 终端 SIM 卡 ICCID
/// 终端 SIM 卡 ICCID
/// BCD[10]
/// </summary>
public string Terminal_SIM_ICCID { get; set; }
@@ -81,9 +86,18 @@ namespace JT808.Protocol.MessageBody
{
JT808_0x0107 jT808_0X0107 = new JT808_0x0107();
jT808_0X0107.TerminalType = reader.ReadUInt16();
jT808_0X0107.MakerId = reader.ReadString(5);
jT808_0X0107.TerminalModel = reader.ReadString(20);
jT808_0X0107.TerminalId = reader.ReadString(7);
if(reader.Version== JT808Version.JTT2019)
{
jT808_0X0107.MakerId = reader.ReadString(11);
jT808_0X0107.TerminalModel = reader.ReadString(30);
jT808_0X0107.TerminalId = reader.ReadString(30);
}
else
{
jT808_0X0107.MakerId = reader.ReadString(5);
jT808_0X0107.TerminalModel = reader.ReadString(20);
jT808_0X0107.TerminalId = reader.ReadString(7);
}
jT808_0X0107.Terminal_SIM_ICCID = reader.ReadBCD(10, config.Trim);
jT808_0X0107.Terminal_Hardware_Version_Length = reader.ReadByte();
jT808_0X0107.Terminal_Hardware_Version_Num = reader.ReadString(jT808_0X0107.Terminal_Hardware_Version_Length);
@@ -97,9 +111,18 @@ namespace JT808.Protocol.MessageBody
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0107 value, IJT808Config config)
{
writer.WriteUInt16(value.TerminalType);
writer.WriteString(value.MakerId.PadRight(5, '0'));
writer.WriteString(value.TerminalModel.PadRight(20, '0'));
writer.WriteString(value.TerminalId.PadRight(7, '0'));
if (writer.Version == JT808Version.JTT2019)
{
writer.WriteString(value.MakerId.PadLeft(11, '0'));
writer.WriteString(value.TerminalModel.PadLeft(30, '0'));
writer.WriteString(value.TerminalId.PadLeft(30, '0'));
}
else
{
writer.WriteString(value.MakerId.PadRight(5, '0'));
writer.WriteString(value.TerminalModel.PadRight(20, '0'));
writer.WriteString(value.TerminalId.PadRight(7, '0'));
}
writer.WriteBCD(value.Terminal_SIM_ICCID, 10);
writer.WriteByte((byte)value.Terminal_Hardware_Version_Num.Length);
writer.WriteString(value.Terminal_Hardware_Version_Num);


+ 37
- 0
src/JT808.Protocol/MessageBody/JT808_0x0200_0x05.cs Zobrazit soubor

@@ -0,0 +1,37 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
{
/// <summary>
/// 胎压
/// 2019版本
/// </summary>
public class JT808_0x0200_0x05 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter<JT808_0x0200_0x05>, IJT808_2019_Version
{
/// <summary>
/// 胎压
/// </summary>
public string TirePressure { get; set; }
public override byte AttachInfoId { get; set; } = 0x05;
public override byte AttachInfoLength { get; set; } = 30;

public JT808_0x0200_0x05 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
{
JT808_0x0200_0x05 value = new JT808_0x0200_0x05();
value.AttachInfoId = reader.ReadByte();
value.AttachInfoLength = reader.ReadByte();
value.TirePressure = reader.ReadString(value.AttachInfoLength);
return value;
}

public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x05 value, IJT808Config config)
{
writer.WriteByte(value.AttachInfoId);
writer.WriteByte(value.AttachInfoLength);
writer.WriteString(value.TirePressure);
}
}
}

+ 37
- 0
src/JT808.Protocol/MessageBody/JT808_0x0200_0x06.cs Zobrazit soubor

@@ -0,0 +1,37 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
{
/// <summary>
/// 胎压
/// 2019版本
/// </summary>
public class JT808_0x0200_0x06 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter<JT808_0x0200_0x06>, IJT808_2019_Version
{
/// <summary>
/// 车厢温度
/// </summary>
public short CarTemperature { get; set; }
public override byte AttachInfoId { get; set; } = 0x05;
public override byte AttachInfoLength { get; set; } = 2;

public JT808_0x0200_0x06 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
{
JT808_0x0200_0x06 value = new JT808_0x0200_0x06();
value.AttachInfoId = reader.ReadByte();
value.AttachInfoLength = reader.ReadByte();
value.CarTemperature =reader.ReadInt16();
return value;
}

public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x06 value, IJT808Config config)
{
writer.WriteByte(value.AttachInfoId);
writer.WriteByte(value.AttachInfoLength);
writer.WriteInt16(value.CarTemperature);
}
}
}

+ 4
- 1
src/JT808.Protocol/MessageBody/JT808_0x0301.cs Zobrazit soubor

@@ -1,5 +1,7 @@
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;
using System;

namespace JT808.Protocol.MessageBody
{
@@ -7,7 +9,8 @@ namespace JT808.Protocol.MessageBody
/// 事件报告
/// 0x0301
/// </summary>
public class JT808_0x0301 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0301>
[Obsolete("2019版本已作删除")]
public class JT808_0x0301 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0301>, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x0301;
/// <summary>


+ 4
- 1
src/JT808.Protocol/MessageBody/JT808_0x0302.cs Zobrazit soubor

@@ -1,6 +1,8 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;
using System;

namespace JT808.Protocol.MessageBody
{
@@ -8,7 +10,8 @@ namespace JT808.Protocol.MessageBody
/// 提问应答
/// 0x0302
/// </summary>
public class JT808_0x0302 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0302>
[Obsolete("2019版本已作删除")]
public class JT808_0x0302 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0302>,IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x0302;
/// <summary>


+ 4
- 1
src/JT808.Protocol/MessageBody/JT808_0x0303.cs Zobrazit soubor

@@ -1,5 +1,7 @@
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;
using System;

namespace JT808.Protocol.MessageBody
{
@@ -7,7 +9,8 @@ namespace JT808.Protocol.MessageBody
/// 信息点播/取消
/// 0x0303
/// </summary>
public class JT808_0x0303 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0303>
[Obsolete("2019版本已作删除")]
public class JT808_0x0303 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x0303>, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x0303;
/// <summary>


+ 2
- 1
src/JT808.Protocol/MessageBody/JT808_0x8004.cs Zobrazit soubor

@@ -1,4 +1,5 @@
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;
using System;

@@ -8,7 +9,7 @@ namespace JT808.Protocol.MessageBody
/// 查询服务器时间应答
/// 2019版本
/// </summary>
public class JT808_0x8004 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8004>
public class JT808_0x8004 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8004>, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x8004;



+ 9
- 6
src/JT808.Protocol/MessageBody/JT808_0x8103_0x0018.cs Zobrazit soubor

@@ -1,13 +1,16 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;
using System;

namespace JT808.Protocol.MessageBody
{
/// <summary>
/// 服务器 TCP 端口
/// </summary>
public class JT808_0x8103_0x0018 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0018>
[Obsolete("2019版本已作为保留")]
public class JT808_0x8103_0x0018 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0018>, IJT808_2019_Version
{
public override uint ParamId { get; set; } = 0x0018;
/// <summary>
@@ -20,11 +23,11 @@ namespace JT808.Protocol.MessageBody
public uint ParamValue { get; set; }
public JT808_0x8103_0x0018 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
{
JT808_0x8103_0x0018 jT808_0x8103_0x0018 = new JT808_0x8103_0x0018();
jT808_0x8103_0x0018.ParamId = reader.ReadUInt32();
jT808_0x8103_0x0018.ParamLength = reader.ReadByte();
jT808_0x8103_0x0018.ParamValue = reader.ReadUInt32();
return jT808_0x8103_0x0018;
JT808_0x8103_0x0018 value = new JT808_0x8103_0x0018();
value.ParamId = reader.ReadUInt32();
value.ParamLength = reader.ReadByte();
value.ParamValue = reader.ReadUInt32();
return value;
}

public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0018 value, IJT808Config config)


+ 9
- 6
src/JT808.Protocol/MessageBody/JT808_0x8103_0x0019.cs Zobrazit soubor

@@ -1,13 +1,16 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;
using System;

namespace JT808.Protocol.MessageBody
{
/// <summary>
/// 服务器 UDP 端口
/// </summary>
public class JT808_0x8103_0x0019 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0019>
[Obsolete("2019版本已作为保留")]
public class JT808_0x8103_0x0019 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0019>, IJT808_2019_Version
{
public override uint ParamId { get; set; } = 0x0019;
/// <summary>
@@ -20,11 +23,11 @@ namespace JT808.Protocol.MessageBody
public uint ParamValue { get; set; }
public JT808_0x8103_0x0019 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
{
JT808_0x8103_0x0019 jT808_0x8103_0x0019 = new JT808_0x8103_0x0019();
jT808_0x8103_0x0019.ParamId = reader.ReadUInt32();
jT808_0x8103_0x0019.ParamLength = reader.ReadByte();
jT808_0x8103_0x0019.ParamValue = reader.ReadUInt32();
return jT808_0x8103_0x0019;
JT808_0x8103_0x0019 value = new JT808_0x8103_0x0019();
value.ParamId = reader.ReadUInt32();
value.ParamLength = reader.ReadByte();
value.ParamValue = reader.ReadUInt32();
return value;
}

public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0019 value, IJT808Config config)


+ 41
- 0
src/JT808.Protocol/MessageBody/JT808_0x8103_0x0023.cs Zobrazit soubor

@@ -0,0 +1,41 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
{
/// <summary>
/// 从服务器APN。该值为空时,终端应使用主服务器相同配置
/// 2019版本
/// </summary>
public class JT808_0x8103_0x0023 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0023>, IJT808_2019_Version
{
public override uint ParamId { get; set; } = 0x0023;
/// <summary>
/// 数据 长度
/// </summary>
public override byte ParamLength { get; set; }
/// <summary>
///
/// </summary>
public string ParamValue { get; set; }
public JT808_0x8103_0x0023 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
{
JT808_0x8103_0x0023 value = new JT808_0x8103_0x0023();
value.ParamId = reader.ReadUInt32();
value.ParamLength = reader.ReadByte();
value.ParamValue = reader.ReadString(value.ParamLength);
return value;
}

public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0023 value, IJT808Config config)
{
writer.WriteUInt32(value.ParamId);
writer.Skip(1, out int skipPosition);
writer.WriteString(value.ParamValue);
int length = writer.GetCurrentPosition() - skipPosition - 1;
writer.WriteByteReturn((byte)length, skipPosition);
}
}
}

+ 41
- 0
src/JT808.Protocol/MessageBody/JT808_0x8103_0x0024.cs Zobrazit soubor

@@ -0,0 +1,41 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
{
/// <summary>
/// 从服务器无线通信拨号用户名。该值为空时,终端应使用主服务器相同配置
/// 2019版本
/// </summary>
public class JT808_0x8103_0x0024 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0024>, IJT808_2019_Version
{
public override uint ParamId { get; set; } = 0x0024;
/// <summary>
/// 数据 长度
/// </summary>
public override byte ParamLength { get; set; }
/// <summary>
///
/// </summary>
public string ParamValue { get; set; }
public JT808_0x8103_0x0024 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
{
JT808_0x8103_0x0024 jT808_0x8103_0x0024 = new JT808_0x8103_0x0024();
jT808_0x8103_0x0024.ParamId = reader.ReadUInt32();
jT808_0x8103_0x0024.ParamLength = reader.ReadByte();
jT808_0x8103_0x0024.ParamValue = reader.ReadString(jT808_0x8103_0x0024.ParamLength);
return jT808_0x8103_0x0024;
}

public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0024 value, IJT808Config config)
{
writer.WriteUInt32(value.ParamId);
writer.Skip(1, out int skipPosition);
writer.WriteString(value.ParamValue);
int length = writer.GetCurrentPosition() - skipPosition - 1;
writer.WriteByteReturn((byte)length, skipPosition);
}
}
}

+ 41
- 0
src/JT808.Protocol/MessageBody/JT808_0x8103_0x0025.cs Zobrazit soubor

@@ -0,0 +1,41 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
{
/// <summary>
/// 从服务器无线通信拨号密码。该值为空,终端应使用主服务器相同配置
/// 2019版本
/// </summary>
public class JT808_0x8103_0x0025 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0025>, IJT808_2019_Version
{
public override uint ParamId { get; set; } = 0x0025;
/// <summary>
/// 数据 长度
/// </summary>
public override byte ParamLength { get; set; }
/// <summary>
///
/// </summary>
public string ParamValue { get; set; }
public JT808_0x8103_0x0025 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
{
JT808_0x8103_0x0025 jT808_0x8103_0x0025 = new JT808_0x8103_0x0025();
jT808_0x8103_0x0025.ParamId = reader.ReadUInt32();
jT808_0x8103_0x0025.ParamLength = reader.ReadByte();
jT808_0x8103_0x0025.ParamValue = reader.ReadString(jT808_0x8103_0x0025.ParamLength);
return jT808_0x8103_0x0025;
}

public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0025 value, IJT808Config config)
{
writer.WriteUInt32(value.ParamId);
writer.Skip(1, out int skipPosition);
writer.WriteString(value.ParamValue);
int length = writer.GetCurrentPosition() - skipPosition - 1;
writer.WriteByteReturn((byte)length, skipPosition);
}
}
}

+ 41
- 0
src/JT808.Protocol/MessageBody/JT808_0x8103_0x0026.cs Zobrazit soubor

@@ -0,0 +1,41 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
{
/// <summary>
/// 从服务器无线通信拨号密码。该值为空,终端应使用主服务器相同配置
/// 2019版本
/// </summary>
public class JT808_0x8103_0x0026 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0026>, IJT808_2019_Version
{
public override uint ParamId { get; set; } = 0x0026;
/// <summary>
/// 数据 长度
/// </summary>
public override byte ParamLength { get; set; }
/// <summary>
///
/// </summary>
public string ParamValue { get; set; }
public JT808_0x8103_0x0026 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
{
JT808_0x8103_0x0026 value = new JT808_0x8103_0x0026();
value.ParamId = reader.ReadUInt32();
value.ParamLength = reader.ReadByte();
value.ParamValue = reader.ReadString(value.ParamLength);
return value;
}

public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0026 value, IJT808Config config)
{
writer.WriteUInt32(value.ParamId);
writer.Skip(1, out int skipPosition);
writer.WriteString(value.ParamValue);
int length = writer.GetCurrentPosition() - skipPosition - 1;
writer.WriteByteReturn((byte)length, skipPosition);
}
}
}

+ 38
- 0
src/JT808.Protocol/MessageBody/JT808_0x8103_0x0032.cs Zobrazit soubor

@@ -0,0 +1,38 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
{
/// <summary>
/// 违规行驶时段范围
/// </summary>
public class JT808_0x8103_0x0032 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0032>, IJT808_2019_Version
{
public override uint ParamId { get; set; } = 0x0032;
/// <summary>
/// 数据 长度
/// </summary>
public override byte ParamLength { get; set; } = 4;
/// <summary>
/// 电子围栏半径(非法位移阈值),单位为米
/// </summary>
public byte[] ParamValue { get; set; }
public JT808_0x8103_0x0032 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
{
JT808_0x8103_0x0032 value = new JT808_0x8103_0x0032();
value.ParamId = reader.ReadUInt32();
value.ParamLength = reader.ReadByte();
value.ParamValue = reader.ReadArray(4).ToArray();
return value;
}

public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0032 value, IJT808Config config)
{
writer.WriteUInt32(value.ParamId);
writer.WriteByte(value.ParamLength);
writer.WriteArray(value.ParamValue);
}
}
}

+ 2
- 1
src/JT808.Protocol/MessageBody/JT808_0x8103_0x0084.cs Zobrazit soubor

@@ -1,5 +1,6 @@
using JT808.Protocol.Attributes;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
@@ -7,7 +8,7 @@ namespace JT808.Protocol.MessageBody
/// <summary>
/// 车牌颜色,按照 JT/T415-2006 的 5.4.12
/// </summary>
public class JT808_0x8103_0x0084 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0084>
public class JT808_0x8103_0x0084 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0084>, IJT808_2019_Version
{
public override uint ParamId { get; set; } = 0x0084;
/// <summary>


+ 2
- 1
src/JT808.Protocol/MessageBody/JT808_0x8105.cs Zobrazit soubor

@@ -1,4 +1,5 @@
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;
using System;

@@ -7,7 +8,7 @@ namespace JT808.Protocol.MessageBody
/// <summary>
/// 终端控制
/// </summary>
public class JT808_0x8105 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8105>
public class JT808_0x8105 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8105>, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x8105;
/// <summary>


+ 20
- 4
src/JT808.Protocol/MessageBody/JT808_0x8108.cs Zobrazit soubor

@@ -1,5 +1,6 @@
using JT808.Protocol.Enums;
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
@@ -7,7 +8,7 @@ namespace JT808.Protocol.MessageBody
/// <summary>
/// 下发终端升级包
/// </summary>
public class JT808_0x8108 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8108>
public class JT808_0x8108 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8108>, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x8108;
/// <summary>
@@ -16,7 +17,8 @@ namespace JT808.Protocol.MessageBody
public JT808UpgradeType UpgradeType { get; set; }
/// <summary>
/// 制造商 ID
/// 5 个字节,终端制造商编码
/// 2013版本 5 个字节,终端制造商编码
/// 2019版本 11 个字节,终端制造商编码
/// </summary>
public string MakerId { get; set; }
/// <summary>
@@ -40,7 +42,14 @@ namespace JT808.Protocol.MessageBody
{
JT808_0x8108 jT808_0X8108 = new JT808_0x8108();
jT808_0X8108.UpgradeType = (JT808UpgradeType)reader.ReadByte();
jT808_0X8108.MakerId = reader.ReadString(5);
if (reader.Version == JT808Version.JTT2019)
{
jT808_0X8108.MakerId = reader.ReadString(11);
}
else
{
jT808_0X8108.MakerId = reader.ReadString(5);
}
jT808_0X8108.VersionNumLength = reader.ReadByte();
jT808_0X8108.VersionNum = reader.ReadString(jT808_0X8108.VersionNumLength);
jT808_0X8108.UpgradePackageLength = reader.ReadInt32();
@@ -51,7 +60,14 @@ namespace JT808.Protocol.MessageBody
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8108 value, IJT808Config config)
{
writer.WriteByte((byte)value.UpgradeType);
writer.WriteString(value.MakerId.PadRight(5, '0'));
if (writer.Version == JT808Version.JTT2019)
{
writer.WriteString(value.MakerId.PadLeft(11, '0'));
}
else
{
writer.WriteString(value.MakerId.PadRight(5, '0'));
}
writer.WriteByte((byte)value.VersionNum.Length);
writer.WriteString(value.VersionNum);
writer.WriteInt32(value.UpgradePackage.Length);


+ 17
- 0
src/JT808.Protocol/MessageBody/JT808_0x8204.cs Zobrazit soubor

@@ -0,0 +1,17 @@
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;

namespace JT808.Protocol.MessageBody
{
/// <summary>
/// 链路检测
/// 2019版本
/// </summary>
public class JT808_0x8204 : JT808Bodies, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x8204;

public override bool SkipSerialization { get; set; } = true;
}
}

+ 4
- 1
src/JT808.Protocol/MessageBody/JT808_0x8301.cs Zobrazit soubor

@@ -1,6 +1,8 @@
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;
using JT808.Protocol.Metadata;
using System;
using System.Collections.Generic;

namespace JT808.Protocol.MessageBody
@@ -9,7 +11,8 @@ namespace JT808.Protocol.MessageBody
/// 事件设置
/// 0x8301
/// </summary>
public class JT808_0x8301 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8301>
[Obsolete("2019版本已作删除")]
public class JT808_0x8301 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8301>,IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x8301;
/// <summary>


+ 3
- 1
src/JT808.Protocol/MessageBody/JT808_0x8302.cs Zobrazit soubor

@@ -1,4 +1,5 @@
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;
using System;
using System.Collections.Generic;
@@ -9,7 +10,8 @@ namespace JT808.Protocol.MessageBody
/// 提问下发
/// 0x8302
/// </summary>
public class JT808_0x8302 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8302>
[Obsolete("2019版本已作删除")]
public class JT808_0x8302 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8302>, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x8302;
/// <summary>


+ 4
- 1
src/JT808.Protocol/MessageBody/JT808_0x8303.cs Zobrazit soubor

@@ -1,6 +1,8 @@
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;
using JT808.Protocol.Metadata;
using System;
using System.Collections.Generic;

namespace JT808.Protocol.MessageBody
@@ -9,7 +11,8 @@ namespace JT808.Protocol.MessageBody
/// 信息点播菜单设置
/// 0x8303
/// </summary>
public class JT808_0x8303 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8303>
[Obsolete("2019版本已作删除")]
public class JT808_0x8303 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8303>, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x8303;
/// <summary>


+ 4
- 1
src/JT808.Protocol/MessageBody/JT808_0x8304.cs Zobrazit soubor

@@ -1,5 +1,7 @@
using JT808.Protocol.Formatters;
using JT808.Protocol.Interfaces;
using JT808.Protocol.MessagePack;
using System;

namespace JT808.Protocol.MessageBody
{
@@ -7,7 +9,8 @@ namespace JT808.Protocol.MessageBody
/// 信息服务
/// 0x8304
/// </summary>
public class JT808_0x8304 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8304>
[Obsolete("2019版本已作删除")]
public class JT808_0x8304 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x8304>, IJT808_2019_Version
{
public override ushort MsgId { get; } = 0x8304;
/// <summary>


+ 4
- 0
src/JT808.Protocol/MessagePack/JT808MessagePackReader.cs Zobrazit soubor

@@ -128,6 +128,10 @@ namespace JT808.Protocol.MessagePack
public bool CheckXorCodeVali => _checkXorCodeVali;
public byte ReadStart()=> ReadByte();
public byte ReadEnd()=> ReadByte();
public short ReadInt16()
{
return BinaryPrimitives.ReadInt16BigEndian(GetReadOnlySpan(2));
}
public ushort ReadUInt16()
{
return BinaryPrimitives.ReadUInt16BigEndian(GetReadOnlySpan(2));


+ 5
- 0
src/JT808.Protocol/MessagePack/JT808MessagePackWriter.cs Zobrazit soubor

@@ -70,6 +70,11 @@ namespace JT808.Protocol.MessagePack
span[0] = value;
writer.Advance(1);
}
public void WriteInt16(short value)
{
BinaryPrimitives.WriteInt16BigEndian(writer.Free, value);
writer.Advance(2);
}
public void WriteUInt16(ushort value)
{
BinaryPrimitives.WriteUInt16BigEndian(writer.Free, value);


Načítá se…
Zrušit
Uložit