@@ -22,7 +22,7 @@ namespace JT809.Protocol.Test.JT809SubMessageBody | |||||
Command= JT809CommandType.采集记录仪事故疑点记录, | Command= JT809CommandType.采集记录仪事故疑点记录, | ||||
StartTime=DateTime.Parse("2018-09-27 20:00:20"), | StartTime=DateTime.Parse("2018-09-27 20:00:20"), | ||||
EndTime=DateTime.Parse("2018-09-27 23:00:20"), | EndTime=DateTime.Parse("2018-09-27 23:00:20"), | ||||
//Max=5556 | |||||
Max=5556 | |||||
}; | }; | ||||
var hex = JT809Serializer.Serialize(jT809_0X9500_0X9504).ToHexString(); | var hex = JT809Serializer.Serialize(jT809_0X9500_0X9504).ToHexString(); | ||||
//"10 18 09 27 20 00 20 18 09 27 23 00 20 15 B4" | //"10 18 09 27 20 00 20 18 09 27 23 00 20 15 B4" | ||||
@@ -223,7 +223,7 @@ namespace JT809.Protocol.Enums | |||||
[Description("车辆行驶线路请求应答")] | [Description("车辆行驶线路请求应答")] | ||||
[JT809BodiesType(typeof(JT809_0x9200_0x920D))] | [JT809BodiesType(typeof(JT809_0x9200_0x920D))] | ||||
[JT809SubBusinessTypeDescription("DOWN_BASE_MSG_DRVLINE_ACK", "车辆行驶线路请求应答", JT809BusinessType.从链路车辆动态信息交换业务)] | [JT809SubBusinessTypeDescription("DOWN_BASE_MSG_DRVLINE_ACK", "车辆行驶线路请求应答", JT809BusinessType.从链路车辆动态信息交换业务)] | ||||
车辆行驶线路请求应答 = 0x920B, | |||||
车辆行驶线路请求应答 = 0x920D, | |||||
#endregion | #endregion | ||||
#region 主链路平台信息交互消息 UP_PLATFORM_MSG | #region 主链路平台信息交互消息 UP_PLATFORM_MSG | ||||
@@ -0,0 +1,12 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT809.Protocol.Enums | |||||
{ | |||||
public enum JT809_0x920A_UploadFlag:byte | |||||
{ | |||||
最近收到的消息=0x00, | |||||
从终端获取=0x01 | |||||
} | |||||
} |
@@ -78,6 +78,7 @@ | |||||
<Compile Include="Enums\JT809_0x1401_Result.cs" /> | <Compile Include="Enums\JT809_0x1401_Result.cs" /> | ||||
<Compile Include="Enums\JT809_0x1002_Result.cs" /> | <Compile Include="Enums\JT809_0x1002_Result.cs" /> | ||||
<Compile Include="Enums\JT809_0x1007_ErrorCode.cs" /> | <Compile Include="Enums\JT809_0x1007_ErrorCode.cs" /> | ||||
<Compile Include="Enums\JT809_0x920A_UploadFlag.cs" /> | |||||
<Compile Include="Enums\JT809_0x9201_Result.cs" /> | <Compile Include="Enums\JT809_0x9201_Result.cs" /> | ||||
<Compile Include="Enums\JT809_0x9302_ObjectType.cs" /> | <Compile Include="Enums\JT809_0x9302_ObjectType.cs" /> | ||||
<Compile Include="Enums\JT809_0x9301_ObjectType.cs" /> | <Compile Include="Enums\JT809_0x9301_ObjectType.cs" /> | ||||
@@ -82,7 +82,7 @@ namespace JT809.Protocol.SubMessageBody | |||||
} | } | ||||
value.WarnType = (JT809WarnType)reader.ReadUInt16(); | value.WarnType = (JT809WarnType)reader.ReadUInt16(); | ||||
value.WarnTime = reader.ReadUTCDateTime(); | value.WarnTime = reader.ReadUTCDateTime(); | ||||
if (config.Version != JT809Version.JTT2013) | |||||
if (config.Version == JT809Version.JTT2013) | |||||
{ | { | ||||
value.InfoID = reader.ReadUInt32(); | value.InfoID = reader.ReadUInt32(); | ||||
} | } | ||||
@@ -15,7 +15,7 @@ namespace JT809.Protocol.SubMessageBody | |||||
/// </summary> | /// </summary> | ||||
public class JT809_0x1400_0x1413 : JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1400_0x1413>, IJT809_2019_Version | public class JT809_0x1400_0x1413 : JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1400_0x1413>, IJT809_2019_Version | ||||
{ | { | ||||
public override ushort SubMsgId => JT809SubBusinessType.主动上报报警处理结果消息.ToUInt16Value(); | |||||
public override ushort SubMsgId => JT809SubBusinessType.上报报警督办请求消息.ToUInt16Value(); | |||||
public override string Description => "上报报警督办请求消息"; | public override string Description => "上报报警督办请求消息"; | ||||
/// <summary> | /// <summary> | ||||
@@ -12,7 +12,6 @@ namespace JT809.Protocol.SubMessageBody | |||||
/// <para>描述:下级平台应答上级平台下发的上报车辆行驶记录请求消息,将车辆行驶记录数据上传至上级平台</para> | /// <para>描述:下级平台应答上级平台下发的上报车辆行驶记录请求消息,将车辆行驶记录数据上传至上级平台</para> | ||||
/// </summary> | /// </summary> | ||||
public class JT809_0x1500_0x1504:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1500_0x1504>, IJT809_2019_Version | public class JT809_0x1500_0x1504:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x1500_0x1504>, IJT809_2019_Version | ||||
{ | |||||
{ | { | ||||
public override ushort SubMsgId => JT809SubBusinessType.上报车辆行驶记录应答消息.ToUInt16Value(); | public override ushort SubMsgId => JT809SubBusinessType.上报车辆行驶记录应答消息.ToUInt16Value(); | ||||
@@ -1,5 +1,8 @@ | |||||
using JT809.Protocol.Enums; | using JT809.Protocol.Enums; | ||||
using JT809.Protocol.Extensions; | using JT809.Protocol.Extensions; | ||||
using JT809.Protocol.Formatters; | |||||
using JT809.Protocol.Interfaces; | |||||
using JT809.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -10,12 +13,34 @@ namespace JT809.Protocol.SubMessageBody | |||||
/// 上报车辆驾驶员身份识别信息请求 | /// 上报车辆驾驶员身份识别信息请求 | ||||
/// <para>子业务类型标识:DOWN_EXG_MSG_REPORT_DRIVER_INFO</para> | /// <para>子业务类型标识:DOWN_EXG_MSG_REPORT_DRIVER_INFO</para> | ||||
/// </summary> | /// </summary> | ||||
public class JT809_0x9200_0x920A:JT809SubBodies | |||||
{ | |||||
public class JT809_0x9200_0x920A:JT809SubBodies, IJT809MessagePackFormatter<JT809_0x9200_0x920A>, IJT809_2019_Version | |||||
{ | |||||
public override ushort SubMsgId => JT809SubBusinessType.上报车辆驾驶员身份识别信息请求.ToUInt16Value(); | public override ushort SubMsgId => JT809SubBusinessType.上报车辆驾驶员身份识别信息请求.ToUInt16Value(); | ||||
public override string Description => "上报车辆驾驶员身份识别信息请求"; | public override string Description => "上报车辆驾驶员身份识别信息请求"; | ||||
public override bool SkipSerialization => true; | |||||
public override bool SkipSerialization => false; | |||||
/// <summary> | |||||
/// 上传标志 | |||||
/// </summary> | |||||
public JT809_0x920A_UploadFlag Flag { get; set; } | |||||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x9200_0x920A value, IJT809Config config) | |||||
{ | |||||
if (config.Version == JT809Version.JTT2019) | |||||
{ | |||||
writer.WriteByte((byte)value.Flag); | |||||
} | |||||
} | |||||
public JT809_0x9200_0x920A Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | |||||
{ | |||||
var value = new JT809_0x9200_0x920A(); | |||||
if (config.Version == JT809Version.JTT2019) | |||||
{ | |||||
value.Flag = (JT809_0x920A_UploadFlag)reader.ReadByte(); | |||||
} | |||||
return value; | |||||
} | |||||
} | } | ||||
} | } |
@@ -29,21 +29,84 @@ namespace JT809.Protocol.SubMessageBody | |||||
/// 命令字ID | /// 命令字ID | ||||
/// </summary> | /// </summary> | ||||
public JT809CommandType Command { get; set; } | public JT809CommandType Command { get; set; } | ||||
/// <summary> | |||||
/// 最大数据数 | |||||
/// </summary> | |||||
public ushort Max { get; set; } | |||||
public JT809_0x9500_0x9504 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | public JT809_0x9500_0x9504 Deserialize(ref JT809MessagePackReader reader, IJT809Config config) | ||||
{ | { | ||||
var value = new JT809_0x9500_0x9504(); | var value = new JT809_0x9500_0x9504(); | ||||
value.StartTime = reader.ReadUTCDateTime(); | |||||
value.EndTime = reader.ReadUTCDateTime(); | |||||
value.Command = (JT809CommandType)reader.ReadByte(); | |||||
if(config.Version == JT809Version.JTT2019){ | |||||
value.StartTime = reader.ReadUTCDateTime(); | |||||
value.EndTime = reader.ReadUTCDateTime(); | |||||
value.Command = (JT809CommandType)reader.ReadByte(); | |||||
} | |||||
else { | |||||
value.Command = (JT809CommandType)reader.ReadByte(); | |||||
switch (value.Command) | |||||
{ | |||||
case JT809CommandType.记录仪标准版本: | |||||
case JT809CommandType.当前驾驶人信息: | |||||
case JT809CommandType.记录仪时间: | |||||
case JT809CommandType.记录仪累计行驶里程: | |||||
case JT809CommandType.记录仪脉冲系数: | |||||
case JT809CommandType.车辆信息: | |||||
case JT809CommandType.记录仪状态信号配置信息: | |||||
case JT809CommandType.记录仪唯一性编号: | |||||
break; | |||||
case JT809CommandType.采集记录仪行驶记录: | |||||
case JT809CommandType.采集记录仪位置信息记录: | |||||
case JT809CommandType.采集记录仪事故疑点记录: | |||||
case JT809CommandType.采集记录仪超时驾驶记录: | |||||
case JT809CommandType.采集记录仪驾驶人身份记录: | |||||
case JT809CommandType.采集记录仪外部供电记录: | |||||
case JT809CommandType.采集记录仪参数修改记录: | |||||
case JT809CommandType.采集记录仪速度状态日志: | |||||
value.StartTime = reader.ReadDateTime6(); | |||||
value.EndTime = reader.ReadDateTime6(); | |||||
value.Max = reader.ReadUInt16(); | |||||
break; | |||||
} | |||||
} | |||||
return value; | return value; | ||||
} | } | ||||
public void Serialize(ref JT809MessagePackWriter writer, JT809_0x9500_0x9504 value, IJT809Config config) | public void Serialize(ref JT809MessagePackWriter writer, JT809_0x9500_0x9504 value, IJT809Config config) | ||||
{ | { | ||||
writer.WriteUTCDateTime(value.StartTime); | |||||
writer.WriteUTCDateTime(value.EndTime); | |||||
writer.WriteByte((byte)value.Command); | |||||
if (config.Version == JT809Version.JTT2019) | |||||
{ | |||||
writer.WriteUTCDateTime(value.StartTime); | |||||
writer.WriteUTCDateTime(value.EndTime); | |||||
writer.WriteByte((byte)value.Command); | |||||
} | |||||
else { | |||||
writer.WriteByte((byte)value.Command); | |||||
switch (value.Command) | |||||
{ | |||||
case JT809CommandType.记录仪标准版本: | |||||
case JT809CommandType.当前驾驶人信息: | |||||
case JT809CommandType.记录仪时间: | |||||
case JT809CommandType.记录仪累计行驶里程: | |||||
case JT809CommandType.记录仪脉冲系数: | |||||
case JT809CommandType.车辆信息: | |||||
case JT809CommandType.记录仪状态信号配置信息: | |||||
case JT809CommandType.记录仪唯一性编号: | |||||
break; | |||||
case JT809CommandType.采集记录仪行驶记录: | |||||
case JT809CommandType.采集记录仪位置信息记录: | |||||
case JT809CommandType.采集记录仪事故疑点记录: | |||||
case JT809CommandType.采集记录仪超时驾驶记录: | |||||
case JT809CommandType.采集记录仪驾驶人身份记录: | |||||
case JT809CommandType.采集记录仪外部供电记录: | |||||
case JT809CommandType.采集记录仪参数修改记录: | |||||
case JT809CommandType.采集记录仪速度状态日志: | |||||
writer.WriteDateTime6(value.StartTime); | |||||
writer.WriteDateTime6(value.EndTime); | |||||
writer.WriteUInt16(value.Max); | |||||
break; | |||||
} | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } |