@@ -116,10 +116,19 @@ namespace JT809.Protocol.Enums | |||
[JT809SubBusinessTypeDescription("UP_EXG_MSG_DRVLINE_INFO", "主动上报车辆行驶路线信息", JT809BusinessType.主链路车辆动态信息交换业务)] | |||
主动上报车辆行驶路线信息 = 0x120E, | |||
#endregion | |||
#region 从链路动态信息交换消息 DOWN_EXG_MSG | |||
///<summary> | |||
///车辆注册信息应答消息 | |||
///DOWN_EXG_MSG_REGISTER_ACK | |||
///</summary> | |||
[Description("车辆注册信息应答消息")] | |||
[JT809BodiesType(typeof(JT809_0x9200_0x9201))] | |||
[JT809SubBusinessTypeDescription("DOWN_EXG_MSG_REGISTER_ACK", "车辆注册信息应答消息", JT809BusinessType.从链路车辆动态信息交换业务)] | |||
车辆注册信息应答消息 = 0x9201, | |||
///<summary> | |||
///交换车辆定位信息 | |||
///DOWN_EXG_MSG_CAR_LOCATION | |||
@@ -168,13 +177,13 @@ namespace JT809.Protocol.Enums | |||
[JT809SubBusinessTypeDescription("DOWN_EXG_MSG_APPLY_FOR_MONITOR_STARTUP_ACK", "申请交换指定车辆定位信息应答", JT809BusinessType.从链路车辆动态信息交换业务)] | |||
申请交换指定车辆定位信息应答 = 0x9207, | |||
///<summary> | |||
///取消交换指定车辆定位信息应答 | |||
///取消交换指定车辆定位信息应答or取消申请交换指定车辆定位信息应答消息 | |||
///DOWN_EXG_MSG_APPLY_FOR_MONITOR_END_ACK | |||
///</summary> | |||
[Description("取消交换指定车辆定位信息应答")] | |||
[Description("取消交换指定车辆定位信息应答or取消申请交换指定车辆定位信息应答消息")] | |||
[JT809BodiesType(typeof(JT809_0x9200_0x9208))] | |||
[JT809SubBusinessTypeDescription("DOWN_EXG_MSG_APPLY_FOR_MONITOR_END_ACK", "取消交换指定车辆定位信息应答", JT809BusinessType.从链路车辆动态信息交换业务)] | |||
取消交换指定车辆定位信息应答 = 0x9208, | |||
取消交换指定车辆定位信息应答or取消申请交换指定车辆定位信息应答消息 = 0x9208, | |||
///<summary> | |||
///补发车辆定位信息应答 | |||
///DOWN_EXG_MSG_APPLY_HISGNSSDATA_ACK | |||
@@ -0,0 +1,17 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
namespace JT809.Protocol.Enums | |||
{ | |||
/// <summary> | |||
/// 处理结果 | |||
/// </summary> | |||
public enum JT809_0x9201_Result : byte | |||
{ | |||
完成注册_加注释=0x00, | |||
审核通过_完成注册= 0x01, | |||
信息错误_未完成注册= 0x02, | |||
审核没通过_未完成注册= 0x03 | |||
} | |||
} |
@@ -78,6 +78,7 @@ | |||
<Compile Include="Enums\JT809_0x1401_Result.cs" /> | |||
<Compile Include="Enums\JT809_0x1002_Result.cs" /> | |||
<Compile Include="Enums\JT809_0x1007_ErrorCode.cs" /> | |||
<Compile Include="Enums\JT809_0x9201_Result.cs" /> | |||
<Compile Include="Enums\JT809_0x9302_ObjectType.cs" /> | |||
<Compile Include="Enums\JT809_0x9301_ObjectType.cs" /> | |||
<Compile Include="Enums\JT809_0x1301_ObjectType.cs" /> | |||
@@ -1,4 +1,5 @@ | |||
using System; | |||
using JT809.Protocol.Enums; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
@@ -9,7 +10,7 @@ namespace JT809.Protocol.Metadata | |||
/// <summary> | |||
/// 是否使用国测局批准的地图保密插件进行加密 1 已加密 0未加密 | |||
/// </summary> | |||
public byte Encrypt { get; set; } | |||
public JT809_VehiclePositionEncrypt Encrypt { get; set; } | |||
/// <summary> | |||
/// 车辆定位信息数据长度 | |||
/// </summary> | |||
@@ -22,7 +23,7 @@ namespace JT809.Protocol.Metadata | |||
/// <summary> | |||
/// 监控平台唯一编码,由平台所在地行政区域代码和平台编码组成 | |||
/// </summary> | |||
public byte[] PlatformId1 { get; set; } | |||
public byte[] PlatformId1 { get; set; } = new byte[11]; | |||
/// <summary> | |||
/// 报警状态,二进制标识 0 正常 1表示报警 | |||
/// 具体定义按照808-2019中表18的规定 | |||
@@ -32,7 +33,7 @@ namespace JT809.Protocol.Metadata | |||
/// 市级监控平台唯一编码,由平台所在地行政区域代码和平台编码组成 | |||
/// 未填写时,全填0,无市级平台应由省级平台全填1 | |||
/// </summary> | |||
public byte[] PlatformId2 { get; set; } | |||
public byte[] PlatformId2 { get; set; } = new byte[11]; | |||
/// <summary> | |||
/// 报警状态,二进制标识 0 正常 1表示报警 | |||
/// 具体定义按照808-2019中表18的规定 | |||
@@ -42,7 +43,7 @@ namespace JT809.Protocol.Metadata | |||
/// 省级监控平台唯一编码,由平台所在地行政区域代码和平台编码组成 | |||
/// 未填写时,全填0 | |||
/// </summary> | |||
public byte[] PlatformId3 { get; set; } | |||
public byte[] PlatformId3 { get; set; } = new byte[11]; | |||
/// <summary> | |||
/// 报警状态,二进制标识 0 正常 1表示报警 | |||
/// 具体定义按照808-2019中表18的规定 | |||
@@ -1,5 +1,8 @@ | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
@@ -11,12 +14,38 @@ namespace JT809.Protocol.SubMessageBody | |||
/// <para>子业务类型标识:UP_EXG_ MSG_ RETURN_ STARTUP ACK</para> | |||
/// <para>描述:本条消息是下级平台对上级平台下发的 DOWN_EXG_ MSG_ RETURN_STARTUP 消息的应答消息</para> | |||
/// </summary> | |||
public class JT809_0x1200_0x1205:JT809SubBodies | |||
public class JT809_0x1200_0x1205:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1200_0x1205>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.启动车辆定位信息交换应答消息.ToUInt16Value(); | |||
public override string Description => "启动车辆定位信息交换应答消息"; | |||
public override bool SkipSerialization => true; | |||
public override bool SkipSerialization => false; | |||
/// <summary> | |||
/// 对应启动车辆定位信息交换请求消息源子业务类型标识 | |||
/// </summary> | |||
public ushort SourceDataType { get; set; } | |||
/// <summary> | |||
/// 对应启动车辆定位信息交换请求消息源报文序列号 | |||
/// </summary> | |||
public uint SourceMsgSn { get; set; } | |||
public JT809_0x1200_0x1205 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
var value = new JT809_0x1200_0x1205(); | |||
if (config.Version == JT809Version.JTT2019) { | |||
value.SourceDataType = reader.ReadUInt16(); | |||
value.SourceMsgSn = reader.ReadUInt32(); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x1200_0x1205 value, IJT809Config config) | |||
{ | |||
if (config.Version == JT809Version.JTT2019) { | |||
writer.WriteUInt16(value.SourceDataType); | |||
writer.WriteUInt32(value.SourceMsgSn); | |||
} | |||
} | |||
} | |||
} |
@@ -1,5 +1,8 @@ | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.Interfaces; | |||
using JT809.Protocol.MessagePack; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Text; | |||
@@ -10,12 +13,40 @@ namespace JT809.Protocol.SubMessageBody | |||
/// 结束车辆定位信息交换应答消息 | |||
/// <para>子业务类型标识:UP_EXG_MSG_RETURN_END_ACK</para> | |||
/// </summary> | |||
public class JT809_0x1200_0x1206:JT809SubBodies | |||
public class JT809_0x1200_0x1206:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1200_0x1206>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.结束车辆定位信息交换应答消息.ToUInt16Value(); | |||
public override string Description => "结束车辆定位信息交换应答消息"; | |||
public override bool SkipSerialization => true; | |||
public override bool SkipSerialization => false; | |||
/// <summary> | |||
/// 对应结束车辆定位信息交换请求消息源子业务类型标识 | |||
/// </summary> | |||
public ushort SourceDataType { get; set; } | |||
/// <summary> | |||
/// 对应结束车辆定位信息交换请求消息源报文序列号 | |||
/// </summary> | |||
public uint SourceMsgSn { get; set; } | |||
public JT809_0x1200_0x1206 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
var value = new JT809_0x1200_0x1206(); | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
value.SourceDataType = reader.ReadUInt16(); | |||
value.SourceMsgSn = reader.ReadUInt32(); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x1200_0x1206 value, IJT809Config config) | |||
{ | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
writer.WriteUInt16(value.SourceDataType); | |||
writer.WriteUInt32(value.SourceMsgSn); | |||
} | |||
} | |||
} | |||
} |
@@ -2,6 +2,8 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
using System; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
@@ -10,12 +12,20 @@ namespace JT809.Protocol.SubMessageBody | |||
/// <para>子业务类型标识:UP_EXG_MSG_REPORT_DRIVER_INFO_ACK</para> | |||
/// <para>描述:下级平台应答上级平台发送的上报驾驶员身份识别信息请求消息,上传指定车辆的驾驶员身份识别信息数据</para> | |||
/// </summary> | |||
public class JT809_0x1200_0x120A:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1200_0x120A> | |||
public class JT809_0x1200_0x120A:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1200_0x120A>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.上报驾驶员身份识别信息应答消息.ToUInt16Value(); | |||
public override string Description => "上报驾驶员身份识别信息应答消息"; | |||
/// <summary> | |||
/// 对应上报驾驶员身份请求信息源子业务类型标识 | |||
/// </summary> | |||
public ushort SourceDataType { get; set; } | |||
/// <summary> | |||
/// 对应上报驾驶员身份请求消息源报文序列号 | |||
/// </summary> | |||
public uint SourceMsgSn { get; set; } | |||
/// <summary> | |||
/// 驾驶员姓名 | |||
/// </summary> | |||
public string DriverName { get; set; } | |||
@@ -31,23 +41,43 @@ namespace JT809.Protocol.SubMessageBody | |||
/// 发证机构名称(备用) | |||
/// </summary> | |||
public string OrgName { get; set; } | |||
/// <summary> | |||
/// 证件有效期,时分秒均用0表示 | |||
/// </summary> | |||
public DateTime ValidDate { get; set; } | |||
public JT809_0x1200_0x120A Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_0x1200_0x120A jT809_0X1200_0X120A = new JT809_0x1200_0x120A(); | |||
if (config.Version == JT809Version.JTT2019) { | |||
jT809_0X1200_0X120A.SourceDataType = reader.ReadUInt16(); | |||
jT809_0X1200_0X120A.SourceMsgSn = reader.ReadUInt32(); | |||
} | |||
jT809_0X1200_0X120A.DriverName = reader.ReadString(16); | |||
jT809_0X1200_0X120A.DriverID = reader.ReadString(20); | |||
jT809_0X1200_0X120A.Licence = reader.ReadString(40); | |||
jT809_0X1200_0X120A.OrgName = reader.ReadString(200); | |||
if (config.Version == JT809Version.JTT2019) { | |||
jT809_0X1200_0X120A.ValidDate = reader.ReadUTCDateTime(); | |||
} | |||
return jT809_0X1200_0X120A; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x1200_0x120A value, IJT809Config config) | |||
{ | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
writer.WriteUInt16(value.SourceDataType); | |||
writer.WriteUInt32(value.SourceMsgSn); | |||
} | |||
writer.WriteStringPadRight(value.DriverName, 16); | |||
writer.WriteStringPadRight(value.DriverID, 20); | |||
writer.WriteStringPadRight(value.Licence, 40); | |||
writer.WriteStringPadRight(value.OrgName, 200); | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
writer.WriteUTCDateTime(value.ValidDate); | |||
} | |||
} | |||
} | |||
} |
@@ -2,6 +2,7 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
@@ -10,12 +11,20 @@ namespace JT809.Protocol.SubMessageBody | |||
/// <para>子业务类型标识:UP_CXG_MSG_TAKE_EWAYBILL_ACK</para> | |||
/// <para>描述:下级平台应答上级平台发送的上报车辆电子运单请求消息,向上级平台上传车辆当前电子运单</para> | |||
/// </summary> | |||
public class JT809_0x1200_0x120B:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1200_0x120B> | |||
public class JT809_0x1200_0x120B:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1200_0x120B>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.上报车辆电子运单应答消息.ToUInt16Value(); | |||
public override string Description => "上报车辆电子运单应答消息"; | |||
/// <summary> | |||
/// 对应上报车辆电子运单源子业务类型标识 | |||
/// </summary> | |||
public ushort SourceDataType { get; set; } | |||
/// <summary> | |||
/// 对应上报车辆电子运单源报文序列号 | |||
/// </summary> | |||
public uint SourceMsgSn { get; set; } | |||
/// <summary> | |||
/// 电子运单数据体长度 | |||
/// </summary> | |||
public uint EwaybillLength { get; set; } | |||
@@ -25,14 +34,24 @@ namespace JT809.Protocol.SubMessageBody | |||
public string EwaybillInfo { get; set; } | |||
public JT809_0x1200_0x120B Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_0x1200_0x120B jT809_0X1200_0X120B = new JT809_0x1200_0x120B(); | |||
jT809_0X1200_0X120B.EwaybillLength = reader.ReadUInt32(); | |||
jT809_0X1200_0X120B.EwaybillInfo = reader.ReadString((int)jT809_0X1200_0X120B.EwaybillLength); | |||
return jT809_0X1200_0X120B; | |||
var value = new JT809_0x1200_0x120B(); | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
value.SourceDataType = reader.ReadUInt16(); | |||
value.SourceMsgSn = reader.ReadUInt32(); | |||
} | |||
value.EwaybillLength = reader.ReadUInt32(); | |||
value.EwaybillInfo = reader.ReadString((int)value.EwaybillLength); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x1200_0x120B value, IJT809Config config) | |||
{ | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
writer.WriteUInt16(value.SourceDataType); | |||
writer.WriteUInt32(value.SourceMsgSn); | |||
} | |||
writer.WriteUInt32((uint)value.EwaybillInfo.Length); | |||
writer.WriteString(value.EwaybillInfo); | |||
} | |||
@@ -2,6 +2,7 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
@@ -9,7 +10,7 @@ namespace JT809.Protocol.SubMessageBody | |||
/// 主动上报驾驶员身份信息消息 | |||
/// <para>子业务类型标识:UP_EXG_MSG_REPORT_DRIVER_INFO</para> | |||
/// </summary> | |||
public class JT809_0x1200_0x120C:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1200_0x120C> | |||
public class JT809_0x1200_0x120C:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1200_0x120C>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.主动上报驾驶员身份信息消息.ToUInt16Value(); | |||
@@ -2,6 +2,7 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
@@ -9,7 +10,7 @@ namespace JT809.Protocol.SubMessageBody | |||
/// 主动上报车辆电子运单信息 | |||
/// <para>子业务类型标识:UP_EXG_MSG_REPORT_EWAYBILL_INFO</para> | |||
/// </summary> | |||
public class JT809_0x1200_0x120D:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1200_0x120D> | |||
public class JT809_0x1200_0x120D:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1200_0x120D>,IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.主动上报车辆电子运单信息.ToUInt16Value(); | |||
@@ -2,6 +2,7 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
@@ -10,25 +11,48 @@ namespace JT809.Protocol.SubMessageBody | |||
/// <para>子业务类型标识:UP_PLATFORM_MSG_INFO_ACK</para> | |||
/// <para>描述:下级平台收到上级平台发送的下发平台间报文请求消息后,发送应答消息</para> | |||
/// </summary> | |||
public class JT809_0x1300_0x1302:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1300_0x1302> | |||
public class JT809_0x1300_0x1302:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1300_0x1302>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.下发平台间报文应答消息.ToUInt16Value(); | |||
public override string Description => "下发平台间报文应答消息"; | |||
/// <summary> | |||
/// 对应下发平台间报文请求消息源子业务类型标识 | |||
/// </summary> | |||
public ushort SourceDataType { get; set; } | |||
/// <summary> | |||
/// 对应下发平台间报文请求消息源报文序列号 | |||
/// </summary> | |||
public uint SourceMsgSn { get; set; } | |||
/// <summary> | |||
/// 信息ID | |||
/// </summary> | |||
public uint InfoID { get; set; } | |||
public JT809_0x1300_0x1302 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_0x1300_0x1302 jT809_0X1200_0X1302 = new JT809_0x1300_0x1302(); | |||
jT809_0X1200_0X1302.InfoID = reader.ReadUInt32(); | |||
return jT809_0X1200_0X1302; | |||
JT809_0x1300_0x1302 value = new JT809_0x1300_0x1302(); | |||
if (config.Version == JT809Version.JTT2019) { | |||
value.SourceDataType = reader.ReadUInt16(); | |||
value.SourceMsgSn = reader.ReadUInt32(); | |||
} | |||
else | |||
{ | |||
value.InfoID = reader.ReadUInt32(); | |||
} | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x1300_0x1302 value, IJT809Config config) | |||
{ | |||
writer.WriteUInt32(value.InfoID); | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
writer.WriteUInt16(value.SourceDataType); | |||
writer.WriteUInt32(value.SourceMsgSn); | |||
} | |||
else { | |||
writer.WriteUInt32(value.InfoID); | |||
} | |||
} | |||
} | |||
} |
@@ -2,6 +2,7 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
@@ -10,12 +11,20 @@ namespace JT809.Protocol.SubMessageBody | |||
/// <para>子业务类型标识:UP_CTRL_MSG_TEXT_INFO_ACK</para> | |||
/// <para>描述:下级平台应答上级平台下发的报文是否成功到达指定车辆</para> | |||
/// </summary> | |||
public class JT809_0x1500_0x1503:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1500_0x1503> | |||
public class JT809_0x1500_0x1503:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1500_0x1503>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.下发车辆报文应答消息.ToUInt16Value(); | |||
public override string Description => "下发车辆报文应答消息"; | |||
/// <summary> | |||
/// 对应下发车辆报文请求消息源子业务类型标识 | |||
/// </summary> | |||
public ushort SourceDataType { get; set; } | |||
/// <summary> | |||
/// 对应下发车辆报文请求消息源报文序列号 | |||
/// </summary> | |||
public uint SourceMsgSn { get; set; } | |||
/// <summary> | |||
/// 消息ID | |||
/// 对应“下发车辆报文请求消息”中的MSG_ID | |||
/// </summary> | |||
@@ -26,15 +35,32 @@ namespace JT809.Protocol.SubMessageBody | |||
public JT809_0x1503_Result Result { get; set; } | |||
public JT809_0x1500_0x1503 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_0x1500_0x1503 jT809_0X1500_0X1503 = new JT809_0x1500_0x1503(); | |||
jT809_0X1500_0X1503.MsgID = reader.ReadUInt32(); | |||
jT809_0X1500_0X1503.Result = (JT809_0x1503_Result)reader.ReadByte(); | |||
return jT809_0X1500_0X1503; | |||
JT809_0x1500_0x1503 value = new JT809_0x1500_0x1503(); | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
value.SourceDataType = reader.ReadUInt16(); | |||
value.SourceMsgSn = reader.ReadUInt32(); | |||
} | |||
else | |||
{ | |||
value.MsgID = reader.ReadUInt32(); | |||
} | |||
value.Result = (JT809_0x1503_Result)reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x1500_0x1503 value, IJT809Config config) | |||
{ | |||
writer.WriteUInt32(value.MsgID); | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
writer.WriteUInt16(value.SourceDataType); | |||
writer.WriteUInt32(value.SourceMsgSn); | |||
} | |||
else | |||
{ | |||
writer.WriteUInt32(value.MsgID); | |||
} | |||
writer.WriteByte((byte)value.Result); | |||
} | |||
} | |||
@@ -2,6 +2,7 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
@@ -10,12 +11,21 @@ namespace JT809.Protocol.SubMessageBody | |||
/// <para>子业务类型标识:UP_CTRL_MSG_TAKE_T'RAVEL_ACK</para> | |||
/// <para>描述:下级平台应答上级平台下发的上报车辆行驶记录请求消息,将车辆行驶记录数据上传至上级平台</para> | |||
/// </summary> | |||
public class JT809_0x1500_0x1504:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1500_0x1504> | |||
public class JT809_0x1500_0x1504:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1500_0x1504>, IJT809_2019_Version | |||
{ | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.上报车辆行驶记录应答消息.ToUInt16Value(); | |||
public override string Description => "上报车辆行驶记录应答消息"; | |||
/// <summary> | |||
/// 对应上报车辆行驶记录请求消息源子业务类型标识 | |||
/// </summary> | |||
public ushort SourceDataType { get; set; } | |||
/// <summary> | |||
/// 对应上报车辆行驶记录请求消息源报文序列号 | |||
/// </summary> | |||
public uint SourceMsgSn { get; set; } | |||
/// <summary> | |||
/// 命令字 | |||
/// </summary> | |||
public JT809CommandType CommandType { get; set; } | |||
@@ -29,15 +39,26 @@ namespace JT809.Protocol.SubMessageBody | |||
public string TraveldataInfo { get; set; } | |||
public JT809_0x1500_0x1504 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_0x1500_0x1504 jT809_0X1500_0X1504 = new JT809_0x1500_0x1504(); | |||
jT809_0X1500_0X1504.CommandType = (JT809CommandType)reader.ReadByte(); | |||
jT809_0X1500_0X1504.TraveldataLength = reader.ReadUInt32(); | |||
jT809_0X1500_0X1504.TraveldataInfo = reader.ReadString((int)jT809_0X1500_0X1504.TraveldataLength); | |||
return jT809_0X1500_0X1504; | |||
JT809_0x1500_0x1504 value = new JT809_0x1500_0x1504(); | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
value.SourceDataType = reader.ReadUInt16(); | |||
value.SourceMsgSn = reader.ReadUInt32(); | |||
} | |||
value.CommandType = (JT809CommandType)reader.ReadByte(); | |||
value.TraveldataLength = reader.ReadUInt32(); | |||
value.TraveldataInfo = reader.ReadString((int)value.TraveldataLength); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x1500_0x1504 value, IJT809Config config) | |||
{ | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
writer.WriteUInt16(value.SourceDataType); | |||
writer.WriteUInt32(value.SourceMsgSn); | |||
} | |||
writer.WriteByte((byte)value.CommandType); | |||
// 先计算内容长度(汉字为两个字节) | |||
writer.Skip(4, out int lengthPosition); | |||
@@ -2,6 +2,7 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
@@ -10,24 +11,42 @@ namespace JT809.Protocol.SubMessageBody | |||
/// <para>子业务类型标识: UP_CTRL_MSG_EMERGENCY_MONITORING_ACK</para> | |||
/// <para>描述:下级平台应答上级平台下发的车辆应急接入监管平台请求消息应答</para> | |||
/// </summary> | |||
public class JT809_0x1500_0x1505:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1500_0x1505> | |||
public class JT809_0x1500_0x1505:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1500_0x1505>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.车辆应急接入监管平台应答消息.ToUInt16Value(); | |||
public override string Description => "车辆应急接入监管平台应答消息"; | |||
/// <summary> | |||
/// 对应车辆应急接入监管平台请求消息源子业务类型标识 | |||
/// </summary> | |||
public ushort SourceDataType { get; set; } | |||
/// <summary> | |||
/// 对应车辆应急接入监管平台请求消息源报文序列号 | |||
/// </summary> | |||
public uint SourceMsgSn { get; set; } | |||
/// <summary> | |||
/// 应答结果 | |||
/// </summary> | |||
public JT809_0x1505_Result Result { get; set; } | |||
public JT809_0x1500_0x1505 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_0x1500_0x1505 jT809_0X1500_0X1505 = new JT809_0x1500_0x1505(); | |||
jT809_0X1500_0X1505.Result = (JT809_0x1505_Result)reader.ReadByte(); | |||
return jT809_0X1500_0X1505; | |||
JT809_0x1500_0x1505 value = new JT809_0x1500_0x1505(); | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
value.SourceDataType = reader.ReadUInt16(); | |||
value.SourceMsgSn = reader.ReadUInt32(); | |||
} | |||
value.Result = (JT809_0x1505_Result)reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x1500_0x1505 value, IJT809Config config) | |||
{ | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
writer.WriteUInt16(value.SourceDataType); | |||
writer.WriteUInt32(value.SourceMsgSn); | |||
} | |||
writer.WriteByte((byte)value.Result); | |||
} | |||
} | |||
@@ -2,6 +2,7 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
@@ -10,24 +11,42 @@ namespace JT809.Protocol.SubMessageBody | |||
/// <para>子业务类型标识:UP_BASE_MSG_VEHICLE_ADDED_ACK</para> | |||
/// <para>描述:上级平台应答下级平台发送的补报车辆静态信息清求消息</para> | |||
/// </summary> | |||
public class JT809_0x1600_0x1601:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1600_0x1601> | |||
public class JT809_0x1600_0x1601:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1600_0x1601>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.补报车辆静态信息应答.ToUInt16Value(); | |||
public override string Description => "补报车辆静态信息应答"; | |||
/// <summary> | |||
/// 对应补报车辆静态信息请求消息源子业务类型标识 | |||
/// </summary> | |||
public ushort SourceDataType { get; set; } | |||
/// <summary> | |||
/// 对应补报车辆静态信息请求消息源报文序列号 | |||
/// </summary> | |||
public uint SourceMsgSn { get; set; } | |||
/// <summary> | |||
/// 车辆信息 | |||
/// </summary> | |||
public string CarInfo { get; set; } | |||
public JT809_0x1600_0x1601 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_0x1600_0x1601 jT809_0X9600_0X1601 = new JT809_0x1600_0x1601(); | |||
jT809_0X9600_0X1601.CarInfo = reader.ReadRemainStringContent(); | |||
return jT809_0X9600_0X1601; | |||
JT809_0x1600_0x1601 value = new JT809_0x1600_0x1601(); | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
value.SourceDataType = reader.ReadUInt16(); | |||
value.SourceMsgSn = reader.ReadUInt32(); | |||
} | |||
value.CarInfo = reader.ReadRemainStringContent(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x1600_0x1601 value, IJT809Config config) | |||
{ | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
writer.WriteUInt16(value.SourceDataType); | |||
writer.WriteUInt32(value.SourceMsgSn); | |||
} | |||
writer.WriteString(value.CarInfo); | |||
} | |||
} | |||
@@ -0,0 +1,42 @@ | |||
using JT809.Protocol.Enums; | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
/// <summary> | |||
/// 车辆注册信息应答消息 | |||
/// <para>子业务类型标识:DOWN_EXG_MSG_REGISTER_ACK</para> | |||
/// <para>描述:上级平台在收到下级平台上报的车辆注册信息后,向下级平台发送车辆注册应答消息</para> | |||
/// </summary> | |||
public class JT809_0x9200_0x9201:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x9200_0x9201>,IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.车辆注册信息应答消息.ToUInt16Value(); | |||
public override string Description => "车辆注册信息应答消息"; | |||
/// <summary> | |||
/// 车辆注册信息消息源报文序号 | |||
/// </summary> | |||
public uint MsgSn { get; set; } | |||
/// <summary> | |||
/// 处理结果 | |||
/// </summary> | |||
public JT809_0x9201_Result Result { get; set; } | |||
public JT809_0x9200_0x9201 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
var value = new JT809_0x9200_0x9201(); | |||
value.MsgSn = reader.ReadUInt32(); | |||
value.Result = (JT809_0x9201_Result)reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x9200_0x9201 value, IJT809Config config) | |||
{ | |||
writer.WriteUInt32(value.MsgSn); | |||
writer.WriteByte((byte)value.Result); | |||
} | |||
} | |||
} |
@@ -3,6 +3,7 @@ using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Metadata; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
@@ -11,60 +12,90 @@ namespace JT809.Protocol.SubMessageBody | |||
/// <para>子业务类型标识:DOWN_EXG_MSG_CAR_LOCATION</para> | |||
/// <para>描述:上级平台通过该消息不间断地向车辆驶入区域所属的下级平台发送车辆定位信息,直到该车驶离该区域</para> | |||
/// </summary> | |||
public class JT809_0x9200_0x9202:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x9200_0x9202> | |||
public class JT809_0x9200_0x9202:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x9200_0x9202>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.交换车辆定位信息消息.ToUInt16Value(); | |||
public override string Description => "交换车辆定位信息消息"; | |||
public JT809_0x9200_0x9202() | |||
{ | |||
VehiclePosition = new JT809VehiclePositionProperties(); | |||
} | |||
/// <summary> | |||
/// 车辆定位信息 | |||
/// </summary> | |||
public JT809VehiclePositionProperties VehiclePosition { get; set; } | |||
public JT809VehiclePositionProperties_2019 GNSSData { get; set; } | |||
public JT809_0x9200_0x9202 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_0x9200_0x9202 jT809_0X1200_0x9202 = new JT809_0x9200_0x9202(); | |||
jT809_0X1200_0x9202.VehiclePosition.Encrypt = (JT809_VehiclePositionEncrypt)reader.ReadByte(); | |||
jT809_0X1200_0x9202.VehiclePosition.Day = reader.ReadByte(); | |||
jT809_0X1200_0x9202.VehiclePosition.Month = reader.ReadByte(); | |||
jT809_0X1200_0x9202.VehiclePosition.Year = reader.ReadUInt16(); | |||
jT809_0X1200_0x9202.VehiclePosition.Hour = reader.ReadByte(); | |||
jT809_0X1200_0x9202.VehiclePosition.Minute = reader.ReadByte(); | |||
jT809_0X1200_0x9202.VehiclePosition.Second = reader.ReadByte(); | |||
jT809_0X1200_0x9202.VehiclePosition.Lon = reader.ReadUInt32(); | |||
jT809_0X1200_0x9202.VehiclePosition.Lat = reader.ReadUInt32(); | |||
jT809_0X1200_0x9202.VehiclePosition.Vec1 = reader.ReadUInt16(); | |||
jT809_0X1200_0x9202.VehiclePosition.Vec2 = reader.ReadUInt16(); | |||
jT809_0X1200_0x9202.VehiclePosition.Vec3 = reader.ReadUInt32(); | |||
jT809_0X1200_0x9202.VehiclePosition.Direction = reader.ReadUInt16(); | |||
jT809_0X1200_0x9202.VehiclePosition.Altitude = reader.ReadUInt16(); | |||
jT809_0X1200_0x9202.VehiclePosition.State = reader.ReadUInt32(); | |||
jT809_0X1200_0x9202.VehiclePosition.Alarm = reader.ReadUInt32(); | |||
if (config.Version == JT809Version.JTT2013) | |||
{ | |||
jT809_0X1200_0x9202.VehiclePosition = new JT809VehiclePositionProperties(); | |||
jT809_0X1200_0x9202.VehiclePosition.Encrypt = (JT809_VehiclePositionEncrypt)reader.ReadByte(); | |||
jT809_0X1200_0x9202.VehiclePosition.Day = reader.ReadByte(); | |||
jT809_0X1200_0x9202.VehiclePosition.Month = reader.ReadByte(); | |||
jT809_0X1200_0x9202.VehiclePosition.Year = reader.ReadUInt16(); | |||
jT809_0X1200_0x9202.VehiclePosition.Hour = reader.ReadByte(); | |||
jT809_0X1200_0x9202.VehiclePosition.Minute = reader.ReadByte(); | |||
jT809_0X1200_0x9202.VehiclePosition.Second = reader.ReadByte(); | |||
jT809_0X1200_0x9202.VehiclePosition.Lon = reader.ReadUInt32(); | |||
jT809_0X1200_0x9202.VehiclePosition.Lat = reader.ReadUInt32(); | |||
jT809_0X1200_0x9202.VehiclePosition.Vec1 = reader.ReadUInt16(); | |||
jT809_0X1200_0x9202.VehiclePosition.Vec2 = reader.ReadUInt16(); | |||
jT809_0X1200_0x9202.VehiclePosition.Vec3 = reader.ReadUInt32(); | |||
jT809_0X1200_0x9202.VehiclePosition.Direction = reader.ReadUInt16(); | |||
jT809_0X1200_0x9202.VehiclePosition.Altitude = reader.ReadUInt16(); | |||
jT809_0X1200_0x9202.VehiclePosition.State = reader.ReadUInt32(); | |||
jT809_0X1200_0x9202.VehiclePosition.Alarm = reader.ReadUInt32(); | |||
} | |||
else | |||
{ | |||
jT809_0X1200_0x9202.GNSSData = new JT809VehiclePositionProperties_2019(); | |||
jT809_0X1200_0x9202.GNSSData.Encrypt = (JT809_VehiclePositionEncrypt)reader.ReadByte(); | |||
jT809_0X1200_0x9202.GNSSData.DataLength = reader.ReadUInt32(); | |||
jT809_0X1200_0x9202.GNSSData.GnssData = reader.ReadArray((int)jT809_0X1200_0x9202.GNSSData.DataLength).ToArray(); | |||
jT809_0X1200_0x9202.GNSSData.PlatformId1 = reader.ReadArray(11).ToArray(); | |||
jT809_0X1200_0x9202.GNSSData.Alarm1 = reader.ReadUInt32(); | |||
jT809_0X1200_0x9202.GNSSData.PlatformId2 = reader.ReadArray(11).ToArray(); | |||
jT809_0X1200_0x9202.GNSSData.Alarm2 = reader.ReadUInt32(); | |||
jT809_0X1200_0x9202.GNSSData.PlatformId3 = reader.ReadArray(11).ToArray(); | |||
jT809_0X1200_0x9202.GNSSData.Alarm3 = reader.ReadUInt32(); | |||
} | |||
return jT809_0X1200_0x9202; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x9200_0x9202 value, IJT809Config config) | |||
{ | |||
writer.WriteByte((byte)value.VehiclePosition.Encrypt); | |||
writer.WriteByte(value.VehiclePosition.Day); | |||
writer.WriteByte(value.VehiclePosition.Month); | |||
writer.WriteUInt16(value.VehiclePosition.Year); | |||
writer.WriteByte(value.VehiclePosition.Hour); | |||
writer.WriteByte(value.VehiclePosition.Minute); | |||
writer.WriteByte(value.VehiclePosition.Second); | |||
writer.WriteUInt32(value.VehiclePosition.Lon); | |||
writer.WriteUInt32(value.VehiclePosition.Lat); | |||
writer.WriteUInt16(value.VehiclePosition.Vec1); | |||
writer.WriteUInt16(value.VehiclePosition.Vec2); | |||
writer.WriteUInt32(value.VehiclePosition.Vec3); | |||
writer.WriteUInt16(value.VehiclePosition.Direction); | |||
writer.WriteUInt16(value.VehiclePosition.Altitude); | |||
writer.WriteUInt32(value.VehiclePosition.State); | |||
writer.WriteUInt32(value.VehiclePosition.Alarm); | |||
if (config.Version == JT809Version.JTT2013) | |||
{ | |||
writer.WriteByte((byte)value.VehiclePosition.Encrypt); | |||
writer.WriteByte(value.VehiclePosition.Day); | |||
writer.WriteByte(value.VehiclePosition.Month); | |||
writer.WriteUInt16(value.VehiclePosition.Year); | |||
writer.WriteByte(value.VehiclePosition.Hour); | |||
writer.WriteByte(value.VehiclePosition.Minute); | |||
writer.WriteByte(value.VehiclePosition.Second); | |||
writer.WriteUInt32(value.VehiclePosition.Lon); | |||
writer.WriteUInt32(value.VehiclePosition.Lat); | |||
writer.WriteUInt16(value.VehiclePosition.Vec1); | |||
writer.WriteUInt16(value.VehiclePosition.Vec2); | |||
writer.WriteUInt32(value.VehiclePosition.Vec3); | |||
writer.WriteUInt16(value.VehiclePosition.Direction); | |||
writer.WriteUInt16(value.VehiclePosition.Altitude); | |||
writer.WriteUInt32(value.VehiclePosition.State); | |||
writer.WriteUInt32(value.VehiclePosition.Alarm); | |||
} | |||
else { | |||
writer.WriteByte((byte)value.GNSSData.Encrypt); | |||
writer.Skip(4, out int position); | |||
writer.WriteArray(value.GNSSData.GnssData); | |||
writer.WriteArray(value.GNSSData.PlatformId1); | |||
writer.WriteUInt32(value.GNSSData.Alarm1); | |||
writer.WriteArray(value.GNSSData.PlatformId2); | |||
writer.WriteUInt32(value.GNSSData.Alarm2); | |||
writer.WriteArray(value.GNSSData.PlatformId3); | |||
writer.WriteUInt32(value.GNSSData.Alarm3); | |||
writer.WriteUInt32Return((uint)(writer.GetCurrentPosition() - position-4), position); | |||
} | |||
} | |||
} | |||
} |
@@ -2,6 +2,7 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
@@ -10,24 +11,42 @@ namespace JT809.Protocol.SubMessageBody | |||
/// <para>子业务类型标识:DOWN_EXG_MSG_APPLY_FOR_MONITOR_STARTUP_ACK</para> | |||
/// <para>描述:应答下级平台申请交换指定车辆定位信息,请求消息."即 UP_EXG_MSG_APPLY_FOR_MONITOR_STARTUP</para> | |||
/// </summary> | |||
public class JT809_0x9200_0x9207:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x9200_0x9207> | |||
public class JT809_0x9200_0x9207:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x9200_0x9207>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.申请交换指定车辆定位信息应答.ToUInt16Value(); | |||
public override string Description => "申请交换指定车辆定位信息应答"; | |||
/// <summary> | |||
/// 对应申请交换指定车辆定位信息请求消息源子业务类型标识 | |||
/// </summary> | |||
public ushort SourceDataType { get; set; } | |||
/// <summary> | |||
/// 对应申请交换指定车辆定位信息请求消息源报文序列号 | |||
/// </summary> | |||
public uint SourceMsgSn { get; set; } | |||
/// <summary> | |||
/// 返回结果 | |||
/// </summary> | |||
public JT809_0x9207_Result Result { get; set; } | |||
public JT809_0x9200_0x9207 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_0x9200_0x9207 jT809_0X1200_0x9207 = new JT809_0x9200_0x9207(); | |||
jT809_0X1200_0x9207.Result = (JT809_0x9207_Result)reader.ReadByte(); | |||
return jT809_0X1200_0x9207; | |||
var value = new JT809_0x9200_0x9207(); | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
value.SourceDataType = reader.ReadUInt16(); | |||
value.SourceMsgSn = reader.ReadUInt32(); | |||
} | |||
value.Result = (JT809_0x9207_Result)reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x9200_0x9207 value, IJT809Config config) | |||
{ | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
writer.WriteUInt16(value.SourceDataType); | |||
writer.WriteUInt32(value.SourceMsgSn); | |||
} | |||
writer.WriteByte((byte)value.Result); | |||
} | |||
} | |||
@@ -2,18 +2,27 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
/// <summary> | |||
/// 取消交换指定车辆定位信息应答 | |||
/// 取消交换指定车辆定位信息应答or取消申请交换指定车辆定位信息应答消息 | |||
/// <para>子业务类型标识:DOWN_EXG_MSG_APPLY_FOR_MONITOR_END_ACK</para> | |||
/// </summary> | |||
public class JT809_0x9200_0x9208:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x9200_0x9208> | |||
public class JT809_0x9200_0x9208:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x9200_0x9208>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.取消交换指定车辆定位信息应答.ToUInt16Value(); | |||
public override ushort SubMsgId => JT809SubBusinessType.取消交换指定车辆定位信息应答or取消申请交换指定车辆定位信息应答消息.ToUInt16Value(); | |||
public override string Description => "取消交换指定车辆定位信息应答"; | |||
public override string Description => "取消交换指定车辆定位信息应答or取消申请交换指定车辆定位信息应答消息"; | |||
/// <summary> | |||
/// 对应取消申请交换指定车辆定位信息请求消息源子业务类型标识 | |||
/// </summary> | |||
public ushort SourceDataType { get; set; } | |||
/// <summary> | |||
/// 对应取消申请交换指定车辆定位信息请求消息源报文序列号 | |||
/// </summary> | |||
public uint SourceMsgSn { get; set; } | |||
/// <summary> | |||
/// 返回结果 | |||
/// </summary> | |||
@@ -21,13 +30,23 @@ namespace JT809.Protocol.SubMessageBody | |||
public JT809_0x9200_0x9208 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_0x9200_0x9208 jT809_0X1200_0x9208 = new JT809_0x9200_0x9208(); | |||
jT809_0X1200_0x9208.Result = (JT809_0x9208_Result)reader.ReadByte(); | |||
return jT809_0X1200_0x9208; | |||
var value = new JT809_0x9200_0x9208(); | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
value.SourceDataType = reader.ReadUInt16(); | |||
value.SourceMsgSn = reader.ReadUInt32(); | |||
} | |||
value.Result = (JT809_0x9208_Result)reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x9200_0x9208 value, IJT809Config config) | |||
{ | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
writer.WriteUInt16(value.SourceDataType); | |||
writer.WriteUInt32(value.SourceMsgSn); | |||
} | |||
writer.WriteByte((byte)value.Result); | |||
} | |||
} | |||
@@ -2,32 +2,51 @@ | |||
using JT809.Protocol.Formatters; | |||
using JT809.Protocol.MessagePack; | |||
using JT809.Protocol.Extensions; | |||
using JT809.Protocol.Interfaces; | |||
namespace JT809.Protocol.SubMessageBody | |||
{ | |||
/// <summary> | |||
/// 补发车辆定位信息应答 | |||
/// <para>子业务类型标识:DOWN_EXG_MSG_APPLY_FOR_MONITOR_END_ACK</para> | |||
/// <para>子业务类型标识:DOWN_EXG_MSG_APPLY_HISGNSSDATA_ACK</para> | |||
/// </summary> | |||
public class JT809_0x9200_0x9209: JT809SubBodies, IJT809MessagePackFormatter<JT809_0x9200_0x9209> | |||
public class JT809_0x9200_0x9209: JT809SubBodies, IJT809MessagePackFormatter<JT809_0x9200_0x9209>, IJT809_2019_Version | |||
{ | |||
public override ushort SubMsgId => JT809SubBusinessType.补发车辆定位信息应答.ToUInt16Value(); | |||
public override string Description => "补发车辆定位信息应答"; | |||
/// <summary> | |||
/// 对应补发车辆定位信息请求消息源子业务类型标识 | |||
/// </summary> | |||
public ushort SourceDataType { get; set; } | |||
/// <summary> | |||
/// 对应补发车辆定位信息请求消息源报文序列号 | |||
/// </summary> | |||
public uint SourceMsgSn { get; set; } | |||
/// <summary> | |||
/// 返回结果 | |||
/// </summary> | |||
public JT809_0x9209_Result Result { get; set; } | |||
public JT809_0x9200_0x9209 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||
{ | |||
JT809_0x9200_0x9209 jT809_0X1200_0x9209 = new JT809_0x9200_0x9209(); | |||
jT809_0X1200_0x9209.Result = (JT809_0x9209_Result)reader.ReadByte(); | |||
return jT809_0X1200_0x9209; | |||
var value = new JT809_0x9200_0x9209(); | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
value.SourceDataType = reader.ReadUInt16(); | |||
value.SourceMsgSn = reader.ReadUInt32(); | |||
} | |||
value.Result = (JT809_0x9209_Result)reader.ReadByte(); | |||
return value; | |||
} | |||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x9200_0x9209 value, IJT809Config config) | |||
{ | |||
if (config.Version == JT809Version.JTT2019) | |||
{ | |||
writer.WriteUInt16(value.SourceDataType); | |||
writer.WriteUInt32(value.SourceMsgSn); | |||
} | |||
writer.WriteByte((byte)value.Result); | |||
} | |||
} | |||