From c6b6501f444544f454d70412a0f22509e3e9063c Mon Sep 17 00:00:00 2001 From: SmallChi <564952747@qq.com> Date: Mon, 24 Sep 2018 22:18:15 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A00x1208|0x1209|0x120A|0x120B?= =?UTF-8?q?|0x120C|0x120D=E6=B6=88=E6=81=AF=202.=E5=A2=9E=E5=8A=A00x1209|0?= =?UTF-8?q?x120A|0x10B=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +++- .../JT809_0x1200_0x1209Test.cs | 36 +++++++++++++++++ .../JT809_0x1200_0x120ATest.cs | 40 +++++++++++++++++++ .../JT809_0x1200_0x120BTest.cs | 35 ++++++++++++++++ .../JT809Enums/JT809SubBusinessType.cs | 6 +++ .../JT809_0x1200_0x1209Formatter.cs | 29 ++++++++++++++ .../JT809_0x1200_0x120AFormatter.cs | 33 +++++++++++++++ .../JT809_0x1200_0x120BFormatter.cs | 29 ++++++++++++++ .../JT809_0x1200_0x120CFormatter.cs | 33 +++++++++++++++ .../JT809_0x1200_0x120DFormatter.cs | 29 ++++++++++++++ .../JT809_0x1200_0x1208.cs | 16 ++++++++ .../JT809_0x1200_0x1209.cs | 26 ++++++++++++ .../JT809_0x1200_0x120A.cs | 34 ++++++++++++++++ .../JT809_0x1200_0x120B.cs | 26 ++++++++++++ .../JT809_0x1200_0x120C.cs | 30 ++++++++++++++ .../JT809_0x1200_0x120D.cs | 25 ++++++++++++ 16 files changed, 434 insertions(+), 1 deletion(-) create mode 100644 src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x1209Test.cs create mode 100644 src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x120ATest.cs create mode 100644 src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x120BTest.cs create mode 100644 src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x1209Formatter.cs create mode 100644 src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120AFormatter.cs create mode 100644 src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120BFormatter.cs create mode 100644 src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120CFormatter.cs create mode 100644 src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120DFormatter.cs create mode 100644 src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x1208.cs create mode 100644 src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x1209.cs create mode 100644 src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120A.cs create mode 100644 src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120B.cs create mode 100644 src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120C.cs create mode 100644 src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120D.cs diff --git a/README.md b/README.md index 2c28799..b3e8f84 100644 --- a/README.md +++ b/README.md @@ -49,4 +49,10 @@ | 4 | 0x1203 | √ | 车辆定位信息自动补报 | | 5 | 0x1205 | √ | 启动车辆定位信息交换应答消息 | | 6 | 0x1206 | √ | 结束车辆定位信息交换应答消息 | -| 7 | 0x1207 | √ | 申请交换指定车辆定位信息请求消息 | \ No newline at end of file +| 7 | 0x1207 | √ | 申请交换指定车辆定位信息请求消息 | +| 8 | 0x1208 | √ | 取消交换指定车辆定位信息请求 | +| 9 | 0x1209 | √ | 补发车辆定位信息请求 | +| 10 | 0x120A | √ | 上报车辆驾驶员身份识别信息应答 | +| 11 | 0x120B | √ | 上报车辆电子运单应答 | +| 12 | 0x120C | √ | 主动上报驾驶员身份信息 | +| 13 | 0x120D | √ | 主动上报车辆电子运单信息 | \ No newline at end of file diff --git a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x1209Test.cs b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x1209Test.cs new file mode 100644 index 0000000..7090711 --- /dev/null +++ b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x1209Test.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; +using JT809.Protocol; +using JT809.Protocol.JT809Extensions; +using JT809.Protocol.JT809MessageBody; +using JT809.Protocol.JT809Exceptions; +using JT809.Protocol.JT809SubMessageBody; + +namespace JT809.Protocol.Test.JT809SubMessageBody +{ + public class JT809_0x1200_0x1209Test + { + [Fact] + public void Test1() + { + JT809_0x1200_0x1209 jT809_0X1200_0X1209 = new JT809_0x1200_0x1209 + { + StartTime = DateTime.Parse("2018-09-24 14:14:14"), + EndTime = DateTime.Parse("2018-09-24 23:23:23") + }; + var hex = JT809Serializer.Serialize(jT809_0X1200_0X1209).ToHexString(); + //"00 00 00 00 5B A8 80 B6 00 00 00 00 5B A9 01 6B" + } + + [Fact] + public void Test2() + { + var bytes = "00 00 00 00 5B A8 80 B6 00 00 00 00 5B A9 01 6B".ToHexBytes(); + JT809_0x1200_0x1209 jT809_0X1200_0X1209 = JT809Serializer.Deserialize(bytes); + Assert.Equal(DateTime.Parse("2018-09-24 14:14:14"), jT809_0X1200_0X1209.StartTime); + Assert.Equal(DateTime.Parse("2018-09-24 23:23:23"), jT809_0X1200_0X1209.EndTime); + } + } +} diff --git a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x120ATest.cs b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x120ATest.cs new file mode 100644 index 0000000..b41d9ba --- /dev/null +++ b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x120ATest.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; +using JT809.Protocol; +using JT809.Protocol.JT809Extensions; +using JT809.Protocol.JT809MessageBody; +using JT809.Protocol.JT809Exceptions; +using JT809.Protocol.JT809SubMessageBody; + +namespace JT809.Protocol.Test.JT809SubMessageBody +{ + public class JT809_0x1200_0x120ATest + { + [Fact] + public void Test1() + { + JT809_0x1200_0x120A jT809_0X1200_0X120A = new JT809_0x1200_0x120A + { + DriverID = "123456789123456789", + DriverName = "smallchi", + Licence= "abcdef123456789", + OrgName= "www123456789" + }; + var hex = JT809Serializer.Serialize(jT809_0X1200_0X120A).ToHexString(); + //"73 6D 61 6C 6C 63 68 69 00 00 00 00 00 00 00 00 31 32 33 34 35 36 37 38 39 31 32 33 34 35 36 37 38 39 00 00 61 62 63 64 65 66 31 32 33 34 35 36 37 38 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 77 77 77 31 32 33 34 35 36 37 38 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" + } + + [Fact] + public void Test2() + { + var bytes = "73 6D 61 6C 6C 63 68 69 00 00 00 00 00 00 00 00 31 32 33 34 35 36 37 38 39 31 32 33 34 35 36 37 38 39 00 00 61 62 63 64 65 66 31 32 33 34 35 36 37 38 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 77 77 77 31 32 33 34 35 36 37 38 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00".ToHexBytes(); + JT809_0x1200_0x120A jT809_0X1200_0X120A = JT809Serializer.Deserialize(bytes); + Assert.Equal("123456789123456789", jT809_0X1200_0X120A.DriverID); + Assert.Equal("smallchi", jT809_0X1200_0X120A.DriverName); + Assert.Equal("abcdef123456789", jT809_0X1200_0X120A.Licence); + Assert.Equal("www123456789", jT809_0X1200_0X120A.OrgName); + } + } +} diff --git a/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x120BTest.cs b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x120BTest.cs new file mode 100644 index 0000000..8fda46e --- /dev/null +++ b/src/JT809.Protocol.Test/JT809SubMessageBody/JT809_0x1200_0x120BTest.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; +using JT809.Protocol; +using JT809.Protocol.JT809Extensions; +using JT809.Protocol.JT809MessageBody; +using JT809.Protocol.JT809Exceptions; +using JT809.Protocol.JT809SubMessageBody; + +namespace JT809.Protocol.Test.JT809SubMessageBody +{ + public class JT809_0x1200_0x120BTest + { + [Fact] + public void Test1() + { + JT809_0x1200_0x120B jT809_0X1200_0X120B = new JT809_0x1200_0x120B + { + EwaybillInfo="asd123456asd" + }; + var hex = JT809Serializer.Serialize(jT809_0X1200_0X120B).ToHexString(); + //"00 00 00 0C 61 73 64 31 32 33 34 35 36 61 73 64" + } + + [Fact] + public void Test2() + { + var bytes = "00 00 00 0C 61 73 64 31 32 33 34 35 36 61 73 64".ToHexBytes(); + JT809_0x1200_0x120B jT809_0X1200_0X120B = JT809Serializer.Deserialize(bytes); + Assert.Equal("asd123456asd", jT809_0X1200_0X120B.EwaybillInfo); + Assert.Equal((uint)12, jT809_0X1200_0X120B.EwaybillLength); + } + } +} diff --git a/src/JT809.Protocol/JT809Enums/JT809SubBusinessType.cs b/src/JT809.Protocol/JT809Enums/JT809SubBusinessType.cs index 2d67fc8..777da96 100644 --- a/src/JT809.Protocol/JT809Enums/JT809SubBusinessType.cs +++ b/src/JT809.Protocol/JT809Enums/JT809SubBusinessType.cs @@ -50,31 +50,37 @@ namespace JT809.Protocol.JT809Enums ///取消交换指定车辆定位信息请求 /// [Description("取消交换指定车辆定位信息请求")] + [JT809BodiesType(typeof(JT809_0x1200_0x1208))] UP_EXG_MSG_APPLY_FOR_MONITOR_END = 0x1208, /// ///补发车辆定位信息请求 /// [Description("补发车辆定位信息请求")] + [JT809BodiesType(typeof(JT809_0x1200_0x1209))] UP_EXG_MSG_APPLY_HISGNSSDATA_REQ = 0x1209, /// ///上报车辆驾驶员身份识别信息应答 /// [Description("上报车辆驾驶员身份识别信息应答")] + [JT809BodiesType(typeof(JT809_0x1200_0x120A))] UP_EXG_MSG_REPORT_DRIVER_INFO_ACK = 0x120A, /// ///上报车辆电子运单应答 /// [Description("上报车辆电子运单应答")] + [JT809BodiesType(typeof(JT809_0x1200_0x120B))] UP_EXG_MSG_TAKE_EWAYBILL_ACK = 0x120B, /// ///主动上报驾驶员身份信息 /// [Description("主动上报驾驶员身份信息")] + [JT809BodiesType(typeof(JT809_0x1200_0x120C))] UP_EXG_MSG_REPORT_DRIVER_INFO = 0x120C, /// ///主动上报车辆电子运单信息 /// [Description("主动上报车辆电子运单信息")] + [JT809BodiesType(typeof(JT809_0x1200_0x120D))] UP_EXG_MSG_REPORT_EWAYBILL_INFO = 0x120D, #endregion diff --git a/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x1209Formatter.cs b/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x1209Formatter.cs new file mode 100644 index 0000000..4286f10 --- /dev/null +++ b/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x1209Formatter.cs @@ -0,0 +1,29 @@ +using JT809.Protocol.JT809Extensions; +using JT809.Protocol.JT809SubMessageBody; +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Text; + +namespace JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters +{ + public class JT809_0x1200_0x1209Formatter : IJT809Formatter + { + public JT809_0x1200_0x1209 Deserialize(ReadOnlySpan bytes, out int readSize) + { + int offset = 0; + JT809_0x1200_0x1209 jT809_0X1200_0X1207 = new JT809_0x1200_0x1209(); + jT809_0X1200_0X1207.StartTime = JT809BinaryExtensions.ReadUTCDateTimeLittle(bytes, ref offset); + jT809_0X1200_0X1207.EndTime = JT809BinaryExtensions.ReadUTCDateTimeLittle(bytes, ref offset); + readSize = offset; + return jT809_0X1200_0X1207; + } + + public int Serialize(IMemoryOwner memoryOwner, int offset, JT809_0x1200_0x1209 value) + { + offset += JT809BinaryExtensions.WriteUTCDateTimeLittle(memoryOwner, offset, value.StartTime); + offset += JT809BinaryExtensions.WriteUTCDateTimeLittle(memoryOwner, offset, value.EndTime); + return offset; + } + } +} diff --git a/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120AFormatter.cs b/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120AFormatter.cs new file mode 100644 index 0000000..c4f0218 --- /dev/null +++ b/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120AFormatter.cs @@ -0,0 +1,33 @@ +using JT809.Protocol.JT809Extensions; +using JT809.Protocol.JT809SubMessageBody; +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Text; + +namespace JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters +{ + public class JT809_0x1200_0x120AFormatter : IJT809Formatter + { + public JT809_0x1200_0x120A Deserialize(ReadOnlySpan bytes, out int readSize) + { + int offset = 0; + JT809_0x1200_0x120A jT809_0X1200_0X120A = new JT809_0x1200_0x120A(); + jT809_0X1200_0X120A.DriverName = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset,16); + jT809_0X1200_0X120A.DriverID = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 20); + jT809_0X1200_0X120A.Licence = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset,40); + jT809_0X1200_0X120A.OrgName = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 200); + readSize = offset; + return jT809_0X1200_0X120A; + } + + public int Serialize(IMemoryOwner memoryOwner, int offset, JT809_0x1200_0x120A value) + { + offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.DriverName,16); + offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.DriverID,20); + offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.Licence, 40); + offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.OrgName, 200); + return offset; + } + } +} diff --git a/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120BFormatter.cs b/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120BFormatter.cs new file mode 100644 index 0000000..80ad93a --- /dev/null +++ b/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120BFormatter.cs @@ -0,0 +1,29 @@ +using JT809.Protocol.JT809Extensions; +using JT809.Protocol.JT809SubMessageBody; +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Text; + +namespace JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters +{ + public class JT809_0x1200_0x120BFormatter : IJT809Formatter + { + public JT809_0x1200_0x120B Deserialize(ReadOnlySpan bytes, out int readSize) + { + int offset = 0; + JT809_0x1200_0x120B jT809_0X1200_0X120B = new JT809_0x1200_0x120B(); + jT809_0X1200_0X120B.EwaybillLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); + jT809_0X1200_0X120B.EwaybillInfo = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, (int)jT809_0X1200_0X120B.EwaybillLength); + readSize = offset; + return jT809_0X1200_0X120B; + } + + public int Serialize(IMemoryOwner memoryOwner, int offset, JT809_0x1200_0x120B value) + { + offset += JT809BinaryExtensions.WriteUInt32Little(memoryOwner, offset, (uint)value.EwaybillInfo.Length); + offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.EwaybillInfo); + return offset; + } + } +} diff --git a/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120CFormatter.cs b/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120CFormatter.cs new file mode 100644 index 0000000..fc3f86a --- /dev/null +++ b/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120CFormatter.cs @@ -0,0 +1,33 @@ +using JT809.Protocol.JT809Extensions; +using JT809.Protocol.JT809SubMessageBody; +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Text; + +namespace JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters +{ + public class JT809_0x1200_0x120CFormatter : IJT809Formatter + { + public JT809_0x1200_0x120C Deserialize(ReadOnlySpan bytes, out int readSize) + { + int offset = 0; + JT809_0x1200_0x120C jT809_0X1200_0X120C = new JT809_0x1200_0x120C(); + jT809_0X1200_0X120C.DriverName = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 16); + jT809_0X1200_0X120C.DriverID = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 20); + jT809_0X1200_0X120C.Licence = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 40); + jT809_0X1200_0X120C.OrgName = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 200); + readSize = offset; + return jT809_0X1200_0X120C; + } + + public int Serialize(IMemoryOwner memoryOwner, int offset, JT809_0x1200_0x120C value) + { + offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.DriverName, 16); + offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.DriverID, 20); + offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.Licence, 40); + offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.OrgName, 200); + return offset; + } + } +} diff --git a/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120DFormatter.cs b/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120DFormatter.cs new file mode 100644 index 0000000..493b2cb --- /dev/null +++ b/src/JT809.Protocol/JT809Formatters/JT809SubMessageBodyFormatters/JT809_0x1200_0x120DFormatter.cs @@ -0,0 +1,29 @@ +using JT809.Protocol.JT809Extensions; +using JT809.Protocol.JT809SubMessageBody; +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Text; + +namespace JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters +{ + public class JT809_0x1200_0x120DFormatter : IJT809Formatter + { + public JT809_0x1200_0x120D Deserialize(ReadOnlySpan bytes, out int readSize) + { + int offset = 0; + JT809_0x1200_0x120D jT809_0X1200_0X120D = new JT809_0x1200_0x120D(); + jT809_0X1200_0X120D.EwaybillLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); + jT809_0X1200_0X120D.EwaybillInfo = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, (int)jT809_0X1200_0X120D.EwaybillLength); + readSize = offset; + return jT809_0X1200_0X120D; + } + + public int Serialize(IMemoryOwner memoryOwner, int offset, JT809_0x1200_0x120D value) + { + offset += JT809BinaryExtensions.WriteUInt32Little(memoryOwner, offset, (uint)value.EwaybillInfo.Length); + offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.EwaybillInfo); + return offset; + } + } +} diff --git a/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x1208.cs b/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x1208.cs new file mode 100644 index 0000000..c7fe19b --- /dev/null +++ b/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x1208.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT809.Protocol.JT809SubMessageBody +{ + /// + /// 取消交换指定车辆定位信息请 + /// 子业务类型标识:UP_EXG_MSG_APPLY_F0R_MONIOR_END + /// 描述:下级平台上传该命令给上级平台,取消之前申请监控的特殊车辆 + /// + public class JT809_0x1200_0x1208:JT809SubBodies + { + + } +} diff --git a/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x1209.cs b/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x1209.cs new file mode 100644 index 0000000..f37756a --- /dev/null +++ b/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x1209.cs @@ -0,0 +1,26 @@ +using JT809.Protocol.JT809Attributes; +using JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT809.Protocol.JT809SubMessageBody +{ + /// + /// 补发车辆定位信息请求 + /// 子业务类型标识:UP_EXG_MSG_APPLY_HISGNSSDATA_REQ + /// 描述:在平台间传输链路中断并重新建立连接后,下级平台向上级平台请求中断期间内上级平台需交换至下级平台的车辆定位信息时,向上级平台发出补发车辆定位信息请求,上级平台对请求应答后进行“补发车辆定位信息” + /// + [JT809Formatter(typeof(JT809_0x1200_0x1209Formatter))] + public class JT809_0x1200_0x1209:JT809SubBodies + { + /// + /// 开始时间,用 UTC 时间表示 + /// + public DateTime StartTime { get; set; } + /// + /// 结束时间,用 UTC 时间表示 + /// + public DateTime EndTime { get; set; } + } +} diff --git a/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120A.cs b/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120A.cs new file mode 100644 index 0000000..92f386f --- /dev/null +++ b/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120A.cs @@ -0,0 +1,34 @@ +using JT809.Protocol.JT809Attributes; +using JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT809.Protocol.JT809SubMessageBody +{ + /// + /// 上报驾驶员身份识别信息应答消息 + /// 子业务类型标识:UP_EXG_MSG_REPORT_DRIVER_INFO_ACK + /// 描述:下级平台应答上级平台发送的上报驾驶员身份识别信息请求消息,上传指定车辆的驾驶员身份识别信息数据 + /// + [JT809Formatter(typeof(JT809_0x1200_0x120AFormatter))] + public class JT809_0x1200_0x120A:JT809SubBodies + { + /// + /// 驾驶员姓名 + /// + public string DriverName { get; set; } + /// + /// 身份证编号 + /// + public string DriverID { get; set; } + /// + /// 从业资格证(备用) + /// + public string Licence { get; set; } + /// + /// 发证机构名称(备用) + /// + public string OrgName { get; set; } + } +} diff --git a/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120B.cs b/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120B.cs new file mode 100644 index 0000000..9bc0a67 --- /dev/null +++ b/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120B.cs @@ -0,0 +1,26 @@ +using JT809.Protocol.JT809Attributes; +using JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT809.Protocol.JT809SubMessageBody +{ + /// + /// 上报车辆电子运单应答消息 + /// 子业务类型标识:UP_CXG_MSG_TAKE_EWAYBILL_ACK + /// 描述:下级平台应答上级平台发送的上报车辆电子运单请求消息,向上级平台上传车辆当前电子运单 + /// + [JT809Formatter(typeof(JT809_0x1200_0x120BFormatter))] + public class JT809_0x1200_0x120B:JT809SubBodies + { + /// + /// 电子运单数据体长度 + /// + public uint EwaybillLength { get; set; } + /// + /// 电子运单数据内容 + /// + public string EwaybillInfo { get; set; } + } +} diff --git a/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120C.cs b/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120C.cs new file mode 100644 index 0000000..b727332 --- /dev/null +++ b/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120C.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT809.Protocol.JT809SubMessageBody +{ + /// + /// 主动上报驾驶员身份信息消息 + /// 子业务类型标识:UP_EXG_MSG_REPORT_DRIVER_INFO + /// + public class JT809_0x1200_0x120C:JT809SubBodies + { + /// + /// 驾驶员姓名 + /// + public string DriverName { get; set; } + /// + /// 身份证编号 + /// + public string DriverID { get; set; } + /// + /// 从业资格证(备用) + /// + public string Licence { get; set; } + /// + /// 发证机构名称(备用) + /// + public string OrgName { get; set; } + } +} diff --git a/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120D.cs b/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120D.cs new file mode 100644 index 0000000..2331630 --- /dev/null +++ b/src/JT809.Protocol/JT809SubMessageBody/JT809_0x1200_0x120D.cs @@ -0,0 +1,25 @@ +using JT809.Protocol.JT809Attributes; +using JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT809.Protocol.JT809SubMessageBody +{ + /// + /// 主动上报车辆电子运单信息 + /// 子业务类型标识:UP_EXG_MSG_REPORT_EWAYBILL_INFO + /// + [JT809Formatter(typeof(JT809_0x1200_0x120DFormatter))] + public class JT809_0x1200_0x120D:JT809SubBodies + { + /// + /// 电子运单数据体长度 + /// + public uint EwaybillLength { get; set; } + /// + /// 电子运单数据内容 + /// + public string EwaybillInfo { get; set; } + } +}