@@ -55,4 +55,20 @@ | |||||
| 10 | 0x120A | √ | 上报车辆驾驶员身份识别信息应答 | | | 10 | 0x120A | √ | 上报车辆驾驶员身份识别信息应答 | | ||||
| 11 | 0x120B | √ | 上报车辆电子运单应答 | | | 11 | 0x120B | √ | 上报车辆电子运单应答 | | ||||
| 12 | 0x120C | √ | 主动上报驾驶员身份信息 | | | 12 | 0x120C | √ | 主动上报驾驶员身份信息 | | ||||
| 13 | 0x120D | √ | 主动上报车辆电子运单信息 | | |||||
| 13 | 0x120D | √ | 主动上报车辆电子运单信息 | | |||||
#### 从链路动态信息交换消息 | |||||
|序号|消息ID|完成情况|消息体名称| | |||||
|:------:|:------:|:------:|:------:| | |||||
| 1 | 0x9200 | √ | 从链路动态信息交换消息 | | |||||
| 2 | 0x9202 | √ | 交换车辆定位信息消息 | | |||||
| 3 | 0x9203 | √ | 车辆定位信息交换补发消息 | | |||||
| 4 | 0x9204 | √ | 交换车辆静态信息消息 | | |||||
| 5 | 0x9205 | √ | 启动车辆定位信息交换请求消息 | | |||||
| 6 | 0x9206 | √ | 结束车辆定位信息交换请求消息 | | |||||
| 7 | 0x9207 | √ | 申请交换指定车辆定位信息应答消息 | | |||||
| 8 | 0x9208 | √ | 取消申请交换指定车辆定位信息应答消息 | | |||||
| 9 | 0x9209 | √ | 补发车辆定位信息应答消息 | | |||||
| 10 | 0x920A | √ | 上报驾驶员身份识别信息请求消息 | | |||||
| 11 | 0x920B | √ | 上报车辆电子运单请求消息 | |
@@ -40,6 +40,11 @@ | |||||
<Compile Include="JT809Enums\JT809VehicleColorType.cs" /> | <Compile Include="JT809Enums\JT809VehicleColorType.cs" /> | ||||
<Compile Include="JT809Enums\JT809_0x1002_Result.cs" /> | <Compile Include="JT809Enums\JT809_0x1002_Result.cs" /> | ||||
<Compile Include="JT809Enums\JT809_0x1007_ErrorCode.cs" /> | <Compile Include="JT809Enums\JT809_0x1007_ErrorCode.cs" /> | ||||
<Compile Include="JT809Enums\JT809_0x9209_Result.cs" /> | |||||
<Compile Include="JT809Enums\JT809_0x9208_Result.cs" /> | |||||
<Compile Include="JT809Enums\JT809_0x9207_Result.cs" /> | |||||
<Compile Include="JT809Enums\JT809_0x9206_ReasonCode.cs" /> | |||||
<Compile Include="JT809Enums\JT809_0x9205_ReasonCode.cs" /> | |||||
<Compile Include="JT809Enums\JT809_0x9007_ReasonCode.cs" /> | <Compile Include="JT809Enums\JT809_0x9007_ReasonCode.cs" /> | ||||
<Compile Include="JT809Enums\JT809_0x1008_ReasonCode.cs" /> | <Compile Include="JT809Enums\JT809_0x1008_ReasonCode.cs" /> | ||||
<Compile Include="JT809Enums\JT809_0x9002_Result.cs" /> | <Compile Include="JT809Enums\JT809_0x9002_Result.cs" /> | ||||
@@ -126,9 +126,10 @@ namespace JT809.Protocol.JT809Enums | |||||
[JT809BodiesType(typeof(JT809_0x1200))] | [JT809BodiesType(typeof(JT809_0x1200))] | ||||
UP_EXG_MSG = 0x1200, | UP_EXG_MSG = 0x1200, | ||||
///<summary> | ///<summary> | ||||
///从链路动态信息交换消息 | |||||
///从链路动态信息交换消息 | |||||
///</summary> | ///</summary> | ||||
[Description("从链路动态信息交换消息")] | [Description("从链路动态信息交换消息")] | ||||
[JT809BodiesType(typeof(JT809_0x9200))] | |||||
DOWN_EXG_MSG = 0x9200, | DOWN_EXG_MSG = 0x9200, | ||||
#endregion | #endregion | ||||
#region 平台间信息交互类 | #region 平台间信息交互类 | ||||
@@ -89,51 +89,61 @@ namespace JT809.Protocol.JT809Enums | |||||
///交换车辆定位信息 | ///交换车辆定位信息 | ||||
///</summary> | ///</summary> | ||||
[Description("交换车辆定位信息")] | [Description("交换车辆定位信息")] | ||||
[JT809BodiesType(typeof(JT809_0x9200_0x9202))] | |||||
DOWN_EXG_MSG_CAR_LOCATION = 0x9202, | DOWN_EXG_MSG_CAR_LOCATION = 0x9202, | ||||
///<summary> | ///<summary> | ||||
///车辆定位信息交换补发 | ///车辆定位信息交换补发 | ||||
///</summary> | ///</summary> | ||||
[Description("车辆定位信息交换补发")] | [Description("车辆定位信息交换补发")] | ||||
[JT809BodiesType(typeof(JT809_0x9200_0x9203))] | |||||
DOWN_EXG_MSG_HISTORY_ARCOSSAREA = 0x9203, | DOWN_EXG_MSG_HISTORY_ARCOSSAREA = 0x9203, | ||||
///<summary> | ///<summary> | ||||
///交换车辆静态信息 | ///交换车辆静态信息 | ||||
///</summary> | ///</summary> | ||||
[Description("交换车辆静态信息")] | [Description("交换车辆静态信息")] | ||||
[JT809BodiesType(typeof(JT809_0x9200_0x9204))] | |||||
DOWN_EXG_MSG_CAR_INFO = 0x9204, | DOWN_EXG_MSG_CAR_INFO = 0x9204, | ||||
///<summary> | ///<summary> | ||||
///启动车辆定位信息交换请求 | ///启动车辆定位信息交换请求 | ||||
///</summary> | ///</summary> | ||||
[Description("启动车辆定位信息交换请求")] | [Description("启动车辆定位信息交换请求")] | ||||
[JT809BodiesType(typeof(JT809_0x9200_0x9205))] | |||||
DOWN_EXG_MSG_RETURN_STARTUP = 0x9205, | DOWN_EXG_MSG_RETURN_STARTUP = 0x9205, | ||||
///<summary> | ///<summary> | ||||
///结束车辆定位信息交换请求 | ///结束车辆定位信息交换请求 | ||||
///</summary> | ///</summary> | ||||
[Description("结束车辆定位信息交换请求")] | [Description("结束车辆定位信息交换请求")] | ||||
[JT809BodiesType(typeof(JT809_0x9200_0x9206))] | |||||
DOWN_EXG_MSG_RETURN_END = 0x9206, | DOWN_EXG_MSG_RETURN_END = 0x9206, | ||||
///<summary> | ///<summary> | ||||
///申请交换指定车辆定位信息应答 | ///申请交换指定车辆定位信息应答 | ||||
///</summary> | ///</summary> | ||||
[Description("申请交换指定车辆定位信息应答")] | [Description("申请交换指定车辆定位信息应答")] | ||||
[JT809BodiesType(typeof(JT809_0x9200_0x9207))] | |||||
DOWN_EXG_MSG_APPLY_FOR_MONITOR_STARTUP_ACK = 0x9207, | DOWN_EXG_MSG_APPLY_FOR_MONITOR_STARTUP_ACK = 0x9207, | ||||
///<summary> | ///<summary> | ||||
///取消交换指定车辆定位信息应答 | ///取消交换指定车辆定位信息应答 | ||||
///</summary> | ///</summary> | ||||
[Description("取消交换指定车辆定位信息应答")] | [Description("取消交换指定车辆定位信息应答")] | ||||
[JT809BodiesType(typeof(JT809_0x9200_0x9208))] | |||||
DOWN_EXG_MSG_APPLY_FOR_MONITOR_END_ACK = 0x9208, | DOWN_EXG_MSG_APPLY_FOR_MONITOR_END_ACK = 0x9208, | ||||
///<summary> | ///<summary> | ||||
///补发车辆定位信息应答 | ///补发车辆定位信息应答 | ||||
///</summary> | ///</summary> | ||||
[Description("补发车辆定位信息应答")] | [Description("补发车辆定位信息应答")] | ||||
[JT809BodiesType(typeof(JT809_0x9200_0x9209))] | |||||
DOWN_EXG_MSG_APPLY_HISGNSSDATA_ACK = 0x9209, | DOWN_EXG_MSG_APPLY_HISGNSSDATA_ACK = 0x9209, | ||||
///<summary> | ///<summary> | ||||
///上报车辆驾驶员身份识别信息请求 | ///上报车辆驾驶员身份识别信息请求 | ||||
///</summary> | ///</summary> | ||||
[Description("上报车辆驾驶员身份识别信息请求")] | [Description("上报车辆驾驶员身份识别信息请求")] | ||||
[JT809BodiesType(typeof(JT809_0x9200_0x920A))] | |||||
DOWN_EXG_MSG_REPORT_DRIVER_INFO = 0x920A, | DOWN_EXG_MSG_REPORT_DRIVER_INFO = 0x920A, | ||||
///<summary> | ///<summary> | ||||
///上报车辆电子运单请求 | ///上报车辆电子运单请求 | ||||
///</summary> | ///</summary> | ||||
[Description("上报车辆电子运单请求")] | [Description("上报车辆电子运单请求")] | ||||
[JT809BodiesType(typeof(JT809_0x9200_0x920B))] | |||||
DOWN_EXG_MSG_TAKE_EWAYBILL_REQ = 0x920B, | DOWN_EXG_MSG_TAKE_EWAYBILL_REQ = 0x920B, | ||||
#endregion | #endregion | ||||
@@ -0,0 +1,17 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809Enums | |||||
{ | |||||
/// <summary> | |||||
/// 错误代码 | |||||
/// </summary> | |||||
public enum JT809_0x9205_ReasonCode : byte | |||||
{ | |||||
车辆进入指定区域 = 0x00, | |||||
人工指定交换 = 0x01, | |||||
应急状态下车辆定位信息回传 = 0x02, | |||||
其它原因 = 0x03 | |||||
} | |||||
} |
@@ -0,0 +1,18 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809Enums | |||||
{ | |||||
/// <summary> | |||||
/// 错误代码 | |||||
/// </summary> | |||||
public enum JT809_0x9206_ReasonCode : byte | |||||
{ | |||||
车辆离开指定区域 = 0x00, | |||||
人工停止交换 = 0x01, | |||||
紧急监控完成 = 0x02, | |||||
车辆离线 = 0x03, | |||||
其它原因 = 0x04 | |||||
} | |||||
} |
@@ -0,0 +1,17 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809Enums | |||||
{ | |||||
/// <summary> | |||||
/// 验证结果 | |||||
/// </summary> | |||||
public enum JT809_0x9207_Result : byte | |||||
{ | |||||
申请成功 = 0x00, | |||||
上级平台没有该车数据 = 0x01, | |||||
申请时间段错误 = 0x02, | |||||
其它 = 0x03 | |||||
} | |||||
} |
@@ -0,0 +1,16 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809Enums | |||||
{ | |||||
/// <summary> | |||||
/// 验证结果 | |||||
/// </summary> | |||||
public enum JT809_0x9208_Result : byte | |||||
{ | |||||
取消申请成功 = 0x00, | |||||
之前没有对应申请信息 = 0x01, | |||||
其它 = 0x02 | |||||
} | |||||
} |
@@ -0,0 +1,18 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809Enums | |||||
{ | |||||
/// <summary> | |||||
/// 验证结果 | |||||
/// </summary> | |||||
public enum JT809_0x9209_Result : byte | |||||
{ | |||||
成功_上级平台即刻补发 = 0x00, | |||||
成功_上级平台择机补发 = 0x01, | |||||
失败_上级平台无对应申请的定位数据 = 0x02, | |||||
失败_申请内容不正确 = 0x03, | |||||
其它原因 = 0x04, | |||||
} | |||||
} |
@@ -0,0 +1,64 @@ | |||||
using JT809.Protocol.JT809Attributes; | |||||
using JT809.Protocol.JT809Enums; | |||||
using JT809.Protocol.JT809Exceptions; | |||||
using JT809.Protocol.JT809Extensions; | |||||
using JT809.Protocol.JT809MessageBody; | |||||
using System; | |||||
using System.Buffers; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809Formatters.JT809MessageBodyFormatters | |||||
{ | |||||
public class JT809_0x9200Formatter : IJT809Formatter<JT809_0x9200> | |||||
{ | |||||
public JT809_0x9200 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||||
{ | |||||
int offset = 0; | |||||
JT809_0x9200 jT809_0X9200 = new JT809_0x9200(); | |||||
jT809_0X9200.VehicleNo = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 21); | |||||
jT809_0X9200.VehicleColor = (JT809VehicleColorType)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
jT809_0X9200.SubBusinessType = (JT809SubBusinessType)JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||||
jT809_0X9200.DataLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||||
//JT809.Protocol.JT809Enums.JT809BusinessType 映射对应消息特性 | |||||
JT809BodiesTypeAttribute jT809SubBodiesTypeAttribute = jT809_0X9200.SubBusinessType.GetAttribute<JT809BodiesTypeAttribute>(); | |||||
if (jT809SubBodiesTypeAttribute == null) | |||||
{ | |||||
throw new JT809Exception(JT809ErrorCode.GetAttributeError, $"JT809BodiesTypeAttribute Not Found>{jT809_0X9200.SubBusinessType.ToString()}"); | |||||
} | |||||
try | |||||
{ | |||||
jT809_0X9200.JT809SubBodies = JT809FormatterResolverExtensions.JT809DynamicDeserialize(JT809FormatterExtensions.GetFormatter(jT809SubBodiesTypeAttribute.JT809BodiesType), bytes.Slice(offset, (int)jT809_0X9200.DataLength), out readSize); | |||||
} | |||||
catch | |||||
{ | |||||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{jT809_0X9200.SubBusinessType.ToString()}"); | |||||
} | |||||
readSize = offset; | |||||
return jT809_0X9200; | |||||
} | |||||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9200 value) | |||||
{ | |||||
offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.VehicleNo, 21); | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, (byte)value.VehicleColor); | |||||
offset += JT809BinaryExtensions.WriteUInt16Little(memoryOwner, offset, (ushort)value.SubBusinessType); | |||||
offset += JT809BinaryExtensions.WriteUInt32Little(memoryOwner, offset, value.DataLength); | |||||
//JT809.Protocol.JT809Enums.JT809BusinessType 映射对应消息特性 | |||||
JT809BodiesTypeAttribute jT809SubBodiesTypeAttribute = value.SubBusinessType.GetAttribute<JT809BodiesTypeAttribute>(); | |||||
if (jT809SubBodiesTypeAttribute == null) | |||||
{ | |||||
throw new JT809Exception(JT809ErrorCode.GetAttributeError, $"JT809BodiesTypeAttribute Not Found>{value.SubBusinessType.ToString()}"); | |||||
} | |||||
try | |||||
{ | |||||
offset = JT809FormatterResolverExtensions.JT809DynamicSerialize(JT809FormatterExtensions.GetFormatter(jT809SubBodiesTypeAttribute.JT809BodiesType), memoryOwner, offset, value.JT809SubBodies); | |||||
} | |||||
catch | |||||
{ | |||||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{value.SubBusinessType.ToString()}"); | |||||
} | |||||
return offset; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,58 @@ | |||||
using JT809.Protocol.JT809Extensions; | |||||
using JT809.Protocol.JT809SubMessageBody; | |||||
using JT809.Protocol.JT809Enums; | |||||
using System; | |||||
using System.Buffers; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters | |||||
{ | |||||
public class JT809_0x9200_0x9202Formatter : IJT809Formatter<JT809_0x9200_0x9202> | |||||
{ | |||||
public JT809_0x9200_0x9202 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||||
{ | |||||
int offset = 0; | |||||
JT809_0x9200_0x9202 jT809_0X1200_0x9202 = new JT809_0x9200_0x9202(); | |||||
jT809_0X1200_0x9202.VehiclePosition.Encrypt = (JT809_VehiclePositionExcrypt)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Day= JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Month = JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Year = JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Hour = JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Minute = JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Second = JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Lon = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Lat = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Vec1 = JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Vec2 = JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Vec3 = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Direction = JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Altitude = JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.State = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||||
jT809_0X1200_0x9202.VehiclePosition.Alarm = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||||
readSize = offset; | |||||
return jT809_0X1200_0x9202; | |||||
} | |||||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9200_0x9202 value) | |||||
{ | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset,(byte) value.VehiclePosition.Encrypt); | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, value.VehiclePosition.Day); | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, value.VehiclePosition.Month); | |||||
offset += JT809BinaryExtensions.WriteUInt16Little(memoryOwner, offset, value.VehiclePosition.Year); | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, value.VehiclePosition.Hour); | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, value.VehiclePosition.Minute); | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, value.VehiclePosition.Second); | |||||
offset += JT809BinaryExtensions.WriteUInt32Little(memoryOwner, offset, value.VehiclePosition.Lon); | |||||
offset += JT809BinaryExtensions.WriteUInt32Little(memoryOwner, offset, value.VehiclePosition.Lat); | |||||
offset += JT809BinaryExtensions.WriteUInt16Little(memoryOwner, offset, value.VehiclePosition.Vec1); | |||||
offset += JT809BinaryExtensions.WriteUInt16Little(memoryOwner, offset, value.VehiclePosition.Vec2); | |||||
offset += JT809BinaryExtensions.WriteUInt32Little(memoryOwner, offset, value.VehiclePosition.Vec3); | |||||
offset += JT809BinaryExtensions.WriteUInt16Little(memoryOwner, offset, value.VehiclePosition.Direction); | |||||
offset += JT809BinaryExtensions.WriteUInt16Little(memoryOwner, offset, value.VehiclePosition.Altitude); | |||||
offset += JT809BinaryExtensions.WriteUInt32Little(memoryOwner, offset, value.VehiclePosition.State); | |||||
offset += JT809BinaryExtensions.WriteUInt32Little(memoryOwner, offset, value.VehiclePosition.Alarm); | |||||
return offset; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,71 @@ | |||||
using JT809.Protocol.JT809Enums; | |||||
using JT809.Protocol.JT809Extensions; | |||||
using JT809.Protocol.JT809Properties; | |||||
using JT809.Protocol.JT809SubMessageBody; | |||||
using System; | |||||
using System.Buffers; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters | |||||
{ | |||||
public class JT809_0x9200_0x9203Formatter : IJT809Formatter<JT809_0x9200_0x9203> | |||||
{ | |||||
public JT809_0x9200_0x9203 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||||
{ | |||||
int offset = 0; | |||||
JT809_0x9200_0x9203 jT809_0X1200_0x9203 = new JT809_0x9200_0x9203(); | |||||
jT809_0X1200_0x9203.GNSSCount= JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
if (jT809_0X1200_0x9203.GNSSCount > 0) | |||||
{ | |||||
jT809_0X1200_0x9203.GNSS = new List<JT809_0x9200_0x9202>(); | |||||
int bufReadSize; | |||||
int tempOffset = 0; | |||||
for (int i = 0; i < jT809_0X1200_0x9203.GNSSCount; i++) | |||||
{ | |||||
try | |||||
{ | |||||
if (i == 0) | |||||
{ | |||||
tempOffset = offset + 36; | |||||
JT809_0x9200_0x9202 jT809_0x1200_0x1202 = JT809FormatterExtensions.GetFormatter<JT809_0x9200_0x9202>() | |||||
.Deserialize(bytes.Slice(offset, 36), out bufReadSize); | |||||
jT809_0X1200_0x9203.GNSS.Add(jT809_0x1200_0x1202); | |||||
} | |||||
else | |||||
{ | |||||
JT809_0x9200_0x9202 jT809_0x1200_0x9202 = JT809FormatterExtensions.GetFormatter<JT809_0x9200_0x9202>() | |||||
.Deserialize(bytes.Slice(tempOffset, 36), out bufReadSize); | |||||
tempOffset += 36; | |||||
jT809_0X1200_0x9203.GNSS.Add(jT809_0x1200_0x9202); | |||||
} | |||||
} | |||||
catch (Exception) | |||||
{ | |||||
tempOffset += 36; | |||||
} | |||||
} | |||||
} | |||||
readSize = jT809_0X1200_0x9203.GNSSCount * 36 + 1; | |||||
return jT809_0X1200_0x9203; | |||||
} | |||||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9200_0x9203 value) | |||||
{ | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, (byte)value.GNSS.Count); | |||||
foreach(var item in value.GNSS) | |||||
{ | |||||
try | |||||
{ | |||||
int positionOffset = JT809FormatterExtensions.GetFormatter<JT809_0x9200_0x9202>().Serialize(memoryOwner, offset, item); | |||||
offset = positionOffset; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
} | |||||
} | |||||
return offset; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,27 @@ | |||||
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_0x9200_0x9204Formatter : IJT809Formatter<JT809_0x9200_0x9204> | |||||
{ | |||||
public JT809_0x9200_0x9204 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||||
{ | |||||
int offset = 0; | |||||
JT809_0x9200_0x9204 jT809_0X1200_0x9204 = new JT809_0x9200_0x9204(); | |||||
jT809_0X1200_0x9204.CarInfo = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset); | |||||
readSize = offset; | |||||
return jT809_0X1200_0x9204; | |||||
} | |||||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9200_0x9204 value) | |||||
{ | |||||
offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.CarInfo); | |||||
return offset; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,28 @@ | |||||
using JT809.Protocol.JT809Enums; | |||||
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_0x9200_0x9205Formatter : IJT809Formatter<JT809_0x9200_0x9205> | |||||
{ | |||||
public JT809_0x9200_0x9205 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||||
{ | |||||
int offset = 0; | |||||
JT809_0x9200_0x9205 jT809_0X1200_0x9205 = new JT809_0x9200_0x9205(); | |||||
jT809_0X1200_0x9205.ReasonCode = (JT809_0x9205_ReasonCode)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
readSize = offset; | |||||
return jT809_0X1200_0x9205; | |||||
} | |||||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9200_0x9205 value) | |||||
{ | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset,(byte)value.ReasonCode); | |||||
return offset; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,28 @@ | |||||
using JT809.Protocol.JT809Enums; | |||||
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_0x9200_0x9206Formatter : IJT809Formatter<JT809_0x9200_0x9206> | |||||
{ | |||||
public JT809_0x9200_0x9206 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||||
{ | |||||
int offset = 0; | |||||
JT809_0x9200_0x9206 jT809_0X1200_0x9206 = new JT809_0x9200_0x9206(); | |||||
jT809_0X1200_0x9206.ReasonCode = (JT809_0x9206_ReasonCode)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
readSize = offset; | |||||
return jT809_0X1200_0x9206; | |||||
} | |||||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9200_0x9206 value) | |||||
{ | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, (byte)value.ReasonCode); | |||||
return offset; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,28 @@ | |||||
using JT809.Protocol.JT809Enums; | |||||
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_0x9200_0x9207Formatter : IJT809Formatter<JT809_0x9200_0x9207> | |||||
{ | |||||
public JT809_0x9200_0x9207 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||||
{ | |||||
int offset = 0; | |||||
JT809_0x9200_0x9207 jT809_0X1200_0x9207 = new JT809_0x9200_0x9207(); | |||||
jT809_0X1200_0x9207.Result = (JT809_0x9207_Result)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
readSize = offset; | |||||
return jT809_0X1200_0x9207; | |||||
} | |||||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9200_0x9207 value) | |||||
{ | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, (byte)value.Result); | |||||
return offset; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,28 @@ | |||||
using JT809.Protocol.JT809Enums; | |||||
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_0x9200_0x9208Formatter : IJT809Formatter<JT809_0x9200_0x9208> | |||||
{ | |||||
public JT809_0x9200_0x9208 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||||
{ | |||||
int offset = 0; | |||||
JT809_0x9200_0x9208 jT809_0X1200_0x9208 = new JT809_0x9200_0x9208(); | |||||
jT809_0X1200_0x9208.Result = (JT809_0x9208_Result)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
readSize = offset; | |||||
return jT809_0X1200_0x9208; | |||||
} | |||||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9200_0x9208 value) | |||||
{ | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, (byte)value.Result); | |||||
return offset; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,28 @@ | |||||
using JT809.Protocol.JT809Enums; | |||||
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_0x9200_0x9209Formatter : IJT809Formatter<JT809_0x9200_0x9209> | |||||
{ | |||||
public JT809_0x9200_0x9209 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||||
{ | |||||
int offset = 0; | |||||
JT809_0x9200_0x9209 jT809_0X1200_0x9209 = new JT809_0x9200_0x9209(); | |||||
jT809_0X1200_0x9209.Result = (JT809_0x9209_Result)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||||
readSize = offset; | |||||
return jT809_0X1200_0x9209; | |||||
} | |||||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9200_0x9209 value) | |||||
{ | |||||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, (byte)value.Result); | |||||
return offset; | |||||
} | |||||
} | |||||
} |
@@ -34,10 +34,6 @@ namespace JT809.Protocol.JT809MessageBody | |||||
/// </summary> | /// </summary> | ||||
public uint DataLength { get; set; } | public uint DataLength { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// 数据部分 | |||||
/// </summary> | |||||
public byte[] Data { get; set; } | |||||
/// <summary> | |||||
/// 子业务数据体 | /// 子业务数据体 | ||||
/// </summary> | /// </summary> | ||||
public JT809SubBodies JT809SubBodies { get; set; } | public JT809SubBodies JT809SubBodies { get; set; } | ||||
@@ -0,0 +1,41 @@ | |||||
using JT809.Protocol.JT809Attributes; | |||||
using JT809.Protocol.JT809Enums; | |||||
using JT809.Protocol.JT809Formatters.JT809MessageBodyFormatters; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809MessageBody | |||||
{ | |||||
/// <summary> | |||||
/// 从链路车辆动态信息交换业务 | |||||
/// <para>链路类型:从链路</para> | |||||
/// <para>消息方向:上级平台台往下级平台</para> | |||||
/// <para>业务数据类型标识:DOWN_EXG_MSG</para> | |||||
/// <para>描述:上级平台作为客户端向下级平台服务端发送车辆动态信息交换业务</para> | |||||
/// </summary> | |||||
[JT809Formatter(typeof(JT809_0x9200Formatter))] | |||||
public class JT809_0x9200:JT809Bodies | |||||
{ | |||||
/// <summary> | |||||
/// 车牌号 | |||||
/// </summary> | |||||
public string VehicleNo { get; set; } | |||||
/// <summary> | |||||
/// 车辆颜色 | |||||
/// </summary> | |||||
public JT809VehicleColorType VehicleColor { get; set; } | |||||
/// <summary> | |||||
/// 子业务类型标识 | |||||
/// </summary> | |||||
public JT809SubBusinessType SubBusinessType { get; set; } | |||||
/// <summary> | |||||
/// 后续数据长度 | |||||
/// </summary> | |||||
public uint DataLength { get; set; } | |||||
/// <summary> | |||||
/// 子业务数据体 | |||||
/// </summary> | |||||
public JT809SubBodies JT809SubBodies { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,27 @@ | |||||
using JT809.Protocol.JT809Attributes; | |||||
using JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters; | |||||
using JT809.Protocol.JT809Properties; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809SubMessageBody | |||||
{ | |||||
/// <summary> | |||||
/// 交换车辆定位信息消息 | |||||
/// <para>子业务类型标识:DOWN_EXG_MSG_CAR_LOCATION</para> | |||||
/// <para>描述:上级平台通过该消息不间断地向车辆驶入区域所属的下级平台发送车辆定位信息,直到该车驶离该区域</para> | |||||
/// </summary> | |||||
[JT809Formatter(typeof(JT809_0x9200_0x9202Formatter))] | |||||
public class JT809_0x9200_0x9202:JT809SubBodies | |||||
{ | |||||
public JT809_0x9200_0x9202() | |||||
{ | |||||
VehiclePosition = new JT809VehiclePositionProperties(); | |||||
} | |||||
/// <summary> | |||||
/// 车辆定位信息 | |||||
/// </summary> | |||||
public JT809VehiclePositionProperties VehiclePosition { get; set; } | |||||
} | |||||
} |
@@ -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 | |||||
{ | |||||
/// <summary> | |||||
/// 车辆定位信息交换补发消息 | |||||
/// <para>子业务类型标识:DOWN_EXG_MSG_HISTORY_ARCOSSAREA</para> | |||||
/// <para>描述:本业务在 DOWN_EXG_MSG_APPLY_HISGNSSDATA_ACK 应答成功后,立即开始交换。如果申请失败,则不进行数据转发</para> | |||||
/// </summary> | |||||
[JT809Formatter(typeof(JT809_0x9200_0x9203Formatter))] | |||||
public class JT809_0x9200_0x9203:JT809SubBodies | |||||
{ | |||||
/// <summary> | |||||
/// 卫星定位数据个数 1<=GNSS_CNT<=5。 | |||||
/// </summary> | |||||
public byte GNSSCount { get; set; } | |||||
/// <summary> | |||||
/// 卫星定位数据集合 | |||||
/// </summary> | |||||
public IList<JT809_0x9200_0x9202> GNSS { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,22 @@ | |||||
using JT809.Protocol.JT809Attributes; | |||||
using JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809SubMessageBody | |||||
{ | |||||
/// <summary> | |||||
/// 交换车辆静态信息消息 | |||||
/// <para>子业务类型标识:DOWN_EXG_MSG_CAR_INFO</para> | |||||
/// <para>描述:在首次启动跨域车辆定位信息交换,或者以后交换过程中车辆静态信息有更新时,由上级平台向下级平台下发一次车辆静态信息。下.级平台接收后自行更新该车辆静态信息</para> | |||||
/// </summary> | |||||
[JT809Formatter(typeof(JT809_0x9200_0x9204Formatter))] | |||||
public class JT809_0x9200_0x9204 | |||||
{ | |||||
/// <summary> | |||||
/// 车牌号 | |||||
/// </summary> | |||||
public string CarInfo { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,23 @@ | |||||
using JT809.Protocol.JT809Attributes; | |||||
using JT809.Protocol.JT809Enums; | |||||
using JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809SubMessageBody | |||||
{ | |||||
/// <summary> | |||||
/// 启动车辆定位信息交换请求消息 | |||||
/// <para>子业务类型标识:DOWN_EXG_MSG_RETURN_STARTUP</para> | |||||
/// <para>描述:在有车辆进入非归属地区地理区域、人工指定车辆定位信息交换和应急状态监控车辆时,上级平台向下级平台发出启动车辆定位信息交换清求消息。下级平台收到此命令后需要回复启动车辆定位信息交换应答消息给上级平台,即UP_EXG_MSG-RETURN-STARTUP_ ACK</para> | |||||
/// </summary> | |||||
[JT809Formatter(typeof(JT809_0x9200_0x9205Formatter))] | |||||
public class JT809_0x9200_0x9205:JT809SubBodies | |||||
{ | |||||
/// <summary> | |||||
/// 错误代码 | |||||
/// </summary> | |||||
public JT809_0x9205_ReasonCode ReasonCode { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,23 @@ | |||||
using JT809.Protocol.JT809Attributes; | |||||
using JT809.Protocol.JT809Enums; | |||||
using JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809SubMessageBody | |||||
{ | |||||
/// <summary> | |||||
/// 结束车辆定位信息交换请求 | |||||
/// <para>子业务类型标识:DOWN_EXG_MSG_RETURN_END</para> | |||||
/// <para>描述:在进入非归属地区地理区域的车辆离开该地理区域、人上取消指定车辆定位信息交换和应急状态结束时,上级平台向下级平台发出结束车辆定位信息交换请求消息。下级平台收到该命令后应回复结束车辆定位信息交换应答消息,即 UP_EXG_MSG_RE_TURN_END_ACK</para> | |||||
/// </summary> | |||||
[JT809Formatter(typeof(JT809_0x9200_0x9206Formatter))] | |||||
public class JT809_0x9200_0x9206:JT809SubBodies | |||||
{ | |||||
/// <summary> | |||||
/// 错误代码 | |||||
/// </summary> | |||||
public JT809_0x9206_ReasonCode ReasonCode { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,23 @@ | |||||
using JT809.Protocol.JT809Attributes; | |||||
using JT809.Protocol.JT809Enums; | |||||
using JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809SubMessageBody | |||||
{ | |||||
/// <summary> | |||||
/// 申请交换指定车辆定位信息应答 | |||||
/// <para>子业务类型标识:DOWN_EXG_MSG_APPLY_FOR_MONITOR_STARTUP_ACK</para> | |||||
/// <para>描述:应答下级平台申请交换指定车辆定位信息,请求消息."即 UP_EXG_MSG_APPLY_FOR_MONITOR_STARTUP</para> | |||||
/// </summary> | |||||
[JT809Formatter(typeof(JT809_0x9200_0x9207Formatter))] | |||||
public class JT809_0x9200_0x9207:JT809SubBodies | |||||
{ | |||||
/// <summary> | |||||
/// 返回结果 | |||||
/// </summary> | |||||
public JT809_0x9207_Result Result { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,22 @@ | |||||
using JT809.Protocol.JT809Attributes; | |||||
using JT809.Protocol.JT809Enums; | |||||
using JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809SubMessageBody | |||||
{ | |||||
/// <summary> | |||||
/// 取消交换指定车辆定位信息应答 | |||||
/// <para>子业务类型标识:DOWN_EXG_MSG_APPLY_FOR_MONITOR_END_ACK</para> | |||||
/// </summary> | |||||
[JT809Formatter(typeof(JT809_0x9200_0x9208Formatter))] | |||||
public class JT809_0x9200_0x9208:JT809SubBodies | |||||
{ | |||||
/// <summary> | |||||
/// 返回结果 | |||||
/// </summary> | |||||
public JT809_0x9208_Result Result { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,22 @@ | |||||
using JT809.Protocol.JT809Attributes; | |||||
using JT809.Protocol.JT809Enums; | |||||
using JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809SubMessageBody | |||||
{ | |||||
/// <summary> | |||||
/// 取消交换指定车辆定位信息应答 | |||||
/// <para>子业务类型标识:DOWN_EXG_MSG_APPLY_FOR_MONITOR_END_ACK</para> | |||||
/// </summary> | |||||
[JT809Formatter(typeof(JT809_0x9200_0x9209Formatter))] | |||||
public class JT809_0x9200_0x9209: JT809SubBodies | |||||
{ | |||||
/// <summary> | |||||
/// 返回结果 | |||||
/// </summary> | |||||
public JT809_0x9209_Result Result { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,14 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809SubMessageBody | |||||
{ | |||||
/// <summary> | |||||
/// 上报车辆驾驶员身份识别信息请求 | |||||
/// <para>子业务类型标识:DOWN_EXG_MSG_REPORT_DRIVER_INFO</para> | |||||
/// </summary> | |||||
public class JT809_0x9200_0x920A:JT809SubBodies | |||||
{ | |||||
} | |||||
} |
@@ -0,0 +1,14 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.JT809SubMessageBody | |||||
{ | |||||
/// <summary> | |||||
/// 上报车辆电子运单请求消息 | |||||
/// <para>子业务类型标识:DOWN_EXG_MSG_TAKE_EWAYBILL_REQ</para> | |||||
/// </summary> | |||||
public class JT809_0x9200_0x920B | |||||
{ | |||||
} | |||||
} |