From 65f321da0df115fca76cf9540a008b38266b5230 Mon Sep 17 00:00:00 2001 From: waterliu99 Date: Tue, 28 Apr 2020 12:52:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B92019?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JT809_0x1400_0x1402Test.cs | 8 +++---- .../JT809_0x1400_0x1403Test.cs | 8 +++---- .../JT809_0x9400_0x9402Test.cs | 8 +++---- .../JT809_0x9400_0x9403Test.cs | 8 +++---- .../Enums/JT809SubBusinessType.cs | 8 +++---- .../JT809SubPackageExtensionsTemplate.cs | 14 ++++++------- src/JT809.Protocol/JT809.Protocol.xml | 3 ++- .../MessageBody/JT809_0x1103.cs | 1 + .../MessageBody/JT809_0x1400.cs | 4 ++-- .../MessageBody/JT809_0x9103.cs | 1 + .../JT809VehiclePositionProperties_2019.cs | 6 +++--- .../SubMessageBody/JT809_0x1200_0x1205.cs | 10 +++++++-- .../SubMessageBody/JT809_0x1200_0x1206.cs | 7 +++++++ .../SubMessageBody/JT809_0x1200_0x120B.cs | 2 +- .../SubMessageBody/JT809_0x1200_0x120C.cs | 1 + .../SubMessageBody/JT809_0x1200_0x120D.cs | 1 + .../SubMessageBody/JT809_0x1200_0x120E.cs | 2 +- .../SubMessageBody/JT809_0x1300_0x1301.cs | 3 ++- .../SubMessageBody/JT809_0x1300_0x1302.cs | 3 +-- .../SubMessageBody/JT809_0x1300_0x1303.cs | 21 ++++++++++++++++--- .../SubMessageBody/JT809_0x1400_0x1402.cs | 15 ++++++------- .../SubMessageBody/JT809_0x1400_0x1403.cs | 12 +++++------ .../SubMessageBody/JT809_0x1400_0x1411.cs | 2 +- .../SubMessageBody/JT809_0x1400_0x1413.cs | 6 +++--- .../SubMessageBody/JT809_0x1500_0x1504.cs | 4 ++-- .../SubMessageBody/JT809_0x1500_0x1505.cs | 2 +- .../SubMessageBody/JT809_0x1600_0x1601.cs | 2 +- .../SubMessageBody/JT809_0x9200_0x9202.cs | 21 ++++++++++++------- .../SubMessageBody/JT809_0x9200_0x9208.cs | 1 + .../SubMessageBody/JT809_0x9200_0x9209.cs | 1 + .../SubMessageBody/JT809_0x9200_0x920D.cs | 1 + .../SubMessageBody/JT809_0x9400_0x9402.cs | 12 +++++------ .../SubMessageBody/JT809_0x9400_0x9403.cs | 12 +++++------ .../SubMessageBody/JT809_0x9500_0x9505.cs | 3 ++- 34 files changed, 129 insertions(+), 84 deletions(-) diff --git a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1400_0x1402Test.cs b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1400_0x1402Test.cs index b463336..8ab0509 100644 --- a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1400_0x1402Test.cs +++ b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1400_0x1402Test.cs @@ -50,14 +50,14 @@ namespace JT809.Protocol.Test.JT809SubMessageBody { JT809_0x1400_0x1402 jT809_0x1400_0x1402 = new JT809_0x1400_0x1402 { - SourcePlatformId = new byte[11], + SourcePlatformId = "30313233343536373839", WarnType = JT809WarnType.偏离路线报警, WarnTime = DateTime.Parse("2020-04-23"), StartTime= DateTime.Parse("2020-04-23"), EndTime= DateTime.Parse("2020-04-24"), VehicleNo="粤A11111", VehicleColor= JT809VehicleColorType.蓝色, - DestinationPlatformId = new byte[11], + DestinationPlatformId = "30313233343536373839", InfoContent = "gfdf454553", }; var hex = JT809_2019_Serializer.Serialize(jT809_0x1400_0x1402).ToHexString(); @@ -69,7 +69,7 @@ namespace JT809.Protocol.Test.JT809SubMessageBody { var bytes = "0000000000000000000000000B000000005EA06A00000000005EA06A00000000005EA1BB80D4C141313131313100000000000000000000000000010000000000000000000000000000000000000A67666466343534353533".ToHexBytes(); JT809_0x1400_0x1402 jT809_0x1400_0x1402 = JT809_2019_Serializer.Deserialize(bytes); - Assert.Equal(new byte[11], jT809_0x1400_0x1402.SourcePlatformId); + Assert.Equal("30313233343536373839", jT809_0x1400_0x1402.SourcePlatformId); Assert.Equal("gfdf454553", jT809_0x1400_0x1402.InfoContent); Assert.Equal(JT809WarnType.偏离路线报警, jT809_0x1400_0x1402.WarnType); Assert.Equal((uint)10, jT809_0x1400_0x1402.InfoLength); @@ -78,7 +78,7 @@ namespace JT809.Protocol.Test.JT809SubMessageBody Assert.Equal(DateTime.Parse("2020-04-24"), jT809_0x1400_0x1402.EndTime); Assert.Equal("粤A11111", jT809_0x1400_0x1402.VehicleNo); Assert.Equal(JT809VehicleColorType.蓝色, jT809_0x1400_0x1402.VehicleColor); - Assert.Equal(new byte[11], jT809_0x1400_0x1402.DestinationPlatformId); + Assert.Equal("30313233343536373839", jT809_0x1400_0x1402.DestinationPlatformId); } } } diff --git a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1400_0x1403Test.cs b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1400_0x1403Test.cs index 2d6ee86..6777c0f 100644 --- a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1400_0x1403Test.cs +++ b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1400_0x1403Test.cs @@ -43,14 +43,14 @@ namespace JT809.Protocol.Test.JT809SubMessageBody { JT809_0x1400_0x1403 jT809_0x1400_0x1403 = new JT809_0x1400_0x1403 { - SourcePlatformId = new byte[11], + SourcePlatformId = "30313233343536373839", WarnType = JT809WarnType.偏离路线报警, WarnTime = DateTime.Parse("2020-04-23"), StartTime = DateTime.Parse("2020-04-23"), EndTime = DateTime.Parse("2020-04-24"), VehicleNo = "粤A11111", VehicleColor = JT809VehicleColorType.蓝色, - DestinationPlatformId = new byte[11], + DestinationPlatformId = "30313233343536373839", InfoContent = "gfdf454553", DRVLineId=55 }; @@ -63,7 +63,7 @@ namespace JT809.Protocol.Test.JT809SubMessageBody { var bytes = "0000000000000000000000000B000000005EA06A00000000005EA06A00000000005EA1BB80D4C141313131313100000000000000000000000000010000000000000000000000000000370000000A67666466343534353533".ToHexBytes(); JT809_0x1400_0x1403 jT809_0x1400_0x1403 = JT809_2019_Serializer.Deserialize(bytes); - Assert.Equal(new byte[11], jT809_0x1400_0x1403.SourcePlatformId); + Assert.Equal("30313233343536373839", jT809_0x1400_0x1403.SourcePlatformId); Assert.Equal("gfdf454553", jT809_0x1400_0x1403.InfoContent); Assert.Equal(JT809WarnType.偏离路线报警, jT809_0x1400_0x1403.WarnType); Assert.Equal((uint)10, jT809_0x1400_0x1403.InfoLength); @@ -72,7 +72,7 @@ namespace JT809.Protocol.Test.JT809SubMessageBody Assert.Equal(DateTime.Parse("2020-04-24"), jT809_0x1400_0x1403.EndTime); Assert.Equal("粤A11111", jT809_0x1400_0x1403.VehicleNo); Assert.Equal(JT809VehicleColorType.蓝色, jT809_0x1400_0x1403.VehicleColor); - Assert.Equal(new byte[11], jT809_0x1400_0x1403.DestinationPlatformId); + Assert.Equal("30313233343536373839", jT809_0x1400_0x1403.DestinationPlatformId); Assert.Equal(55u, jT809_0x1400_0x1403.DRVLineId); } } diff --git a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x9400_0x9402Test.cs b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x9400_0x9402Test.cs index a5e5137..cb549ff 100644 --- a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x9400_0x9402Test.cs +++ b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x9400_0x9402Test.cs @@ -47,14 +47,14 @@ namespace JT809.Protocol.Test.JT809SubMessageBody { JT809_0x9400_0x9402 jT809_0x9400_0x9402 = new JT809_0x9400_0x9402 { - SourcePlatformId=new byte[11], + SourcePlatformId = "30313233343536373839", WarnType = JT809WarnType.劫警, WarnTime = DateTime.Parse("2020-04-26 18:23:00"), StartTime = DateTime.Parse("2020-04-26 18:23:00"), EndTime = DateTime.Parse("2020-04-26 19:23:00"), VehicleNo= "粤A12345", VehicleColor= JT809VehicleColorType.蓝色, - DestinationPlatformId= new byte[11], + DestinationPlatformId = "30313233343536373839", DRVLineId=22, WarnContent = "劫警", }; @@ -74,8 +74,8 @@ namespace JT809.Protocol.Test.JT809SubMessageBody Assert.Equal(DateTime.Parse("2020-04-26 19:23:00"), jT809_0x9400_0x9402.EndTime); Assert.Equal("粤A12345", jT809_0x9400_0x9402.VehicleNo); Assert.Equal(JT809VehicleColorType.蓝色, jT809_0x9400_0x9402.VehicleColor); - Assert.Equal(new byte[11], jT809_0x9400_0x9402.DestinationPlatformId); - Assert.Equal(new byte[11], jT809_0x9400_0x9402.SourcePlatformId); + Assert.Equal("30313233343536373839", jT809_0x9400_0x9402.DestinationPlatformId); + Assert.Equal("30313233343536373839", jT809_0x9400_0x9402.SourcePlatformId); Assert.Equal(22u, jT809_0x9400_0x9402.DRVLineId); Assert.Equal(4u, jT809_0x9400_0x9402.WarnLength); } diff --git a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x9400_0x9403Test.cs b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x9400_0x9403Test.cs index 48bcde0..ddcecff 100644 --- a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x9400_0x9403Test.cs +++ b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x9400_0x9403Test.cs @@ -47,14 +47,14 @@ namespace JT809.Protocol.Test.JT809SubMessageBody { JT809_0x9400_0x9403 jT809_0x9400_0x9403 = new JT809_0x9400_0x9403 { - SourcePlatformId=new byte[11], + SourcePlatformId = "30313233343536373839", WarnType = JT809WarnType.疲劳驾驶报警, WarnTime = DateTime.Parse("2020-04-26 18:24:00"), StartTime = DateTime.Parse("2020-04-26 18:24:00"), EndTime = DateTime.Parse("2020-04-26 19:24:00"), VehicleNo = "粤A5647", VehicleColor = JT809VehicleColorType.黄色, - DestinationPlatformId = new byte[11], + DestinationPlatformId = "30313233343536373839", WarnContent = "疲劳驾驶报警", }; var hex = JT809_2019_Serializer.Serialize(jT809_0x9400_0x9403).ToHexString(); @@ -72,8 +72,8 @@ namespace JT809.Protocol.Test.JT809SubMessageBody Assert.Equal(DateTime.Parse("2020-04-26 19:24:00"), jT809_0x9400_0x9403.EndTime); Assert.Equal("疲劳驾驶报警", jT809_0x9400_0x9403.WarnContent); Assert.Equal((uint)12, jT809_0x9400_0x9403.WarnLength); - Assert.Equal(new byte[11], jT809_0x9400_0x9403.DestinationPlatformId); - Assert.Equal(new byte[11], jT809_0x9400_0x9403.SourcePlatformId); + Assert.Equal("30313233343536373839", jT809_0x9400_0x9403.DestinationPlatformId); + Assert.Equal("30313233343536373839", jT809_0x9400_0x9403.SourcePlatformId); } } } diff --git a/src/JT809.Protocol/Enums/JT809SubBusinessType.cs b/src/JT809.Protocol/Enums/JT809SubBusinessType.cs index 71c7a63..a883cf6 100644 --- a/src/JT809.Protocol/Enums/JT809SubBusinessType.cs +++ b/src/JT809.Protocol/Enums/JT809SubBusinessType.cs @@ -109,12 +109,12 @@ namespace JT809.Protocol.Enums 主动上报车辆电子运单信息 = 0x120D, /// ///主动上报车辆行驶路线信息 - ///UP_EXG_MSG_DRVLINE_INFO + ///UP_BASE_MSG_DRVLINE_INFO /// [Description("主动上报车辆行驶路线信息")] [JT809BodiesType(typeof(JT809_0x1200_0x120E))] - [JT809SubBusinessTypeDescription("UP_EXG_MSG_DRVLINE_INFO", "主动上报车辆行驶路线信息", JT809BusinessType.主链路车辆动态信息交换业务)] - 主动上报车辆行驶路线信息 = 0x120E, + [JT809SubBusinessTypeDescription("UP_BASE_MSG_DRVLINE_INFO", "主动上报车辆行驶路线信息", JT809BusinessType.主链路车辆动态信息交换业务)] + 主动上报车辆行驶路线信息 = 0x120E, #endregion @@ -313,7 +313,7 @@ namespace JT809.Protocol.Enums /// [Description("主动上报报警处理结果消息")] [JT809BodiesType(typeof(JT809_0x1400_0x1412))] - [JT809SubBusinessTypeDescription("UP_WARN_MSG_URGE_TODO_ACK_INFO", "主动上报报警处理结果消息", JT809BusinessType.主链路报警信息交互消息)] + [JT809SubBusinessTypeDescription("UP_WARN_MSG_ADPT_TODO_INFO", "主动上报报警处理结果消息", JT809BusinessType.主链路报警信息交互消息)] 主动上报报警处理结果消息 = 0x1412, /// ///上报报警督办请求消息 diff --git a/src/JT809.Protocol/Extensions/JT809SubPackageExtensionsTemplate.cs b/src/JT809.Protocol/Extensions/JT809SubPackageExtensionsTemplate.cs index e90666e..458e9a5 100644 --- a/src/JT809.Protocol/Extensions/JT809SubPackageExtensionsTemplate.cs +++ b/src/JT809.Protocol/Extensions/JT809SubPackageExtensionsTemplate.cs @@ -120,7 +120,7 @@ namespace JT809.Protocol.Extensions } /// /// 4608 - /// UP_EXG_MSG_DRVLINE_INFO - 主动上报车辆行驶路线信息 + /// UP_BASE_MSG_DRVLINE_INFO - 主动上报车辆行驶路线信息 /// auto-generated /// public static JT809.Protocol.SubMessageBody.JT809_0x1200_0x120E Create_主动上报车辆行驶路线信息(this JT809SubBusinessType jT809SubBusinessType,JT809.Protocol.SubMessageBody.JT809_0x1200_0x120E subBodies) @@ -190,12 +190,12 @@ namespace JT809.Protocol.Extensions { return Create(jT809SubBusinessType,subBodies); } - /// - /// 5120 - /// UP_WARN_MSG_URGE_TODO_ACK_INFO - 主动上报报警处理结果消息 - /// auto-generated - /// - public static JT809.Protocol.SubMessageBody.JT809_0x1400_0x1412 Create_主动上报报警处理结果消息(this JT809SubBusinessType jT809SubBusinessType,JT809.Protocol.SubMessageBody.JT809_0x1400_0x1412 subBodies) + /// + /// 5120 + /// UP_WARN_MSG_ADPT_TODO_INFO - 主动上报报警处理结果消息 + /// auto-generated + /// + public static JT809.Protocol.SubMessageBody.JT809_0x1400_0x1412 Create_主动上报报警处理结果消息(this JT809SubBusinessType jT809SubBusinessType,JT809.Protocol.SubMessageBody.JT809_0x1400_0x1412 subBodies) { return Create(jT809SubBusinessType,subBodies); } diff --git a/src/JT809.Protocol/JT809.Protocol.xml b/src/JT809.Protocol/JT809.Protocol.xml index b430d30..2135af6 100644 --- a/src/JT809.Protocol/JT809.Protocol.xml +++ b/src/JT809.Protocol/JT809.Protocol.xml @@ -724,7 +724,8 @@ 4608 - UP_EXG_MSG_TAKE_EWAYBILL_ACK - 上报车辆电子运单应答消息 + + - 上报车辆电子运单应答消息 auto-generated diff --git a/src/JT809.Protocol/MessageBody/JT809_0x1103.cs b/src/JT809.Protocol/MessageBody/JT809_0x1103.cs index d36274e..73ecf50 100644 --- a/src/JT809.Protocol/MessageBody/JT809_0x1103.cs +++ b/src/JT809.Protocol/MessageBody/JT809_0x1103.cs @@ -15,6 +15,7 @@ namespace JT809.Protocol.MessageBody /// 链路类型:主链路 /// 消息方向:上级平台往下级平台 /// 业务类型标识:UP_MANAGE_MSG_SN_INFORM + /// 描述:链路登录成功后,平台须发送链路断开之前所有子业务数据类型对应的消息序列号,发送方根据收到的消息序列号,在发送消息时,续编链路中断之前的消息序列号 /// public class JT809_0x1103 : JT809ExchangeMessageBodies, IJT809MessagePackFormatter,IJT809_2019_Version { diff --git a/src/JT809.Protocol/MessageBody/JT809_0x1400.cs b/src/JT809.Protocol/MessageBody/JT809_0x1400.cs index 4af443f..167db18 100644 --- a/src/JT809.Protocol/MessageBody/JT809_0x1400.cs +++ b/src/JT809.Protocol/MessageBody/JT809_0x1400.cs @@ -27,9 +27,9 @@ namespace JT809.Protocol.MessageBody if (config.Version == JT809Version.JTT2011) { value.VehicleNo = reader.ReadString(21); - value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); - value.SubBusinessType = reader.ReadUInt16(); + value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); } + value.SubBusinessType = reader.ReadUInt16(); value.DataLength = reader.ReadUInt32(); try { diff --git a/src/JT809.Protocol/MessageBody/JT809_0x9103.cs b/src/JT809.Protocol/MessageBody/JT809_0x9103.cs index 83024fe..b783c7a 100644 --- a/src/JT809.Protocol/MessageBody/JT809_0x9103.cs +++ b/src/JT809.Protocol/MessageBody/JT809_0x9103.cs @@ -15,6 +15,7 @@ namespace JT809.Protocol.MessageBody /// 链路类型:从链路 /// 消息方向:上级平台往下级平台 /// 业务类型标识:DOWN_MANAGE_MSG_SN_INFORM + /// 描述:链路登录成功后,平台须发送链路断开之前所有子业务数据类型对应的消息序列号,发送方根据收到的消息序列号,在发送消息时,续编链路中断之前的消息序列号 /// public class JT809_0x9103 : JT809ExchangeMessageBodies, IJT809MessagePackFormatter,IJT809_2019_Version { diff --git a/src/JT809.Protocol/Metadata/JT809VehiclePositionProperties_2019.cs b/src/JT809.Protocol/Metadata/JT809VehiclePositionProperties_2019.cs index d7e128e..880ac96 100644 --- a/src/JT809.Protocol/Metadata/JT809VehiclePositionProperties_2019.cs +++ b/src/JT809.Protocol/Metadata/JT809VehiclePositionProperties_2019.cs @@ -23,7 +23,7 @@ namespace JT809.Protocol.Metadata /// /// 监控平台唯一编码,由平台所在地行政区域代码和平台编码组成 11位 /// - public string PlatformId1 { get; set; }; + public string PlatformId1 { get; set; } /// /// 报警状态,二进制标识 0 正常 1表示报警 /// 具体定义按照808-2019中表18的规定 @@ -33,7 +33,7 @@ namespace JT809.Protocol.Metadata /// 市级监控平台唯一编码,由平台所在地行政区域代码和平台编码组成 /// 未填写时,全填0,无市级平台应由省级平台全填1 11位 /// - public string PlatformId2 { get; set; }; + public string PlatformId2 { get; set; } /// /// 报警状态,二进制标识 0 正常 1表示报警 /// 具体定义按照808-2019中表18的规定 @@ -43,7 +43,7 @@ namespace JT809.Protocol.Metadata /// 省级监控平台唯一编码,由平台所在地行政区域代码和平台编码组成 /// 未填写时,全填0 11位 /// - public string PlatformId3 { get; set; }; + public string PlatformId3 { get; set; } /// /// 报警状态,二进制标识 0 正常 1表示报警 /// 具体定义按照808-2019中表18的规定 diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x1205.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x1205.cs index 02648e7..2b9eaa3 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x1205.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x1205.cs @@ -11,8 +11,8 @@ namespace JT809.Protocol.SubMessageBody { /// /// 启动车辆定位信息交换应答消息 - /// 子业务类型标识:UP_EXG_ MSG_ RETURN_ STARTUP ACK - /// 描述:本条消息是下级平台对上级平台下发的 DOWN_EXG_ MSG_ RETURN_STARTUP 消息的应答消息 + /// 子业务类型标识:UP_EXG_MSG_RETURN_STARTUP_ACK + /// 描述:本条消息是下级平台对上级平台下发的 DOWN_EXG_MSG_RETURN_STARTUP 消息的应答消息 /// public class JT809_0x1200_0x1205:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { @@ -29,6 +29,10 @@ namespace JT809.Protocol.SubMessageBody /// 对应启动车辆定位信息交换请求消息源报文序列号 /// public uint SourceMsgSn { get; set; } + /// + /// 后续数据长度 值为0x00 + /// + public uint DataLength { get; set; } = 0x00; public JT809_0x1200_0x1205 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) { @@ -36,6 +40,7 @@ namespace JT809.Protocol.SubMessageBody if (config.Version == JT809Version.JTT2019) { value.SourceDataType = reader.ReadUInt16(); value.SourceMsgSn = reader.ReadUInt32(); + value.DataLength = reader.ReadUInt32(); } return value; } @@ -45,6 +50,7 @@ namespace JT809.Protocol.SubMessageBody if (config.Version == JT809Version.JTT2019) { writer.WriteUInt16(value.SourceDataType); writer.WriteUInt32(value.SourceMsgSn); + writer.WriteUInt32(value.DataLength); } } } diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x1206.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x1206.cs index 7dfcd9e..a148ab5 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x1206.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x1206.cs @@ -12,6 +12,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 结束车辆定位信息交换应答消息 /// 子业务类型标识:UP_EXG_MSG_RETURN_END_ACK + /// 本条消息时下级平台对上级平台服务器下发的DOWN_EXG_MSG_RETURN_END消息的应答消息 /// public class JT809_0x1200_0x1206:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { @@ -28,6 +29,10 @@ namespace JT809.Protocol.SubMessageBody /// 对应结束车辆定位信息交换请求消息源报文序列号 /// public uint SourceMsgSn { get; set; } + /// + /// 后续数据长度 值为0x00 + /// + public uint DataLength { get; set; } = 0x00; public JT809_0x1200_0x1206 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) { @@ -36,6 +41,7 @@ namespace JT809.Protocol.SubMessageBody { value.SourceDataType = reader.ReadUInt16(); value.SourceMsgSn = reader.ReadUInt32(); + value.DataLength = reader.ReadUInt32(); } return value; } @@ -46,6 +52,7 @@ namespace JT809.Protocol.SubMessageBody { writer.WriteUInt16(value.SourceDataType); writer.WriteUInt32(value.SourceMsgSn); + writer.WriteUInt32(value.DataLength); } } } diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120B.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120B.cs index b1fb052..4954ce9 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120B.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120B.cs @@ -8,7 +8,7 @@ namespace JT809.Protocol.SubMessageBody { /// /// 上报车辆电子运单应答消息 - /// 子业务类型标识:UP_CXG_MSG_TAKE_EWAYBILL_ACK + /// 子业务类型标识:UP_EXG_MSG_TAKE_EWAYBILL_ACK /// 描述:下级平台应答上级平台发送的上报车辆电子运单请求消息,向上级平台上传车辆当前电子运单 /// public class JT809_0x1200_0x120B:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120C.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120C.cs index 613d16f..6a12ee9 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120C.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120C.cs @@ -10,6 +10,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 主动上报驾驶员身份信息消息 /// 子业务类型标识:UP_EXG_MSG_REPORT_DRIVER_INFO + /// 下级平台在接收到车载终端上传的驾驶员身份信息后,主动向上级平台上报该消息 /// public class JT809_0x1200_0x120C:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120D.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120D.cs index b55f094..f30e5fa 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120D.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120D.cs @@ -9,6 +9,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 主动上报车辆电子运单信息 /// 子业务类型标识:UP_EXG_MSG_REPORT_EWAYBILL_INFO + /// 描述:下级平台“主动上报车辆电子运单信息”,向上级平台上报车辆当前电子运单 /// public class JT809_0x1200_0x120D:JT809SubBodies, IJT809MessagePackFormatter,IJT809_2019_Version { diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120E.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120E.cs index 713d3cc..d545eea 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120E.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1200_0x120E.cs @@ -8,7 +8,7 @@ namespace JT809.Protocol.SubMessageBody { /// /// 主动上报车辆行驶路线信息 - /// 子业务类型标识:UP_EXG_MSG_DRVLINE_INFO + /// 子业务类型标识:UP_BASE_MSG_DRVLINE_INFO /// public class JT809_0x1200_0x120E:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1300_0x1301.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1300_0x1301.cs index a83a466..b23b413 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1300_0x1301.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1300_0x1301.cs @@ -9,7 +9,8 @@ namespace JT809.Protocol.SubMessageBody /// /// 平台查岗应答消息 /// 子业务类型标识:UP_PLATFORM_MSG_POST_QUERY_ACK - /// 描述:下级平台应答上级平台发送的不定期平台查岗消息 + /// 2011 描述:下级平台应答上级平台发送的不定期平台查岗消息 + /// 2019 描述:下级平台根据查岗对象地类型将上级平台发送地不定期平台查岗消息发送到不同地查岗对象,并将不同地查岗对象地应答分别转发给上级平台 /// public class JT809_0x1300_0x1301:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1300_0x1302.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1300_0x1302.cs index 9b819f1..8c60364 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1300_0x1302.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1300_0x1302.cs @@ -9,7 +9,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 下发平台间报文应答消息 /// 子业务类型标识:UP_PLATFORM_MSG_INFO_ACK - /// 描述:下级平台收到上级平台发送的下发平台间报文请求消息后,发送应答消息 + /// 描述:下级平台收到上级平台发送的"下发平台间报文请求"消息后,根据相应的下发报文对象类型,进行转发,并向上级平台发送应答消息 /// public class JT809_0x1300_0x1302:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { @@ -39,7 +39,6 @@ namespace JT809.Protocol.SubMessageBody { value.InfoID = reader.ReadUInt32(); } - return value; } diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1300_0x1303.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1300_0x1303.cs index 2d37e56..66a1ec3 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1300_0x1303.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1300_0x1303.cs @@ -4,6 +4,7 @@ using JT809.Protocol.MessagePack; using JT809.Protocol.Extensions; using System; using JT809.Protocol.Interfaces; +using System.Collections.Generic; namespace JT809.Protocol.SubMessageBody { @@ -17,11 +18,16 @@ namespace JT809.Protocol.SubMessageBody public override ushort SubMsgId => JT809SubBusinessType.上传平台间消息补传请求消息.ToUInt16Value(); public override string Description => "上传平台间消息补传请求消息"; + /// + /// 对应需要重传消息地子业务类型标识 + /// + public byte SerialCount { get; set; } + /// /// 需要重传消息的起始报文序列号和结束的报文序列号。如只请求重传一个消息,则起始消息报文序列号和结束消息报文序列号相同 /// 8位 /// - public byte[] SerialList { get; set; } + public List SerialList { get; set; } /// /// 重传起始系统utc时间 /// 8位 @@ -30,14 +36,23 @@ namespace JT809.Protocol.SubMessageBody public JT809_0x1300_0x1303 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) { var value= new JT809_0x1300_0x1303(); - value.SerialList = reader.ReadArray(8).ToArray(); + value.SerialCount = reader.ReadByte(); + value.SerialList = new List(); + for (int i = 0; i < SerialCount; i++) + { + value.SerialList.Add(reader.ReadArray(8).ToArray()); + } value.Time = reader.ReadUTCDateTime(); return value; } public void Serialize(ref JT809MessagePackWriter writer, JT809_0x1300_0x1303 value, IJT809Config config) { - writer.WriteArray(value.SerialList); + writer.WriteByte(value.SerialCount); + foreach (var item in value.SerialList) + { + writer.WriteArray(item); + } writer.WriteUTCDateTime(value.Time); } } diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1402.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1402.cs index 85438b3..e634239 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1402.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1402.cs @@ -10,7 +10,8 @@ namespace JT809.Protocol.SubMessageBody /// /// 上报报警信息消息 /// 子业务类型标识:UP_WARN_MSG_ADPT_INFO - /// 描述:下级平台向上级平台上报某车辆的报警信息 + /// 2011 描述:下级平台向上级平台上报某车辆的报警信息 + /// 2019 描述:下级平台向上级平台“上报报警信息”。 /// 本条消息上级平台无需应答 /// public class JT809_0x1400_0x1402:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version @@ -25,7 +26,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 发起报警平台唯一编码,由平台所在地行政区域代码和平台编号组成 /// - public byte[] SourcePlatformId { get; set; } + public string SourcePlatformId { get; set; } /// /// 报警类型 /// @@ -53,7 +54,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 被报警平台唯一编码,由平台所在地行政区划代码和平台编号组成。非平台相关报警全填0 /// - public byte[] DestinationPlatformId { get; set; } + public string DestinationPlatformId { get; set; } /// /// 线路ID 808-2019中0x8606规定的报文中的线路ID /// @@ -79,7 +80,7 @@ namespace JT809.Protocol.SubMessageBody } else { - value.SourcePlatformId = reader.ReadArray(11).ToArray(); + value.SourcePlatformId = reader.ReadBigNumber(11); } value.WarnType = (JT809WarnType)reader.ReadUInt16(); value.WarnTime = reader.ReadUTCDateTime(); @@ -94,7 +95,7 @@ namespace JT809.Protocol.SubMessageBody #warning 此处车牌号文档长度有误,使用旧版长度21 value.VehicleNo = reader.ReadString(21); value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); - value.DestinationPlatformId = reader.ReadArray(11).ToArray(); + value.DestinationPlatformId = reader.ReadBigNumber(11); value.DRVLineId = reader.ReadUInt32(); } value.InfoLength = reader.ReadUInt32(); @@ -110,7 +111,7 @@ namespace JT809.Protocol.SubMessageBody } else { - writer.WriteArray(value.SourcePlatformId); + writer.WriteBigNumber(value.SourcePlatformId,11); } writer.WriteUInt16((ushort)value.WarnType); writer.WriteUTCDateTime(value.WarnTime); @@ -124,7 +125,7 @@ namespace JT809.Protocol.SubMessageBody writer.WriteUTCDateTime(value.EndTime); writer.WriteStringPadRight(value.VehicleNo,21); writer.WriteByte((byte)value.VehicleColor); - writer.WriteArray(value.DestinationPlatformId); + writer.WriteBigNumber(value.DestinationPlatformId,11); writer.WriteUInt32(value.DRVLineId); } // 先计算内容长度(汉字为两个字节) diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1403.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1403.cs index 5c83466..a939b15 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1403.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1403.cs @@ -24,7 +24,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 发起报警平台唯一编码,由平台所在地行政区域代码和平台编号组成 /// - public byte[] SourcePlatformId { get; set; } + public string SourcePlatformId { get; set; } /// /// 报警类型 /// @@ -52,7 +52,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 被报警平台唯一编码,由平台所在地行政区划代码和平台编号组成。非平台相关报警全填0 /// - public byte[] DestinationPlatformId { get; set; } + public string DestinationPlatformId { get; set; } /// /// 线路ID 808-2019中0x8606规定的报文中的线路ID /// @@ -83,7 +83,7 @@ namespace JT809.Protocol.SubMessageBody } else { - value.SourcePlatformId = reader.ReadArray(11).ToArray(); + value.SourcePlatformId = reader.ReadBigNumber(11); value.WarnType = (JT809WarnType)reader.ReadUInt16(); value.WarnTime = reader.ReadUTCDateTime(); value.StartTime = reader.ReadUTCDateTime(); @@ -91,7 +91,7 @@ namespace JT809.Protocol.SubMessageBody #warning 此处车牌号文档长度有误,使用旧版长度21 value.VehicleNo = reader.ReadString(21); value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); - value.DestinationPlatformId = reader.ReadArray(11).ToArray(); + value.DestinationPlatformId = reader.ReadBigNumber(11); value.DRVLineId = reader.ReadUInt32(); value.InfoLength = reader.ReadUInt32(); value.InfoContent = reader.ReadString((int)value.InfoLength); @@ -108,14 +108,14 @@ namespace JT809.Protocol.SubMessageBody } else { - writer.WriteArray(value.SourcePlatformId); + writer.WriteBigNumber(value.SourcePlatformId,11); writer.WriteUInt16((ushort)value.WarnType); writer.WriteUTCDateTime(value.WarnTime); writer.WriteUTCDateTime(value.StartTime); writer.WriteUTCDateTime(value.EndTime); writer.WriteStringPadRight(value.VehicleNo, 21); writer.WriteByte((byte)value.VehicleColor); - writer.WriteArray(value.DestinationPlatformId); + writer.WriteBigNumber(value.DestinationPlatformId,11); writer.WriteUInt32(value.DRVLineId); // 先计算内容长度(汉字为两个字节) writer.Skip(4, out int lengthPosition); diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1411.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1411.cs index 41c12e1..bb29c20 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1411.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1411.cs @@ -9,7 +9,7 @@ namespace JT809.Protocol.SubMessageBody { /// /// 上报报警督办应答消息 - /// 子业务类型标识:UP_WARN_MSG_ADPT_INFO + /// 子业务类型标识:UP_WARN_MSG_URGE_TODO_ACK_INFO /// 描述:下级平台向上级平台上报某车辆的报警信息 /// 本条消息上级平台无需应答 /// diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1413.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1413.cs index 8c4351a..b22370b 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1413.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1400_0x1413.cs @@ -21,7 +21,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 发起报警平台唯一编码,由平台所在地行政区划大码和平台编号组成 /// - public byte[] SourcePlatformId { get; set; } + public string SourcePlatformId { get; set; } /// /// 报警时间 utc /// @@ -57,7 +57,7 @@ namespace JT809.Protocol.SubMessageBody public JT809_0x1400_0x1413 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) { var value = new JT809_0x1400_0x1413(); - value.SourcePlatformId = reader.ReadArray(11).ToArray(); + value.SourcePlatformId = reader.ReadBigNumber(11); value.WarnTime = reader.ReadUTCDateTime(); value.SourceDateType = reader.ReadUInt16(); value.SourceMsgSn = reader.ReadUInt32(); @@ -71,7 +71,7 @@ namespace JT809.Protocol.SubMessageBody public void Serialize(ref JT809MessagePackWriter writer, JT809_0x1400_0x1413 value, IJT809Config config) { - writer.WriteArray(value.SourcePlatformId); + writer.WriteBigNumber(value.SourcePlatformId,11); writer.WriteUTCDateTime(value.WarnTime); writer.WriteUInt16(value.SourceDateType); writer.WriteUInt32(value.SourceMsgSn); diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1500_0x1504.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1500_0x1504.cs index 6c1eb3d..872b5cd 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1500_0x1504.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1500_0x1504.cs @@ -8,8 +8,8 @@ namespace JT809.Protocol.SubMessageBody { /// /// 上报车辆行驶记录应答消息 - /// 子业务类型标识:UP_CTRL_MSG_TAKE_T'RAVEL_ACK - /// 描述:下级平台应答上级平台下发的上报车辆行驶记录请求消息,将车辆行驶记录数据上传至上级平台 + /// 子业务类型标识:UP_CTRL_MSG_TAKE_TRAVEL_ACK + /// 描述:下级平台应答上级平台下发的"上报车辆行驶记录请求"消息,将车辆行驶记录数据上传至上级平台 /// public class JT809_0x1500_0x1504:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1500_0x1505.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1500_0x1505.cs index 3c0b929..c92300b 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1500_0x1505.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1500_0x1505.cs @@ -9,7 +9,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 车辆应急接入监管平台应答消息 /// 子业务类型标识: UP_CTRL_MSG_EMERGENCY_MONITORING_ACK - /// 描述:下级平台应答上级平台下发的车辆应急接入监管平台请求消息应答 + /// 描述:下级平台应答上级平台下发的"车辆应急接入监管平台请求"消息应答 /// public class JT809_0x1500_0x1505:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x1600_0x1601.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x1600_0x1601.cs index 32f10e0..efb55b5 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x1600_0x1601.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x1600_0x1601.cs @@ -9,7 +9,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 补报车辆静态信息应答 /// 子业务类型标识:UP_BASE_MSG_VEHICLE_ADDED_ACK - /// 描述:上级平台应答下级平台发送的补报车辆静态信息清求消息 + /// 描述:上级平台应答下级平台发送的"补报车辆静态信息清求"消息 /// public class JT809_0x1600_0x1601:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x9202.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x9202.cs index 17f9132..ac4f7c1 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x9202.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x9202.cs @@ -7,10 +7,17 @@ using JT809.Protocol.Interfaces; namespace JT809.Protocol.SubMessageBody { +#warning 8.3.3.2.5 交换车辆行驶路线信息消息 无指定消息子类型,暂未对接 /// /// 交换车辆定位信息消息 /// 子业务类型标识:DOWN_EXG_MSG_CAR_LOCATION - /// 描述:上级平台通过该消息不间断地向车辆驶入区域所属的下级平台发送车辆定位信息,直到该车驶离该区域 + /// 2011 描述:上级平台通过该消息不间断地向车辆驶入区域所属的下级平台发送车辆定位信息,直到该车驶离该区域 + /// 2019 描述:上级平台在以下四种情况下通过该消息不间断地向车辆进入区域所属的下级平台发送车辆定位信息,直到该车辆离开该区域 + /// 1.车辆跨域时,上级平台通过该消息不间断地向车辆进入区域所属的下级平台发送车辆定位信息,直到该车辆离开该区域 + /// 2.人工指定车辆定位信息交换时,上级平台通过该消息不间断地向指定交换对象下级平台发送车辆定位信息,直到人工指定“交换车辆定位信息”结束 + /// 3.下级平台向上级平台“申请交换指定车辆定位信息”成功后,上级平台通过该消息不间断地向交换对象下级平台发送车辆定位信息,直到“申请交换指定车辆定位信息”结束 + /// 4.应急状态监控车辆时,上级平台向车辆归属下级平台通过该消息不间断地发送车辆定位信息,实现车辆定位信息回传 + /// /// public class JT809_0x9200_0x9202:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { @@ -53,11 +60,11 @@ namespace JT809.Protocol.SubMessageBody jT809_0X1200_0x9202.GNSSData.Encrypt = (JT809_VehiclePositionEncrypt)reader.ReadByte(); jT809_0X1200_0x9202.GNSSData.DataLength = reader.ReadUInt32(); jT809_0X1200_0x9202.GNSSData.GnssData = reader.ReadArray((int)jT809_0X1200_0x9202.GNSSData.DataLength).ToArray(); - jT809_0X1200_0x9202.GNSSData.PlatformId1 = reader.ReadArray(11).ToArray(); + jT809_0X1200_0x9202.GNSSData.PlatformId1 = reader.ReadBigNumber(11); jT809_0X1200_0x9202.GNSSData.Alarm1 = reader.ReadUInt32(); - jT809_0X1200_0x9202.GNSSData.PlatformId2 = reader.ReadArray(11).ToArray(); + jT809_0X1200_0x9202.GNSSData.PlatformId2 = reader.ReadBigNumber(11); jT809_0X1200_0x9202.GNSSData.Alarm2 = reader.ReadUInt32(); - jT809_0X1200_0x9202.GNSSData.PlatformId3 = reader.ReadArray(11).ToArray(); + jT809_0X1200_0x9202.GNSSData.PlatformId3 = reader.ReadBigNumber(11); jT809_0X1200_0x9202.GNSSData.Alarm3 = reader.ReadUInt32(); } return jT809_0X1200_0x9202; @@ -88,11 +95,11 @@ namespace JT809.Protocol.SubMessageBody writer.WriteByte((byte)value.GNSSData.Encrypt); writer.Skip(4, out int position); writer.WriteArray(value.GNSSData.GnssData); - writer.WriteArray(value.GNSSData.PlatformId1); + writer.WriteBigNumber(value.GNSSData.PlatformId1,11); writer.WriteUInt32(value.GNSSData.Alarm1); - writer.WriteArray(value.GNSSData.PlatformId2); + writer.WriteBigNumber(value.GNSSData.PlatformId2,11); writer.WriteUInt32(value.GNSSData.Alarm2); - writer.WriteArray(value.GNSSData.PlatformId3); + writer.WriteBigNumber(value.GNSSData.PlatformId3,11); writer.WriteUInt32(value.GNSSData.Alarm3); writer.WriteUInt32Return((uint)(writer.GetCurrentPosition() - position-4), position); } diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x9208.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x9208.cs index 55479d2..f33baf1 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x9208.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x9208.cs @@ -9,6 +9,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 取消交换指定车辆定位信息应答or取消申请交换指定车辆定位信息应答消息 /// 子业务类型标识:DOWN_EXG_MSG_APPLY_FOR_MONITOR_END_ACK + /// 应答下级平台“取消申请交换指定车辆定位信息” /// public class JT809_0x9200_0x9208:JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x9209.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x9209.cs index 9db6349..84c75a4 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x9209.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x9209.cs @@ -9,6 +9,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 补发车辆定位信息应答 /// 子业务类型标识:DOWN_EXG_MSG_APPLY_HISGNSSDATA_ACK + /// 本条消息是上级平台应答下级平台发送的“补发车辆定位信息请求”消息,即 UP_EXG_MSG_APPLY_HISGNSSDATA_REQ /// public class JT809_0x9200_0x9209: JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x920D.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x920D.cs index da44691..62c203e 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x920D.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x9200_0x920D.cs @@ -12,6 +12,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 车辆行驶线路请求应答 /// 子业务类型标识:DOWN_BASE_MSG_DRVLINE_ACK + /// 上级平台应答下级平台发送地车辆行驶路线信息 /// public class JT809_0x9200_0x920D : JT809SubBodies, IJT809MessagePackFormatter, IJT809_2019_Version { diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x9400_0x9402.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x9400_0x9402.cs index 4fb3cfe..4840a8b 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x9400_0x9402.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x9400_0x9402.cs @@ -26,7 +26,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 发起报警平台唯一编码,由平台所在地行政区域代码和平台编号组成 /// - public byte[] SourcePlatformId { get; set; } + public string SourcePlatformId { get; set; } /// /// 报警类型 /// @@ -54,7 +54,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 被报警平台唯一编码,由平台所在地行政区划代码和平台编号组成。非平台相关报警全填0 /// - public byte[] DestinationPlatformId { get; set; } + public string DestinationPlatformId { get; set; } /// /// 线路ID 808-2019中0x8606规定的报文中的线路ID /// @@ -77,7 +77,7 @@ namespace JT809.Protocol.SubMessageBody } else { - value.SourcePlatformId = reader.ReadArray(11).ToArray(); + value.SourcePlatformId = reader.ReadBigNumber(11); } value.WarnType = (JT809WarnType)reader.ReadUInt16(); value.WarnTime = reader.ReadUTCDateTime(); @@ -87,7 +87,7 @@ namespace JT809.Protocol.SubMessageBody #warning 此处车牌号文档长度有误,使用旧版长度21 value.VehicleNo = reader.ReadString(21); value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); - value.DestinationPlatformId = reader.ReadArray(11).ToArray(); + value.DestinationPlatformId = reader.ReadBigNumber(11); value.DRVLineId = reader.ReadUInt32(); } value.WarnLength = reader.ReadUInt32(); @@ -103,7 +103,7 @@ namespace JT809.Protocol.SubMessageBody } else { - writer.WriteArray(value.SourcePlatformId); + writer.WriteBigNumber(value.SourcePlatformId,11); } writer.WriteUInt16((ushort)value.WarnType); writer.WriteUTCDateTime(value.WarnTime); @@ -112,7 +112,7 @@ namespace JT809.Protocol.SubMessageBody writer.WriteUTCDateTime(value.EndTime); writer.WriteStringPadRight(value.VehicleNo, 21); writer.WriteByte((byte)value.VehicleColor); - writer.WriteArray(value.DestinationPlatformId); + writer.WriteBigNumber(value.DestinationPlatformId,11); writer.WriteUInt32(value.DRVLineId); } // 先计算内容长度(汉字为两个字节) diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x9400_0x9403.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x9400_0x9403.cs index af75255..cadd173 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x9400_0x9403.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x9400_0x9403.cs @@ -25,7 +25,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 发起报警平台唯一编码,由平台所在地行政区域代码和平台编号组成 /// - public byte[] SourcePlatformId { get; set; } + public string SourcePlatformId { get; set; } /// /// 报警类型 /// @@ -53,7 +53,7 @@ namespace JT809.Protocol.SubMessageBody /// /// 被报警平台唯一编码,由平台所在地行政区划代码和平台编号组成。非平台相关报警全填0 /// - public byte[] DestinationPlatformId { get; set; } + public string DestinationPlatformId { get; set; } /// /// 线路ID 808-2019中0x8606规定的报文中的线路ID /// @@ -75,7 +75,7 @@ namespace JT809.Protocol.SubMessageBody } else { - value.SourcePlatformId = reader.ReadArray(11).ToArray(); + value.SourcePlatformId = reader.ReadBigNumber(11); } value.WarnType = (JT809WarnType)reader.ReadUInt16(); value.WarnTime = reader.ReadUTCDateTime(); @@ -86,7 +86,7 @@ namespace JT809.Protocol.SubMessageBody #warning 此处车牌号文档长度有误,使用旧版长度21 value.VehicleNo = reader.ReadString(21); value.VehicleColor = (JT809VehicleColorType)reader.ReadByte(); - value.DestinationPlatformId = reader.ReadArray(11).ToArray(); + value.DestinationPlatformId = reader.ReadBigNumber(11); value.DRVLineId = reader.ReadUInt32(); } value.WarnLength = reader.ReadUInt32(); @@ -102,7 +102,7 @@ namespace JT809.Protocol.SubMessageBody } else { - writer.WriteArray(value.SourcePlatformId); + writer.WriteBigNumber(value.SourcePlatformId,11); } writer.WriteUInt16((ushort)value.WarnType); writer.WriteUTCDateTime(value.WarnTime); @@ -112,7 +112,7 @@ namespace JT809.Protocol.SubMessageBody writer.WriteUTCDateTime(value.EndTime); writer.WriteStringPadRight(value.VehicleNo, 21); writer.WriteByte((byte)value.VehicleColor); - writer.WriteArray(value.DestinationPlatformId); + writer.WriteBigNumber(value.DestinationPlatformId,11); writer.WriteUInt32(value.DRVLineId); } // 先计算内容长度(汉字为两个字节) diff --git a/src/JT809.Protocol/SubMessageBody/JT809_0x9500_0x9505.cs b/src/JT809.Protocol/SubMessageBody/JT809_0x9500_0x9505.cs index 257b1d9..4b07bcb 100644 --- a/src/JT809.Protocol/SubMessageBody/JT809_0x9500_0x9505.cs +++ b/src/JT809.Protocol/SubMessageBody/JT809_0x9500_0x9505.cs @@ -3,6 +3,7 @@ using JT809.Protocol.Formatters; using JT809.Protocol.MessagePack; using JT809.Protocol.Extensions; using System; +using JT809.Protocol.Interfaces; namespace JT809.Protocol.SubMessageBody { @@ -11,7 +12,7 @@ namespace JT809.Protocol.SubMessageBody /// 子业务类型标识:UP_CTRL_MSG_EMERGENCY_MONITORING_REQ /// 描述:发生应急情况时,政府监管平台需要及时监控该车辆时,就向该车辆归属的下级平台发送该命令 /// - public class JT809_0x9500_0x9505:JT809SubBodies, IJT809MessagePackFormatter + public class JT809_0x9500_0x9505:JT809SubBodies, IJT809MessagePackFormatter,IJT809_2019_Version { public override ushort SubMsgId => JT809SubBusinessType.车辆应急接入监管平台请求消息.ToUInt16Value();