@@ -316,7 +316,7 @@ Platform=AnyCpu Server=False Toolchain=.NET Core 3.0 | |||||
| 6 | 0x8100 | √ | √ | 终端注册应答 | | | 6 | 0x8100 | √ | √ | 终端注册应答 | | ||||
| 7 | 0x0003 | √ | √ | 终端注销 | | | 7 | 0x0003 | √ | √ | 终端注销 | | ||||
| 8 | 0x0102 | √ | √ | 终端鉴权 |修改| | | 8 | 0x0102 | √ | √ | 终端鉴权 |修改| | ||||
| 9 | 0x8103 | √ | x | 设置终端参数 |修改且增加| | |||||
| 9 | 0x8103 | √ | √ | 设置终端参数 |修改且增加| | |||||
| 10 | 0x8104 | √ | √ | 查询终端参数 | | | 10 | 0x8104 | √ | √ | 查询终端参数 | | ||||
| 11 | 0x0104 | √ | √ | 查询终端参数应答 | | | 11 | 0x0104 | √ | √ | 查询终端参数应答 | | ||||
| 12 | 0x8105 | √ | √ | 终端控制 | | | 12 | 0x8105 | √ | √ | 终端控制 | | ||||
@@ -325,19 +325,19 @@ Platform=AnyCpu Server=False Toolchain=.NET Core 3.0 | |||||
| 15 | 0x0107 | √ | √ | 查询终端属性应答 | | | 15 | 0x0107 | √ | √ | 查询终端属性应答 | | ||||
| 16 | 0x8108 | √ | √ | 下发终端升级包 | | | 16 | 0x8108 | √ | √ | 下发终端升级包 | | ||||
| 17 | 0x0108 | √ | √ | 终端升级结果通知 | | | 17 | 0x0108 | √ | √ | 终端升级结果通知 | | ||||
| 18 | 0x0200 | √ | √ | 位置信息汇报 | | |||||
| 18 | 0x0200 | √ | √ | 位置信息汇报 |增加附加信息| | |||||
| 19 | 0x8201 | √ | √ | 位置信息查询 | | | 19 | 0x8201 | √ | √ | 位置信息查询 | | ||||
| 20 | 0x0201 | √ | √ | 位置信息查询应答 | | | 20 | 0x0201 | √ | √ | 位置信息查询应答 | | ||||
| 21 | 0x8202 | √ | √ | 临时位置跟踪控制 | | | 21 | 0x8202 | √ | √ | 临时位置跟踪控制 | | ||||
| 22 | 0x8203 | √ | √ | 人工确认报警消息 | | | 22 | 0x8203 | √ | √ | 人工确认报警消息 | | ||||
| 23 | 0x8300 | √ | √ | 文本信息下发 | | | 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 | √ | √ | 电话回拨 | | | 31 | 0x8400 | √ | √ | 电话回拨 | | ||||
| 32 | 0x8401 | √ | √ | 设置电话本 | | | 32 | 0x8401 | √ | √ | 设置电话本 | | ||||
| 33 | 0x8500 | √ | √ | 车辆控制 | | | 33 | 0x8500 | √ | √ | 车辆控制 | | ||||
@@ -378,3 +378,4 @@ Platform=AnyCpu Server=False Toolchain=.NET Core 3.0 | |||||
| 68 | 0x0004 | √ | √ | 查询服务器时间请求 |新增| | | 68 | 0x0004 | √ | √ | 查询服务器时间请求 |新增| | ||||
| 69 | 0x8004 | √ | √ | 查询服务器时间应答 |新增| | | 69 | 0x8004 | √ | √ | 查询服务器时间应答 |新增| | ||||
| 70 | 0x0005 | √ | √ | 终端补传分包请求 |新增| | | 70 | 0x0005 | √ | √ | 终端补传分包请求 |新增| | ||||
| 71 | 0x8204 | √ | √ | 链路检测 |新增| |
@@ -162,5 +162,7 @@ namespace JT808.Protocol.Test.MessageBody | |||||
Assert.Equal(customParams, Newtonsoft.Json.JsonConvert.SerializeObject(jT808_0X8103.CustomParamList)); | Assert.Equal(customParams, Newtonsoft.Json.JsonConvert.SerializeObject(jT808_0X8103.CustomParamList)); | ||||
} | } | ||||
} | } | ||||
} | } |
@@ -6,6 +6,7 @@ using System.Text; | |||||
using Xunit; | using Xunit; | ||||
using System.Buffers; | using System.Buffers; | ||||
using JT808.Protocol.Enums; | using JT808.Protocol.Enums; | ||||
using System.Buffers.Binary; | |||||
namespace JT808.Protocol.Test.MessagePack | namespace JT808.Protocol.Test.MessagePack | ||||
{ | { | ||||
@@ -468,5 +469,16 @@ namespace JT808.Protocol.Test.MessagePack | |||||
msgpackWriter.Version = JT808Version.JTT2019; | msgpackWriter.Version = JT808Version.JTT2019; | ||||
Assert.Equal(JT808Version.JTT2019, msgpackWriter.Version); | 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); | |||||
} | |||||
} | } | ||||
} | } |
@@ -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 | |||||
{ | |||||
} | |||||
} |
@@ -65,13 +65,13 @@ | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.7"> | |||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8"> | |||||
<PrivateAssets>all</PrivateAssets> | <PrivateAssets>all</PrivateAssets> | ||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||
</PackageReference> | </PackageReference> | ||||
<PackageReference Include="Microsoft.CSharp" Version="4.6.0" /> | <PackageReference Include="Microsoft.CSharp" Version="4.6.0" /> | ||||
<PackageReference Include="System.Text.Encoding.CodePages" 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> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -1661,6 +1661,11 @@ | |||||
注意:处理808的分包读取完流需要先进行转义在进行分包 | 注意:处理808的分包读取完流需要先进行转义在进行分包 | ||||
</summary> | </summary> | ||||
</member> | </member> | ||||
<member name="T:JT808.Protocol.Interfaces.IJT808_2019_Version"> | |||||
<summary> | |||||
只用来标识2019版本增删改情况 | |||||
</summary> | |||||
</member> | |||||
<member name="P:JT808.Protocol.IJT808Config.MsgSNDistributed"> | <member name="P:JT808.Protocol.IJT808Config.MsgSNDistributed"> | ||||
<summary> | <summary> | ||||
消息流水号 | 消息流水号 | ||||
@@ -2538,26 +2543,29 @@ | |||||
<member name="P:JT808.Protocol.MessageBody.JT808_0x0107.MakerId"> | <member name="P:JT808.Protocol.MessageBody.JT808_0x0107.MakerId"> | ||||
<summary> | <summary> | ||||
制造商 ID | 制造商 ID | ||||
5 个字节,终端制造商编码 | |||||
2013版本 5 个字节,终端制造商编码 | |||||
2019版本 11 个字节,终端制造商编码 | |||||
</summary> | </summary> | ||||
</member> | </member> | ||||
<member name="P:JT808.Protocol.MessageBody.JT808_0x0107.TerminalModel"> | <member name="P:JT808.Protocol.MessageBody.JT808_0x0107.TerminalModel"> | ||||
<summary> | <summary> | ||||
终端型号 | 终端型号 | ||||
BYTE[20] | |||||
20 个字节,此终端型号由制造商自行定义,位数不足时,后补“0X00”。 | |||||
BYTE[20] 20 个字节,此终端型号由制造商自行定义,位数不足时,后补“0X00”。 | |||||
2019版本 | |||||
BYTE[30] 30 个字节,此终端型号由制造商自行定义,位数不足时,后补“0X00”。 | |||||
</summary> | </summary> | ||||
</member> | </member> | ||||
<member name="P:JT808.Protocol.MessageBody.JT808_0x0107.TerminalId"> | <member name="P:JT808.Protocol.MessageBody.JT808_0x0107.TerminalId"> | ||||
<summary> | <summary> | ||||
终端ID | 终端ID | ||||
BYTE[7] | |||||
7 个字节,由大写字母和数字组成,此终端 ID 由制造商自行定义,位数不足时,后补“0X00” | |||||
BYTE[7] 7 个字节,由大写字母和数字组成,此终端 ID 由制造商自行定义,位数不足时,后补“0X00” | |||||
2019版本 | |||||
BYTE[30] 30 个字节,由大写字母和数字组成,此终端 ID 由制造商自行定义,位数不足时,后补“0X00” | |||||
</summary> | </summary> | ||||
</member> | </member> | ||||
<member name="P:JT808.Protocol.MessageBody.JT808_0x0107.Terminal_SIM_ICCID"> | <member name="P:JT808.Protocol.MessageBody.JT808_0x0107.Terminal_SIM_ICCID"> | ||||
<summary> | <summary> | ||||
终端 SIM 卡 ICCID | |||||
终端 SIM 卡 ICCID | |||||
BCD[10] | BCD[10] | ||||
</summary> | </summary> | ||||
</member> | </member> | ||||
@@ -2729,6 +2737,28 @@ | |||||
需要人工确认报警事件的 ID,从 1 开始计数 | 需要人工确认报警事件的 ID,从 1 开始计数 | ||||
</summary> | </summary> | ||||
</member> | </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"> | <member name="P:JT808.Protocol.MessageBody.JT808_0x0200_0x11.JT808PositionType"> | ||||
<summary> | <summary> | ||||
超速报警附加信息 | 超速报警附加信息 | ||||
@@ -3694,6 +3724,70 @@ | |||||
驾驶员未登录汇报时间间隔,单位为秒(s),>0 | 驾驶员未登录汇报时间间隔,单位为秒(s),>0 | ||||
</summary> | </summary> | ||||
</member> | </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"> | <member name="T:JT808.Protocol.MessageBody.JT808_0x8103_0x0027"> | ||||
<summary> | <summary> | ||||
休眠时汇报时间间隔,单位为秒(s),>0 | 休眠时汇报时间间隔,单位为秒(s),>0 | ||||
@@ -3821,6 +3915,21 @@ | |||||
电子围栏半径(非法位移阈值),单位为米 | 电子围栏半径(非法位移阈值),单位为米 | ||||
</summary> | </summary> | ||||
</member> | </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"> | <member name="T:JT808.Protocol.MessageBody.JT808_0x8103_0x0040"> | ||||
<summary> | <summary> | ||||
监控平台电话号码 | 监控平台电话号码 | ||||
@@ -4768,7 +4877,8 @@ | |||||
<member name="P:JT808.Protocol.MessageBody.JT808_0x8108.MakerId"> | <member name="P:JT808.Protocol.MessageBody.JT808_0x8108.MakerId"> | ||||
<summary> | <summary> | ||||
制造商 ID | 制造商 ID | ||||
5 个字节,终端制造商编码 | |||||
2013版本 5 个字节,终端制造商编码 | |||||
2019版本 11 个字节,终端制造商编码 | |||||
</summary> | </summary> | ||||
</member> | </member> | ||||
<member name="P:JT808.Protocol.MessageBody.JT808_0x8108.VersionNumLength"> | <member name="P:JT808.Protocol.MessageBody.JT808_0x8108.VersionNumLength"> | ||||
@@ -4835,6 +4945,12 @@ | |||||
人工确认报警类型 | 人工确认报警类型 | ||||
</summary> | </summary> | ||||
</member> | </member> | ||||
<member name="T:JT808.Protocol.MessageBody.JT808_0x8204"> | |||||
<summary> | |||||
链路检测 | |||||
2019版本 | |||||
</summary> | |||||
</member> | |||||
<member name="T:JT808.Protocol.MessageBody.JT808_0x8300"> | <member name="T:JT808.Protocol.MessageBody.JT808_0x8300"> | ||||
<summary> | <summary> | ||||
文本信息下发 | 文本信息下发 | ||||
@@ -1,10 +1,12 @@ | |||||
namespace JT808.Protocol.MessageBody | |||||
using JT808.Protocol.Interfaces; | |||||
namespace JT808.Protocol.MessageBody | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 查询服务器时间请求 | /// 查询服务器时间请求 | ||||
/// 2019版本 | /// 2019版本 | ||||
/// </summary> | /// </summary> | ||||
public class JT808_0x0004 : JT808Bodies | |||||
public class JT808_0x0004 : JT808Bodies, IJT808_2019_Version | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 跳过数据体序列化 | /// 跳过数据体序列化 | ||||
@@ -1,4 +1,5 @@ | |||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
@@ -7,7 +8,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// 终端补传分包请求 | /// 终端补传分包请求 | ||||
/// 2019版本 | /// 2019版本 | ||||
/// </summary> | /// </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; | public override ushort MsgId { get; } = 0x0005; | ||||
/// <summary> | /// <summary> | ||||
@@ -1,5 +1,6 @@ | |||||
using JT808.Protocol.Enums; | using JT808.Protocol.Enums; | ||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
@@ -7,7 +8,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 终端注册 | /// 终端注册 | ||||
/// </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; | public override ushort MsgId { get; } = 0x0100; | ||||
/// <summary> | /// <summary> | ||||
@@ -1,5 +1,6 @@ | |||||
using JT808.Protocol.Enums; | using JT808.Protocol.Enums; | ||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
@@ -7,7 +8,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 终端鉴权 | /// 终端鉴权 | ||||
/// </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; | public override ushort MsgId { get; } = 0x0102; | ||||
/// <summary> | /// <summary> | ||||
@@ -1,4 +1,6 @@ | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Enums; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
@@ -6,7 +8,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 查询终端属性应答 | /// 查询终端属性应答 | ||||
/// </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; | public override ushort MsgId { get; } = 0x0107; | ||||
/// <summary> | /// <summary> | ||||
@@ -21,23 +23,26 @@ namespace JT808.Protocol.MessageBody | |||||
public ushort TerminalType { get; set; } | public ushort TerminalType { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 制造商 ID | /// 制造商 ID | ||||
/// 5 个字节,终端制造商编码 | |||||
/// 2013版本 5 个字节,终端制造商编码 | |||||
/// 2019版本 11 个字节,终端制造商编码 | |||||
/// </summary> | /// </summary> | ||||
public string MakerId { get; set; } | public string MakerId { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 终端型号 | /// 终端型号 | ||||
/// BYTE[20] | |||||
/// 20 个字节,此终端型号由制造商自行定义,位数不足时,后补“0X00”。 | |||||
/// BYTE[20] 20 个字节,此终端型号由制造商自行定义,位数不足时,后补“0X00”。 | |||||
/// 2019版本 | |||||
/// BYTE[30] 30 个字节,此终端型号由制造商自行定义,位数不足时,后补“0X00”。 | |||||
/// </summary> | /// </summary> | ||||
public string TerminalModel { get; set; } | public string TerminalModel { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 终端ID | /// 终端ID | ||||
/// BYTE[7] | |||||
/// 7 个字节,由大写字母和数字组成,此终端 ID 由制造商自行定义,位数不足时,后补“0X00” | |||||
/// BYTE[7] 7 个字节,由大写字母和数字组成,此终端 ID 由制造商自行定义,位数不足时,后补“0X00” | |||||
/// 2019版本 | |||||
/// BYTE[30] 30 个字节,由大写字母和数字组成,此终端 ID 由制造商自行定义,位数不足时,后补“0X00” | |||||
/// </summary> | /// </summary> | ||||
public string TerminalId { get; set; } | public string TerminalId { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 终端 SIM 卡 ICCID | |||||
/// 终端 SIM 卡 ICCID | |||||
/// BCD[10] | /// BCD[10] | ||||
/// </summary> | /// </summary> | ||||
public string Terminal_SIM_ICCID { get; set; } | public string Terminal_SIM_ICCID { get; set; } | ||||
@@ -81,9 +86,18 @@ namespace JT808.Protocol.MessageBody | |||||
{ | { | ||||
JT808_0x0107 jT808_0X0107 = new JT808_0x0107(); | JT808_0x0107 jT808_0X0107 = new JT808_0x0107(); | ||||
jT808_0X0107.TerminalType = reader.ReadUInt16(); | 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_SIM_ICCID = reader.ReadBCD(10, config.Trim); | ||||
jT808_0X0107.Terminal_Hardware_Version_Length = reader.ReadByte(); | jT808_0X0107.Terminal_Hardware_Version_Length = reader.ReadByte(); | ||||
jT808_0X0107.Terminal_Hardware_Version_Num = reader.ReadString(jT808_0X0107.Terminal_Hardware_Version_Length); | 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) | public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0107 value, IJT808Config config) | ||||
{ | { | ||||
writer.WriteUInt16(value.TerminalType); | 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.WriteBCD(value.Terminal_SIM_ICCID, 10); | ||||
writer.WriteByte((byte)value.Terminal_Hardware_Version_Num.Length); | writer.WriteByte((byte)value.Terminal_Hardware_Version_Num.Length); | ||||
writer.WriteString(value.Terminal_Hardware_Version_Num); | writer.WriteString(value.Terminal_Hardware_Version_Num); | ||||
@@ -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); | |||||
} | |||||
} | |||||
} |
@@ -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); | |||||
} | |||||
} | |||||
} |
@@ -1,5 +1,7 @@ | |||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
@@ -7,7 +9,8 @@ namespace JT808.Protocol.MessageBody | |||||
/// 事件报告 | /// 事件报告 | ||||
/// 0x0301 | /// 0x0301 | ||||
/// </summary> | /// </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; | public override ushort MsgId { get; } = 0x0301; | ||||
/// <summary> | /// <summary> | ||||
@@ -1,6 +1,8 @@ | |||||
using JT808.Protocol.Attributes; | using JT808.Protocol.Attributes; | ||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
@@ -8,7 +10,8 @@ namespace JT808.Protocol.MessageBody | |||||
/// 提问应答 | /// 提问应答 | ||||
/// 0x0302 | /// 0x0302 | ||||
/// </summary> | /// </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; | public override ushort MsgId { get; } = 0x0302; | ||||
/// <summary> | /// <summary> | ||||
@@ -1,5 +1,7 @@ | |||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
@@ -7,7 +9,8 @@ namespace JT808.Protocol.MessageBody | |||||
/// 信息点播/取消 | /// 信息点播/取消 | ||||
/// 0x0303 | /// 0x0303 | ||||
/// </summary> | /// </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; | public override ushort MsgId { get; } = 0x0303; | ||||
/// <summary> | /// <summary> | ||||
@@ -1,4 +1,5 @@ | |||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System; | using System; | ||||
@@ -8,7 +9,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// 查询服务器时间应答 | /// 查询服务器时间应答 | ||||
/// 2019版本 | /// 2019版本 | ||||
/// </summary> | /// </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; | public override ushort MsgId { get; } = 0x8004; | ||||
@@ -1,13 +1,16 @@ | |||||
using JT808.Protocol.Attributes; | using JT808.Protocol.Attributes; | ||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 服务器 TCP 端口 | /// 服务器 TCP 端口 | ||||
/// </summary> | /// </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; | public override uint ParamId { get; set; } = 0x0018; | ||||
/// <summary> | /// <summary> | ||||
@@ -20,11 +23,11 @@ namespace JT808.Protocol.MessageBody | |||||
public uint ParamValue { get; set; } | public uint ParamValue { get; set; } | ||||
public JT808_0x8103_0x0018 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | 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) | public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0018 value, IJT808Config config) | ||||
@@ -1,13 +1,16 @@ | |||||
using JT808.Protocol.Attributes; | using JT808.Protocol.Attributes; | ||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 服务器 UDP 端口 | /// 服务器 UDP 端口 | ||||
/// </summary> | /// </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; | public override uint ParamId { get; set; } = 0x0019; | ||||
/// <summary> | /// <summary> | ||||
@@ -20,11 +23,11 @@ namespace JT808.Protocol.MessageBody | |||||
public uint ParamValue { get; set; } | public uint ParamValue { get; set; } | ||||
public JT808_0x8103_0x0019 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | 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) | public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0019 value, IJT808Config config) | ||||
@@ -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); | |||||
} | |||||
} | |||||
} |
@@ -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); | |||||
} | |||||
} | |||||
} |
@@ -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); | |||||
} | |||||
} | |||||
} |
@@ -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); | |||||
} | |||||
} | |||||
} |
@@ -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); | |||||
} | |||||
} | |||||
} |
@@ -1,5 +1,6 @@ | |||||
using JT808.Protocol.Attributes; | using JT808.Protocol.Attributes; | ||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
@@ -7,7 +8,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 车牌颜色,按照 JT/T415-2006 的 5.4.12 | /// 车牌颜色,按照 JT/T415-2006 的 5.4.12 | ||||
/// </summary> | /// </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; | public override uint ParamId { get; set; } = 0x0084; | ||||
/// <summary> | /// <summary> | ||||
@@ -1,4 +1,5 @@ | |||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System; | using System; | ||||
@@ -7,7 +8,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 终端控制 | /// 终端控制 | ||||
/// </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; | public override ushort MsgId { get; } = 0x8105; | ||||
/// <summary> | /// <summary> | ||||
@@ -1,5 +1,6 @@ | |||||
using JT808.Protocol.Enums; | using JT808.Protocol.Enums; | ||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
@@ -7,7 +8,7 @@ namespace JT808.Protocol.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 下发终端升级包 | /// 下发终端升级包 | ||||
/// </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; | public override ushort MsgId { get; } = 0x8108; | ||||
/// <summary> | /// <summary> | ||||
@@ -16,7 +17,8 @@ namespace JT808.Protocol.MessageBody | |||||
public JT808UpgradeType UpgradeType { get; set; } | public JT808UpgradeType UpgradeType { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 制造商 ID | /// 制造商 ID | ||||
/// 5 个字节,终端制造商编码 | |||||
/// 2013版本 5 个字节,终端制造商编码 | |||||
/// 2019版本 11 个字节,终端制造商编码 | |||||
/// </summary> | /// </summary> | ||||
public string MakerId { get; set; } | public string MakerId { get; set; } | ||||
/// <summary> | /// <summary> | ||||
@@ -40,7 +42,14 @@ namespace JT808.Protocol.MessageBody | |||||
{ | { | ||||
JT808_0x8108 jT808_0X8108 = new JT808_0x8108(); | JT808_0x8108 jT808_0X8108 = new JT808_0x8108(); | ||||
jT808_0X8108.UpgradeType = (JT808UpgradeType)reader.ReadByte(); | 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.VersionNumLength = reader.ReadByte(); | ||||
jT808_0X8108.VersionNum = reader.ReadString(jT808_0X8108.VersionNumLength); | jT808_0X8108.VersionNum = reader.ReadString(jT808_0X8108.VersionNumLength); | ||||
jT808_0X8108.UpgradePackageLength = reader.ReadInt32(); | jT808_0X8108.UpgradePackageLength = reader.ReadInt32(); | ||||
@@ -51,7 +60,14 @@ namespace JT808.Protocol.MessageBody | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8108 value, IJT808Config config) | public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8108 value, IJT808Config config) | ||||
{ | { | ||||
writer.WriteByte((byte)value.UpgradeType); | 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.WriteByte((byte)value.VersionNum.Length); | ||||
writer.WriteString(value.VersionNum); | writer.WriteString(value.VersionNum); | ||||
writer.WriteInt32(value.UpgradePackage.Length); | writer.WriteInt32(value.UpgradePackage.Length); | ||||
@@ -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; | |||||
} | |||||
} |
@@ -1,6 +1,8 @@ | |||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using JT808.Protocol.Metadata; | using JT808.Protocol.Metadata; | ||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
@@ -9,7 +11,8 @@ namespace JT808.Protocol.MessageBody | |||||
/// 事件设置 | /// 事件设置 | ||||
/// 0x8301 | /// 0x8301 | ||||
/// </summary> | /// </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; | public override ushort MsgId { get; } = 0x8301; | ||||
/// <summary> | /// <summary> | ||||
@@ -1,4 +1,5 @@ | |||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
@@ -9,7 +10,8 @@ namespace JT808.Protocol.MessageBody | |||||
/// 提问下发 | /// 提问下发 | ||||
/// 0x8302 | /// 0x8302 | ||||
/// </summary> | /// </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; | public override ushort MsgId { get; } = 0x8302; | ||||
/// <summary> | /// <summary> | ||||
@@ -1,6 +1,8 @@ | |||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using JT808.Protocol.Metadata; | using JT808.Protocol.Metadata; | ||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
@@ -9,7 +11,8 @@ namespace JT808.Protocol.MessageBody | |||||
/// 信息点播菜单设置 | /// 信息点播菜单设置 | ||||
/// 0x8303 | /// 0x8303 | ||||
/// </summary> | /// </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; | public override ushort MsgId { get; } = 0x8303; | ||||
/// <summary> | /// <summary> | ||||
@@ -1,5 +1,7 @@ | |||||
using JT808.Protocol.Formatters; | using JT808.Protocol.Formatters; | ||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | using JT808.Protocol.MessagePack; | ||||
using System; | |||||
namespace JT808.Protocol.MessageBody | namespace JT808.Protocol.MessageBody | ||||
{ | { | ||||
@@ -7,7 +9,8 @@ namespace JT808.Protocol.MessageBody | |||||
/// 信息服务 | /// 信息服务 | ||||
/// 0x8304 | /// 0x8304 | ||||
/// </summary> | /// </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; | public override ushort MsgId { get; } = 0x8304; | ||||
/// <summary> | /// <summary> | ||||
@@ -128,6 +128,10 @@ namespace JT808.Protocol.MessagePack | |||||
public bool CheckXorCodeVali => _checkXorCodeVali; | public bool CheckXorCodeVali => _checkXorCodeVali; | ||||
public byte ReadStart()=> ReadByte(); | public byte ReadStart()=> ReadByte(); | ||||
public byte ReadEnd()=> ReadByte(); | public byte ReadEnd()=> ReadByte(); | ||||
public short ReadInt16() | |||||
{ | |||||
return BinaryPrimitives.ReadInt16BigEndian(GetReadOnlySpan(2)); | |||||
} | |||||
public ushort ReadUInt16() | public ushort ReadUInt16() | ||||
{ | { | ||||
return BinaryPrimitives.ReadUInt16BigEndian(GetReadOnlySpan(2)); | return BinaryPrimitives.ReadUInt16BigEndian(GetReadOnlySpan(2)); | ||||
@@ -70,6 +70,11 @@ namespace JT808.Protocol.MessagePack | |||||
span[0] = value; | span[0] = value; | ||||
writer.Advance(1); | writer.Advance(1); | ||||
} | } | ||||
public void WriteInt16(short value) | |||||
{ | |||||
BinaryPrimitives.WriteInt16BigEndian(writer.Free, value); | |||||
writer.Advance(2); | |||||
} | |||||
public void WriteUInt16(ushort value) | public void WriteUInt16(ushort value) | ||||
{ | { | ||||
BinaryPrimitives.WriteUInt16BigEndian(writer.Free, value); | BinaryPrimitives.WriteUInt16BigEndian(writer.Free, value); | ||||