diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/Enums/JT808_JTActiveSafety_0x0900_Type.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/Enums/JT808_JTActiveSafety_0x0900_Type.cs new file mode 100644 index 0000000..44be60c --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/Enums/JT808_JTActiveSafety_0x0900_Type.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.Enums +{ + public enum JT808_JTActiveSafety_0x0900_Type : byte + { + /// + /// 状态查询 + /// 外设状态信息:外设工作状态、设备报警信息 + /// + QueryState = 0xF7, + /// + /// 信息查询 + /// 外设传感器的基本信息:公司信息、产品代码、版本号、外设ID、客户代码。 + /// + QueryInfomation = 0xF8 + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/Enums/USBIDType.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/Enums/USBIDType.cs new file mode 100644 index 0000000..8ed48c7 --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/Enums/USBIDType.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.Enums +{ + public enum USBIDType:byte + { + ADAS=0x64, + DSM=0x65, + TPMS=0x66, + BSD=0x67 + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/Extensions/JT808_JTActiveSafety_0x0900_USBMessageExtensions.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/Extensions/JT808_JTActiveSafety_0x0900_USBMessageExtensions.cs new file mode 100644 index 0000000..d72af91 --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/Extensions/JT808_JTActiveSafety_0x0900_USBMessageExtensions.cs @@ -0,0 +1,34 @@ +using JT808.Protocol.Extensions.JTActiveSafety.Enums; +using JT808.Protocol.Extensions.JTActiveSafety.Formatters; +using JT808.Protocol.Extensions.JTActiveSafety.MessageBody; +using JT808.Protocol.MessagePack; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.Extensions +{ +#warning 由于透传消息类型没有向下传递导致下面获取不到,先用这种方式临时处理 + public static class JT808_JTActiveSafety_0x0900_USBMessageExtensions + { + /// + /// 解析透传对象扩展 + /// + /// + /// + public static void ParseObject(this JT808_JTActiveSafety_0x0900_USBMessage jT808_JTActiveSafety_0X0900_USBMessage, JT808_JTActiveSafety_0x0900_Type jT808_JTActiveSafety_0X0900_Type) + { + switch(jT808_JTActiveSafety_0X0900_Type) + { + case JT808_JTActiveSafety_0x0900_Type.QueryState: + JT808MessagePackReader QueryStateMessagePackReader = new JT808MessagePackReader(jT808_JTActiveSafety_0X0900_USBMessage.MessageContent); + jT808_JTActiveSafety_0X0900_USBMessage.MessageContentObejct=JT808_JTActiveSafety_0x0900_USB_0xF7_Formatter.Instance.Deserialize(ref QueryStateMessagePackReader, null); + break; + case JT808_JTActiveSafety_0x0900_Type.QueryInfomation: + JT808MessagePackReader QueryInfomationMessagePackReader = new JT808MessagePackReader(jT808_JTActiveSafety_0X0900_USBMessage.MessageContent); + jT808_JTActiveSafety_0X0900_USBMessage.MessageContentObejct = JT808_JTActiveSafety_0x0900_USB_0xF7_Formatter.Instance.Deserialize(ref QueryInfomationMessagePackReader, null); + break; + } + } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_0x8103_0xF364_Formatter.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_0x8103_0xF364_Formatter.cs new file mode 100644 index 0000000..11b430f --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_0x8103_0xF364_Formatter.cs @@ -0,0 +1,117 @@ +using JT808.Protocol.Extensions.JTActiveSafety.MessageBody; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.Formatters +{ + public class JT808_0x8103_0xF364_Formatter : IJT808MessagePackFormatter + { + public JT808_0x8103_0xF364 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0xF364 jT808_0X8103_0XF364 = new JT808_0x8103_0xF364(); + jT808_0X8103_0XF364.ParamId = reader.ReadUInt32(); + jT808_0X8103_0XF364.ParamLength = reader.ReadByte(); + jT808_0X8103_0XF364.AlarmJudgeSpeedThreshold= reader.ReadByte(); + jT808_0X8103_0XF364.WarningVolume = reader.ReadByte(); + jT808_0X8103_0XF364.ActivePhotographyStrategy = reader.ReadByte(); + jT808_0X8103_0XF364.ActivelyTimePhotoInterval = reader.ReadUInt16(); + jT808_0X8103_0XF364.ActiveDistancePhotographyDistanceInterval = reader.ReadUInt16(); + jT808_0X8103_0XF364.SingleInitiativePhotos = reader.ReadByte(); + jT808_0X8103_0XF364.SingleInitiativePhotosInterval = reader.ReadByte(); + jT808_0X8103_0XF364.PhotoResolution = reader.ReadByte(); + jT808_0X8103_0XF364.VideoRecordingResolution = reader.ReadByte(); + jT808_0X8103_0XF364.AlarmEnable = reader.ReadUInt32(); + jT808_0X8103_0XF364.EventEnable = reader.ReadUInt32(); + jT808_0X8103_0XF364.Placeholder1 = reader.ReadByte(); + jT808_0X8103_0XF364.DistanceThresholdObstacleAlarm = reader.ReadByte(); + jT808_0X8103_0XF364.HierarchicalSpeedThresholdObstacleAlarm = reader.ReadByte(); + jT808_0X8103_0XF364.VideoRecordingTimeBeforeAndAfterObstacleAlarm = reader.ReadByte(); + jT808_0X8103_0XF364.BarrierAlarmPhotographs = reader.ReadByte(); + jT808_0X8103_0XF364.ObstacleAlarmInterval = reader.ReadByte(); + jT808_0X8103_0XF364.FrequentChannelChangeAlarmJudgmentTimePeriod = reader.ReadByte(); + jT808_0X8103_0XF364.FrequentAlarmJudgmentNumberChannelChange = reader.ReadByte(); + jT808_0X8103_0XF364.HierarchicalSpeedThresholdFrequentChannelChangeAlarm = reader.ReadByte(); + jT808_0X8103_0XF364.VideoRecordingTimeBeforeAndAfterFrequentLaneChangeAlarm = reader.ReadByte(); + jT808_0X8103_0XF364.FrequentChannelChangeAlarmPhotos = reader.ReadByte(); + jT808_0X8103_0XF364.FrequentLaneChangeAlarmInterval = reader.ReadByte(); + jT808_0X8103_0XF364.GradedSpeedThresholdLaneDeviationAlarm = reader.ReadByte(); + jT808_0X8103_0XF364.VideoRecordingTimeBeforeAndAfterLaneDepartureAlarm = reader.ReadByte(); + jT808_0X8103_0XF364.LaneDepartureAlarmPhoto = reader.ReadByte(); + jT808_0X8103_0XF364.LaneDepartureAlarmPhotoInterval = reader.ReadByte(); + jT808_0X8103_0XF364.ForwardCollisionWarningTimeThreshold = reader.ReadByte(); + jT808_0X8103_0XF364.HierarchicalSpeedThresholdForwardCollisionWarning = reader.ReadByte(); + jT808_0X8103_0XF364.VideoRecordingTimeBeforeAndAfterForwardCollisionAlarm = reader.ReadByte(); + jT808_0X8103_0XF364.ForwardCollisionAlarmPhotographs = reader.ReadByte(); + jT808_0X8103_0XF364.ForwardCollisionAlarmInterval = reader.ReadByte(); + jT808_0X8103_0XF364.PedestrianCollisionAlarmTimeThreshold = reader.ReadByte(); + jT808_0X8103_0XF364.PedestrianCollisionAlarmEnablingSpeedThreshold = reader.ReadByte(); + jT808_0X8103_0XF364.VideoRecordingTimeBeforeAndAfterPedestrianCollisionAlarm = reader.ReadByte(); + jT808_0X8103_0XF364.PedestrianCollisionAlarmPhotos = reader.ReadByte(); + jT808_0X8103_0XF364.PedestrianCollisionAlarmInterval = reader.ReadByte(); + jT808_0X8103_0XF364.VehicleDistanceMonitoringAlarmDistanceThreshold = reader.ReadByte(); + jT808_0X8103_0XF364.VehicleDistanceMonitoringAndAlarmClassificationSpeedThreshold = reader.ReadByte(); + jT808_0X8103_0XF364.VideoRecordingTimeBeforeAndAfterAlarmVehicleProximity = reader.ReadByte(); + jT808_0X8103_0XF364.AlarmPhotoVehicleCloseDistance = reader.ReadByte(); + jT808_0X8103_0XF364.AlarmPhotoVehicleCloseDistanceInterval = reader.ReadByte(); + jT808_0X8103_0XF364.RoadSignRecognitionPhotographs = reader.ReadByte(); + jT808_0X8103_0XF364.RoadSignRecognitionPhotographsInterval = reader.ReadByte(); + jT808_0X8103_0XF364.Placeholder2 = reader.ReadArray(4).ToArray(); + return jT808_0X8103_0XF364; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0xF364 value, IJT808Config config) + { + writer.WriteUInt32(value.ParamId); + writer.Skip(1,out int ParamLengthPosition); + writer.WriteByte(value.AlarmJudgeSpeedThreshold); + writer.WriteByte(value.WarningVolume); + writer.WriteByte(value.ActivePhotographyStrategy); + writer.WriteUInt16(value.ActivelyTimePhotoInterval); + writer.WriteUInt16(value.ActiveDistancePhotographyDistanceInterval); + writer.WriteByte(value.SingleInitiativePhotos); + writer.WriteByte(value.SingleInitiativePhotosInterval); + writer.WriteByte(value.PhotoResolution); + writer.WriteByte(value.VideoRecordingResolution); + writer.WriteUInt32(value.AlarmEnable); + writer.WriteUInt32(value.EventEnable); + writer.WriteByte(value.Placeholder1); + writer.WriteByte(value.DistanceThresholdObstacleAlarm); + writer.WriteByte(value.HierarchicalSpeedThresholdObstacleAlarm); + writer.WriteByte(value.VideoRecordingTimeBeforeAndAfterObstacleAlarm); + writer.WriteByte(value.BarrierAlarmPhotographs); + writer.WriteByte(value.ObstacleAlarmInterval); + writer.WriteByte(value.FrequentChannelChangeAlarmJudgmentTimePeriod); + writer.WriteByte(value.FrequentAlarmJudgmentNumberChannelChange); + writer.WriteByte(value.HierarchicalSpeedThresholdFrequentChannelChangeAlarm); + writer.WriteByte(value.VideoRecordingTimeBeforeAndAfterFrequentLaneChangeAlarm); + writer.WriteByte(value.FrequentChannelChangeAlarmPhotos); + writer.WriteByte(value.FrequentLaneChangeAlarmInterval); + writer.WriteByte(value.GradedSpeedThresholdLaneDeviationAlarm); + writer.WriteByte(value.VideoRecordingTimeBeforeAndAfterLaneDepartureAlarm); + writer.WriteByte(value.LaneDepartureAlarmPhoto); + writer.WriteByte(value.LaneDepartureAlarmPhotoInterval); + writer.WriteByte(value.ForwardCollisionWarningTimeThreshold); + writer.WriteByte(value.HierarchicalSpeedThresholdForwardCollisionWarning); + writer.WriteByte(value.VideoRecordingTimeBeforeAndAfterForwardCollisionAlarm); + writer.WriteByte(value.ForwardCollisionAlarmPhotographs); + writer.WriteByte(value.ForwardCollisionAlarmInterval); + writer.WriteByte(value.PedestrianCollisionAlarmTimeThreshold); + writer.WriteByte(value.PedestrianCollisionAlarmEnablingSpeedThreshold); + writer.WriteByte(value.VideoRecordingTimeBeforeAndAfterPedestrianCollisionAlarm); + writer.WriteByte(value.PedestrianCollisionAlarmPhotos); + writer.WriteByte(value.PedestrianCollisionAlarmInterval); + writer.WriteByte(value.VehicleDistanceMonitoringAlarmDistanceThreshold); + writer.WriteByte(value.VehicleDistanceMonitoringAndAlarmClassificationSpeedThreshold); + writer.WriteByte(value.VideoRecordingTimeBeforeAndAfterAlarmVehicleProximity); + writer.WriteByte(value.AlarmPhotoVehicleCloseDistance); + writer.WriteByte(value.AlarmPhotoVehicleCloseDistanceInterval); + writer.WriteByte(value.RoadSignRecognitionPhotographs); + writer.WriteByte(value.RoadSignRecognitionPhotographsInterval); + writer.WriteArray(value.Placeholder2); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - ParamLengthPosition - 1), ParamLengthPosition); + } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_0x8103_0xF365_Formatter.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_0x8103_0xF365_Formatter.cs new file mode 100644 index 0000000..4e013d4 --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_0x8103_0xF365_Formatter.cs @@ -0,0 +1,95 @@ +using JT808.Protocol.Extensions.JTActiveSafety.MessageBody; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.Formatters +{ + public class JT808_0x8103_0xF365_Formatter : IJT808MessagePackFormatter + { + public JT808_0x8103_0xF365 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0xF365 jT808_0X8103_0XF365 = new JT808_0x8103_0xF365(); + jT808_0X8103_0XF365.ParamId = reader.ReadUInt32(); + jT808_0X8103_0XF365.ParamLength = reader.ReadByte(); + jT808_0X8103_0XF365.AlarmJudgeSpeedThreshold = reader.ReadByte(); + jT808_0X8103_0XF365.WarningVolume = reader.ReadByte(); + jT808_0X8103_0XF365.ActivePhotographyStrategy = reader.ReadByte(); + jT808_0X8103_0XF365.ActivelyTimePhotoInterval = reader.ReadUInt16(); + jT808_0X8103_0XF365.ActiveDistancePhotographyDistanceInterval = reader.ReadUInt16(); + jT808_0X8103_0XF365.SingleInitiativePhotos = reader.ReadByte(); + jT808_0X8103_0XF365.SingleInitiativePhotosInterval = reader.ReadByte(); + jT808_0X8103_0XF365.PhotoResolution = reader.ReadByte(); + jT808_0X8103_0XF365.VideoRecordingResolution = reader.ReadByte(); + jT808_0X8103_0XF365.AlarmEnable = reader.ReadUInt32(); + jT808_0X8103_0XF365.EventEnable = reader.ReadUInt32(); + jT808_0X8103_0XF365.TimeIntervalSmokingAlarmJudgment = reader.ReadUInt16(); + jT808_0X8103_0XF365.CallAlarmDetermineTimeInterval = reader.ReadUInt16(); + jT808_0X8103_0XF365.Reserve = reader.ReadArray(3).ToArray(); + jT808_0X8103_0XF365.GradedSpeedThresholdFatigueDrivingAlarm = reader.ReadByte(); + jT808_0X8103_0XF365.VideoRecordingTimeBeforeAndAfterFatigueDrivingAlarm = reader.ReadByte(); + jT808_0X8103_0XF365.FatigueDrivingAlarmPhotograph = reader.ReadByte(); + jT808_0X8103_0XF365.FatigueDrivingAlarmPhotographInterval = reader.ReadByte(); + jT808_0X8103_0XF365.ClassifiedSpeedThresholdCallAlarm = reader.ReadByte(); + jT808_0X8103_0XF365.VideoRecordingTimeBeforeAndAfterCallAlarm = reader.ReadByte(); + jT808_0X8103_0XF365.CallAlarmTakePicturesDriverFacialFeatures = reader.ReadByte(); + jT808_0X8103_0XF365.CallAlarmTakePicturesDriverFacialFeaturesInterval = reader.ReadByte(); + jT808_0X8103_0XF365.ClassifiedSpeedThresholdSmokingAlarm = reader.ReadByte(); + jT808_0X8103_0XF365.VideoRecordingTimeBeforeAndAfterSmokingAlarm = reader.ReadByte(); + jT808_0X8103_0XF365.SmokingAlarmPhotographsDriverFaceCharacteristics = reader.ReadByte(); + jT808_0X8103_0XF365.SmokingAlarmPhotographsDriverFaceCharacteristicsInterval = reader.ReadByte(); + jT808_0X8103_0XF365.ClassifiedSpeedThresholdDistractedDrivingAlarm = reader.ReadByte(); + jT808_0X8103_0XF365.DistractedDrivingAlarmPhotography = reader.ReadByte(); + jT808_0X8103_0XF365.DistractedDrivingAlarmPhotographyInterval = reader.ReadByte(); + jT808_0X8103_0XF365.VideoRecordingTimeAbnormalDrivingBehavior = reader.ReadByte(); + jT808_0X8103_0XF365.PhotographsAbnormalDrivingBehavior = reader.ReadByte(); + jT808_0X8103_0XF365.PictureIntervalAbnormalDrivingBehavior = reader.ReadByte(); + jT808_0X8103_0XF365.DriverIdentificationTrigger = reader.ReadByte(); + jT808_0X8103_0XF365.Retain = reader.ReadArray(reader.ReadCurrentRemainContentLength()).ToArray(); + return jT808_0X8103_0XF365; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0xF365 value, IJT808Config config) + { + writer.WriteUInt32(value.ParamId); + writer.Skip(1, out int ParamLengthPosition); + writer.WriteByte(value.AlarmJudgeSpeedThreshold); + writer.WriteByte(value.WarningVolume); + writer.WriteByte(value.ActivePhotographyStrategy); + writer.WriteUInt16(value.ActivelyTimePhotoInterval); + writer.WriteUInt16(value.ActiveDistancePhotographyDistanceInterval); + writer.WriteByte(value.SingleInitiativePhotos); + writer.WriteByte(value.SingleInitiativePhotosInterval); + writer.WriteByte(value.PhotoResolution); + writer.WriteByte(value.VideoRecordingResolution); + writer.WriteUInt32(value.AlarmEnable); + writer.WriteUInt32(value.EventEnable); + writer.WriteUInt16(value.TimeIntervalSmokingAlarmJudgment); + writer.WriteUInt16(value.CallAlarmDetermineTimeInterval); + writer.WriteArray(value.Reserve); + writer.WriteByte(value.GradedSpeedThresholdFatigueDrivingAlarm); + writer.WriteByte(value.VideoRecordingTimeBeforeAndAfterFatigueDrivingAlarm); + writer.WriteByte(value.FatigueDrivingAlarmPhotograph); + writer.WriteByte(value.FatigueDrivingAlarmPhotographInterval); + writer.WriteByte(value.ClassifiedSpeedThresholdCallAlarm); + writer.WriteByte(value.VideoRecordingTimeBeforeAndAfterCallAlarm); + writer.WriteByte(value.CallAlarmTakePicturesDriverFacialFeatures); + writer.WriteByte(value.CallAlarmTakePicturesDriverFacialFeaturesInterval); + writer.WriteByte(value.ClassifiedSpeedThresholdSmokingAlarm); + writer.WriteByte(value.VideoRecordingTimeBeforeAndAfterSmokingAlarm); + writer.WriteByte(value.SmokingAlarmPhotographsDriverFaceCharacteristics); + writer.WriteByte(value.SmokingAlarmPhotographsDriverFaceCharacteristicsInterval); + writer.WriteByte(value.ClassifiedSpeedThresholdDistractedDrivingAlarm); + writer.WriteByte(value.DistractedDrivingAlarmPhotography); + writer.WriteByte(value.DistractedDrivingAlarmPhotographyInterval); + writer.WriteByte(value.VideoRecordingTimeAbnormalDrivingBehavior); + writer.WriteByte(value.PhotographsAbnormalDrivingBehavior); + writer.WriteByte(value.PictureIntervalAbnormalDrivingBehavior); + writer.WriteByte(value.DriverIdentificationTrigger); + writer.WriteArray(value.Retain); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - ParamLengthPosition - 1), ParamLengthPosition); + } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_0x8103_0xF366_Formatter.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_0x8103_0xF366_Formatter.cs new file mode 100644 index 0000000..9710eab --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_0x8103_0xF366_Formatter.cs @@ -0,0 +1,49 @@ +using JT808.Protocol.Extensions.JTActiveSafety.MessageBody; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.Formatters +{ + public class JT808_0x8103_0xF366_Formatter : IJT808MessagePackFormatter + { + public JT808_0x8103_0xF366 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0xF366 jT808_0X8103_0XF366 = new JT808_0x8103_0xF366(); + jT808_0X8103_0XF366.ParamId = reader.ReadUInt32(); + jT808_0X8103_0XF366.ParamLength = reader.ReadByte(); + jT808_0X8103_0XF366.TyreSpecificationType= reader.ReadString(12); + jT808_0X8103_0XF366.TyrePressureUnit = reader.ReadUInt16(); + jT808_0X8103_0XF366.NormalFetalPressure = reader.ReadUInt16(); + jT808_0X8103_0XF366.ThresholdUnbalancedTirePressure = reader.ReadUInt16(); + jT808_0X8103_0XF366.SlowLeakageThreshold = reader.ReadUInt16(); + jT808_0X8103_0XF366.LowVoltageThreshold = reader.ReadUInt16(); + jT808_0X8103_0XF366.HighVoltageThreshold = reader.ReadUInt16(); + jT808_0X8103_0XF366.HighTemperatureThreshold = reader.ReadUInt16(); + jT808_0X8103_0XF366.VoltageThreshold = reader.ReadUInt16(); + jT808_0X8103_0XF366.TimedReportingInterval = reader.ReadUInt16(); + jT808_0X8103_0XF366.Retain = reader.ReadArray(reader.ReadCurrentRemainContentLength()).ToArray(); + return jT808_0X8103_0XF366; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0xF366 value, IJT808Config config) + { + writer.WriteUInt32(value.ParamId); + writer.Skip(1, out int ParamLengthPosition); + writer.WriteString(value.TyreSpecificationType); + writer.WriteUInt16(value.TyrePressureUnit); + writer.WriteUInt16(value.NormalFetalPressure); + writer.WriteUInt16(value.ThresholdUnbalancedTirePressure); + writer.WriteUInt16(value.SlowLeakageThreshold); + writer.WriteUInt16(value.LowVoltageThreshold); + writer.WriteUInt16(value.HighVoltageThreshold); + writer.WriteUInt16(value.HighTemperatureThreshold); + writer.WriteUInt16(value.VoltageThreshold); + writer.WriteUInt16(value.TimedReportingInterval); + writer.WriteArray(value.Retain); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - ParamLengthPosition - 1), ParamLengthPosition); + } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_0x8103_0xF367_Formatter.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_0x8103_0xF367_Formatter.cs new file mode 100644 index 0000000..5d45f83 --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_0x8103_0xF367_Formatter.cs @@ -0,0 +1,30 @@ +using JT808.Protocol.Extensions.JTActiveSafety.MessageBody; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.Formatters +{ + public class JT808_0x8103_0xF367_Formatter : IJT808MessagePackFormatter + { + public JT808_0x8103_0xF367 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_0x8103_0xF367 jT808_0X8103_0XF367 = new JT808_0x8103_0xF367(); + jT808_0X8103_0XF367.ParamId = reader.ReadUInt32(); + jT808_0X8103_0XF367.ParamLength = reader.ReadByte(); + jT808_0X8103_0XF367.RearApproachAlarmTimeThreshold = reader.ReadByte(); + jT808_0X8103_0XF367.LateralRearApproachAlarmTimeThreshold = reader.ReadByte(); + return jT808_0X8103_0XF367; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_0x8103_0xF367 value, IJT808Config config) + { + writer.WriteUInt32(value.ParamId); + writer.WriteByte(2); + writer.WriteByte(value.RearApproachAlarmTimeThreshold); + writer.WriteByte(value.LateralRearApproachAlarmTimeThreshold); + } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_JTActiveSafety_0x0900_Formatter.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_JTActiveSafety_0x0900_Formatter.cs new file mode 100644 index 0000000..15025ec --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_JTActiveSafety_0x0900_Formatter.cs @@ -0,0 +1,56 @@ +using JT808.Protocol.Extensions.JTActiveSafety.Enums; +using JT808.Protocol.Extensions.JTActiveSafety.MessageBody; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.Formatters +{ + public class JT808_JTActiveSafety_0x0900_Formatter : IJT808MessagePackFormatter + { + public JT808_JTActiveSafety_0x0900 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_JTActiveSafety_0x0900 jT808_JTActiveSafety_0X0900 = new JT808_JTActiveSafety_0x0900(); + jT808_JTActiveSafety_0X0900.USBMessageCount = reader.ReadByte(); + if (jT808_JTActiveSafety_0X0900.USBMessageCount > 0) + { + jT808_JTActiveSafety_0X0900.USBMessages = new List(); + for (int i = 0; i < jT808_JTActiveSafety_0X0900.USBMessageCount; i++) + { + JT808_JTActiveSafety_0x0900_USBMessage jT808_JTActiveSafety_0X0900_USBMessage = new JT808_JTActiveSafety_0x0900_USBMessage(); + jT808_JTActiveSafety_0X0900_USBMessage.USBID= reader.ReadByte(); + jT808_JTActiveSafety_0X0900_USBMessage.MessageLength = reader.ReadByte(); + jT808_JTActiveSafety_0X0900_USBMessage.MessageContent = reader.ReadArray(jT808_JTActiveSafety_0X0900_USBMessage.MessageLength).ToArray(); + jT808_JTActiveSafety_0X0900.USBMessages.Add(jT808_JTActiveSafety_0X0900_USBMessage); + } + } + return jT808_JTActiveSafety_0X0900; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_JTActiveSafety_0x0900 value, IJT808Config config) + { + if(value.USBMessages!=null && value.USBMessages.Count>0) + { + writer.WriteByte((byte)value.USBMessages.Count); + foreach(var item in value.USBMessages) + { + writer.WriteByte(item.USBID); + if(item.MessageContent!=null&& item.MessageContent.Length > 0) + { + writer.WriteByte((byte)item.MessageContent.Length); + writer.WriteArray(item.MessageContent); + } + else if (item.MessageContentObejct != null) + { + writer.Skip(1,out int MessageContentLengthPosition); + object obj = config.GetMessagePackFormatterByType(item.MessageContentObejct.GetType()); + JT808MessagePackFormatterResolverExtensions.JT808DynamicSerialize(obj, ref writer, item.MessageContentObejct, config); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - MessageContentLengthPosition - 1), MessageContentLengthPosition); + } + } + } + } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_JTActiveSafety_0x0900_USB_0xF7_Formatter.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_JTActiveSafety_0x0900_USB_0xF7_Formatter.cs new file mode 100644 index 0000000..2b10338 --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_JTActiveSafety_0x0900_USB_0xF7_Formatter.cs @@ -0,0 +1,27 @@ +using JT808.Protocol.Extensions.JTActiveSafety.MessageBody; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.Formatters +{ + public class JT808_JTActiveSafety_0x0900_USB_0xF7_Formatter : IJT808MessagePackFormatter + { + public readonly static JT808_JTActiveSafety_0x0900_USB_0xF7_Formatter Instance = new JT808_JTActiveSafety_0x0900_USB_0xF7_Formatter(); + public JT808_JTActiveSafety_0x0900_USB_0xF7 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_JTActiveSafety_0x0900_USB_0xF7 jT808_JTActiveSafety_0X0900_USB_0XF7 = new JT808_JTActiveSafety_0x0900_USB_0xF7(); + jT808_JTActiveSafety_0X0900_USB_0XF7.WorkingCondition = reader.ReadByte(); + jT808_JTActiveSafety_0X0900_USB_0XF7.AlarmStatus = reader.ReadUInt32(); + return jT808_JTActiveSafety_0X0900_USB_0XF7; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_JTActiveSafety_0x0900_USB_0xF7 value, IJT808Config config) + { + writer.WriteByte(value.WorkingCondition); + writer.WriteUInt32(value.AlarmStatus); + } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_JTActiveSafety_0x0900_USB_0xF8_Formatter.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_JTActiveSafety_0x0900_USB_0xF8_Formatter.cs new file mode 100644 index 0000000..73c3787 --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_JTActiveSafety_0x0900_USB_0xF8_Formatter.cs @@ -0,0 +1,58 @@ +using JT808.Protocol.Extensions.JTActiveSafety.MessageBody; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.Formatters +{ + public class JT808_JTActiveSafety_0x0900_USB_0xF8_Formatter : IJT808MessagePackFormatter + { + public readonly static JT808_JTActiveSafety_0x0900_USB_0xF8_Formatter Instance = new JT808_JTActiveSafety_0x0900_USB_0xF8_Formatter(); + public JT808_JTActiveSafety_0x0900_USB_0xF8 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_JTActiveSafety_0x0900_USB_0xF8 jT808_JTActiveSafety_0X0900_USB_0XF8 = new JT808_JTActiveSafety_0x0900_USB_0xF8(); + jT808_JTActiveSafety_0X0900_USB_0XF8.CompantNameLength = reader.ReadByte(); + jT808_JTActiveSafety_0X0900_USB_0XF8.CompantName = reader.ReadString(jT808_JTActiveSafety_0X0900_USB_0XF8.CompantNameLength); + jT808_JTActiveSafety_0X0900_USB_0XF8.ProductModelLength = reader.ReadByte(); + jT808_JTActiveSafety_0X0900_USB_0XF8.ProductModel = reader.ReadString(jT808_JTActiveSafety_0X0900_USB_0XF8.ProductModelLength); + jT808_JTActiveSafety_0X0900_USB_0XF8.HardwareVersionNumberLength = reader.ReadByte(); + jT808_JTActiveSafety_0X0900_USB_0XF8.HardwareVersionNumber = reader.ReadString(jT808_JTActiveSafety_0X0900_USB_0XF8.HardwareVersionNumberLength); + jT808_JTActiveSafety_0X0900_USB_0XF8.SoftwareVersionNumberLength = reader.ReadByte(); + jT808_JTActiveSafety_0X0900_USB_0XF8.SoftwareVersionNumber = reader.ReadString(jT808_JTActiveSafety_0X0900_USB_0XF8.SoftwareVersionNumberLength); + jT808_JTActiveSafety_0X0900_USB_0XF8.DevicesIDLength = reader.ReadByte(); + jT808_JTActiveSafety_0X0900_USB_0XF8.DevicesID = reader.ReadString(jT808_JTActiveSafety_0X0900_USB_0XF8.DevicesIDLength); + jT808_JTActiveSafety_0X0900_USB_0XF8.CustomerCodeLength = reader.ReadByte(); + jT808_JTActiveSafety_0X0900_USB_0XF8.CustomerCode = reader.ReadString(jT808_JTActiveSafety_0X0900_USB_0XF8.CustomerCodeLength); + return jT808_JTActiveSafety_0X0900_USB_0XF8; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_JTActiveSafety_0x0900_USB_0xF8 value, IJT808Config config) + { + writer.Skip(1, out int CompantNameLengthPosition); + writer.WriteString(value.CompantName); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - CompantNameLengthPosition - 1), CompantNameLengthPosition); + + writer.Skip(1, out int ProductModelLengthPosition); + writer.WriteString(value.ProductModel); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - ProductModelLengthPosition - 1), ProductModelLengthPosition); + + writer.Skip(1, out int HardwareVersionNumberLengthPosition); + writer.WriteString(value.HardwareVersionNumber); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - HardwareVersionNumberLengthPosition - 1), HardwareVersionNumberLengthPosition); + + writer.Skip(1, out int SoftwareVersionNumberLengthPosition); + writer.WriteString(value.SoftwareVersionNumber); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - SoftwareVersionNumberLengthPosition - 1), SoftwareVersionNumberLengthPosition); + + writer.Skip(1, out int DevicesIDLengthPosition); + writer.WriteString(value.DevicesID); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - DevicesIDLengthPosition - 1), DevicesIDLengthPosition); + + writer.Skip(1, out int CustomerCodeLengthPosition); + writer.WriteString(value.CustomerCode); + writer.WriteByteReturn((byte)(writer.GetCurrentPosition() - CustomerCodeLengthPosition - 1), CustomerCodeLengthPosition); + } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_JTActiveSafety_0x8900_Formatter.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_JTActiveSafety_0x8900_Formatter.cs new file mode 100644 index 0000000..a680036 --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/Formatters/JT808_JTActiveSafety_0x8900_Formatter.cs @@ -0,0 +1,39 @@ +using JT808.Protocol.Extensions.JTActiveSafety.MessageBody; +using JT808.Protocol.Formatters; +using JT808.Protocol.MessagePack; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.Formatters +{ + public class JT808_JTActiveSafety_0x8900_Formatter : IJT808MessagePackFormatter + { + public JT808_JTActiveSafety_0x8900 Deserialize(ref JT808MessagePackReader reader, IJT808Config config) + { + JT808_JTActiveSafety_0x8900 jT808_JTActiveSafety_0X8900 = new JT808_JTActiveSafety_0x8900(); + jT808_JTActiveSafety_0X8900.USBCount=reader.ReadByte(); + if (jT808_JTActiveSafety_0X8900.USBCount > 0) + { + jT808_JTActiveSafety_0X8900.MultipleUSB = new List(); + for(int i=0;i < jT808_JTActiveSafety_0X8900.USBCount; i++) + { + jT808_JTActiveSafety_0X8900.MultipleUSB.Add(reader.ReadByte()); + } + } + return jT808_JTActiveSafety_0X8900; + } + + public void Serialize(ref JT808MessagePackWriter writer, JT808_JTActiveSafety_0x8900 value, IJT808Config config) + { + if(value.MultipleUSB!=null && value.MultipleUSB.Count > 0) + { + writer.WriteByte((byte)value.MultipleUSB.Count); + foreach(var item in value.MultipleUSB) + { + writer.WriteByte(item); + } + } + } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/JT808.Protocol.Extensions.JTActiveSafety.csproj b/src/JT808.Protocol.Extensions.JTActiveSafety/JT808.Protocol.Extensions.JTActiveSafety.csproj index 9f5c4f4..1df4b06 100644 --- a/src/JT808.Protocol.Extensions.JTActiveSafety/JT808.Protocol.Extensions.JTActiveSafety.csproj +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/JT808.Protocol.Extensions.JTActiveSafety.csproj @@ -1,7 +1,15 @@ - + netstandard2.0 + + + + + + + + diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/JT808_JTActiveSafety_Constants.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/JT808_JTActiveSafety_Constants.cs new file mode 100644 index 0000000..d4ca3cc --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/JT808_JTActiveSafety_Constants.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety +{ + public static class JT808_JTActiveSafety_Constants + { + /// + /// 附加信息ID 高级驾驶辅助系统报警信息 + /// + public const byte JT808_0X0200_0x64 = 0x64; + /// + /// 附加信息ID 驾驶员状态监测系统报警信息 + /// + public const byte JT808_0X0200_0x65 = 0x65; + /// + /// 附加信息ID 胎压监测系统报警信息 + /// + public const byte JT808_0X0200_0x66 = 0x66; + /// + /// 附加信息ID 盲区监测系统报警信息 + /// + public const byte JT808_0X0200_0x67 = 0x67; + /// + /// 高级驾驶辅助系统参数设置 + /// + public const uint JT808_0X8103_0xF364 = 0xF364; + /// + /// 驾驶员状态监测系统参数设置 + /// + public const uint JT808_0X8103_0xF365 = 0xF365; + /// + /// 胎压监测系统参数设置 + /// + public const uint JT808_0X8103_0xF366 = 0xF366; + /// + /// 盲区监测系统参数设置 + /// + public const uint JT808_0X8103_0xF367 = 0xF367; + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_0x8103_0xF364.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_0x8103_0xF364.cs new file mode 100644 index 0000000..c22e5cf --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_0x8103_0xF364.cs @@ -0,0 +1,200 @@ +using JT808.Protocol.Attributes; +using JT808.Protocol.Extensions.JTActiveSafety.Formatters; +using JT808.Protocol.MessageBody; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.MessageBody +{ + /// + /// 高级驾驶辅助系统参数 + /// + [JT808Formatter(typeof(JT808_0x8103_0xF364_Formatter))] + public class JT808_0x8103_0xF364 : JT808_0x8103_BodyBase + { + public override uint ParamId { get; set; } = 0xF364; + public override byte ParamLength { get; set; } + /// + /// 报警判断速度阈值 + /// + public byte AlarmJudgeSpeedThreshold { get; set; } + /// + /// 报警提示音量 + /// + public byte WarningVolume { get; set; } + /// + /// 主动拍照策略 + /// + public byte ActivePhotographyStrategy { get; set; } + /// + /// 主动定时拍照时间间隔 + /// + public ushort ActivelyTimePhotoInterval { get; set; } + /// + /// 主动定距拍照距离间隔 + /// + public ushort ActiveDistancePhotographyDistanceInterval { get; set; } + /// + /// 单次主动拍照张数 + /// + public byte SingleInitiativePhotos { get; set; } + /// + /// 单次主动拍照时间间隔 + /// + public byte SingleInitiativePhotosInterval { get; set; } + /// + /// 拍照分辨率 + /// + public byte PhotoResolution { get; set; } + /// + /// 视频录制分辨率 + /// + public byte VideoRecordingResolution { get; set; } + /// + /// 报警使能 + /// + public uint AlarmEnable { get; set; } + /// + /// 事件使能 + /// + public uint EventEnable { get; set; } + /// + /// 预留字段 + /// + public byte Placeholder1 { get; set; } + /// + /// 障碍物报警距离阈值 + /// + public byte DistanceThresholdObstacleAlarm { get; set; } + /// + /// 障碍物报警分级速度阈值 + /// + public byte HierarchicalSpeedThresholdObstacleAlarm { get; set; } + /// + /// 障碍物报警前后视频录制时间 + /// + public byte VideoRecordingTimeBeforeAndAfterObstacleAlarm { get; set; } + /// + /// 障碍物报警拍照张数 + /// + public byte BarrierAlarmPhotographs { get; set; } + /// + /// 障碍物报警拍照间隔 + /// + public byte ObstacleAlarmInterval { get; set; } + /// + /// 频繁变道报警判断时间段 + /// + public byte FrequentChannelChangeAlarmJudgmentTimePeriod { get; set; } + + /// + /// 频繁变道报警判断次数 + /// + public byte FrequentAlarmJudgmentNumberChannelChange { get; set; } + /// + /// 频繁变道报警分级速度阈值 + /// + public byte HierarchicalSpeedThresholdFrequentChannelChangeAlarm { get; set; } + /// + /// 频繁变道报警前后视频录制时间 + /// + public byte VideoRecordingTimeBeforeAndAfterFrequentLaneChangeAlarm { get; set; } + /// + /// 频繁变道报警拍照张数 + /// + public byte FrequentChannelChangeAlarmPhotos { get; set; } + /// + /// 频繁变道报警拍照间隔 + /// + public byte FrequentLaneChangeAlarmInterval { get; set; } + /// + /// 车道偏离报警分级速度阈值 + /// + public byte GradedSpeedThresholdLaneDeviationAlarm { get; set; } + /// + /// 车道偏离报警前后视频录制时间 + /// + public byte VideoRecordingTimeBeforeAndAfterLaneDepartureAlarm { get; set; } + /// + /// 车道偏离报警拍照张数 + /// + public byte LaneDepartureAlarmPhoto { get; set; } + /// + /// 车道偏离报警拍照间隔 + /// + public byte LaneDepartureAlarmPhotoInterval { get; set; } + /// + /// 前向碰撞报警时间阈值 + /// + public byte ForwardCollisionWarningTimeThreshold { get; set; } + /// + /// 前向碰撞报警分级速度阈值 + /// + public byte HierarchicalSpeedThresholdForwardCollisionWarning { get; set; } + /// + /// 前向碰撞报警前后视频录制时间 + /// + public byte VideoRecordingTimeBeforeAndAfterForwardCollisionAlarm { get; set; } + /// + /// 前向碰撞报警拍照张数 + /// + public byte ForwardCollisionAlarmPhotographs { get; set; } + /// + /// 前向碰撞报警拍照间隔 + /// + public byte ForwardCollisionAlarmInterval { get; set; } + /// + /// 行人碰撞报警时间阈值 + /// + public byte PedestrianCollisionAlarmTimeThreshold { get; set; } + /// + /// 行人碰撞报警使能速度阈值 + /// + public byte PedestrianCollisionAlarmEnablingSpeedThreshold { get; set; } + /// + /// 行人碰撞报警前后视频录制时间 + /// + public byte VideoRecordingTimeBeforeAndAfterPedestrianCollisionAlarm { get; set; } + /// + /// 行人碰撞报警拍照张数 + /// + public byte PedestrianCollisionAlarmPhotos { get; set; } + /// + /// 行人碰撞报警拍照间隔 + /// + public byte PedestrianCollisionAlarmInterval { get; set; } + /// + /// 车距监控报警距离阈值 + /// + public byte VehicleDistanceMonitoringAlarmDistanceThreshold { get; set; } + /// + /// 车距监控报警分级速度阈值 + /// + public byte VehicleDistanceMonitoringAndAlarmClassificationSpeedThreshold { get; set; } + /// + /// 车距过近报警前后视频录制时间 + /// + public byte VideoRecordingTimeBeforeAndAfterAlarmVehicleProximity { get; set; } + /// + /// 车距过近报警拍照张数 + /// + public byte AlarmPhotoVehicleCloseDistance { get; set; } + /// + /// 车距过近报警拍照间隔 + /// + public byte AlarmPhotoVehicleCloseDistanceInterval { get; set; } + /// + /// 道路标志识别拍照张数 + /// + public byte RoadSignRecognitionPhotographs { get; set; } + /// + /// 道路标志识别拍照间隔 + /// + public byte RoadSignRecognitionPhotographsInterval { get; set; } + /// + /// 保留字段 + /// + public byte[] Placeholder2 { get; set; } = new byte[4]; + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_0x8103_0xF365.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_0x8103_0xF365.cs new file mode 100644 index 0000000..519e100 --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_0x8103_0xF365.cs @@ -0,0 +1,155 @@ +using JT808.Protocol.Attributes; +using JT808.Protocol.Extensions.JTActiveSafety.Formatters; +using JT808.Protocol.MessageBody; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.MessageBody +{ + /// + /// 驾驶员状态监测系统参数 + /// + [JT808Formatter(typeof(JT808_0x8103_0xF365_Formatter))] + public class JT808_0x8103_0xF365 : JT808_0x8103_BodyBase + { + public override uint ParamId { get; set; } = 0xF365; + public override byte ParamLength { get; set; } + /// + /// 报警判断速度阈值 + /// + public byte AlarmJudgeSpeedThreshold { get; set; } + /// + /// 报警提示音量 + /// + public byte WarningVolume { get; set; } + /// + /// 主动拍照策略 + /// + public byte ActivePhotographyStrategy { get; set; } + /// + /// 主动定时拍照时间间隔 + /// + public ushort ActivelyTimePhotoInterval { get; set; } + /// + /// 主动定距拍照距离间隔 + /// + public ushort ActiveDistancePhotographyDistanceInterval { get; set; } + /// + /// 单次主动拍照张数 + /// + public byte SingleInitiativePhotos { get; set; } + /// + /// 单次主动拍照时间间隔 + /// + public byte SingleInitiativePhotosInterval { get; set; } + /// + /// 拍照分辨率 + /// + public byte PhotoResolution { get; set; } + /// + /// 视频录制分辨率 + /// + public byte VideoRecordingResolution { get; set; } + /// + /// 报警使能 + /// + public uint AlarmEnable { get; set; } + /// + /// 事件使能 + /// + public uint EventEnable { get; set; } + /// + /// 吸烟报警判断时间间隔 + /// + public ushort TimeIntervalSmokingAlarmJudgment { get; set; } + /// + /// 接打电话报警判断时间间隔 + /// + public ushort CallAlarmDetermineTimeInterval{ get; set; } + /// + /// 预留字段 + /// + public byte[] Reserve { get; set; } = new byte[3]; + /// + /// 疲劳驾驶报警分级速度阈值 + /// + public byte GradedSpeedThresholdFatigueDrivingAlarm { get; set; } + /// + /// 疲劳驾驶报警前后视频录制时间 + /// + public byte VideoRecordingTimeBeforeAndAfterFatigueDrivingAlarm { get; set; } + /// + /// 疲劳驾驶报警拍照张数 + /// + public byte FatigueDrivingAlarmPhotograph { get; set; } + /// + /// 疲劳驾驶报警拍照间隔时间 + /// + public byte FatigueDrivingAlarmPhotographInterval { get; set; } + /// + /// 接打电话报警分级速度阈值 + /// + public byte ClassifiedSpeedThresholdCallAlarm{ get; set; } + /// + /// 接打电话报警前后视频录制时间 + /// + public byte VideoRecordingTimeBeforeAndAfterCallAlarm{ get; set; } + /// + /// 接打电话报警拍驾驶员面部特征照片张数 + /// + public byte CallAlarmTakePicturesDriverFacialFeatures{ get; set; } + /// + /// 接打电话报警拍驾驶员面部特征照片间隔时间 + /// + public byte CallAlarmTakePicturesDriverFacialFeaturesInterval { get; set; } + /// + /// 抽烟报警分级车速阈值 + /// + public byte ClassifiedSpeedThresholdSmokingAlarm{ get; set; } + /// + /// 抽烟报警前后视频录制时间 + /// + public byte VideoRecordingTimeBeforeAndAfterSmokingAlarm{ get; set; } + /// + /// 抽烟报警拍驾驶员面部特征照片张数 + /// + public byte SmokingAlarmPhotographsDriverFaceCharacteristics { get; set; } + /// + /// 抽烟报警拍驾驶员面部特征照片间隔时间 + /// + public byte SmokingAlarmPhotographsDriverFaceCharacteristicsInterval { get; set; } + /// + /// 分神驾驶报警分级车速阈值 + /// + public byte ClassifiedSpeedThresholdDistractedDrivingAlarm { get; set; } + /// + /// 分神驾驶报警拍照张数 + /// + public byte DistractedDrivingAlarmPhotography{ get; set; } + /// + /// 分神驾驶报警拍照间隔时间 + /// + public byte DistractedDrivingAlarmPhotographyInterval { get; set; } + /// + /// 驾驶行为异常视频录制时间 + /// + public byte VideoRecordingTimeAbnormalDrivingBehavior{ get; set; } + /// + /// 驾驶行为异常抓拍照片张数 + /// + public byte PhotographsAbnormalDrivingBehavior{ get; set; } + /// + /// 驾驶行为异常拍照间隔 + /// + public byte PictureIntervalAbnormalDrivingBehavior{ get; set; } + /// + /// 驾驶员身份识别触发 + /// + public byte DriverIdentificationTrigger { get; set; } + /// + /// 保留字段 + /// + public byte[] Retain { get; set; } = new byte[2]; + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_0x8103_0xF366.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_0x8103_0xF366.cs new file mode 100644 index 0000000..3a4bb48 --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_0x8103_0xF366.cs @@ -0,0 +1,63 @@ +using JT808.Protocol.Attributes; +using JT808.Protocol.Extensions.JTActiveSafety.Formatters; +using JT808.Protocol.MessageBody; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.MessageBody +{ + /// + /// 胎压监测系统参数 + /// + [JT808Formatter(typeof(JT808_0x8103_0xF366_Formatter))] + public class JT808_0x8103_0xF366 : JT808_0x8103_BodyBase + { + public override uint ParamId { get; set; } = 0xF366; + public override byte ParamLength { get; set; } = 46; + /// + /// 轮胎规格型号 + /// + public string TyreSpecificationType { get; set; } + /// + /// 胎压单位 + /// + public ushort TyrePressureUnit { get; set; } + /// + /// 正常胎压值 + /// + public ushort NormalFetalPressure { get; set; } + /// + /// 胎压不平衡门限 + /// + public ushort ThresholdUnbalancedTirePressure { get; set; } + /// + /// 慢漏气门限 + /// + public ushort SlowLeakageThreshold { get; set; } + /// + /// 低压阈值 + /// + public ushort LowVoltageThreshold { get; set; } + /// + /// 高压阈值 + /// + public ushort HighVoltageThreshold { get; set; } + /// + /// 高温阈值 + /// + public ushort HighTemperatureThreshold { get; set; } + /// + /// 电压阈值 + /// + public ushort VoltageThreshold { get; set; } + /// + /// 定时上报时间间隔 + /// + public ushort TimedReportingInterval { get; set; } + /// + /// 保留项 + /// + public byte[] Retain { get; set; } = new byte[6]; + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_0x8103_0xF367.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_0x8103_0xF367.cs new file mode 100644 index 0000000..6d2c89b --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_0x8103_0xF367.cs @@ -0,0 +1,27 @@ +using JT808.Protocol.Attributes; +using JT808.Protocol.Extensions.JTActiveSafety.Formatters; +using JT808.Protocol.MessageBody; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.MessageBody +{ + /// + /// 盲区监测系统参数 + /// + [JT808Formatter(typeof(JT808_0x8103_0xF367_Formatter))] + public class JT808_0x8103_0xF367 : JT808_0x8103_BodyBase + { + public override uint ParamId { get; set; } = 0xF367; + public override byte ParamLength { get; set; } = 2; + /// + /// 后方接近报警时间阈值 + /// + public byte RearApproachAlarmTimeThreshold { get; set; } + /// + /// 侧后方接近报警时间阈值 + /// + public byte LateralRearApproachAlarmTimeThreshold { get; set; } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900.cs new file mode 100644 index 0000000..71956fc --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900.cs @@ -0,0 +1,23 @@ +using JT808.Protocol.Attributes; +using JT808.Protocol.Extensions.JTActiveSafety.Formatters; +using JT808.Protocol.MessageBody; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.MessageBody +{ + /// + /// 上传基本信息 + /// + [JT808Formatter(typeof(JT808_JTActiveSafety_0x0900_Formatter))] + public class JT808_JTActiveSafety_0x0900 : JT808_0x0900_BodyBase + { + /// + /// 消息列表总数 + /// + public byte USBMessageCount { get; set; } + + public List USBMessages { get; set; } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900_USBMessage.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900_USBMessage.cs new file mode 100644 index 0000000..d7b2b98 --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900_USBMessage.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.MessageBody +{ + /// + /// 外设消息结构 + /// + public class JT808_JTActiveSafety_0x0900_USBMessage + { + /// + /// 外设ID + /// + public byte USBID { get; set; } + /// + /// 消息长度 + /// + public byte MessageLength { get; set; } + /// + /// 消息内容 + /// + public byte[] MessageContent { get; set; } + /// + /// 消息内容对象 + /// + public JT808_JTActiveSafety_0x0900_USB_Base MessageContentObejct { get; set; } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900_USB_0xF7.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900_USB_0xF7.cs new file mode 100644 index 0000000..560ff69 --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900_USB_0xF7.cs @@ -0,0 +1,21 @@ +using JT808.Protocol.Attributes; +using JT808.Protocol.Extensions.JTActiveSafety.Formatters; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.MessageBody +{ + [JT808Formatter(typeof(JT808_JTActiveSafety_0x0900_USB_0xF7_Formatter))] + public class JT808_JTActiveSafety_0x0900_USB_0xF7 : JT808_JTActiveSafety_0x0900_USB_Base + { + /// + /// 工作状态 + /// + public byte WorkingCondition { get; set; } + /// + /// 报警状态 + /// + public uint AlarmStatus { get; set; } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900_USB_0xF8.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900_USB_0xF8.cs new file mode 100644 index 0000000..24c9a6c --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900_USB_0xF8.cs @@ -0,0 +1,63 @@ +using JT808.Protocol.Attributes; +using JT808.Protocol.Extensions.JTActiveSafety.Formatters; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.MessageBody +{ + [JT808Formatter(typeof(JT808_JTActiveSafety_0x0900_USB_0xF8_Formatter))] + public class JT808_JTActiveSafety_0x0900_USB_0xF8 : JT808_JTActiveSafety_0x0900_USB_Base + { + /// + /// 公司名称长度 + /// + public byte CompantNameLength { get; set; } + /// + /// 公司名称 + /// + public string CompantName { get; set; } + /// + /// 产品型号长度 + /// + public byte ProductModelLength { get; set; } + /// + /// 产品型号 + /// + public string ProductModel { get; set; } + /// + /// 硬件版本号长度 + /// + public byte HardwareVersionNumberLength { get; set; } + /// + /// 硬件版本号 + /// ASCII + /// + public string HardwareVersionNumber { get; set; } + /// + /// 软件版本号长度 + /// + public byte SoftwareVersionNumberLength { get; set; } + /// + /// 软件版本号 + /// ASCII + /// + public string SoftwareVersionNumber { get; set; } + /// + /// 设备ID长度 + /// + public byte DevicesIDLength { get; set; } + /// + /// 设备ID + /// + public string DevicesID { get; set; } + /// + /// 客户代码长度 + /// + public byte CustomerCodeLength { get; set; } + /// + /// 客户代码 + /// + public string CustomerCode { get; set; } + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900_USB_Base.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900_USB_Base.cs new file mode 100644 index 0000000..19140a7 --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x0900_USB_Base.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.MessageBody +{ + public abstract class JT808_JTActiveSafety_0x0900_USB_Base + { + } +} diff --git a/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x8900.cs b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x8900.cs new file mode 100644 index 0000000..f8c5eeb --- /dev/null +++ b/src/JT808.Protocol.Extensions.JTActiveSafety/MessageBody/JT808_JTActiveSafety_0x8900.cs @@ -0,0 +1,25 @@ +using JT808.Protocol.Attributes; +using JT808.Protocol.Extensions.JTActiveSafety.Formatters; +using JT808.Protocol.MessageBody; +using System; +using System.Collections.Generic; +using System.Text; + +namespace JT808.Protocol.Extensions.JTActiveSafety.MessageBody +{ + /// + /// 查询基本信息 + /// + [JT808Formatter(typeof(JT808_JTActiveSafety_0x8900_Formatter))] + public class JT808_JTActiveSafety_0x8900: JT808_0x8900_BodyBase + { + /// + /// 外设ID列表总数 + /// + public byte USBCount { get; set; } + /// + /// 外设ID + /// + public List MultipleUSB { get; set; } + } +}