@@ -89,4 +89,56 @@ | |||
|:------:|:------:|:------:|:------:| | |||
| 1 | 0x9300 | √ | 从链路平台间信息交互消息 | | |||
| 2 | 0x9301 | √ | 平台查岗请求 | | |||
| 3 | 0x9302 | √ | 下发平台间报文请求 | | |||
| 3 | 0x9302 | √ | 下发平台间报文请求 | | |||
### 车辆报警信息交互类 | |||
#### 主链路报警信息交互消息 | |||
|序号|消息ID|完成情况|消息体名称| | |||
|:------:|:------:|:------:|:------:| | |||
| 1 | 0x1400 | √ | 主链路平台间信息交互消息 | | |||
| 2 | 0x1401 | √ | 报警督办应答消息 | | |||
| 3 | 0x1402 | √ | 上报报警信息消息 | | |||
| 4 | 0x1403 | √ | 主动上报报警处理结果信息 | | |||
#### 从链路报警信息交互消息 | |||
|序号|消息ID|完成情况|消息体名称| | |||
|:------:|:------:|:------:|:------:| | |||
| 1 | 0x9400 | √ | 主链路平台间信息交互消息 | | |||
| 2 | 0x9401 | √ | 报警督办请求 | | |||
| 3 | 0x9402 | √ | 报警预警 | | |||
| 4 | 0x9403 | √ | 实时交换报警信息 | | |||
### 车辆监管类 | |||
#### 主链路车辆监管消息 | |||
|序号|消息ID|完成情况|消息体名称| | |||
|:------:|:------:|:------:|:------:| | |||
| 1 | 0x1500 | √ | 主链路车辆监管消息 | | |||
| 2 | 0x1501 | √ | 车辆单向监听应答 | | |||
| 3 | 0x1502 | √ | 车辆拍照应答 | | |||
#### 从链路车辆监管消息 | |||
|序号|消息ID|完成情况|消息体名称| | |||
|:------:|:------:|:------:|:------:| | |||
| 1 | 0x9500 | √ | 从链路车辆监管消息 | | |||
### 车辆静态信息交换类 | |||
#### 主链路静态信息交换消息 | |||
|序号|消息ID|完成情况|消息体名称| | |||
|:------:|:------:|:------:|:------:| | |||
| 1 | 0x1600 | √ | 主链路静态信息交换消息 | | |||
| 2 | 0x1601 | √ | 补报车辆静态信息应答 | | |||
#### 从链路静态信息交换消息 | |||
|序号|消息ID|完成情况|消息体名称| | |||
|:------:|:------:|:------:|:------:| | |||
| 1 | 0x9600 | √ | 从链路静态信息交换消息 | | |||
| 2 | 0x9601 | √ | 补报车辆静态信息应答 | |
@@ -5,7 +5,7 @@ VisualStudioVersion = 15.0.27428.2005 | |||
MinimumVisualStudioVersion = 10.0.40219.1 | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT809.Protocol", "JT809.Protocol\JT809.Protocol.csproj", "{4D33A5C9-F583-4230-9791-AB0394EFAD57}" | |||
EndProject | |||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JT809.Protocol.Test", "JT809.Protocol.Test\JT809.Protocol.Test.csproj", "{59D2D876-8D81-4CCE-839A-B153912C0C27}" | |||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JT809.Protocol.Test", "JT809.Protocol.Test\JT809.Protocol.Test.csproj", "{59D2D876-8D81-4CCE-839A-B153912C0C27}" | |||
EndProject | |||
Global | |||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||
@@ -38,6 +38,14 @@ | |||
<Compile Include="JT809Enums\JT809BusinessType.cs" /> | |||
<Compile Include="JT809Enums\JT809SubBusinessType.cs" /> | |||
<Compile Include="JT809Enums\JT809VehicleColorType.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x1502_PhotoRspFlag.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x1501_Result.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x9403_WarnSrc.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x9402_WarnSrc.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x9401_WarnSrc.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x1403_Result.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x1402_WarnSrc.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x1401_Result.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x1002_Result.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x1007_ErrorCode.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x9302_ObjectType.cs" /> | |||
@@ -52,7 +60,7 @@ | |||
<Compile Include="JT809Enums\JT809_0x1008_ReasonCode.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x9002_Result.cs" /> | |||
<Compile Include="JT809Enums\JT809_0x9008_ReasonCode.cs" /> | |||
<Compile Include="JT809Enums\JT809_VehiclePositionExcrypt.cs" /> | |||
<Compile Include="JT809Enums\JT809_VehiclePositionEncrypt.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
@@ -151,24 +151,27 @@ namespace JT809.Protocol.JT809Enums | |||
///主链路报警信息交互消息 | |||
///</summary> | |||
[Description("主链路报警信息交互消息")] | |||
[JT809BodiesType(typeof(JT809_0x1400))] | |||
UP_WARN_MSG = 0x1400, | |||
///<summary> | |||
///从链路报警信息交互消息 | |||
///</summary> | |||
[Description("从链路报警信息交互消息")] | |||
[JT809BodiesType(typeof(JT809_0x9400))] | |||
DOWN_WARN_MSG = 0x9400, | |||
#endregion | |||
#region 车辆监管类 | |||
///<summary> | |||
///主链路车辆监管消息 | |||
///</summary> | |||
[Description("主链路车辆监管消息")] | |||
[JT809BodiesType(typeof(JT809_0x1500))] | |||
UP_CTRL_MSG = 0x1500, | |||
///<summary> | |||
///从链路车辆监管消息 | |||
///</summary> | |||
[Description("从链路车辆监管消息")] | |||
[JT809BodiesType(typeof(JT809_0x9500))] | |||
DOWN_CTRL_MSG = 0x9500, | |||
#endregion | |||
#region 车辆静态信息交换类 | |||
@@ -176,11 +179,13 @@ namespace JT809.Protocol.JT809Enums | |||
///主链路静态信息交换消息 | |||
///</summary> | |||
[Description("主链路静态信息交换消息")] | |||
[JT809BodiesType(typeof(JT809_0x1600))] | |||
UP_BASE_MSG = 0x1600, | |||
///<summary> | |||
///从链路静态信息交换消息 | |||
///</summary> | |||
[Description("从链路静态信息交换消息")] | |||
[JT809BodiesType(typeof(JT809_0x9600))] | |||
DOWN_BASE_MSG = 0x9600, | |||
#endregion | |||
} | |||
@@ -182,16 +182,19 @@ namespace JT809.Protocol.JT809Enums | |||
///报警督办应答 | |||
///</summary> | |||
[Description("报警督办应答")] | |||
[JT809BodiesType(typeof(JT809_0x1400_0x1401))] | |||
UP_WARN_MSG_URGE_TODO_ACK = 0x1401, | |||
///<summary> | |||
///上报报警信息 | |||
///</summary> | |||
[Description("上报报警信息")] | |||
[JT809BodiesType(typeof(JT809_0x1400_0x1402))] | |||
UP_WARN_MSG_ADPT_INFO = 0x1402, | |||
///<summary> | |||
///主动上报报警处理结果信息 | |||
///</summary> | |||
[Description("主动上报报警处理结果信息")] | |||
[JT809BodiesType(typeof(JT809_0x1400_0x1403))] | |||
UP_WARN_MSG_ADPT_TODO_INFO = 0x1403, | |||
#endregion | |||
@@ -200,16 +203,19 @@ namespace JT809.Protocol.JT809Enums | |||
///报警督办请求 | |||
///</summary> | |||
[Description("报警督办请求")] | |||
[JT809BodiesType(typeof(JT809_0x9400_0x9401))] | |||
DOWN_WARN_MSG_URGE_TODO_REQ = 0x9401, | |||
///<summary> | |||
///报警预警 | |||
///</summary> | |||
[Description("报警预警")] | |||
[JT809BodiesType(typeof(JT809_0x9400_0x9402))] | |||
DOWN_WARN_MSG_INFORM_TIPS = 0x9402, | |||
///<summary> | |||
///实时交换报警信息 | |||
///</summary> | |||
[Description("实时交换报警信息")] | |||
[JT809BodiesType(typeof(JT809_0x9400_0x9403))] | |||
DOWN_WARN_MSG_EXG_INFORM = 0x9403, | |||
#endregion | |||
@@ -218,26 +224,31 @@ namespace JT809.Protocol.JT809Enums | |||
///车辆单向监听应答 | |||
///</summary> | |||
[Description("车辆单向监听应答")] | |||
[JT809BodiesType(typeof(JT809_0x1500_0x1501))] | |||
UP_CTRL_MSG_MONITOR_VEHICLE_ACK = 0x1501, | |||
///<summary> | |||
///车辆拍照应答 | |||
///</summary> | |||
[Description("车辆拍照应答")] | |||
[JT809BodiesType(typeof(JT809_0x1500_0x1502))] | |||
UP_CTRL_MSG_TAKE_PHOTO_ACK = 0x1502, | |||
///<summary> | |||
///下发车辆报文应答 | |||
///</summary> | |||
[Description("下发车辆报文应答")] | |||
//[JT809BodiesType(typeof(JT809_0x1500_0x1503))] | |||
UP_CTRL_MSG_TEXT_INFO_ACK = 0x1503, | |||
///<summary> | |||
///上报车辆行驶记录应答 | |||
///</summary> | |||
[Description("上报车辆行驶记录应答")] | |||
//[JT809BodiesType(typeof(JT809_0x1500_0x1504))] | |||
UP_CTRL_MSG_TAKE_TRAVEL_ACK = 0x1504, | |||
///<summary> | |||
///车辆应急接入监管平台应答消息 | |||
///</summary> | |||
[Description("车辆应急接入监管平台应答消息")] | |||
//[JT809BodiesType(typeof(JT809_0x1500_0x1505))] | |||
UP_CTRL_MSG_EMERGENCY_MONITORING_ACK = 0x1505, | |||
#endregion | |||
@@ -274,6 +285,7 @@ namespace JT809.Protocol.JT809Enums | |||
///补报车辆静态信息应答 | |||
///</summary> | |||
[Description("补报车辆静态信息应答")] | |||
[JT809BodiesType(typeof(JT809_0x1600_0x1601))] | |||
UP_BASE_MSG_VEHICLE_ADDED_ACK = 0x1601, | |||
#endregion | |||
@@ -282,6 +294,7 @@ namespace JT809.Protocol.JT809Enums | |||
///补报车辆静态信息请求 | |||
///</summary> | |||
[Description("补报车辆静态信息请求")] | |||
[JT809BodiesType(typeof(JT809_0x9600_0x9601))] | |||
DOWN_BASE_MSG_VEHICLE_ADDED = 0x9601, | |||
#endregion | |||
} | |||
@@ -0,0 +1,17 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.JT809Enums | |||
{ | |||
/// <summary> | |||
/// 报警处理结果 | |||
/// </summary> | |||
public enum JT809_0x1401_Result : byte | |||
{ | |||
处理中 = 0x00, | |||
已处理完毕 = 0x01, | |||
不做处理 = 0x02, | |||
将来处理 = 0x03 | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.JT809Enums | |||
{ | |||
/// <summary> | |||
/// 报警信息来源 | |||
/// </summary> | |||
public enum JT809_0x1402_WarnSrc : byte | |||
{ | |||
车载终端 = 0x00, | |||
企业监控平台 = 0x01, | |||
政府监管平台 = 0x02, | |||
其他 =0x09 | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.JT809Enums | |||
{ | |||
/// <summary> | |||
/// 报警处理结果 | |||
/// </summary> | |||
public enum JT809_0x1403_Result : byte | |||
{ | |||
处理中 = 0x00, | |||
已处理完毕 = 0x01, | |||
不做处理 = 0x02, | |||
将来处理 = 0x03 | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.JT809Enums | |||
{ | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public enum JT809_0x1501_Result : byte | |||
{ | |||
监听成功 = 0x00, | |||
监听失败 = 0x01 | |||
} | |||
} |
@@ -0,0 +1,20 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.JT809Enums | |||
{ | |||
/// <summary> | |||
/// 拍照应答标识 | |||
/// </summary> | |||
public enum JT809_0x1502_PhotoRspFlag : byte | |||
{ | |||
不支持拍照 = 0x00, | |||
完成拍照 = 0x01, | |||
完成拍照_照片数据稍后传送 = 0x02, | |||
未拍照_不在线 = 0x03, | |||
未拍照_无法使用指定镜头 = 0x04, | |||
未拍照_其他原因 = 0x05, | |||
车牌号码错误 = 0x09, | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.JT809Enums | |||
{ | |||
/// <summary> | |||
/// 报警信息来源 | |||
/// </summary> | |||
public enum JT809_0x9401_WarnSrc : byte | |||
{ | |||
车载终端 = 0x00, | |||
企业监控平台 = 0x01, | |||
政府监管平台 = 0x02, | |||
其他 =0x09 | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.JT809Enums | |||
{ | |||
/// <summary> | |||
/// 报警信息来源 | |||
/// </summary> | |||
public enum JT809_0x9402_WarnSrc : byte | |||
{ | |||
车载终端 = 0x00, | |||
企业监控平台 = 0x01, | |||
政府监管平台 = 0x02, | |||
其他 =0x09 | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.JT809Enums | |||
{ | |||
/// <summary> | |||
/// 报警信息来源 | |||
/// </summary> | |||
public enum JT809_0x9403_WarnSrc : byte | |||
{ | |||
车载终端 = 0x00, | |||
企业监控平台 = 0x01, | |||
政府监管平台 = 0x02, | |||
其他 =0x09 | |||
} | |||
} |
@@ -7,7 +7,7 @@ namespace JT809.Protocol.JT809Enums | |||
/// <summary> | |||
/// 定位信息是否使用国家测绘局批准的地图保密插件进行加密。 | |||
/// </summary> | |||
public enum JT809_VehiclePositionExcrypt:byte | |||
public enum JT809_VehiclePositionEncrypt:byte | |||
{ | |||
未加密 = 0x00, | |||
已加密 = 0x01 |
@@ -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_0x1006Formatter : IJT809Formatter<JT809_0x1006> | |||
{ | |||
public JT809_0x1006 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x1006 jT809_0X1006 = new JT809_0x1006(); | |||
jT809_0X1006.VehicleNo = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 21); | |||
jT809_0X1006.VehicleColor = (JT809VehicleColorType)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X1006.SubBusinessType = (JT809SubBusinessType)JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||
jT809_0X1006.DataLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
//JT809.Protocol.JT809Enums.JT809BusinessType 映射对应消息特性 | |||
JT809BodiesTypeAttribute jT809SubBodiesTypeAttribute = jT809_0X1006.SubBusinessType.GetAttribute<JT809BodiesTypeAttribute>(); | |||
if (jT809SubBodiesTypeAttribute == null) | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.GetAttributeError, $"JT809BodiesTypeAttribute Not Found>{jT809_0X1006.SubBusinessType.ToString()}"); | |||
} | |||
try | |||
{ | |||
jT809_0X1006.JT809SubBodies = JT809FormatterResolverExtensions.JT809DynamicDeserialize(JT809FormatterExtensions.GetFormatter(jT809SubBodiesTypeAttribute.JT809BodiesType), bytes.Slice(offset, (int)jT809_0X1006.DataLength), out readSize); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{jT809_0X1006.SubBusinessType.ToString()}"); | |||
} | |||
readSize = offset; | |||
return jT809_0X1006; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x1006 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,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_0x1400Formatter : IJT809Formatter<JT809_0x1400> | |||
{ | |||
public JT809_0x1400 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x1400 jT809_0X1400 = new JT809_0x1400(); | |||
jT809_0X1400.VehicleNo = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 21); | |||
jT809_0X1400.VehicleColor = (JT809VehicleColorType)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X1400.SubBusinessType = (JT809SubBusinessType)JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||
jT809_0X1400.DataLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
//JT809.Protocol.JT809Enums.JT809BusinessType 映射对应消息特性 | |||
JT809BodiesTypeAttribute jT809SubBodiesTypeAttribute = jT809_0X1400.SubBusinessType.GetAttribute<JT809BodiesTypeAttribute>(); | |||
if (jT809SubBodiesTypeAttribute == null) | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.GetAttributeError, $"JT809BodiesTypeAttribute Not Found>{jT809_0X1400.SubBusinessType.ToString()}"); | |||
} | |||
try | |||
{ | |||
jT809_0X1400.JT809SubBodies = JT809FormatterResolverExtensions.JT809DynamicDeserialize(JT809FormatterExtensions.GetFormatter(jT809SubBodiesTypeAttribute.JT809BodiesType), bytes.Slice(offset, (int)jT809_0X1400.DataLength), out readSize); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{jT809_0X1400.SubBusinessType.ToString()}"); | |||
} | |||
readSize = offset; | |||
return jT809_0X1400; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x1400 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,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_0x1500Formatter : IJT809Formatter<JT809_0x1500> | |||
{ | |||
public JT809_0x1500 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x1500 jT809_0X1500 = new JT809_0x1500(); | |||
jT809_0X1500.VehicleNo = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 21); | |||
jT809_0X1500.VehicleColor = (JT809VehicleColorType)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X1500.SubBusinessType = (JT809SubBusinessType)JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||
jT809_0X1500.DataLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
//JT809.Protocol.JT809Enums.JT809BusinessType 映射对应消息特性 | |||
JT809BodiesTypeAttribute jT809SubBodiesTypeAttribute = jT809_0X1500.SubBusinessType.GetAttribute<JT809BodiesTypeAttribute>(); | |||
if (jT809SubBodiesTypeAttribute == null) | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.GetAttributeError, $"JT809BodiesTypeAttribute Not Found>{jT809_0X1500.SubBusinessType.ToString()}"); | |||
} | |||
try | |||
{ | |||
jT809_0X1500.JT809SubBodies = JT809FormatterResolverExtensions.JT809DynamicDeserialize(JT809FormatterExtensions.GetFormatter(jT809SubBodiesTypeAttribute.JT809BodiesType), bytes.Slice(offset, (int)jT809_0X1500.DataLength), out readSize); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{jT809_0X1500.SubBusinessType.ToString()}"); | |||
} | |||
readSize = offset; | |||
return jT809_0X1500; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x1500 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,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_0x1600Formatter : IJT809Formatter<JT809_0x1600> | |||
{ | |||
public JT809_0x1600 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x1600 jT809_0X1600 = new JT809_0x1600(); | |||
jT809_0X1600.VehicleNo = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 21); | |||
jT809_0X1600.VehicleColor = (JT809VehicleColorType)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X1600.SubBusinessType = (JT809SubBusinessType)JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||
jT809_0X1600.DataLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
//JT809.Protocol.JT809Enums.JT809BusinessType 映射对应消息特性 | |||
JT809BodiesTypeAttribute jT809SubBodiesTypeAttribute = jT809_0X1600.SubBusinessType.GetAttribute<JT809BodiesTypeAttribute>(); | |||
if (jT809SubBodiesTypeAttribute == null) | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.GetAttributeError, $"JT809BodiesTypeAttribute Not Found>{jT809_0X1600.SubBusinessType.ToString()}"); | |||
} | |||
try | |||
{ | |||
jT809_0X1600.JT809SubBodies = JT809FormatterResolverExtensions.JT809DynamicDeserialize(JT809FormatterExtensions.GetFormatter(jT809SubBodiesTypeAttribute.JT809BodiesType), bytes.Slice(offset, (int)jT809_0X1600.DataLength), out readSize); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{jT809_0X1600.SubBusinessType.ToString()}"); | |||
} | |||
readSize = offset; | |||
return jT809_0X1600; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x1600 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,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_0x9400Formatter : IJT809Formatter<JT809_0x9400> | |||
{ | |||
public JT809_0x9400 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x9400 jT809_0X9400 = new JT809_0x9400(); | |||
jT809_0X9400.VehicleNo = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 21); | |||
jT809_0X9400.VehicleColor = (JT809VehicleColorType)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X9400.SubBusinessType = (JT809SubBusinessType)JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||
jT809_0X9400.DataLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
//JT809.Protocol.JT809Enums.JT809BusinessType 映射对应消息特性 | |||
JT809BodiesTypeAttribute jT809SubBodiesTypeAttribute = jT809_0X9400.SubBusinessType.GetAttribute<JT809BodiesTypeAttribute>(); | |||
if (jT809SubBodiesTypeAttribute == null) | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.GetAttributeError, $"JT809BodiesTypeAttribute Not Found>{jT809_0X9400.SubBusinessType.ToString()}"); | |||
} | |||
try | |||
{ | |||
jT809_0X9400.JT809SubBodies = JT809FormatterResolverExtensions.JT809DynamicDeserialize(JT809FormatterExtensions.GetFormatter(jT809SubBodiesTypeAttribute.JT809BodiesType), bytes.Slice(offset, (int)jT809_0X9400.DataLength), out readSize); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{jT809_0X9400.SubBusinessType.ToString()}"); | |||
} | |||
readSize = offset; | |||
return jT809_0X9400; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9400 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,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_0x9500Formatter : IJT809Formatter<JT809_0x9500> | |||
{ | |||
public JT809_0x9500 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x9500 jT809_0X9500 = new JT809_0x9500(); | |||
jT809_0X9500.VehicleNo = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 21); | |||
jT809_0X9500.VehicleColor = (JT809VehicleColorType)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X9500.SubBusinessType = (JT809SubBusinessType)JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||
jT809_0X9500.DataLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
//JT809.Protocol.JT809Enums.JT809BusinessType 映射对应消息特性 | |||
JT809BodiesTypeAttribute jT809SubBodiesTypeAttribute = jT809_0X9500.SubBusinessType.GetAttribute<JT809BodiesTypeAttribute>(); | |||
if (jT809SubBodiesTypeAttribute == null) | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.GetAttributeError, $"JT809BodiesTypeAttribute Not Found>{jT809_0X9500.SubBusinessType.ToString()}"); | |||
} | |||
try | |||
{ | |||
jT809_0X9500.JT809SubBodies = JT809FormatterResolverExtensions.JT809DynamicDeserialize(JT809FormatterExtensions.GetFormatter(jT809SubBodiesTypeAttribute.JT809BodiesType), bytes.Slice(offset, (int)jT809_0X9500.DataLength), out readSize); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{jT809_0X9500.SubBusinessType.ToString()}"); | |||
} | |||
readSize = offset; | |||
return jT809_0X9500; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9500 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,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_0x9600Formatter : IJT809Formatter<JT809_0x9600> | |||
{ | |||
public JT809_0x9600 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x9600 jT809_0X9600 = new JT809_0x9600(); | |||
jT809_0X9600.VehicleNo = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, 21); | |||
jT809_0X9600.VehicleColor = (JT809VehicleColorType)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X9600.SubBusinessType = (JT809SubBusinessType)JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||
jT809_0X9600.DataLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
//JT809.Protocol.JT809Enums.JT809BusinessType 映射对应消息特性 | |||
JT809BodiesTypeAttribute jT809SubBodiesTypeAttribute = jT809_0X9600.SubBusinessType.GetAttribute<JT809BodiesTypeAttribute>(); | |||
if (jT809SubBodiesTypeAttribute == null) | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.GetAttributeError, $"JT809BodiesTypeAttribute Not Found>{jT809_0X9600.SubBusinessType.ToString()}"); | |||
} | |||
try | |||
{ | |||
jT809_0X9600.JT809SubBodies = JT809FormatterResolverExtensions.JT809DynamicDeserialize(JT809FormatterExtensions.GetFormatter(jT809SubBodiesTypeAttribute.JT809BodiesType), bytes.Slice(offset, (int)jT809_0X9600.DataLength), out readSize); | |||
} | |||
catch | |||
{ | |||
throw new JT809Exception(JT809ErrorCode.SubBodiesParseError, $"SubBusinessType>{jT809_0X9600.SubBusinessType.ToString()}"); | |||
} | |||
readSize = offset; | |||
return jT809_0X9600; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9600 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; | |||
} | |||
} | |||
} |
@@ -14,7 +14,7 @@ namespace JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters | |||
{ | |||
int offset = 0; | |||
JT809_0x1200_0x1202 jT809_0X1200_0X1202 = new JT809_0x1200_0x1202(); | |||
jT809_0X1200_0X1202.VehiclePosition.Encrypt = (JT809_VehiclePositionExcrypt)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X1200_0X1202.VehiclePosition.Encrypt = (JT809_VehiclePositionEncrypt)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X1200_0X1202.VehiclePosition.Day= JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X1200_0X1202.VehiclePosition.Month = JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X1200_0X1202.VehiclePosition.Year = JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||
@@ -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_0x1400_0x1401Formatter : IJT809Formatter<JT809_0x1400_0x1401> | |||
{ | |||
public JT809_0x1400_0x1401 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x1400_0x1401 jT809_0X1400_0X1401 = new JT809_0x1400_0x1401(); | |||
jT809_0X1400_0X1401.SupervisionID = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
jT809_0X1400_0X1401.Result = (JT809Enums.JT809_0x1401_Result)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
readSize = offset; | |||
return jT809_0X1400_0X1401; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x1400_0x1401 value) | |||
{ | |||
offset += JT809BinaryExtensions.WriteUInt32Little(memoryOwner, offset, value.SupervisionID); | |||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset,(byte)value.Result); | |||
return offset; | |||
} | |||
} | |||
} |
@@ -0,0 +1,40 @@ | |||
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_0x1400_0x1402Formatter : IJT809Formatter<JT809_0x1400_0x1402> | |||
{ | |||
public JT809_0x1400_0x1402 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x1400_0x1402 jT809_0X1400_0X1402 = new JT809_0x1400_0x1402(); | |||
jT809_0X1400_0X1402.WarnSrc = (JT809Enums.JT809_0x1402_WarnSrc)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X1400_0X1402.WarnType= JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||
jT809_0X1400_0X1402.WarnTime = JT809BinaryExtensions.ReadUTCDateTimeLittle(bytes, ref offset); | |||
jT809_0X1400_0X1402.InfoID= JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
jT809_0X1400_0X1402.InfoLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
jT809_0X1400_0X1402.InfoContent= JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, (int)jT809_0X1400_0X1402.InfoLength); | |||
readSize = offset; | |||
return jT809_0X1400_0X1402; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x1400_0x1402 value) | |||
{ | |||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, (byte)value.WarnSrc); | |||
offset += JT809BinaryExtensions.WriteUInt16Little(memoryOwner, offset,value.WarnType); | |||
offset += JT809BinaryExtensions.WriteUTCDateTimeLittle(memoryOwner, offset, value.WarnTime); | |||
offset += JT809BinaryExtensions.WriteUInt32Little(memoryOwner, offset, value.InfoID); | |||
// 先计算内容长度(汉字为两个字节) | |||
offset += 4; | |||
int byteLength = JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.InfoContent); | |||
JT809BinaryExtensions.WriteInt32Little(memoryOwner, offset - 4, byteLength); | |||
offset += byteLength; | |||
return offset; | |||
} | |||
} | |||
} |
@@ -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_0x1400_0x1403Formatter : IJT809Formatter<JT809_0x1400_0x1403> | |||
{ | |||
public JT809_0x1400_0x1403 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x1400_0x1403 jT809_0X1400_0X1403 = new JT809_0x1400_0x1403(); | |||
jT809_0X1400_0X1403.InfoID = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
jT809_0X1400_0X1403.Result = (JT809Enums.JT809_0x1403_Result)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
readSize = offset; | |||
return jT809_0X1400_0X1403; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x1400_0x1403 value) | |||
{ | |||
offset += JT809BinaryExtensions.WriteUInt32Little(memoryOwner, offset, value.InfoID); | |||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, (byte)value.Result); | |||
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_0x1500_0x1501Formatter : IJT809Formatter<JT809_0x1500_0x1501> | |||
{ | |||
public JT809_0x1500_0x1501 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x1500_0x1501 jT809_0X1500_0X1501 = new JT809_0x1500_0x1501(); | |||
jT809_0X1500_0X1501.Result= (JT809Enums.JT809_0x1501_Result)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
readSize = offset; | |||
return jT809_0X1500_0X1501; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x1500_0x1501 value) | |||
{ | |||
offset+= JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, (byte)value.Result); | |||
return offset; | |||
} | |||
} | |||
} |
@@ -0,0 +1,21 @@ | |||
using JT809.Protocol.JT809SubMessageBody; | |||
using System; | |||
using System.Buffers; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters | |||
{ | |||
public class JT809_0x1500_0x1502Formatter : IJT809Formatter<JT809_0x1500_0x1502> | |||
{ | |||
public JT809_0x1500_0x1502 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
throw new NotImplementedException(); | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x1500_0x1502 value) | |||
{ | |||
throw new NotImplementedException(); | |||
} | |||
} | |||
} |
@@ -14,7 +14,7 @@ namespace JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters | |||
{ | |||
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.Encrypt = (JT809_VehiclePositionEncrypt)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); | |||
@@ -0,0 +1,43 @@ | |||
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_0x9400_0x9401Formatter : IJT809Formatter<JT809_0x9400_0x9401> | |||
{ | |||
public JT809_0x9400_0x9401 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x9400_0x9401 jT809_0X9400_0X9401 = new JT809_0x9400_0x9401(); | |||
jT809_0X9400_0X9401.WarnSrc = (JT809Enums.JT809_0x9401_WarnSrc)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X9400_0X9401.WarnType = JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||
jT809_0X9400_0X9401.WarnTime = JT809BinaryExtensions.ReadUTCDateTimeLittle(bytes, ref offset); | |||
jT809_0X9400_0X9401.SupervisionID = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
jT809_0X9400_0X9401.SupervisionEndtime = JT809BinaryExtensions.ReadUTCDateTimeLittle(bytes, ref offset); | |||
jT809_0X9400_0X9401.SupervisionLevel = JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X9400_0X9401.Supervisor = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset,16); | |||
jT809_0X9400_0X9401.SupervisorTel = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset,20); | |||
jT809_0X9400_0X9401.SupervisorEmail = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset,32); | |||
readSize = offset; | |||
return jT809_0X9400_0X9401; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9400_0x9401 value) | |||
{ | |||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, (byte)value.WarnSrc); | |||
offset += JT809BinaryExtensions.WriteUInt16Little(memoryOwner, offset, value.WarnType); | |||
offset += JT809BinaryExtensions.WriteUTCDateTimeLittle(memoryOwner, offset, value.WarnTime); | |||
offset += JT809BinaryExtensions.WriteUInt32Little(memoryOwner, offset, value.SupervisionID); | |||
offset += JT809BinaryExtensions.WriteUTCDateTimeLittle(memoryOwner, offset, value.SupervisionEndtime); | |||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, value.SupervisionLevel); | |||
offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.Supervisor,16); | |||
offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.SupervisorTel,20); | |||
offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.SupervisorEmail,32); | |||
return offset; | |||
} | |||
} | |||
} |
@@ -0,0 +1,38 @@ | |||
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_0x9400_0x9402Formatter : IJT809Formatter<JT809_0x9400_0x9402> | |||
{ | |||
public JT809_0x9400_0x9402 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x9400_0x9402 jT809_0X9400_0X9402 = new JT809_0x9400_0x9402(); | |||
jT809_0X9400_0X9402.WarnSrc = (JT809Enums.JT809_0x9402_WarnSrc)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X9400_0X9402.WarnType = JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||
jT809_0X9400_0X9402.WarnTime = JT809BinaryExtensions.ReadUTCDateTimeLittle(bytes, ref offset); | |||
jT809_0X9400_0X9402.WarnLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
jT809_0X9400_0X9402.WarnContent = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset,(int)jT809_0X9400_0X9402.WarnLength); | |||
readSize = offset; | |||
return jT809_0X9400_0X9402; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9400_0x9402 value) | |||
{ | |||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, (byte)value.WarnSrc); | |||
offset += JT809BinaryExtensions.WriteUInt16Little(memoryOwner, offset, value.WarnType); | |||
offset += JT809BinaryExtensions.WriteUTCDateTimeLittle(memoryOwner, offset, value.WarnTime); | |||
// 先计算内容长度(汉字为两个字节) | |||
offset += 4; | |||
int byteLength = JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.WarnContent); | |||
JT809BinaryExtensions.WriteInt32Little(memoryOwner, offset - 4, byteLength); | |||
offset += byteLength; | |||
return offset; | |||
} | |||
} | |||
} |
@@ -0,0 +1,38 @@ | |||
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_0x9400_0x9403Formatter : IJT809Formatter<JT809_0x9400_0x9403> | |||
{ | |||
public JT809_0x9400_0x9403 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x9400_0x9403 jT809_0X9400_0X9403 = new JT809_0x9400_0x9403(); | |||
jT809_0X9400_0X9403.WarnSrc = (JT809Enums.JT809_0x9403_WarnSrc)JT809BinaryExtensions.ReadByteLittle(bytes, ref offset); | |||
jT809_0X9400_0X9403.WarnType = JT809BinaryExtensions.ReadUInt16Little(bytes, ref offset); | |||
jT809_0X9400_0X9403.WarnTime = JT809BinaryExtensions.ReadUTCDateTimeLittle(bytes, ref offset); | |||
jT809_0X9400_0X9403.WarnLength = JT809BinaryExtensions.ReadUInt32Little(bytes, ref offset); | |||
jT809_0X9400_0X9403.WarnContent = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset, (int)jT809_0X9400_0X9403.WarnLength); | |||
readSize = offset; | |||
return jT809_0X9400_0X9403; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x9400_0x9403 value) | |||
{ | |||
offset += JT809BinaryExtensions.WriteByteLittle(memoryOwner, offset, (byte)value.WarnSrc); | |||
offset += JT809BinaryExtensions.WriteUInt16Little(memoryOwner, offset, value.WarnType); | |||
offset += JT809BinaryExtensions.WriteUTCDateTimeLittle(memoryOwner, offset, value.WarnTime); | |||
// 先计算内容长度(汉字为两个字节) | |||
offset += 4; | |||
int byteLength = JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.WarnContent); | |||
JT809BinaryExtensions.WriteInt32Little(memoryOwner, offset - 4, byteLength); | |||
offset += byteLength; | |||
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_0x9600_0x1601Formatter : IJT809Formatter<JT809_0x1600_0x1601> | |||
{ | |||
public JT809_0x1600_0x1601 Deserialize(ReadOnlySpan<byte> bytes, out int readSize) | |||
{ | |||
int offset = 0; | |||
JT809_0x1600_0x1601 jT809_0X9600_0X1601 = new JT809_0x1600_0x1601(); | |||
jT809_0X9600_0X1601.CarInfo = JT809BinaryExtensions.ReadStringLittle(bytes, ref offset); | |||
readSize = offset; | |||
return jT809_0X9600_0X1601; | |||
} | |||
public int Serialize(IMemoryOwner<byte> memoryOwner, int offset, JT809_0x1600_0x1601 value) | |||
{ | |||
offset += JT809BinaryExtensions.WriteStringLittle(memoryOwner, offset, value.CarInfo); | |||
return offset; | |||
} | |||
} | |||
} |
@@ -1,4 +1,5 @@ | |||
using System; | |||
using JT809.Protocol.JT809Enums; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
@@ -14,6 +15,25 @@ namespace JT809.Protocol.JT809MessageBody | |||
/// </summary> | |||
public class JT809_0x1006: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,42 @@ | |||
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>消息方向:下级平台往上级平台</para> | |||
/// <para>业务数据类型标识:UP_WARN_MSG</para> | |||
/// <para>描述:下级平台向上级平台发送车辆报警信息业务</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x1400Formatter))] | |||
public class JT809_0x1400: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,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>业务数据类型标识:UP_CTRL_MSG</para> | |||
/// <para>描述:下级平台向上级平台发送车辆监管业务</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x1500Formatter))] | |||
public class JT809_0x1500: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,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>业务数据类型标识:UP_ BASE_ MSG</para> | |||
/// <para>消息方向:下级平台往上级平台</para> | |||
/// <para>描述:下级平台向上级平台发送车辆睁态信息交换业务</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x1600Formatter))] | |||
public class JT809_0x1600: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,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_WARN_MSG</para> | |||
/// <para>描述:上级平台向下级平台发送报瞥信息业务</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x9400Formatter))] | |||
public class JT809_0x9400: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,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_CTRL_MSG</para> | |||
/// <para>描述:上级平台向下级平台发送车辆监监管业务</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x9500Formatter))] | |||
public class JT809_0x9500: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,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_BASE_MSG</para> | |||
/// <para>描述:上级平台向下级平台发送车辆静态信息交换业务</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x9600Formatter))] | |||
public class JT809_0x9600: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; } | |||
} | |||
} |
@@ -13,7 +13,7 @@ namespace JT809.Protocol.JT809Properties | |||
/// <summary> | |||
/// 该字段标识传输的定位信息是否使用国家测绘局批准的地图保密插件进行加密。 | |||
/// </summary> | |||
public JT809_VehiclePositionExcrypt Encrypt { get; set; } | |||
public JT809_VehiclePositionEncrypt Encrypt { get; set; } | |||
/// <summary> | |||
/// 日 | |||
/// </summary> | |||
@@ -0,0 +1,27 @@ | |||
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>子业务类型标识:UP_WARN_MSG_URGE_TODO_ACK</para> | |||
/// <para>描述:下级平台应答上级平台下发的报警督办请求消息,向上.级平台上报车辆的报瞥处理结果</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x1400_0x1401Formatter))] | |||
public class JT809_0x1400_0x1401:JT809SubBodies | |||
{ | |||
/// <summary> | |||
/// 报警督办 ID | |||
/// </summary> | |||
public uint SupervisionID { get; set; } | |||
/// <summary> | |||
/// 报警处理结果 | |||
/// </summary> | |||
public JT809_0x1401_Result Result { get; set; } | |||
} | |||
} |
@@ -0,0 +1,44 @@ | |||
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>子业务类型标识:UP_WARN_MSG_ADPT_INFO</para> | |||
/// <para>描述:下级平台向上级平台上报某车辆的报警信息</para> | |||
/// <para>本条消息上级平台无需应答</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x1400_0x1402Formatter))] | |||
public class JT809_0x1400_0x1402:JT809SubBodies | |||
{ | |||
/// <summary> | |||
/// 报警信息来源 | |||
/// </summary> | |||
public JT809_0x1402_WarnSrc WarnSrc { get; set; } | |||
/// <summary> | |||
/// 报警类型 | |||
/// </summary> | |||
public ushort WarnType { get; set; } | |||
/// <summary> | |||
/// 报警时间 | |||
/// </summary> | |||
public DateTime WarnTime { get; set; } | |||
/// <summary> | |||
/// 信息ID | |||
/// </summary> | |||
public uint InfoID { get; set; } | |||
/// <summary> | |||
/// 数据长度 | |||
/// </summary> | |||
public uint InfoLength { get; set; } | |||
/// <summary> | |||
/// 数据长度 | |||
/// </summary> | |||
public string InfoContent { get; set; } | |||
} | |||
} |
@@ -0,0 +1,28 @@ | |||
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>子业务类型标识:UP_WARN_MSG_ADPT_TODO_INFO</para> | |||
/// <para>描述:下级平台向上级平台上报报警处理结果</para> | |||
/// <para>本条消息上级平台无需应答</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x1400_0x1403Formatter))] | |||
public class JT809_0x1400_0x1403:JT809SubBodies | |||
{ | |||
/// <summary> | |||
/// 报警信息ID | |||
/// </summary> | |||
public uint InfoID { get; set; } | |||
/// <summary> | |||
/// 处理结果 | |||
/// </summary> | |||
public JT809_0x1403_Result Result { 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>子业务类型标识:UP_CTRL_MSG_MONITOR_VEHTCLE_ACK</para> | |||
/// <para>描述:下级平台向上级平台上传车辆单向监听请求消息的应答</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x1500_0x1501Formatter))] | |||
public class JT809_0x1500_0x1501:JT809SubBodies | |||
{ | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public JT809_0x1501_Result Result { get; set; } | |||
} | |||
} |
@@ -0,0 +1,49 @@ | |||
using JT809.Protocol.JT809Attributes; | |||
using JT809.Protocol.JT809Enums; | |||
using JT809.Protocol.JT809Formatters.JT809SubMessageBodyFormatters; | |||
using JT809.Protocol.JT809Properties; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.JT809SubMessageBody | |||
{ | |||
/// <summary> | |||
/// 车辆拍照应答 | |||
/// <para>子业务类型标识:UP_ CTRL_ MSG _TAKE_ PHOTO_ ACK</para> | |||
/// <para>描述:下级平台应答上级平台发送的车辆拍照请求消息,上传图片信息到上级平台</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x1500_0x1502Formatter))] | |||
public class JT809_0x1500_0x1502:JT809SubBodies | |||
{ | |||
/// <summary> | |||
/// 拍照应答标识 | |||
/// </summary> | |||
public JT809_0x1502_PhotoRspFlag PhotoRspFlag { get; set; } | |||
/// <summary> | |||
/// 车辆定位信息 | |||
/// </summary> | |||
public JT809VehiclePositionProperties VehiclePosition { get; set; } | |||
/// <summary> | |||
/// 镜头ID | |||
/// </summary> | |||
public byte LensID { get; set; } | |||
/// <summary> | |||
/// 图片长度 | |||
/// </summary> | |||
public uint PhotoLen { get; set; } | |||
/// <summary> | |||
/// 图片大小 | |||
/// </summary> | |||
public byte SizeType { get; set; } | |||
/// <summary> | |||
/// 图像格式 | |||
/// </summary> | |||
public byte Type { get; set; } | |||
/// <summary> | |||
/// 图片内容 | |||
/// </summary> | |||
public byte[] Photo { 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>子业务类型标识:UP_BASE_MSG_VEHICLE_ADDED_ACK</para> | |||
/// <para>描述:上级平台应答下级平台发送的补报车辆静态信息清求消息</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x9600_0x1601Formatter))] | |||
public class JT809_0x1600_0x1601:JT809SubBodies | |||
{ | |||
/// <summary> | |||
/// 车辆信息 | |||
/// </summary> | |||
public string CarInfo { get; set; } | |||
} | |||
} |
@@ -0,0 +1,55 @@ | |||
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_WARN_MSG_URGE_TODO_REQ</para> | |||
/// <para>描述:上级平台向车辆归属下级平台下发本消息,催促其及时处理相关车辆的报警信息</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x9400_0x9401Formatter))] | |||
public class JT809_0x9400_0x9401:JT809SubBodies | |||
{ | |||
/// <summary> | |||
/// 报警信息来源 | |||
/// </summary> | |||
public JT809_0x9401_WarnSrc WarnSrc { get; set; } | |||
/// <summary> | |||
/// 报警类型 | |||
/// </summary> | |||
public ushort WarnType { get; set; } | |||
/// <summary> | |||
/// 报警时间 | |||
/// </summary> | |||
public DateTime WarnTime { get; set; } | |||
/// <summary> | |||
/// 报警督办ID | |||
/// </summary> | |||
public uint SupervisionID { get; set; } | |||
/// <summary> | |||
/// 督办截止时间 | |||
/// </summary> | |||
public DateTime SupervisionEndtime { get; set; } | |||
/// <summary> | |||
/// 督办级别 | |||
/// </summary> | |||
public byte SupervisionLevel { get; set; } | |||
/// <summary> | |||
/// 督办人 | |||
/// </summary> | |||
public string Supervisor { get; set; } | |||
/// <summary> | |||
/// 督办联系电话 | |||
/// </summary> | |||
public string SupervisorTel { get; set; } | |||
/// <summary> | |||
/// 督办联系电子邮件 | |||
/// </summary> | |||
public string SupervisorEmail { get; set; } | |||
} | |||
} |
@@ -0,0 +1,40 @@ | |||
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_WARN_MSG_INFORM_TIPS</para> | |||
/// <para>描述:用于上级平台向车辆归属或车辆跨域下级平台下发相关车辆的报警顶警或运行提示信息</para> | |||
/// <para>本条消息下级平台无需应答</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x9400_0x9402Formatter))] | |||
public class JT809_0x9400_0x9402:JT809SubBodies | |||
{ | |||
/// <summary> | |||
/// 报警信息来源 | |||
/// </summary> | |||
public JT809_0x9402_WarnSrc WarnSrc { get; set; } | |||
/// <summary> | |||
/// 报警类型 | |||
/// </summary> | |||
public ushort WarnType { get; set; } | |||
/// <summary> | |||
/// 报警时间 | |||
/// </summary> | |||
public DateTime WarnTime { get; set; } | |||
/// <summary> | |||
/// 数据长度 | |||
/// </summary> | |||
public uint WarnLength { get; set; } | |||
/// <summary> | |||
/// 报警描述 | |||
/// </summary> | |||
public string WarnContent { get; set; } | |||
} | |||
} |
@@ -0,0 +1,40 @@ | |||
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_WARN_MSG_EXG_INFORM</para> | |||
/// <para>描述:用于上级平台向车辆跨域目的地下级平台下发相关车辆的当前报警情况</para> | |||
/// <para>本条消息下级平台无需应答</para> | |||
/// </summary> | |||
[JT809Formatter(typeof(JT809_0x9400_0x9403Formatter))] | |||
public class JT809_0x9400_0x9403:JT809SubBodies | |||
{ | |||
/// <summary> | |||
/// 报警信息来源 | |||
/// </summary> | |||
public JT809_0x9403_WarnSrc WarnSrc { get; set; } | |||
/// <summary> | |||
/// 报警类型 | |||
/// </summary> | |||
public ushort WarnType { get; set; } | |||
/// <summary> | |||
/// 报警时间 | |||
/// </summary> | |||
public DateTime WarnTime { get; set; } | |||
/// <summary> | |||
/// 数据长度 | |||
/// </summary> | |||
public uint WarnLength { get; set; } | |||
/// <summary> | |||
/// 报警描述 | |||
/// </summary> | |||
public string WarnContent { get; set; } | |||
} | |||
} |
@@ -0,0 +1,15 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.JT809SubMessageBody | |||
{ | |||
/// <summary> | |||
/// 补报车辆静态信息请求消息 | |||
/// <para>子业务类型标识:DOWN_BASE_MSG_VEHICLE_ADDED</para> | |||
/// <para>描述:上级平台在接收到车辆定位信息后,发现该车辆静态信息在上级平台不存在,上级平台向下级平台下发补报该车辆静态信息的请求消息</para> | |||
/// </summary> | |||
public class JT809_0x9600_0x9601:JT809SubBodies | |||
{ | |||
} | |||
} |