@@ -288,6 +288,6 @@ namespace JT808.Protocol.Extensions.JT1078.Test | |||||
} | } | ||||
class DefaultGlobalConfig : GlobalConfigBase | class DefaultGlobalConfig : GlobalConfigBase | ||||
{ | { | ||||
public override string ConfigId => "Default"; | |||||
public override string ConfigId { protected set; get; } = "Default"; | |||||
} | } | ||||
} | } |
@@ -14,37 +14,6 @@ namespace JT808.Protocol.Extensions.JT1078 | |||||
public static IJT808Builder AddJT1078Configure(this IJT808Builder jT808Builder) | public static IJT808Builder AddJT1078Configure(this IJT808Builder jT808Builder) | ||||
{ | { | ||||
jT808Builder.Config.Register(Assembly.GetExecutingAssembly()); | jT808Builder.Config.Register(Assembly.GetExecutingAssembly()); | ||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x1003>((ushort)JT808_JT1078_MsgId.终端上传音视频属性, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x1005>((ushort)JT808_JT1078_MsgId.终端上传乘客流量, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x1205>((ushort)JT808_JT1078_MsgId.终端上传音视频资源列表, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x1206>((ushort)JT808_JT1078_MsgId.文件上传完成通知, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9003>((ushort)JT808_JT1078_MsgId.查询终端音视频属性, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9101>((ushort)JT808_JT1078_MsgId.实时音视频传输请求, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9102>((ushort)JT808_JT1078_MsgId.音视频实时传输控制, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9105>((ushort)JT808_JT1078_MsgId.实时音视频传输状态通知, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9201>((ushort)JT808_JT1078_MsgId.平台下发远程录像回放请求, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9202>((ushort)JT808_JT1078_MsgId.平台下发远程录像回放控制, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9205>((ushort)JT808_JT1078_MsgId.查询资源列表, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9206>((ushort)JT808_JT1078_MsgId.文件上传指令, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9207>((ushort)JT808_JT1078_MsgId.文件上传控制, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9301>((ushort)JT808_JT1078_MsgId.云台旋转, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9302>((ushort)JT808_JT1078_MsgId.云台调整焦距控制, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9303>((ushort)JT808_JT1078_MsgId.云台调整光圈控制, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9304>((ushort)JT808_JT1078_MsgId.云台雨刷控制, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9305>((ushort)JT808_JT1078_MsgId.红外补光控制, ""); | |||||
jT808Builder.Config.MsgIdFactory.SetMap<JT808_0x9306>((ushort)JT808_JT1078_MsgId.云台变倍控制, ""); | |||||
jT808Builder.Config.JT808_0X0200_Factory.JT808LocationAttachMethod.Add(JT808_JT1078_Constants.JT808_0X0200_0x14, typeof(JT808_0x0200_0x14)); | |||||
jT808Builder.Config.JT808_0X0200_Factory.JT808LocationAttachMethod.Add(JT808_JT1078_Constants.JT808_0X0200_0x15, typeof(JT808_0x0200_0x15)); | |||||
jT808Builder.Config.JT808_0X0200_Factory.JT808LocationAttachMethod.Add(JT808_JT1078_Constants.JT808_0X0200_0x16, typeof(JT808_0x0200_0x16)); | |||||
jT808Builder.Config.JT808_0X0200_Factory.JT808LocationAttachMethod.Add(JT808_JT1078_Constants.JT808_0X0200_0x17, typeof(JT808_0x0200_0x17)); | |||||
jT808Builder.Config.JT808_0X0200_Factory.JT808LocationAttachMethod.Add(JT808_JT1078_Constants.JT808_0X0200_0x18, typeof(JT808_0x0200_0x18)); | |||||
jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x0075, typeof(JT808_0x8103_0x0075)); | |||||
jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x0076, typeof(JT808_0x8103_0x0076)); | |||||
jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x0077, typeof(JT808_0x8103_0x0077)); | |||||
jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x0079, typeof(JT808_0x8103_0x0079)); | |||||
jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x007A, typeof(JT808_0x8103_0x007A)); | |||||
jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x007B, typeof(JT808_0x8103_0x007B)); | |||||
jT808Builder.Config.JT808_0X8103_Factory.ParamMethods.Add(JT808_JT1078_Constants.JT808_0X8103_0x007C, typeof(JT808_0x8103_0x007C)); | |||||
return jT808Builder; | return jT808Builder; | ||||
} | } | ||||
} | } | ||||
@@ -1,29 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x0200_0x14_Formatter : IJT808MessagePackFormatter<JT808_0x0200_0x14> | |||||
{ | |||||
public JT808_0x0200_0x14 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x0200_0x14 jT808_0x0200_0x14 = new JT808_0x0200_0x14(); | |||||
jT808_0x0200_0x14.AttachInfoId = reader.ReadByte(); | |||||
jT808_0x0200_0x14.AttachInfoLength = reader.ReadByte(); | |||||
jT808_0x0200_0x14.VideoRelateAlarm = reader.ReadUInt32(); | |||||
return jT808_0x0200_0x14; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x14 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.AttachInfoId); | |||||
writer.WriteByte(value.AttachInfoLength); | |||||
writer.WriteUInt32(value.VideoRelateAlarm); | |||||
} | |||||
} | |||||
} |
@@ -1,29 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x0200_0x15_Formatter : IJT808MessagePackFormatter<JT808_0x0200_0x15> | |||||
{ | |||||
public JT808_0x0200_0x15 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x0200_0x15 jT808_0x0200_0x15 = new JT808_0x0200_0x15(); | |||||
jT808_0x0200_0x15.AttachInfoId = reader.ReadByte(); | |||||
jT808_0x0200_0x15.AttachInfoLength = reader.ReadByte(); | |||||
jT808_0x0200_0x15.VideoSignalLoseAlarmStatus = reader.ReadUInt32(); | |||||
return jT808_0x0200_0x15; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x15 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.AttachInfoId); | |||||
writer.WriteByte(value.AttachInfoLength); | |||||
writer.WriteUInt32(value.VideoSignalLoseAlarmStatus); | |||||
} | |||||
} | |||||
} |
@@ -1,29 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x0200_0x16_Formatter : IJT808MessagePackFormatter<JT808_0x0200_0x16> | |||||
{ | |||||
public JT808_0x0200_0x16 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x0200_0x16 jT808_0x0200_0x16 = new JT808_0x0200_0x16(); | |||||
jT808_0x0200_0x16.AttachInfoId = reader.ReadByte(); | |||||
jT808_0x0200_0x16.AttachInfoLength = reader.ReadByte(); | |||||
jT808_0x0200_0x16.VideoSignalOcclusionAlarmStatus = reader.ReadUInt32(); | |||||
return jT808_0x0200_0x16; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x16 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.AttachInfoId); | |||||
writer.WriteByte(value.AttachInfoLength); | |||||
writer.WriteUInt32(value.VideoSignalOcclusionAlarmStatus); | |||||
} | |||||
} | |||||
} |
@@ -1,29 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x0200_0x17_Formatter : IJT808MessagePackFormatter<JT808_0x0200_0x17> | |||||
{ | |||||
public JT808_0x0200_0x17 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x0200_0x17 jT808_0x0200_0x17 = new JT808_0x0200_0x17(); | |||||
jT808_0x0200_0x17.AttachInfoId = reader.ReadByte(); | |||||
jT808_0x0200_0x17.AttachInfoLength = reader.ReadByte(); | |||||
jT808_0x0200_0x17.StorageFaultAlarmStatus = reader.ReadUInt16(); | |||||
return jT808_0x0200_0x17; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x17 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.AttachInfoId); | |||||
writer.WriteByte(value.AttachInfoLength); | |||||
writer.WriteUInt16(value.StorageFaultAlarmStatus); | |||||
} | |||||
} | |||||
} |
@@ -1,29 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x0200_0x18_Formatter : IJT808MessagePackFormatter<JT808_0x0200_0x18> | |||||
{ | |||||
public JT808_0x0200_0x18 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x0200_0x18 jT808_0x0200_0x18 = new JT808_0x0200_0x18(); | |||||
jT808_0x0200_0x18.AttachInfoId = reader.ReadByte(); | |||||
jT808_0x0200_0x18.AttachInfoLength = reader.ReadByte(); | |||||
jT808_0x0200_0x18.AbnormalDrivingBehaviorAlarmInfo = reader.ReadUInt16(); | |||||
return jT808_0x0200_0x18; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x18 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.AttachInfoId); | |||||
writer.WriteByte(value.AttachInfoLength); | |||||
writer.WriteUInt16(value.AbnormalDrivingBehaviorAlarmInfo); | |||||
} | |||||
} | |||||
} |
@@ -1,41 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x1003_Formatter : IJT808MessagePackFormatter<JT808_0x1003> | |||||
{ | |||||
public JT808_0x1003 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x1003 jT808_0x1003 = new JT808_0x1003(); | |||||
jT808_0x1003.EnterAudioEncoding = reader.ReadByte(); | |||||
jT808_0x1003.EnterAudioChannelsNumber = reader.ReadByte(); | |||||
jT808_0x1003.EnterAudioSampleRate = reader.ReadByte(); | |||||
jT808_0x1003.EnterAudioSampleDigits = reader.ReadByte(); | |||||
jT808_0x1003.AudioFrameLength = reader.ReadUInt16(); | |||||
jT808_0x1003.IsSupportedAudioOutput = reader.ReadByte(); | |||||
jT808_0x1003.VideoEncoding = reader.ReadByte(); | |||||
jT808_0x1003.TerminalSupportedMaxNumberOfAudioPhysicalChannels = reader.ReadByte(); | |||||
jT808_0x1003.TerminalSupportedMaxNumberOfVideoPhysicalChannels = reader.ReadByte(); | |||||
return jT808_0x1003; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1003 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.EnterAudioEncoding); | |||||
writer.WriteByte(value.EnterAudioChannelsNumber); | |||||
writer.WriteByte(value.EnterAudioSampleRate); | |||||
writer.WriteByte(value.EnterAudioSampleDigits); | |||||
writer.WriteUInt16(value.AudioFrameLength); | |||||
writer.WriteByte(value.IsSupportedAudioOutput); | |||||
writer.WriteByte(value.VideoEncoding); | |||||
writer.WriteByte(value.TerminalSupportedMaxNumberOfAudioPhysicalChannels); | |||||
writer.WriteByte(value.TerminalSupportedMaxNumberOfVideoPhysicalChannels); | |||||
} | |||||
} | |||||
} |
@@ -1,31 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x1005_Formatter : IJT808MessagePackFormatter<JT808_0x1005> | |||||
{ | |||||
public JT808_0x1005 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x1005 jT808_0x1005 = new JT808_0x1005(); | |||||
jT808_0x1005.BeginTime = reader.ReadDateTime6(); | |||||
jT808_0x1005.EndTime = reader.ReadDateTime6(); | |||||
jT808_0x1005.GettingOnNumber = reader.ReadUInt16(); | |||||
jT808_0x1005.GettingOffNumber = reader.ReadUInt16(); | |||||
return jT808_0x1005; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1005 value, IJT808Config config) | |||||
{ | |||||
writer.WriteDateTime6(value.BeginTime); | |||||
writer.WriteDateTime6(value.EndTime); | |||||
writer.WriteUInt16(value.GettingOnNumber); | |||||
writer.WriteUInt16(value.GettingOffNumber); | |||||
} | |||||
} | |||||
} |
@@ -1,39 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x1205_AVResouce_Formatter : IJT808MessagePackFormatter<JT808_0x1205_AVResouce> | |||||
{ | |||||
public JT808_0x1205_AVResouce Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x1205_AVResouce jT808_0x1205_AVResouce = new JT808_0x1205_AVResouce(); | |||||
jT808_0x1205_AVResouce.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x1205_AVResouce.BeginTime = reader.ReadDateTime6(); | |||||
jT808_0x1205_AVResouce.EndTime = reader.ReadDateTime6(); | |||||
jT808_0x1205_AVResouce.AlarmFlag = reader.ReadUInt32(); | |||||
jT808_0x1205_AVResouce.AVResourceType = reader.ReadByte(); | |||||
jT808_0x1205_AVResouce.StreamType = reader.ReadByte(); | |||||
jT808_0x1205_AVResouce.MemoryType = reader.ReadByte(); | |||||
jT808_0x1205_AVResouce.FileSize = reader.ReadUInt32(); | |||||
return jT808_0x1205_AVResouce; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1205_AVResouce value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteDateTime6(value.BeginTime); | |||||
writer.WriteDateTime6(value.EndTime); | |||||
writer.WriteUInt32(value.AlarmFlag); | |||||
writer.WriteByte(value.AVResourceType); | |||||
writer.WriteByte(value.StreamType); | |||||
writer.WriteByte(value.MemoryType); | |||||
writer.WriteUInt32(value.FileSize); | |||||
} | |||||
} | |||||
} |
@@ -1,46 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x1205_Formatter : IJT808MessagePackFormatter<JT808_0x1205> | |||||
{ | |||||
public JT808_0x1205 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x1205 jT808_0x1205 = new JT808_0x1205(); | |||||
jT808_0x1205.MsgNum = reader.ReadUInt16(); | |||||
jT808_0x1205.AVResouceTotal = reader.ReadUInt32(); | |||||
var channelTotal = jT808_0x1205.AVResouceTotal;//音视频资源总数 | |||||
if (channelTotal > 0) | |||||
{ | |||||
jT808_0x1205.AVResouces =new List<JT808_0x1205_AVResouce>(); | |||||
var formatter = config.GetMessagePackFormatter<JT808_0x1205_AVResouce>(); | |||||
for (int i = 0; i < channelTotal; i++) | |||||
{ | |||||
jT808_0x1205.AVResouces.Add(formatter.Deserialize(ref reader, config)); | |||||
} | |||||
} | |||||
return jT808_0x1205; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1205 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt16(value.MsgNum); | |||||
writer.WriteUInt32(value.AVResouceTotal); | |||||
if (value.AVResouces.Any()) | |||||
{ | |||||
var formatter = config.GetMessagePackFormatter<JT808_0x1205_AVResouce>(); | |||||
foreach (var AVResouce in value.AVResouces) | |||||
{ | |||||
formatter.Serialize(ref writer, AVResouce, config); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -1,27 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x1206_Formatter : IJT808MessagePackFormatter<JT808_0x1206> | |||||
{ | |||||
public JT808_0x1206 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x1206 jT808_0x1206 = new JT808_0x1206(); | |||||
jT808_0x1206.MsgNum = reader.ReadUInt16(); | |||||
jT808_0x1206.Result = reader.ReadByte(); | |||||
return jT808_0x1206; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1206 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt16(value.MsgNum); | |||||
writer.WriteByte(value.Result); | |||||
} | |||||
} | |||||
} |
@@ -1,51 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x8103_0x0075_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x0075> | |||||
{ | |||||
public JT808_0x8103_0x0075 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x0075 jT808_0X8103_0X0075 = new JT808_0x8103_0x0075(); | |||||
jT808_0X8103_0X0075.ParamId = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0075.ParamLength = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.RTS_EncodeMode = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.RTS_Resolution = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.RTS_KF_Interval = reader.ReadUInt16(); | |||||
jT808_0X8103_0X0075.RTS_Target_FPS = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.RTS_Target_CodeRate = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0075.StreamStore_EncodeMode = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.StreamStore_Resolution = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.StreamStore_KF_Interval = reader.ReadUInt16(); | |||||
jT808_0X8103_0X0075.StreamStore_Target_FPS = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.StreamStore_Target_CodeRate = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0075.OSD = reader.ReadUInt16(); | |||||
jT808_0X8103_0X0075.AudioOutputEnabled = reader.ReadByte(); | |||||
return jT808_0X8103_0X0075; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0075 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.WriteByte(value.ParamLength); | |||||
writer.WriteByte(value.RTS_EncodeMode); | |||||
writer.WriteByte(value.RTS_Resolution); | |||||
writer.WriteUInt16(value.RTS_KF_Interval); | |||||
writer.WriteByte(value.RTS_Target_FPS); | |||||
writer.WriteUInt32(value.RTS_Target_CodeRate); | |||||
writer.WriteByte(value.StreamStore_EncodeMode); | |||||
writer.WriteByte(value.StreamStore_Resolution); | |||||
writer.WriteUInt16(value.StreamStore_KF_Interval); | |||||
writer.WriteByte(value.StreamStore_Target_FPS); | |||||
writer.WriteUInt32(value.StreamStore_Target_CodeRate); | |||||
writer.WriteUInt16(value.OSD); | |||||
writer.WriteByte(value.AudioOutputEnabled); | |||||
} | |||||
} | |||||
} |
@@ -1,31 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x8103_0x0076_AVChannelRefTable_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x0076_AVChannelRefTable> | |||||
{ | |||||
public JT808_0x8103_0x0076_AVChannelRefTable Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x0076_AVChannelRefTable jT808_0X8103_0X0076_AVChannelRefTable = new JT808_0x8103_0x0076_AVChannelRefTable(); | |||||
jT808_0X8103_0X0076_AVChannelRefTable.PhysicalChannelNo = reader.ReadByte(); | |||||
jT808_0X8103_0X0076_AVChannelRefTable.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0X8103_0X0076_AVChannelRefTable.ChannelType = reader.ReadByte(); | |||||
jT808_0X8103_0X0076_AVChannelRefTable.IsConnectCloudPlat = reader.ReadByte(); | |||||
return jT808_0X8103_0X0076_AVChannelRefTable; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0076_AVChannelRefTable value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.PhysicalChannelNo); | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.ChannelType); | |||||
writer.WriteByte(value.IsConnectCloudPlat); | |||||
} | |||||
} | |||||
} |
@@ -1,51 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x8103_0x0076_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x0076> | |||||
{ | |||||
public JT808_0x8103_0x0076 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x0076 jT808_0X8103_0X0076 = new JT808_0x8103_0x0076(); | |||||
jT808_0X8103_0X0076.ParamId = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0076.ParamLength = reader.ReadByte(); | |||||
jT808_0X8103_0X0076.AVChannelTotal = reader.ReadByte(); | |||||
jT808_0X8103_0X0076.AudioChannelTotal = reader.ReadByte(); | |||||
jT808_0X8103_0X0076.VudioChannelTotal = reader.ReadByte(); | |||||
var channelTotal = jT808_0X8103_0X0076.AVChannelTotal + jT808_0X8103_0X0076.AudioChannelTotal + jT808_0X8103_0X0076.VudioChannelTotal;//通道总数 | |||||
if (channelTotal > 0) { | |||||
jT808_0X8103_0X0076.AVChannelRefTables = new List<JT808_0x8103_0x0076_AVChannelRefTable>(); | |||||
var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0076_AVChannelRefTable>(); | |||||
for (int i = 0; i < channelTotal; i++) | |||||
{ | |||||
jT808_0X8103_0X0076.AVChannelRefTables.Add(formatter.Deserialize(ref reader, config)); | |||||
} | |||||
} | |||||
return jT808_0X8103_0X0076; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0076 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.Skip(1,out int position); | |||||
writer.WriteByte(value.AVChannelTotal); | |||||
writer.WriteByte(value.AudioChannelTotal); | |||||
writer.WriteByte(value.VudioChannelTotal); | |||||
if (value.AVChannelRefTables.Any()) { | |||||
var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0076_AVChannelRefTable>(); | |||||
foreach (var AVChannelRefTable in value.AVChannelRefTables) | |||||
{ | |||||
formatter.Serialize(ref writer, AVChannelRefTable, config); | |||||
} | |||||
} | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition()- position-1), position); | |||||
} | |||||
} | |||||
} |
@@ -1,46 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x8103_0x0077_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x0077> | |||||
{ | |||||
public JT808_0x8103_0x0077 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x0077 jT808_0X8103_0X0077 = new JT808_0x8103_0x0077(); | |||||
jT808_0X8103_0X0077.ParamId = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0077.ParamLength = reader.ReadByte(); | |||||
jT808_0X8103_0X0077.NeedSetChannelTotal = reader.ReadByte(); | |||||
if (jT808_0X8103_0X0077.NeedSetChannelTotal > 0) { | |||||
jT808_0X8103_0X0077.SignalChannels = new List<JT808_0x8103_0x0077_SignalChannel>(); | |||||
var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0077_SignalChannel>(); | |||||
for (int i = 0; i < jT808_0X8103_0X0077.NeedSetChannelTotal; i++) | |||||
{ | |||||
jT808_0X8103_0X0077.SignalChannels.Add(formatter.Deserialize(ref reader, config)); | |||||
} | |||||
} | |||||
return jT808_0X8103_0X0077; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0077 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.Skip(1,out var position); | |||||
writer.WriteByte(value.NeedSetChannelTotal); | |||||
if (value.SignalChannels.Any()) { | |||||
var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0077_SignalChannel>(); | |||||
foreach (var signalChannel in value.SignalChannels) | |||||
{ | |||||
formatter.Serialize(ref writer, signalChannel, config); | |||||
} | |||||
} | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); | |||||
} | |||||
} | |||||
} |
@@ -1,47 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x8103_0x0077_SignalChannel_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x0077_SignalChannel> | |||||
{ | |||||
public JT808_0x8103_0x0077_SignalChannel Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x0077_SignalChannel jT808_0X8103_0X0077_SignalChannel = new JT808_0x8103_0x0077_SignalChannel(); | |||||
jT808_0X8103_0X0077_SignalChannel.LogicChannelNo= reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.RTS_EncodeMode = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.RTS_Resolution = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.RTS_KF_Interval = reader.ReadUInt16(); | |||||
jT808_0X8103_0X0077_SignalChannel.RTS_Target_FPS = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.RTS_Target_CodeRate = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0077_SignalChannel.StreamStore_EncodeMode = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.StreamStore_Resolution = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.StreamStore_KF_Interval = reader.ReadUInt16(); | |||||
jT808_0X8103_0X0077_SignalChannel.StreamStore_Target_FPS = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.StreamStore_Target_CodeRate = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0077_SignalChannel.OSD = reader.ReadUInt16(); | |||||
return jT808_0X8103_0X0077_SignalChannel; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0077_SignalChannel value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.RTS_EncodeMode); | |||||
writer.WriteByte(value.RTS_Resolution); | |||||
writer.WriteUInt16(value.RTS_KF_Interval); | |||||
writer.WriteByte(value.RTS_Target_FPS); | |||||
writer.WriteUInt32(value.RTS_Target_CodeRate); | |||||
writer.WriteByte(value.StreamStore_EncodeMode); | |||||
writer.WriteByte(value.StreamStore_Resolution); | |||||
writer.WriteUInt16(value.StreamStore_KF_Interval); | |||||
writer.WriteByte(value.StreamStore_Target_FPS); | |||||
writer.WriteUInt32(value.StreamStore_Target_CodeRate); | |||||
writer.WriteUInt16(value.OSD); | |||||
} | |||||
} | |||||
} |
@@ -1,34 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x8103_0x0079_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x0079> | |||||
{ | |||||
public JT808_0x8103_0x0079 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x0079 jT808_0x8103_0x0079 = new JT808_0x8103_0x0079(); | |||||
jT808_0x8103_0x0079.ParamId = reader.ReadUInt32(); | |||||
jT808_0x8103_0x0079.ParamLength = reader.ReadByte(); | |||||
jT808_0x8103_0x0079.StorageThresholds = reader.ReadByte(); | |||||
jT808_0x8103_0x0079.Duration = reader.ReadByte(); | |||||
jT808_0x8103_0x0079.BeginMinute = reader.ReadByte(); | |||||
return jT808_0x8103_0x0079; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0079 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.WriteByte(value.ParamLength); | |||||
writer.WriteByte(value.StorageThresholds); | |||||
writer.WriteByte(value.Duration); | |||||
writer.WriteByte(value.BeginMinute); | |||||
} | |||||
} | |||||
} |
@@ -1,30 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x8103_0x007A_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x007A> | |||||
{ | |||||
public JT808_0x8103_0x007A Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x007A jT808_0x8103_0x007A = new JT808_0x8103_0x007A(); | |||||
jT808_0x8103_0x007A.ParamId = reader.ReadUInt32(); | |||||
jT808_0x8103_0x007A.ParamLength = reader.ReadByte(); | |||||
jT808_0x8103_0x007A.AlarmShielding = reader.ReadUInt32(); | |||||
return jT808_0x8103_0x007A; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007A value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.WriteByte(value.ParamLength); | |||||
writer.WriteUInt32(value.AlarmShielding); | |||||
} | |||||
} | |||||
} |
@@ -1,32 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x8103_0x007B_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x007B> | |||||
{ | |||||
public JT808_0x8103_0x007B Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x007B jT808_0x8103_0x007B = new JT808_0x8103_0x007B(); | |||||
jT808_0x8103_0x007B.ParamId = reader.ReadUInt32(); | |||||
jT808_0x8103_0x007B.ParamLength = reader.ReadByte(); | |||||
jT808_0x8103_0x007B.NuclearLoadNumber = reader.ReadByte(); | |||||
jT808_0x8103_0x007B.FatigueThreshold = reader.ReadByte(); | |||||
return jT808_0x8103_0x007B; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007B value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.WriteByte(value.ParamLength); | |||||
writer.WriteByte(value.NuclearLoadNumber); | |||||
writer.WriteByte(value.FatigueThreshold); | |||||
} | |||||
} | |||||
} |
@@ -1,37 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x8103_0x007C_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x007C> | |||||
{ | |||||
public JT808_0x8103_0x007C Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x007C jT808_0x8103_0x007C = new JT808_0x8103_0x007C(); | |||||
jT808_0x8103_0x007C.ParamId = reader.ReadUInt32(); | |||||
jT808_0x8103_0x007C.ParamLength = reader.ReadByte(); | |||||
jT808_0x8103_0x007C.SleepWakeMode = reader.ReadByte(); | |||||
jT808_0x8103_0x007C.WakeConditionType = reader.ReadByte(); | |||||
jT808_0x8103_0x007C.TimerWakeDaySet = reader.ReadByte(); | |||||
jT808_0x8103_0x007C.TimerWakeDayParamter = config.GetMessagePackFormatter<JT808_0x8103_0x007C_TimerWakeDayParamter>().Deserialize(ref reader, config); | |||||
return jT808_0x8103_0x007C; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007C value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.Skip(1, out var position); | |||||
writer.WriteByte(value.SleepWakeMode); | |||||
writer.WriteByte(value.WakeConditionType); | |||||
writer.WriteByte(value.TimerWakeDaySet); | |||||
config.GetMessagePackFormatter<JT808_0x8103_0x007C_TimerWakeDayParamter>().Serialize(ref writer, value.TimerWakeDayParamter, config); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition()-position-1),position); | |||||
} | |||||
} | |||||
} |
@@ -1,42 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x8103_0x007C_TimerWakeDayParamter_Formatter : IJT808MessagePackFormatter<JT808_0x8103_0x007C_TimerWakeDayParamter> | |||||
{ | |||||
public JT808_0x8103_0x007C_TimerWakeDayParamter Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x007C_TimerWakeDayParamter jT808_0x8103_0x007C_TimerWakeDayParamter = new JT808_0x8103_0x007C_TimerWakeDayParamter(); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimerWakeEnableFlag = reader.ReadByte(); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod1WakeTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod1CloseTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod2WakeTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod2CloseTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod3WakeTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod3CloseTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod4WakeTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod4CloseTime = reader.ReadBCD(4); | |||||
return jT808_0x8103_0x007C_TimerWakeDayParamter; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007C_TimerWakeDayParamter value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.TimerWakeEnableFlag); | |||||
writer.WriteBCD(value.TimePeriod1WakeTime, 4); | |||||
writer.WriteBCD(value.TimePeriod1CloseTime, 4); | |||||
writer.WriteBCD(value.TimePeriod2WakeTime, 4); | |||||
writer.WriteBCD(value.TimePeriod2CloseTime, 4); | |||||
writer.WriteBCD(value.TimePeriod3WakeTime, 4); | |||||
writer.WriteBCD(value.TimePeriod3CloseTime, 4); | |||||
writer.WriteBCD(value.TimePeriod4WakeTime, 4); | |||||
writer.WriteBCD(value.TimePeriod4CloseTime, 4); | |||||
} | |||||
} | |||||
} |
@@ -1,38 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9101_Formatter : IJT808MessagePackFormatter<JT808_0x9101> | |||||
{ | |||||
public JT808_0x9101 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9101 jT808_0X9101 = new JT808_0x9101(); | |||||
jT808_0X9101.ServerIPAddressLength = reader.ReadByte(); | |||||
jT808_0X9101.ServerIPAddress = reader.ReadString(jT808_0X9101.ServerIPAddressLength); | |||||
jT808_0X9101.ServerVideoChannelTcpPort = reader.ReadUInt16(); | |||||
jT808_0X9101.ServerVideoChannelUdpPort = reader.ReadUInt16(); | |||||
jT808_0X9101.LogicalChannelNo = reader.ReadByte(); | |||||
jT808_0X9101.DataType = reader.ReadByte(); | |||||
jT808_0X9101.StreamType = reader.ReadByte(); | |||||
return jT808_0X9101; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9101 value, IJT808Config config) | |||||
{ | |||||
writer.Skip(1, out int position); | |||||
writer.WriteString(value.ServerIPAddress); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); | |||||
writer.WriteUInt16(value.ServerVideoChannelTcpPort); | |||||
writer.WriteUInt16(value.ServerVideoChannelUdpPort); | |||||
writer.WriteByte(value.LogicalChannelNo); | |||||
writer.WriteByte(value.DataType); | |||||
writer.WriteByte(value.StreamType); | |||||
} | |||||
} | |||||
} |
@@ -1,31 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9102_Formatter : IJT808MessagePackFormatter<JT808_0x9102> | |||||
{ | |||||
public JT808_0x9102 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9102 jT808_0X9102 = new JT808_0x9102(); | |||||
jT808_0X9102.LogicalChannelNo = reader.ReadByte(); | |||||
jT808_0X9102.ControlCmd = reader.ReadByte(); | |||||
jT808_0X9102.CloseAVData = reader.ReadByte(); | |||||
jT808_0X9102.SwitchStreamType = reader.ReadByte(); | |||||
return jT808_0X9102; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9102 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicalChannelNo); | |||||
writer.WriteByte(value.ControlCmd); | |||||
writer.WriteByte(value.CloseAVData); | |||||
writer.WriteByte(value.SwitchStreamType); | |||||
} | |||||
} | |||||
} |
@@ -1,27 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9105_Formatter : IJT808MessagePackFormatter<JT808_0x9105> | |||||
{ | |||||
public JT808_0x9105 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9105 jT808_0x9105 = new JT808_0x9105(); | |||||
jT808_0x9105.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9105.DropRate = reader.ReadByte(); | |||||
return jT808_0x9105; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9105 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.DropRate); | |||||
} | |||||
} | |||||
} |
@@ -1,50 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9201_Formatter : IJT808MessagePackFormatter<JT808_0x9201> | |||||
{ | |||||
public JT808_0x9201 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9201 jT808_0x9201 = new JT808_0x9201(); | |||||
jT808_0x9201.ServerIpLength = reader.ReadByte(); | |||||
jT808_0x9201.ServerIp = reader.ReadString(jT808_0x9201.ServerIpLength); | |||||
jT808_0x9201.TcpPort = reader.ReadUInt16(); | |||||
jT808_0x9201.UdpPort = reader.ReadUInt16(); | |||||
jT808_0x9201.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9201.AVItemType = reader.ReadByte(); | |||||
jT808_0x9201.StreamType = reader.ReadByte(); | |||||
jT808_0x9201.MemType = reader.ReadByte(); | |||||
jT808_0x9201.PlayBackWay = reader.ReadByte(); | |||||
jT808_0x9201.FastForwardOrFastRewindMultiples1 = reader.ReadByte(); | |||||
jT808_0x9201.FastForwardOrFastRewindMultiples2 = reader.ReadByte(); | |||||
jT808_0x9201.BeginTime = reader.ReadDateTime6(); | |||||
jT808_0x9201.EndTime = reader.ReadDateTime6(); | |||||
return jT808_0x9201; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9201 value, IJT808Config config) | |||||
{ | |||||
writer.Skip(1,out int position); | |||||
writer.WriteString(value.ServerIp); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position);//计算完字符串后,回写字符串长度 | |||||
writer.WriteUInt16(value.TcpPort); | |||||
writer.WriteUInt16(value.UdpPort); | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.AVItemType); | |||||
writer.WriteByte(value.StreamType); | |||||
writer.WriteByte(value.MemType); | |||||
writer.WriteByte(value.PlayBackWay); | |||||
writer.WriteByte(value.FastForwardOrFastRewindMultiples1); | |||||
writer.WriteByte(value.FastForwardOrFastRewindMultiples2); | |||||
writer.WriteDateTime6(value.BeginTime); | |||||
writer.WriteDateTime6(value.EndTime); | |||||
} | |||||
} | |||||
} |
@@ -1,31 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9202_Formatter : IJT808MessagePackFormatter<JT808_0x9202> | |||||
{ | |||||
public JT808_0x9202 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9202 jT808_0x9202 = new JT808_0x9202(); | |||||
jT808_0x9202.AVChannelNo = reader.ReadByte(); | |||||
jT808_0x9202.PlayBackControl = reader.ReadByte(); | |||||
jT808_0x9202.FastForwardOrFastRewindMultiples = reader.ReadByte(); | |||||
jT808_0x9202.DragPlaybackPosition = reader.ReadDateTime6(); | |||||
return jT808_0x9202; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9202 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.AVChannelNo); | |||||
writer.WriteByte(value.PlayBackControl); | |||||
writer.WriteByte(value.FastForwardOrFastRewindMultiples); | |||||
writer.WriteDateTime6(value.DragPlaybackPosition); | |||||
} | |||||
} | |||||
} |
@@ -1,37 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9205_Formatter : IJT808MessagePackFormatter<JT808_0x9205> | |||||
{ | |||||
public JT808_0x9205 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9205 jT808_0x9205 = new JT808_0x9205(); | |||||
jT808_0x9205.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9205.BeginTime = reader.ReadDateTime6(); | |||||
jT808_0x9205.EndTime = reader.ReadDateTime6(); | |||||
jT808_0x9205.AlarmFlag = reader.ReadUInt32(); | |||||
jT808_0x9205.AVResourceType = reader.ReadByte(); | |||||
jT808_0x9205.StreamType = reader.ReadByte(); | |||||
jT808_0x9205.MemoryType = reader.ReadByte(); | |||||
return jT808_0x9205; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9205 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteDateTime6(value.BeginTime); | |||||
writer.WriteDateTime6(value.EndTime); | |||||
writer.WriteUInt32(value.AlarmFlag); | |||||
writer.WriteByte(value.AVResourceType); | |||||
writer.WriteByte(value.StreamType); | |||||
writer.WriteByte(value.MemoryType); | |||||
} | |||||
} | |||||
} |
@@ -1,61 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9206_Formatter : IJT808MessagePackFormatter<JT808_0x9206> | |||||
{ | |||||
public JT808_0x9206 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9206 jT808_0x9206 = new JT808_0x9206(); | |||||
jT808_0x9206.ServerIpLength = reader.ReadByte(); | |||||
jT808_0x9206.ServerIp = reader.ReadString(jT808_0x9206.ServerIpLength); | |||||
jT808_0x9206.Port = reader.ReadUInt16(); | |||||
jT808_0x9206.UserNameLength = reader.ReadByte(); | |||||
jT808_0x9206.UserName = reader.ReadString(jT808_0x9206.UserNameLength); | |||||
jT808_0x9206.PasswordLength = reader.ReadByte(); | |||||
jT808_0x9206.Password = reader.ReadString(jT808_0x9206.PasswordLength); | |||||
jT808_0x9206.FileUploadPathLength = reader.ReadByte(); | |||||
jT808_0x9206.FileUploadPath = reader.ReadString(jT808_0x9206.FileUploadPathLength); | |||||
jT808_0x9206.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9206.BeginTime = reader.ReadDateTime6(); | |||||
jT808_0x9206.EndTime = reader.ReadDateTime6(); | |||||
jT808_0x9206.AlarmFlag = reader.ReadUInt32(); | |||||
jT808_0x9206.AVResourceType = reader.ReadByte(); | |||||
jT808_0x9206.StreamType = reader.ReadByte(); | |||||
jT808_0x9206.MemoryPositon = reader.ReadByte(); | |||||
jT808_0x9206.TaskExcuteCondition = reader.ReadByte(); | |||||
return jT808_0x9206; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9206 value, IJT808Config config) | |||||
{ | |||||
writer.Skip(1, out int serverIpLengthposition); | |||||
writer.WriteString(value.ServerIp); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - serverIpLengthposition - 1), serverIpLengthposition); | |||||
writer.WriteUInt16(value.Port); | |||||
writer.Skip(1, out int userNameLengthposition); | |||||
writer.WriteString(value.UserName); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - userNameLengthposition - 1), userNameLengthposition); | |||||
writer.Skip(1, out int passwordLengthLengthposition); | |||||
writer.WriteString(value.Password); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - passwordLengthLengthposition - 1), passwordLengthLengthposition); | |||||
writer.Skip(1, out int fileUploadPathLengthLengthposition); | |||||
writer.WriteString(value.FileUploadPath); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - fileUploadPathLengthLengthposition - 1), fileUploadPathLengthLengthposition); | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteDateTime6(value.BeginTime); | |||||
writer.WriteDateTime6(value.EndTime); | |||||
writer.WriteUInt32(value.AlarmFlag); | |||||
writer.WriteByte(value.AVResourceType); | |||||
writer.WriteByte(value.StreamType); | |||||
writer.WriteByte(value.MemoryPositon); | |||||
writer.WriteByte(value.TaskExcuteCondition); | |||||
} | |||||
} | |||||
} |
@@ -1,27 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9207_Formatter : IJT808MessagePackFormatter<JT808_0x9207> | |||||
{ | |||||
public JT808_0x9207 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9207 jT808_0x9207 = new JT808_0x9207(); | |||||
jT808_0x9207.MgsNum = reader.ReadUInt16(); | |||||
jT808_0x9207.UploadControl = reader.ReadByte(); | |||||
return jT808_0x9207; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9207 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt16(value.MgsNum); | |||||
writer.WriteByte(value.UploadControl); | |||||
} | |||||
} | |||||
} |
@@ -1,29 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9301_Formatter : IJT808MessagePackFormatter<JT808_0x9301> | |||||
{ | |||||
public JT808_0x9301 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9301 jT808_0x9301 = new JT808_0x9301(); | |||||
jT808_0x9301.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9301.Direction = reader.ReadByte(); | |||||
jT808_0x9301.Speed = reader.ReadByte(); | |||||
return jT808_0x9301; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9301 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.Direction); | |||||
writer.WriteByte(value.Speed); | |||||
} | |||||
} | |||||
} |
@@ -1,27 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9302_Formatter : IJT808MessagePackFormatter<JT808_0x9302> | |||||
{ | |||||
public JT808_0x9302 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9302 jT808_0x9302 = new JT808_0x9302(); | |||||
jT808_0x9302.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9302.FocusAdjustmentDirection = reader.ReadByte(); | |||||
return jT808_0x9302; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9302 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.FocusAdjustmentDirection); | |||||
} | |||||
} | |||||
} |
@@ -1,27 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9303_Formatter : IJT808MessagePackFormatter<JT808_0x9303> | |||||
{ | |||||
public JT808_0x9303 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9303 jT808_0x9303 = new JT808_0x9303(); | |||||
jT808_0x9303.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9303.IrisAdjustment = reader.ReadByte(); | |||||
return jT808_0x9303; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9303 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.IrisAdjustment); | |||||
} | |||||
} | |||||
} |
@@ -1,27 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9304_Formatter : IJT808MessagePackFormatter<JT808_0x9304> | |||||
{ | |||||
public JT808_0x9304 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9304 jT808_0x9304 = new JT808_0x9304(); | |||||
jT808_0x9304.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9304.StartOrStop = reader.ReadByte(); | |||||
return jT808_0x9304; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9304 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.StartOrStop); | |||||
} | |||||
} | |||||
} |
@@ -1,27 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9305_Formatter : IJT808MessagePackFormatter<JT808_0x9305> | |||||
{ | |||||
public JT808_0x9305 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9305 jT808_0x9305 = new JT808_0x9305(); | |||||
jT808_0x9305.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9305.StartOrStop = reader.ReadByte(); | |||||
return jT808_0x9305; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9305 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.StartOrStop); | |||||
} | |||||
} | |||||
} |
@@ -1,27 +0,0 @@ | |||||
using JT808.Protocol.Extensions.JT1078.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.Interfaces; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace JT808.Protocol.Extensions.JT1078.Formatters | |||||
{ | |||||
public class JT808_0x9306_Formatter : IJT808MessagePackFormatter<JT808_0x9306> | |||||
{ | |||||
public JT808_0x9306 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9306 jT808_0x9306 = new JT808_0x9306(); | |||||
jT808_0x9306.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9306.ChangeMultipleControl = reader.ReadByte(); | |||||
return jT808_0x9306; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9306 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.ChangeMultipleControl); | |||||
} | |||||
} | |||||
} |
@@ -15,7 +15,7 @@ | |||||
<licenseUrl>https://github.com/SmallChi/JT1078/blob/master/LICENSE</licenseUrl> | <licenseUrl>https://github.com/SmallChi/JT1078/blob/master/LICENSE</licenseUrl> | ||||
<license>https://github.com/SmallChi/JT1078/blob/master/LICENSE</license> | <license>https://github.com/SmallChi/JT1078/blob/master/LICENSE</license> | ||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild> | <GeneratePackageOnBuild>false</GeneratePackageOnBuild> | ||||
<Version>2.1.7</Version> | |||||
<Version>2.2.0-preview1</Version> | |||||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | <PackageLicenseFile>LICENSE</PackageLicenseFile> | ||||
</PropertyGroup> | </PropertyGroup> | ||||
@@ -28,7 +28,7 @@ | |||||
</PropertyGroup> | </PropertyGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="JT808" Version="2.1.7" /> | |||||
<PackageReference Include="JT808" Version="2.2.0-preview2" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -1,6 +1,6 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
{ | { | ||||
@@ -8,8 +8,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 视频相关报警 | /// 视频相关报警 | ||||
/// 0x0200_0x14 | /// 0x0200_0x14 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x0200_0x14_Formatter))] | |||||
public class JT808_0x0200_0x14 : JT808_0x0200_BodyBase | |||||
public class JT808_0x0200_0x14 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter<JT808_0x0200_0x14> | |||||
{ | { | ||||
public override byte AttachInfoId { get; set; } = 0x14; | public override byte AttachInfoId { get; set; } = 0x14; | ||||
/// <summary> | /// <summary> | ||||
@@ -20,5 +19,21 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 视频相关报警 | /// 视频相关报警 | ||||
/// </summary> | /// </summary> | ||||
public uint VideoRelateAlarm { get; set; } | public uint VideoRelateAlarm { get; set; } | ||||
public JT808_0x0200_0x14 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x0200_0x14 jT808_0x0200_0x14 = new JT808_0x0200_0x14(); | |||||
jT808_0x0200_0x14.AttachInfoId = reader.ReadByte(); | |||||
jT808_0x0200_0x14.AttachInfoLength = reader.ReadByte(); | |||||
jT808_0x0200_0x14.VideoRelateAlarm = reader.ReadUInt32(); | |||||
return jT808_0x0200_0x14; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x14 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.AttachInfoId); | |||||
writer.WriteByte(value.AttachInfoLength); | |||||
writer.WriteUInt32(value.VideoRelateAlarm); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,6 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
{ | { | ||||
@@ -8,8 +8,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 视频信号丢失报警状态 | /// 视频信号丢失报警状态 | ||||
/// 0x0200_0x15 | /// 0x0200_0x15 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x0200_0x15_Formatter))] | |||||
public class JT808_0x0200_0x15 : JT808_0x0200_BodyBase | |||||
public class JT808_0x0200_0x15 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter<JT808_0x0200_0x15> | |||||
{ | { | ||||
public override byte AttachInfoId { get; set; } = 0x15; | public override byte AttachInfoId { get; set; } = 0x15; | ||||
/// <summary> | /// <summary> | ||||
@@ -20,5 +19,21 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 视频信号丢失报警状态 | /// 视频信号丢失报警状态 | ||||
/// </summary> | /// </summary> | ||||
public uint VideoSignalLoseAlarmStatus { get; set; } | public uint VideoSignalLoseAlarmStatus { get; set; } | ||||
public JT808_0x0200_0x15 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x0200_0x15 jT808_0x0200_0x15 = new JT808_0x0200_0x15(); | |||||
jT808_0x0200_0x15.AttachInfoId = reader.ReadByte(); | |||||
jT808_0x0200_0x15.AttachInfoLength = reader.ReadByte(); | |||||
jT808_0x0200_0x15.VideoSignalLoseAlarmStatus = reader.ReadUInt32(); | |||||
return jT808_0x0200_0x15; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x15 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.AttachInfoId); | |||||
writer.WriteByte(value.AttachInfoLength); | |||||
writer.WriteUInt32(value.VideoSignalLoseAlarmStatus); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,6 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
{ | { | ||||
@@ -8,8 +8,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 视频信号遮挡报警状态 | /// 视频信号遮挡报警状态 | ||||
/// 0x0200_0x16 | /// 0x0200_0x16 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x0200_0x16_Formatter))] | |||||
public class JT808_0x0200_0x16 : JT808_0x0200_BodyBase | |||||
public class JT808_0x0200_0x16 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter<JT808_0x0200_0x16> | |||||
{ | { | ||||
public override byte AttachInfoId { get; set; } = 0x16; | public override byte AttachInfoId { get; set; } = 0x16; | ||||
/// <summary> | /// <summary> | ||||
@@ -20,5 +19,21 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 视频信号遮挡报警状态 | /// 视频信号遮挡报警状态 | ||||
/// </summary> | /// </summary> | ||||
public uint VideoSignalOcclusionAlarmStatus { get; set; } | public uint VideoSignalOcclusionAlarmStatus { get; set; } | ||||
public JT808_0x0200_0x16 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x0200_0x16 jT808_0x0200_0x16 = new JT808_0x0200_0x16(); | |||||
jT808_0x0200_0x16.AttachInfoId = reader.ReadByte(); | |||||
jT808_0x0200_0x16.AttachInfoLength = reader.ReadByte(); | |||||
jT808_0x0200_0x16.VideoSignalOcclusionAlarmStatus = reader.ReadUInt32(); | |||||
return jT808_0x0200_0x16; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x16 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.AttachInfoId); | |||||
writer.WriteByte(value.AttachInfoLength); | |||||
writer.WriteUInt32(value.VideoSignalOcclusionAlarmStatus); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,6 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
{ | { | ||||
@@ -8,8 +8,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 存储器故障报警状态 | /// 存储器故障报警状态 | ||||
/// 0x0200_0x17 | /// 0x0200_0x17 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x0200_0x17_Formatter))] | |||||
public class JT808_0x0200_0x17 : JT808_0x0200_BodyBase | |||||
public class JT808_0x0200_0x17 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter<JT808_0x0200_0x17> | |||||
{ | { | ||||
public override byte AttachInfoId { get; set; } = 0x17; | public override byte AttachInfoId { get; set; } = 0x17; | ||||
/// <summary> | /// <summary> | ||||
@@ -20,5 +19,21 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 存储器故障报警状态 | /// 存储器故障报警状态 | ||||
/// </summary> | /// </summary> | ||||
public ushort StorageFaultAlarmStatus{ get; set; } | public ushort StorageFaultAlarmStatus{ get; set; } | ||||
public JT808_0x0200_0x17 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x0200_0x17 jT808_0x0200_0x17 = new JT808_0x0200_0x17(); | |||||
jT808_0x0200_0x17.AttachInfoId = reader.ReadByte(); | |||||
jT808_0x0200_0x17.AttachInfoLength = reader.ReadByte(); | |||||
jT808_0x0200_0x17.StorageFaultAlarmStatus = reader.ReadUInt16(); | |||||
return jT808_0x0200_0x17; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x17 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.AttachInfoId); | |||||
writer.WriteByte(value.AttachInfoLength); | |||||
writer.WriteUInt16(value.StorageFaultAlarmStatus); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,6 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
{ | { | ||||
@@ -8,8 +8,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 异常驾驶行为报警详细描述 | /// 异常驾驶行为报警详细描述 | ||||
/// 0x0200_0x18 | /// 0x0200_0x18 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x0200_0x18_Formatter))] | |||||
public class JT808_0x0200_0x18 : JT808_0x0200_BodyBase | |||||
public class JT808_0x0200_0x18 : JT808_0x0200_BodyBase, IJT808MessagePackFormatter<JT808_0x0200_0x18> | |||||
{ | { | ||||
public override byte AttachInfoId { get; set; } = 0x18; | public override byte AttachInfoId { get; set; } = 0x18; | ||||
/// <summary> | /// <summary> | ||||
@@ -20,5 +19,20 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 异常驾驶行为报警详细描述 | /// 异常驾驶行为报警详细描述 | ||||
/// </summary> | /// </summary> | ||||
public ushort AbnormalDrivingBehaviorAlarmInfo { get; set; } | public ushort AbnormalDrivingBehaviorAlarmInfo { get; set; } | ||||
public JT808_0x0200_0x18 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x0200_0x18 jT808_0x0200_0x18 = new JT808_0x0200_0x18(); | |||||
jT808_0x0200_0x18.AttachInfoId = reader.ReadByte(); | |||||
jT808_0x0200_0x18.AttachInfoLength = reader.ReadByte(); | |||||
jT808_0x0200_0x18.AbnormalDrivingBehaviorAlarmInfo = reader.ReadUInt16(); | |||||
return jT808_0x0200_0x18; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x0200_0x18 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.AttachInfoId); | |||||
writer.WriteByte(value.AttachInfoLength); | |||||
writer.WriteUInt16(value.AbnormalDrivingBehaviorAlarmInfo); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 终端上传音视频属性 | /// 终端上传音视频属性 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x1003_Formatter))] | |||||
public class JT808_0x1003 : JT808Bodies | |||||
public class JT808_0x1003 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x1003> | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 输入音频编码方式 | /// 输入音频编码方式 | ||||
@@ -48,5 +47,35 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 终端支持的最大视频物理通道数量 | /// 终端支持的最大视频物理通道数量 | ||||
/// </summary> | /// </summary> | ||||
public byte TerminalSupportedMaxNumberOfVideoPhysicalChannels { get; set; } | public byte TerminalSupportedMaxNumberOfVideoPhysicalChannels { get; set; } | ||||
public override ushort MsgId => 0x1003; | |||||
public JT808_0x1003 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x1003 jT808_0x1003 = new JT808_0x1003(); | |||||
jT808_0x1003.EnterAudioEncoding = reader.ReadByte(); | |||||
jT808_0x1003.EnterAudioChannelsNumber = reader.ReadByte(); | |||||
jT808_0x1003.EnterAudioSampleRate = reader.ReadByte(); | |||||
jT808_0x1003.EnterAudioSampleDigits = reader.ReadByte(); | |||||
jT808_0x1003.AudioFrameLength = reader.ReadUInt16(); | |||||
jT808_0x1003.IsSupportedAudioOutput = reader.ReadByte(); | |||||
jT808_0x1003.VideoEncoding = reader.ReadByte(); | |||||
jT808_0x1003.TerminalSupportedMaxNumberOfAudioPhysicalChannels = reader.ReadByte(); | |||||
jT808_0x1003.TerminalSupportedMaxNumberOfVideoPhysicalChannels = reader.ReadByte(); | |||||
return jT808_0x1003; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1003 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.EnterAudioEncoding); | |||||
writer.WriteByte(value.EnterAudioChannelsNumber); | |||||
writer.WriteByte(value.EnterAudioSampleRate); | |||||
writer.WriteByte(value.EnterAudioSampleDigits); | |||||
writer.WriteUInt16(value.AudioFrameLength); | |||||
writer.WriteByte(value.IsSupportedAudioOutput); | |||||
writer.WriteByte(value.VideoEncoding); | |||||
writer.WriteByte(value.TerminalSupportedMaxNumberOfAudioPhysicalChannels); | |||||
writer.WriteByte(value.TerminalSupportedMaxNumberOfVideoPhysicalChannels); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 终端上传乘客流量 | /// 终端上传乘客流量 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x1005_Formatter))] | |||||
public class JT808_0x1005 : JT808Bodies | |||||
public class JT808_0x1005 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x1005> | |||||
{ | { | ||||
public override ushort MsgId => 0x1005; | |||||
/// <summary> | /// <summary> | ||||
/// 起始时间 | /// 起始时间 | ||||
/// </summary> | /// </summary> | ||||
@@ -28,5 +28,23 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 下车人数 | /// 下车人数 | ||||
/// </summary> | /// </summary> | ||||
public ushort GettingOffNumber { get; set; } | public ushort GettingOffNumber { get; set; } | ||||
public JT808_0x1005 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x1005 jT808_0x1005 = new JT808_0x1005(); | |||||
jT808_0x1005.BeginTime = reader.ReadDateTime6(); | |||||
jT808_0x1005.EndTime = reader.ReadDateTime6(); | |||||
jT808_0x1005.GettingOnNumber = reader.ReadUInt16(); | |||||
jT808_0x1005.GettingOffNumber = reader.ReadUInt16(); | |||||
return jT808_0x1005; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1005 value, IJT808Config config) | |||||
{ | |||||
writer.WriteDateTime6(value.BeginTime); | |||||
writer.WriteDateTime6(value.EndTime); | |||||
writer.WriteUInt16(value.GettingOnNumber); | |||||
writer.WriteUInt16(value.GettingOffNumber); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,7 +1,8 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | |||||
using System.Text; | using System.Text; | ||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
@@ -9,9 +10,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 终端上传音视频资源列表 | /// 终端上传音视频资源列表 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x1205_Formatter))] | |||||
public class JT808_0x1205 : JT808Bodies | |||||
public class JT808_0x1205 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x1205> | |||||
{ | { | ||||
public override ushort MsgId => 0x1205; | |||||
/// <summary> | /// <summary> | ||||
/// 流水号 | /// 流水号 | ||||
/// </summary> | /// </summary> | ||||
@@ -24,5 +25,37 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 音视频资源列表 | /// 音视频资源列表 | ||||
/// </summary> | /// </summary> | ||||
public List<JT808_0x1205_AVResouce> AVResouces { get; set; } | public List<JT808_0x1205_AVResouce> AVResouces { get; set; } | ||||
public JT808_0x1205 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x1205 jT808_0x1205 = new JT808_0x1205(); | |||||
jT808_0x1205.MsgNum = reader.ReadUInt16(); | |||||
jT808_0x1205.AVResouceTotal = reader.ReadUInt32(); | |||||
var channelTotal = jT808_0x1205.AVResouceTotal;//音视频资源总数 | |||||
if (channelTotal > 0) | |||||
{ | |||||
jT808_0x1205.AVResouces = new List<JT808_0x1205_AVResouce>(); | |||||
var formatter = config.GetMessagePackFormatter<JT808_0x1205_AVResouce>(); | |||||
for (int i = 0; i < channelTotal; i++) | |||||
{ | |||||
jT808_0x1205.AVResouces.Add(formatter.Deserialize(ref reader, config)); | |||||
} | |||||
} | |||||
return jT808_0x1205; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1205 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt16(value.MsgNum); | |||||
writer.WriteUInt32(value.AVResouceTotal); | |||||
if (value.AVResouces.Any()) | |||||
{ | |||||
var formatter = config.GetMessagePackFormatter<JT808_0x1205_AVResouce>(); | |||||
foreach (var AVResouce in value.AVResouces) | |||||
{ | |||||
formatter.Serialize(ref writer, AVResouce, config); | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 终端上传音视频资源列表 | /// 终端上传音视频资源列表 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x1205_AVResouce_Formatter))] | |||||
public class JT808_0x1205_AVResouce | |||||
public class JT808_0x1205_AVResouce:IJT808MessagePackFormatter<JT808_0x1205_AVResouce> | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 逻辑通道号 | /// 逻辑通道号 | ||||
@@ -44,5 +43,31 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 文件大小 | /// 文件大小 | ||||
/// </summary> | /// </summary> | ||||
public uint FileSize { get; set; } | public uint FileSize { get; set; } | ||||
public JT808_0x1205_AVResouce Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x1205_AVResouce jT808_0x1205_AVResouce = new JT808_0x1205_AVResouce(); | |||||
jT808_0x1205_AVResouce.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x1205_AVResouce.BeginTime = reader.ReadDateTime6(); | |||||
jT808_0x1205_AVResouce.EndTime = reader.ReadDateTime6(); | |||||
jT808_0x1205_AVResouce.AlarmFlag = reader.ReadUInt32(); | |||||
jT808_0x1205_AVResouce.AVResourceType = reader.ReadByte(); | |||||
jT808_0x1205_AVResouce.StreamType = reader.ReadByte(); | |||||
jT808_0x1205_AVResouce.MemoryType = reader.ReadByte(); | |||||
jT808_0x1205_AVResouce.FileSize = reader.ReadUInt32(); | |||||
return jT808_0x1205_AVResouce; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1205_AVResouce value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteDateTime6(value.BeginTime); | |||||
writer.WriteDateTime6(value.EndTime); | |||||
writer.WriteUInt32(value.AlarmFlag); | |||||
writer.WriteByte(value.AVResourceType); | |||||
writer.WriteByte(value.StreamType); | |||||
writer.WriteByte(value.MemoryType); | |||||
writer.WriteUInt32(value.FileSize); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 文件上传完成通知 | /// 文件上传完成通知 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x1206_Formatter))] | |||||
public class JT808_0x1206 : JT808Bodies | |||||
public class JT808_0x1206 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x1206> | |||||
{ | { | ||||
public override ushort MsgId => 0x1206; | |||||
/// <summary> | /// <summary> | ||||
/// 流水号 | /// 流水号 | ||||
/// </summary> | /// </summary> | ||||
@@ -20,5 +20,18 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 结果 | /// 结果 | ||||
/// </summary> | /// </summary> | ||||
public byte Result{ get; set; } | public byte Result{ get; set; } | ||||
public JT808_0x1206 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x1206 jT808_0x1206 = new JT808_0x1206(); | |||||
jT808_0x1206.MsgNum = reader.ReadUInt16(); | |||||
jT808_0x1206.Result = reader.ReadByte(); | |||||
return jT808_0x1206; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x1206 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt16(value.MsgNum); | |||||
writer.WriteByte(value.Result); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,6 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
{ | { | ||||
@@ -8,8 +8,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 音视频参数设置 | /// 音视频参数设置 | ||||
/// 0x8103_0x0075 | /// 0x8103_0x0075 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x8103_0x0075_Formatter))] | |||||
public class JT808_0x8103_0x0075 : JT808_0x8103_BodyBase | |||||
public class JT808_0x8103_0x0075 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0075> | |||||
{ | { | ||||
public override uint ParamId { get; set; } = 0x0075; | public override uint ParamId { get; set; } = 0x0075; | ||||
/// <summary> | /// <summary> | ||||
@@ -70,5 +69,43 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
///1:启用 | ///1:启用 | ||||
/// </summary> | /// </summary> | ||||
public byte AudioOutputEnabled { get; set; } | public byte AudioOutputEnabled { get; set; } | ||||
public JT808_0x8103_0x0075 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x0075 jT808_0X8103_0X0075 = new JT808_0x8103_0x0075(); | |||||
jT808_0X8103_0X0075.ParamId = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0075.ParamLength = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.RTS_EncodeMode = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.RTS_Resolution = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.RTS_KF_Interval = reader.ReadUInt16(); | |||||
jT808_0X8103_0X0075.RTS_Target_FPS = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.RTS_Target_CodeRate = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0075.StreamStore_EncodeMode = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.StreamStore_Resolution = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.StreamStore_KF_Interval = reader.ReadUInt16(); | |||||
jT808_0X8103_0X0075.StreamStore_Target_FPS = reader.ReadByte(); | |||||
jT808_0X8103_0X0075.StreamStore_Target_CodeRate = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0075.OSD = reader.ReadUInt16(); | |||||
jT808_0X8103_0X0075.AudioOutputEnabled = reader.ReadByte(); | |||||
return jT808_0X8103_0X0075; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0075 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.WriteByte(value.ParamLength); | |||||
writer.WriteByte(value.RTS_EncodeMode); | |||||
writer.WriteByte(value.RTS_Resolution); | |||||
writer.WriteUInt16(value.RTS_KF_Interval); | |||||
writer.WriteByte(value.RTS_Target_FPS); | |||||
writer.WriteUInt32(value.RTS_Target_CodeRate); | |||||
writer.WriteByte(value.StreamStore_EncodeMode); | |||||
writer.WriteByte(value.StreamStore_Resolution); | |||||
writer.WriteUInt16(value.StreamStore_KF_Interval); | |||||
writer.WriteByte(value.StreamStore_Target_FPS); | |||||
writer.WriteUInt32(value.StreamStore_Target_CodeRate); | |||||
writer.WriteUInt16(value.OSD); | |||||
writer.WriteByte(value.AudioOutputEnabled); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,17 +1,16 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | |||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
{ | { | ||||
#warning todo:继承非自定义类的时候,没有添加到相应的字典中 | |||||
/// <summary> | /// <summary> | ||||
/// 音视频通道列表设置 | /// 音视频通道列表设置 | ||||
/// 0x8103_0x0076 | /// 0x8103_0x0076 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x8103_0x0076_Formatter))] | |||||
public class JT808_0x8103_0x0076 : JT808_0x8103_BodyBase | |||||
public class JT808_0x8103_0x0076 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0076> | |||||
{ | { | ||||
public override uint ParamId { get; set; } = 0x0076; | public override uint ParamId { get; set; } = 0x0076; | ||||
/// <summary> | /// <summary> | ||||
@@ -38,5 +37,44 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 4*(l+m+n) | /// 4*(l+m+n) | ||||
/// </summary> | /// </summary> | ||||
public List<JT808_0x8103_0x0076_AVChannelRefTable> AVChannelRefTables { get; set; } | public List<JT808_0x8103_0x0076_AVChannelRefTable> AVChannelRefTables { get; set; } | ||||
public JT808_0x8103_0x0076 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x0076 jT808_0X8103_0X0076 = new JT808_0x8103_0x0076(); | |||||
jT808_0X8103_0X0076.ParamId = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0076.ParamLength = reader.ReadByte(); | |||||
jT808_0X8103_0X0076.AVChannelTotal = reader.ReadByte(); | |||||
jT808_0X8103_0X0076.AudioChannelTotal = reader.ReadByte(); | |||||
jT808_0X8103_0X0076.VudioChannelTotal = reader.ReadByte(); | |||||
var channelTotal = jT808_0X8103_0X0076.AVChannelTotal + jT808_0X8103_0X0076.AudioChannelTotal + jT808_0X8103_0X0076.VudioChannelTotal;//通道总数 | |||||
if (channelTotal > 0) | |||||
{ | |||||
jT808_0X8103_0X0076.AVChannelRefTables = new List<JT808_0x8103_0x0076_AVChannelRefTable>(); | |||||
var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0076_AVChannelRefTable>(); | |||||
for (int i = 0; i < channelTotal; i++) | |||||
{ | |||||
jT808_0X8103_0X0076.AVChannelRefTables.Add(formatter.Deserialize(ref reader, config)); | |||||
} | |||||
} | |||||
return jT808_0X8103_0X0076; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0076 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.Skip(1, out int position); | |||||
writer.WriteByte(value.AVChannelTotal); | |||||
writer.WriteByte(value.AudioChannelTotal); | |||||
writer.WriteByte(value.VudioChannelTotal); | |||||
if (value.AVChannelRefTables.Any()) | |||||
{ | |||||
var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0076_AVChannelRefTable>(); | |||||
foreach (var AVChannelRefTable in value.AVChannelRefTables) | |||||
{ | |||||
formatter.Serialize(ref writer, AVChannelRefTable, config); | |||||
} | |||||
} | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.MessageBody; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
{ | { | ||||
@@ -8,8 +7,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 音视频通道列表设置 | /// 音视频通道列表设置 | ||||
/// 0x8103_0x0076_AVChannelRefTable | /// 0x8103_0x0076_AVChannelRefTable | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x8103_0x0076_AVChannelRefTable_Formatter))] | |||||
public class JT808_0x8103_0x0076_AVChannelRefTable | |||||
public class JT808_0x8103_0x0076_AVChannelRefTable: IJT808MessagePackFormatter<JT808_0x8103_0x0076_AVChannelRefTable> | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 物理通道号 | /// 物理通道号 | ||||
@@ -27,5 +25,22 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 是否链接云台 | /// 是否链接云台 | ||||
/// </summary> | /// </summary> | ||||
public byte IsConnectCloudPlat { get; set; } | public byte IsConnectCloudPlat { get; set; } | ||||
public JT808_0x8103_0x0076_AVChannelRefTable Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x0076_AVChannelRefTable jT808_0X8103_0X0076_AVChannelRefTable = new JT808_0x8103_0x0076_AVChannelRefTable(); | |||||
jT808_0X8103_0X0076_AVChannelRefTable.PhysicalChannelNo = reader.ReadByte(); | |||||
jT808_0X8103_0X0076_AVChannelRefTable.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0X8103_0X0076_AVChannelRefTable.ChannelType = reader.ReadByte(); | |||||
jT808_0X8103_0X0076_AVChannelRefTable.IsConnectCloudPlat = reader.ReadByte(); | |||||
return jT808_0X8103_0X0076_AVChannelRefTable; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0076_AVChannelRefTable value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.PhysicalChannelNo); | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.ChannelType); | |||||
writer.WriteByte(value.IsConnectCloudPlat); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,7 +1,8 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | |||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
{ | { | ||||
@@ -9,8 +10,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
///单独视频通道参数设置 | ///单独视频通道参数设置 | ||||
/// 0x8103_0x0077 | /// 0x8103_0x0077 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x8103_0x0077_Formatter))] | |||||
public class JT808_0x8103_0x0077 : JT808_0x8103_BodyBase | |||||
public class JT808_0x8103_0x0077 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0077> | |||||
{ | { | ||||
public override uint ParamId { get; set; } = 0x0077; | public override uint ParamId { get; set; } = 0x0077; | ||||
/// <summary> | /// <summary> | ||||
@@ -23,5 +23,39 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
public byte NeedSetChannelTotal { get; set; } | public byte NeedSetChannelTotal { get; set; } | ||||
public List<JT808_0x8103_0x0077_SignalChannel> SignalChannels { get; set; } | public List<JT808_0x8103_0x0077_SignalChannel> SignalChannels { get; set; } | ||||
public JT808_0x8103_0x0077 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x0077 jT808_0X8103_0X0077 = new JT808_0x8103_0x0077(); | |||||
jT808_0X8103_0X0077.ParamId = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0077.ParamLength = reader.ReadByte(); | |||||
jT808_0X8103_0X0077.NeedSetChannelTotal = reader.ReadByte(); | |||||
if (jT808_0X8103_0X0077.NeedSetChannelTotal > 0) | |||||
{ | |||||
jT808_0X8103_0X0077.SignalChannels = new List<JT808_0x8103_0x0077_SignalChannel>(); | |||||
var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0077_SignalChannel>(); | |||||
for (int i = 0; i < jT808_0X8103_0X0077.NeedSetChannelTotal; i++) | |||||
{ | |||||
jT808_0X8103_0X0077.SignalChannels.Add(formatter.Deserialize(ref reader, config)); | |||||
} | |||||
} | |||||
return jT808_0X8103_0X0077; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0077 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.Skip(1, out var position); | |||||
writer.WriteByte(value.NeedSetChannelTotal); | |||||
if (value.SignalChannels.Any()) | |||||
{ | |||||
var formatter = config.GetMessagePackFormatter<JT808_0x8103_0x0077_SignalChannel>(); | |||||
foreach (var signalChannel in value.SignalChannels) | |||||
{ | |||||
formatter.Serialize(ref writer, signalChannel, config); | |||||
} | |||||
} | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,13 +1,12 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
{ | { | ||||
[JT808Formatter(typeof(JT808_0x8103_0x0077_SignalChannel_Formatter))] | |||||
public class JT808_0x8103_0x0077_SignalChannel | |||||
public class JT808_0x8103_0x0077_SignalChannel: IJT808MessagePackFormatter<JT808_0x8103_0x0077_SignalChannel> | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 逻辑通道号 | /// 逻辑通道号 | ||||
@@ -61,5 +60,38 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
///OSD字幕叠加设置 | ///OSD字幕叠加设置 | ||||
/// </summary> | /// </summary> | ||||
public ushort OSD { get; set; } | public ushort OSD { get; set; } | ||||
public JT808_0x8103_0x0077_SignalChannel Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x0077_SignalChannel jT808_0X8103_0X0077_SignalChannel = new JT808_0x8103_0x0077_SignalChannel(); | |||||
jT808_0X8103_0X0077_SignalChannel.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.RTS_EncodeMode = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.RTS_Resolution = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.RTS_KF_Interval = reader.ReadUInt16(); | |||||
jT808_0X8103_0X0077_SignalChannel.RTS_Target_FPS = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.RTS_Target_CodeRate = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0077_SignalChannel.StreamStore_EncodeMode = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.StreamStore_Resolution = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.StreamStore_KF_Interval = reader.ReadUInt16(); | |||||
jT808_0X8103_0X0077_SignalChannel.StreamStore_Target_FPS = reader.ReadByte(); | |||||
jT808_0X8103_0X0077_SignalChannel.StreamStore_Target_CodeRate = reader.ReadUInt32(); | |||||
jT808_0X8103_0X0077_SignalChannel.OSD = reader.ReadUInt16(); | |||||
return jT808_0X8103_0X0077_SignalChannel; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0077_SignalChannel value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.RTS_EncodeMode); | |||||
writer.WriteByte(value.RTS_Resolution); | |||||
writer.WriteUInt16(value.RTS_KF_Interval); | |||||
writer.WriteByte(value.RTS_Target_FPS); | |||||
writer.WriteUInt32(value.RTS_Target_CodeRate); | |||||
writer.WriteByte(value.StreamStore_EncodeMode); | |||||
writer.WriteByte(value.StreamStore_Resolution); | |||||
writer.WriteUInt16(value.StreamStore_KF_Interval); | |||||
writer.WriteByte(value.StreamStore_Target_FPS); | |||||
writer.WriteUInt32(value.StreamStore_Target_CodeRate); | |||||
writer.WriteUInt16(value.OSD); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,6 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
@@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 特殊报警录像参数设置 | /// 特殊报警录像参数设置 | ||||
/// 0x8103_0x0079 | /// 0x8103_0x0079 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x8103_0x0079_Formatter))] | |||||
public class JT808_0x8103_0x0079 : JT808_0x8103_BodyBase | |||||
public class JT808_0x8103_0x0079 : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x0079> | |||||
{ | { | ||||
public override uint ParamId { get; set; } = 0x0079; | public override uint ParamId { get; set; } = 0x0079; | ||||
/// <summary> | /// <summary> | ||||
@@ -30,5 +29,25 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 分钟min | /// 分钟min | ||||
/// </summary> | /// </summary> | ||||
public byte BeginMinute { get; set; } | public byte BeginMinute { get; set; } | ||||
public JT808_0x8103_0x0079 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x0079 jT808_0x8103_0x0079 = new JT808_0x8103_0x0079(); | |||||
jT808_0x8103_0x0079.ParamId = reader.ReadUInt32(); | |||||
jT808_0x8103_0x0079.ParamLength = reader.ReadByte(); | |||||
jT808_0x8103_0x0079.StorageThresholds = reader.ReadByte(); | |||||
jT808_0x8103_0x0079.Duration = reader.ReadByte(); | |||||
jT808_0x8103_0x0079.BeginMinute = reader.ReadByte(); | |||||
return jT808_0x8103_0x0079; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x0079 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.WriteByte(value.ParamLength); | |||||
writer.WriteByte(value.StorageThresholds); | |||||
writer.WriteByte(value.Duration); | |||||
writer.WriteByte(value.BeginMinute); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,6 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
@@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 视频相关报警屏蔽字 | /// 视频相关报警屏蔽字 | ||||
/// 0x8103_0x007A | /// 0x8103_0x007A | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x8103_0x007A_Formatter))] | |||||
public class JT808_0x8103_0x007A : JT808_0x8103_BodyBase | |||||
public class JT808_0x8103_0x007A : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x007A> | |||||
{ | { | ||||
public override uint ParamId { get; set; } = 0x007A; | public override uint ParamId { get; set; } = 0x007A; | ||||
/// <summary> | /// <summary> | ||||
@@ -21,5 +20,20 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 视频相关屏蔽报警字 | /// 视频相关屏蔽报警字 | ||||
/// </summary> | /// </summary> | ||||
public uint AlarmShielding { get; set; } | public uint AlarmShielding { get; set; } | ||||
public JT808_0x8103_0x007A Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x007A jT808_0x8103_0x007A = new JT808_0x8103_0x007A(); | |||||
jT808_0x8103_0x007A.ParamId = reader.ReadUInt32(); | |||||
jT808_0x8103_0x007A.ParamLength = reader.ReadByte(); | |||||
jT808_0x8103_0x007A.AlarmShielding = reader.ReadUInt32(); | |||||
return jT808_0x8103_0x007A; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007A value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.WriteByte(value.ParamLength); | |||||
writer.WriteUInt32(value.AlarmShielding); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,6 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
@@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 图像分析报警参数设置 | /// 图像分析报警参数设置 | ||||
/// 0x8103_0x007B | /// 0x8103_0x007B | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x8103_0x007B_Formatter))] | |||||
public class JT808_0x8103_0x007B : JT808_0x8103_BodyBase | |||||
public class JT808_0x8103_0x007B : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x007B> | |||||
{ | { | ||||
public override uint ParamId { get; set; } = 0x007B; | public override uint ParamId { get; set; } = 0x007B; | ||||
/// <summary> | /// <summary> | ||||
@@ -25,5 +24,23 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 疲劳程度阈值 | /// 疲劳程度阈值 | ||||
/// </summary> | /// </summary> | ||||
public byte FatigueThreshold { get; set; } | public byte FatigueThreshold { get; set; } | ||||
public JT808_0x8103_0x007B Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x007B jT808_0x8103_0x007B = new JT808_0x8103_0x007B(); | |||||
jT808_0x8103_0x007B.ParamId = reader.ReadUInt32(); | |||||
jT808_0x8103_0x007B.ParamLength = reader.ReadByte(); | |||||
jT808_0x8103_0x007B.NuclearLoadNumber = reader.ReadByte(); | |||||
jT808_0x8103_0x007B.FatigueThreshold = reader.ReadByte(); | |||||
return jT808_0x8103_0x007B; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007B value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.WriteByte(value.ParamLength); | |||||
writer.WriteByte(value.NuclearLoadNumber); | |||||
writer.WriteByte(value.FatigueThreshold); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,6 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
@@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
///终端休眠模式唤醒设置 | ///终端休眠模式唤醒设置 | ||||
/// 0x8103_0x007C | /// 0x8103_0x007C | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x8103_0x007C_Formatter))] | |||||
public class JT808_0x8103_0x007C : JT808_0x8103_BodyBase | |||||
public class JT808_0x8103_0x007C : JT808_0x8103_BodyBase, IJT808MessagePackFormatter<JT808_0x8103_0x007C> | |||||
{ | { | ||||
public override uint ParamId { get; set; } = 0x007C; | public override uint ParamId { get; set; } = 0x007C; | ||||
/// <summary> | /// <summary> | ||||
@@ -33,5 +32,28 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 日定时唤醒参数列表 | /// 日定时唤醒参数列表 | ||||
/// </summary> | /// </summary> | ||||
public JT808_0x8103_0x007C_TimerWakeDayParamter TimerWakeDayParamter { get; set; } | public JT808_0x8103_0x007C_TimerWakeDayParamter TimerWakeDayParamter { get; set; } | ||||
public JT808_0x8103_0x007C Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x007C jT808_0x8103_0x007C = new JT808_0x8103_0x007C(); | |||||
jT808_0x8103_0x007C.ParamId = reader.ReadUInt32(); | |||||
jT808_0x8103_0x007C.ParamLength = reader.ReadByte(); | |||||
jT808_0x8103_0x007C.SleepWakeMode = reader.ReadByte(); | |||||
jT808_0x8103_0x007C.WakeConditionType = reader.ReadByte(); | |||||
jT808_0x8103_0x007C.TimerWakeDaySet = reader.ReadByte(); | |||||
jT808_0x8103_0x007C.TimerWakeDayParamter = config.GetMessagePackFormatter<JT808_0x8103_0x007C_TimerWakeDayParamter>().Deserialize(ref reader, config); | |||||
return jT808_0x8103_0x007C; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007C value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt32(value.ParamId); | |||||
writer.Skip(1, out var position); | |||||
writer.WriteByte(value.SleepWakeMode); | |||||
writer.WriteByte(value.WakeConditionType); | |||||
writer.WriteByte(value.TimerWakeDaySet); | |||||
config.GetMessagePackFormatter<JT808_0x8103_0x007C_TimerWakeDayParamter>().Serialize(ref writer, value.TimerWakeDayParamter, config); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,6 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessageBody; | using JT808.Protocol.MessageBody; | ||||
using JT808.Protocol.MessagePack; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
namespace JT808.Protocol.Extensions.JT1078.MessageBody | namespace JT808.Protocol.Extensions.JT1078.MessageBody | ||||
@@ -9,8 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
///终端休眠模式唤醒设置 | ///终端休眠模式唤醒设置 | ||||
/// 0x8103_0x007C | /// 0x8103_0x007C | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x8103_0x007C_TimerWakeDayParamter_Formatter))] | |||||
public class JT808_0x8103_0x007C_TimerWakeDayParamter | |||||
public class JT808_0x8103_0x007C_TimerWakeDayParamter:IJT808MessagePackFormatter<JT808_0x8103_0x007C_TimerWakeDayParamter> | |||||
{ | { | ||||
/// <summary> | /// <summary> | ||||
/// 定时唤醒启用标志 | /// 定时唤醒启用标志 | ||||
@@ -56,5 +55,33 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 2 | /// 2 | ||||
/// </summary> | /// </summary> | ||||
public string TimePeriod4CloseTime { get; set; } | public string TimePeriod4CloseTime { get; set; } | ||||
public JT808_0x8103_0x007C_TimerWakeDayParamter Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x8103_0x007C_TimerWakeDayParamter jT808_0x8103_0x007C_TimerWakeDayParamter = new JT808_0x8103_0x007C_TimerWakeDayParamter(); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimerWakeEnableFlag = reader.ReadByte(); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod1WakeTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod1CloseTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod2WakeTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod2CloseTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod3WakeTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod3CloseTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod4WakeTime = reader.ReadBCD(4); | |||||
jT808_0x8103_0x007C_TimerWakeDayParamter.TimePeriod4CloseTime = reader.ReadBCD(4); | |||||
return jT808_0x8103_0x007C_TimerWakeDayParamter; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0x007C_TimerWakeDayParamter value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.TimerWakeEnableFlag); | |||||
writer.WriteBCD(value.TimePeriod1WakeTime, 4); | |||||
writer.WriteBCD(value.TimePeriod1CloseTime, 4); | |||||
writer.WriteBCD(value.TimePeriod2WakeTime, 4); | |||||
writer.WriteBCD(value.TimePeriod2CloseTime, 4); | |||||
writer.WriteBCD(value.TimePeriod3WakeTime, 4); | |||||
writer.WriteBCD(value.TimePeriod3CloseTime, 4); | |||||
writer.WriteBCD(value.TimePeriod4WakeTime, 4); | |||||
writer.WriteBCD(value.TimePeriod4CloseTime, 4); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,6 +1,4 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using System; | |||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -11,6 +9,7 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// </summary> | /// </summary> | ||||
public class JT808_0x9003:JT808Bodies | public class JT808_0x9003:JT808Bodies | ||||
{ | { | ||||
public override ushort MsgId => 0x9003; | |||||
public override bool SkipSerialization { get; set; } = true; | public override bool SkipSerialization { get; set; } = true; | ||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 实时音视频传输请求 | /// 实时音视频传输请求 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9101_Formatter))] | |||||
public class JT808_0x9101:JT808Bodies | |||||
public class JT808_0x9101:JT808Bodies, IJT808MessagePackFormatter<JT808_0x9101> | |||||
{ | { | ||||
public override ushort MsgId => 0x9101; | |||||
/// <summary> | /// <summary> | ||||
/// 服务器IP地址长度 | /// 服务器IP地址长度 | ||||
/// </summary> | /// </summary> | ||||
@@ -48,5 +48,30 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 1:子码流 | /// 1:子码流 | ||||
/// </summary> | /// </summary> | ||||
public byte StreamType { get; set; } | public byte StreamType { get; set; } | ||||
public JT808_0x9101 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9101 jT808_0X9101 = new JT808_0x9101(); | |||||
jT808_0X9101.ServerIPAddressLength = reader.ReadByte(); | |||||
jT808_0X9101.ServerIPAddress = reader.ReadString(jT808_0X9101.ServerIPAddressLength); | |||||
jT808_0X9101.ServerVideoChannelTcpPort = reader.ReadUInt16(); | |||||
jT808_0X9101.ServerVideoChannelUdpPort = reader.ReadUInt16(); | |||||
jT808_0X9101.LogicalChannelNo = reader.ReadByte(); | |||||
jT808_0X9101.DataType = reader.ReadByte(); | |||||
jT808_0X9101.StreamType = reader.ReadByte(); | |||||
return jT808_0X9101; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9101 value, IJT808Config config) | |||||
{ | |||||
writer.Skip(1, out int position); | |||||
writer.WriteString(value.ServerIPAddress); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position); | |||||
writer.WriteUInt16(value.ServerVideoChannelTcpPort); | |||||
writer.WriteUInt16(value.ServerVideoChannelUdpPort); | |||||
writer.WriteByte(value.LogicalChannelNo); | |||||
writer.WriteByte(value.DataType); | |||||
writer.WriteByte(value.StreamType); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 音视频实时传输控制 | /// 音视频实时传输控制 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9102_Formatter))] | |||||
public class JT808_0x9102:JT808Bodies | |||||
public class JT808_0x9102:JT808Bodies, IJT808MessagePackFormatter<JT808_0x9102> | |||||
{ | { | ||||
public override ushort MsgId => 0x9102; | |||||
/// <summary> | /// <summary> | ||||
/// 逻辑通道号 | /// 逻辑通道号 | ||||
/// </summary> | /// </summary> | ||||
@@ -41,5 +41,23 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 1:子码流 | /// 1:子码流 | ||||
/// </summary> | /// </summary> | ||||
public byte SwitchStreamType { get; set; } | public byte SwitchStreamType { get; set; } | ||||
public JT808_0x9102 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9102 jT808_0X9102 = new JT808_0x9102(); | |||||
jT808_0X9102.LogicalChannelNo = reader.ReadByte(); | |||||
jT808_0X9102.ControlCmd = reader.ReadByte(); | |||||
jT808_0X9102.CloseAVData = reader.ReadByte(); | |||||
jT808_0X9102.SwitchStreamType = reader.ReadByte(); | |||||
return jT808_0X9102; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9102 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicalChannelNo); | |||||
writer.WriteByte(value.ControlCmd); | |||||
writer.WriteByte(value.CloseAVData); | |||||
writer.WriteByte(value.SwitchStreamType); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 实时音视频传输状态通知 | /// 实时音视频传输状态通知 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9105_Formatter))] | |||||
public class JT808_0x9105 : JT808Bodies | |||||
public class JT808_0x9105 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9105> | |||||
{ | { | ||||
public override ushort MsgId => 0x9105; | |||||
/// <summary> | /// <summary> | ||||
/// 逻辑通道号 | /// 逻辑通道号 | ||||
/// </summary> | /// </summary> | ||||
@@ -20,5 +20,19 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 丢包率 | /// 丢包率 | ||||
/// </summary> | /// </summary> | ||||
public byte DropRate { get; set; } | public byte DropRate { get; set; } | ||||
public JT808_0x9105 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9105 jT808_0x9105 = new JT808_0x9105(); | |||||
jT808_0x9105.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9105.DropRate = reader.ReadByte(); | |||||
return jT808_0x9105; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9105 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.DropRate); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 平台下发远程录像回放请求 | /// 平台下发远程录像回放请求 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9201_Formatter))] | |||||
public class JT808_0x9201 : JT808Bodies | |||||
public class JT808_0x9201 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9201> | |||||
{ | { | ||||
public override ushort MsgId => 0x9201; | |||||
/// <summary> | /// <summary> | ||||
/// 服务器IP地址服务 | /// 服务器IP地址服务 | ||||
/// </summary> | /// </summary> | ||||
@@ -64,5 +64,42 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 结束时间 | /// 结束时间 | ||||
/// </summary> | /// </summary> | ||||
public DateTime EndTime { get; set; } | public DateTime EndTime { get; set; } | ||||
public JT808_0x9201 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9201 jT808_0x9201 = new JT808_0x9201(); | |||||
jT808_0x9201.ServerIpLength = reader.ReadByte(); | |||||
jT808_0x9201.ServerIp = reader.ReadString(jT808_0x9201.ServerIpLength); | |||||
jT808_0x9201.TcpPort = reader.ReadUInt16(); | |||||
jT808_0x9201.UdpPort = reader.ReadUInt16(); | |||||
jT808_0x9201.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9201.AVItemType = reader.ReadByte(); | |||||
jT808_0x9201.StreamType = reader.ReadByte(); | |||||
jT808_0x9201.MemType = reader.ReadByte(); | |||||
jT808_0x9201.PlayBackWay = reader.ReadByte(); | |||||
jT808_0x9201.FastForwardOrFastRewindMultiples1 = reader.ReadByte(); | |||||
jT808_0x9201.FastForwardOrFastRewindMultiples2 = reader.ReadByte(); | |||||
jT808_0x9201.BeginTime = reader.ReadDateTime6(); | |||||
jT808_0x9201.EndTime = reader.ReadDateTime6(); | |||||
return jT808_0x9201; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9201 value, IJT808Config config) | |||||
{ | |||||
writer.Skip(1, out int position); | |||||
writer.WriteString(value.ServerIp); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - position - 1), position);//计算完字符串后,回写字符串长度 | |||||
writer.WriteUInt16(value.TcpPort); | |||||
writer.WriteUInt16(value.UdpPort); | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.AVItemType); | |||||
writer.WriteByte(value.StreamType); | |||||
writer.WriteByte(value.MemType); | |||||
writer.WriteByte(value.PlayBackWay); | |||||
writer.WriteByte(value.FastForwardOrFastRewindMultiples1); | |||||
writer.WriteByte(value.FastForwardOrFastRewindMultiples2); | |||||
writer.WriteDateTime6(value.BeginTime); | |||||
writer.WriteDateTime6(value.EndTime); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 平台下发远程录像回放控制 | /// 平台下发远程录像回放控制 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9202_Formatter))] | |||||
public class JT808_0x9202 : JT808Bodies | |||||
public class JT808_0x9202 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9202> | |||||
{ | { | ||||
public override ushort MsgId => 0x9202; | |||||
/// <summary> | /// <summary> | ||||
/// 音视频通道号 | /// 音视频通道号 | ||||
/// </summary> | /// </summary> | ||||
@@ -28,5 +28,23 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 拖动回放位置 | /// 拖动回放位置 | ||||
/// </summary> | /// </summary> | ||||
public DateTime DragPlaybackPosition { get; set; } | public DateTime DragPlaybackPosition { get; set; } | ||||
public JT808_0x9202 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9202 jT808_0x9202 = new JT808_0x9202(); | |||||
jT808_0x9202.AVChannelNo = reader.ReadByte(); | |||||
jT808_0x9202.PlayBackControl = reader.ReadByte(); | |||||
jT808_0x9202.FastForwardOrFastRewindMultiples = reader.ReadByte(); | |||||
jT808_0x9202.DragPlaybackPosition = reader.ReadDateTime6(); | |||||
return jT808_0x9202; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9202 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.AVChannelNo); | |||||
writer.WriteByte(value.PlayBackControl); | |||||
writer.WriteByte(value.FastForwardOrFastRewindMultiples); | |||||
writer.WriteDateTime6(value.DragPlaybackPosition); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 查询资源列表 | /// 查询资源列表 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9205_Formatter))] | |||||
public class JT808_0x9205 : JT808Bodies | |||||
public class JT808_0x9205 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9205> | |||||
{ | { | ||||
public override ushort MsgId => 0x9205; | |||||
/// <summary> | /// <summary> | ||||
/// 逻辑通道号 | /// 逻辑通道号 | ||||
/// </summary> | /// </summary> | ||||
@@ -40,5 +40,29 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 存储器类型 | /// 存储器类型 | ||||
/// </summary> | /// </summary> | ||||
public byte MemoryType { get; set; } | public byte MemoryType { get; set; } | ||||
public JT808_0x9205 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9205 jT808_0x9205 = new JT808_0x9205(); | |||||
jT808_0x9205.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9205.BeginTime = reader.ReadDateTime6(); | |||||
jT808_0x9205.EndTime = reader.ReadDateTime6(); | |||||
jT808_0x9205.AlarmFlag = reader.ReadUInt32(); | |||||
jT808_0x9205.AVResourceType = reader.ReadByte(); | |||||
jT808_0x9205.StreamType = reader.ReadByte(); | |||||
jT808_0x9205.MemoryType = reader.ReadByte(); | |||||
return jT808_0x9205; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9205 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteDateTime6(value.BeginTime); | |||||
writer.WriteDateTime6(value.EndTime); | |||||
writer.WriteUInt32(value.AlarmFlag); | |||||
writer.WriteByte(value.AVResourceType); | |||||
writer.WriteByte(value.StreamType); | |||||
writer.WriteByte(value.MemoryType); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 文件上传指令 | /// 文件上传指令 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9206_Formatter))] | |||||
public class JT808_0x9206 : JT808Bodies | |||||
public class JT808_0x9206 : JT808Bodies,IJT808MessagePackFormatter<JT808_0x9206> | |||||
{ | { | ||||
public override ushort MsgId => 0x9206; | |||||
/// <summary> | /// <summary> | ||||
/// 服务器IP地址服务 | /// 服务器IP地址服务 | ||||
/// </summary> | /// </summary> | ||||
@@ -80,5 +80,53 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 任务执行条件 | /// 任务执行条件 | ||||
/// </summary> | /// </summary> | ||||
public byte TaskExcuteCondition { get; set; } | public byte TaskExcuteCondition { get; set; } | ||||
public JT808_0x9206 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9206 jT808_0x9206 = new JT808_0x9206(); | |||||
jT808_0x9206.ServerIpLength = reader.ReadByte(); | |||||
jT808_0x9206.ServerIp = reader.ReadString(jT808_0x9206.ServerIpLength); | |||||
jT808_0x9206.Port = reader.ReadUInt16(); | |||||
jT808_0x9206.UserNameLength = reader.ReadByte(); | |||||
jT808_0x9206.UserName = reader.ReadString(jT808_0x9206.UserNameLength); | |||||
jT808_0x9206.PasswordLength = reader.ReadByte(); | |||||
jT808_0x9206.Password = reader.ReadString(jT808_0x9206.PasswordLength); | |||||
jT808_0x9206.FileUploadPathLength = reader.ReadByte(); | |||||
jT808_0x9206.FileUploadPath = reader.ReadString(jT808_0x9206.FileUploadPathLength); | |||||
jT808_0x9206.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9206.BeginTime = reader.ReadDateTime6(); | |||||
jT808_0x9206.EndTime = reader.ReadDateTime6(); | |||||
jT808_0x9206.AlarmFlag = reader.ReadUInt32(); | |||||
jT808_0x9206.AVResourceType = reader.ReadByte(); | |||||
jT808_0x9206.StreamType = reader.ReadByte(); | |||||
jT808_0x9206.MemoryPositon = reader.ReadByte(); | |||||
jT808_0x9206.TaskExcuteCondition = reader.ReadByte(); | |||||
return jT808_0x9206; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9206 value, IJT808Config config) | |||||
{ | |||||
writer.Skip(1, out int serverIpLengthposition); | |||||
writer.WriteString(value.ServerIp); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - serverIpLengthposition - 1), serverIpLengthposition); | |||||
writer.WriteUInt16(value.Port); | |||||
writer.Skip(1, out int userNameLengthposition); | |||||
writer.WriteString(value.UserName); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - userNameLengthposition - 1), userNameLengthposition); | |||||
writer.Skip(1, out int passwordLengthLengthposition); | |||||
writer.WriteString(value.Password); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - passwordLengthLengthposition - 1), passwordLengthLengthposition); | |||||
writer.Skip(1, out int fileUploadPathLengthLengthposition); | |||||
writer.WriteString(value.FileUploadPath); | |||||
writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - fileUploadPathLengthLengthposition - 1), fileUploadPathLengthLengthposition); | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteDateTime6(value.BeginTime); | |||||
writer.WriteDateTime6(value.EndTime); | |||||
writer.WriteUInt32(value.AlarmFlag); | |||||
writer.WriteByte(value.AVResourceType); | |||||
writer.WriteByte(value.StreamType); | |||||
writer.WriteByte(value.MemoryPositon); | |||||
writer.WriteByte(value.TaskExcuteCondition); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,9 +9,9 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 文件上传控制 | /// 文件上传控制 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9207_Formatter))] | |||||
public class JT808_0x9207 : JT808Bodies | |||||
public class JT808_0x9207 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9207> | |||||
{ | { | ||||
public override ushort MsgId => 0x9207; | |||||
/// <summary> | /// <summary> | ||||
/// 流水号 | /// 流水号 | ||||
/// </summary> | /// </summary> | ||||
@@ -20,5 +20,18 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 上传控制 | /// 上传控制 | ||||
/// </summary> | /// </summary> | ||||
public byte UploadControl { get; set; } | public byte UploadControl { get; set; } | ||||
public JT808_0x9207 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9207 jT808_0x9207 = new JT808_0x9207(); | |||||
jT808_0x9207.MgsNum = reader.ReadUInt16(); | |||||
jT808_0x9207.UploadControl = reader.ReadByte(); | |||||
return jT808_0x9207; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9207 value, IJT808Config config) | |||||
{ | |||||
writer.WriteUInt16(value.MgsNum); | |||||
writer.WriteByte(value.UploadControl); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,10 +9,10 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 云台旋转 | /// 云台旋转 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9301_Formatter))] | |||||
public class JT808_0x9301 : JT808Bodies | |||||
public class JT808_0x9301 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9301> | |||||
{ | { | ||||
/// <summary> | |||||
public override ushort MsgId => 0x9301; | |||||
/// <summary> | |||||
/// 逻辑通道号 | /// 逻辑通道号 | ||||
/// </summary> | /// </summary> | ||||
public byte LogicChannelNo { get; set; } | public byte LogicChannelNo { get; set; } | ||||
@@ -24,5 +24,21 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 速度 | /// 速度 | ||||
/// </summary> | /// </summary> | ||||
public byte Speed { get; set; } | public byte Speed { get; set; } | ||||
public JT808_0x9301 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9301 jT808_0x9301 = new JT808_0x9301(); | |||||
jT808_0x9301.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9301.Direction = reader.ReadByte(); | |||||
jT808_0x9301.Speed = reader.ReadByte(); | |||||
return jT808_0x9301; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9301 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.Direction); | |||||
writer.WriteByte(value.Speed); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,10 +9,10 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 云台调整焦距控制 | /// 云台调整焦距控制 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9302_Formatter))] | |||||
public class JT808_0x9302 : JT808Bodies | |||||
public class JT808_0x9302 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9302> | |||||
{ | { | ||||
/// <summary> | |||||
public override ushort MsgId => 0x9302; | |||||
/// <summary> | |||||
/// 逻辑通道号 | /// 逻辑通道号 | ||||
/// </summary> | /// </summary> | ||||
public byte LogicChannelNo { get; set; } | public byte LogicChannelNo { get; set; } | ||||
@@ -20,5 +20,19 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 焦距调整方向 | /// 焦距调整方向 | ||||
/// </summary> | /// </summary> | ||||
public byte FocusAdjustmentDirection { get; set; } | public byte FocusAdjustmentDirection { get; set; } | ||||
public JT808_0x9302 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9302 jT808_0x9302 = new JT808_0x9302(); | |||||
jT808_0x9302.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9302.FocusAdjustmentDirection = reader.ReadByte(); | |||||
return jT808_0x9302; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9302 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.FocusAdjustmentDirection); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,10 +9,10 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 云台调整光圈控制 | /// 云台调整光圈控制 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9303_Formatter))] | |||||
public class JT808_0x9303 : JT808Bodies | |||||
public class JT808_0x9303 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9303> | |||||
{ | { | ||||
/// <summary> | |||||
public override ushort MsgId => 0x9303; | |||||
/// <summary> | |||||
/// 逻辑通道号 | /// 逻辑通道号 | ||||
/// </summary> | /// </summary> | ||||
public byte LogicChannelNo { get; set; } | public byte LogicChannelNo { get; set; } | ||||
@@ -20,5 +20,18 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 光圈调整方式 | /// 光圈调整方式 | ||||
/// </summary> | /// </summary> | ||||
public byte IrisAdjustment { get; set; } | public byte IrisAdjustment { get; set; } | ||||
public JT808_0x9303 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9303 jT808_0x9303 = new JT808_0x9303(); | |||||
jT808_0x9303.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9303.IrisAdjustment = reader.ReadByte(); | |||||
return jT808_0x9303; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9303 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.IrisAdjustment); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,10 +9,10 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 云台雨刷控制 | /// 云台雨刷控制 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9304_Formatter))] | |||||
public class JT808_0x9304 : JT808Bodies | |||||
public class JT808_0x9304 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9304> | |||||
{ | { | ||||
/// <summary> | |||||
public override ushort MsgId => 0x9304; | |||||
/// <summary> | |||||
/// 逻辑通道号 | /// 逻辑通道号 | ||||
/// </summary> | /// </summary> | ||||
public byte LogicChannelNo { get; set; } | public byte LogicChannelNo { get; set; } | ||||
@@ -20,5 +20,18 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 启停标识 | /// 启停标识 | ||||
/// </summary> | /// </summary> | ||||
public byte StartOrStop { get; set; } | public byte StartOrStop { get; set; } | ||||
public JT808_0x9304 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9304 jT808_0x9304 = new JT808_0x9304(); | |||||
jT808_0x9304.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9304.StartOrStop = reader.ReadByte(); | |||||
return jT808_0x9304; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9304 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.StartOrStop); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,10 +9,10 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 红外补光控制 | /// 红外补光控制 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9305_Formatter))] | |||||
public class JT808_0x9305 : JT808Bodies | |||||
public class JT808_0x9305 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9305> | |||||
{ | { | ||||
/// <summary> | |||||
public override ushort MsgId => 0x9305; | |||||
/// <summary> | |||||
/// 逻辑通道号 | /// 逻辑通道号 | ||||
/// </summary> | /// </summary> | ||||
public byte LogicChannelNo { get; set; } | public byte LogicChannelNo { get; set; } | ||||
@@ -20,5 +20,18 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 启停标识 | /// 启停标识 | ||||
/// </summary> | /// </summary> | ||||
public byte StartOrStop { get; set; } | public byte StartOrStop { get; set; } | ||||
public JT808_0x9305 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9305 jT808_0x9305 = new JT808_0x9305(); | |||||
jT808_0x9305.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9305.StartOrStop = reader.ReadByte(); | |||||
return jT808_0x9305; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9305 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.StartOrStop); | |||||
} | |||||
} | } | ||||
} | } |
@@ -1,5 +1,5 @@ | |||||
using JT808.Protocol.Attributes; | |||||
using JT808.Protocol.Extensions.JT1078.Formatters; | |||||
using JT808.Protocol.Formatters; | |||||
using JT808.Protocol.MessagePack; | |||||
using System; | using System; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Text; | using System.Text; | ||||
@@ -9,10 +9,10 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// <summary> | /// <summary> | ||||
/// 云台变倍控制 | /// 云台变倍控制 | ||||
/// </summary> | /// </summary> | ||||
[JT808Formatter(typeof(JT808_0x9306_Formatter))] | |||||
public class JT808_0x9306 : JT808Bodies | |||||
public class JT808_0x9306 : JT808Bodies, IJT808MessagePackFormatter<JT808_0x9306> | |||||
{ | { | ||||
/// <summary> | |||||
public override ushort MsgId => 0x9306; | |||||
/// <summary> | |||||
/// 逻辑通道号 | /// 逻辑通道号 | ||||
/// </summary> | /// </summary> | ||||
public byte LogicChannelNo { get; set; } | public byte LogicChannelNo { get; set; } | ||||
@@ -20,5 +20,19 @@ namespace JT808.Protocol.Extensions.JT1078.MessageBody | |||||
/// 变倍控制 | /// 变倍控制 | ||||
/// </summary> | /// </summary> | ||||
public byte ChangeMultipleControl { get; set; } | public byte ChangeMultipleControl { get; set; } | ||||
public JT808_0x9306 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) | |||||
{ | |||||
JT808_0x9306 jT808_0x9306 = new JT808_0x9306(); | |||||
jT808_0x9306.LogicChannelNo = reader.ReadByte(); | |||||
jT808_0x9306.ChangeMultipleControl = reader.ReadByte(); | |||||
return jT808_0x9306; | |||||
} | |||||
public void Serialize(ref JT808MessagePackWriter writer, JT808_0x9306 value, IJT808Config config) | |||||
{ | |||||
writer.WriteByte(value.LogicChannelNo); | |||||
writer.WriteByte(value.ChangeMultipleControl); | |||||
} | |||||
} | } | ||||
} | } |