Ejemplo n.º 1
0
        public JT808_0x0901 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x0901 jT808_0X0901          = new JT808_0x0901();
            var          compressMessageLength = reader.ReadUInt32();
            var          data = reader.ReadArray((int)compressMessageLength);

            jT808_0X0901.UnCompressMessage       = config.Compress.Decompress(data.ToArray());
            jT808_0X0901.UnCompressMessageLength = (uint)jT808_0X0901.UnCompressMessage.Length;
            return(jT808_0X0901);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public JT808_0x0B02 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x0B02 value = new JT808_0x0B02();

            value.GprsId      = reader.ReadUInt32();
            value.PointType   = reader.ReadByte();
            value.TrafficType = reader.ReadByte();
            value.StationId   = reader.ReadUInt32();
            value.StationNo   = reader.ReadByte();
            value.Tag         = reader.ReadByte();
            value.Latitude    = reader.ReadUInt32();
            value.Longitude   = reader.ReadUInt32();
            value.Altitude    = reader.ReadUInt16();
            value.Speed       = reader.ReadUInt16();
            value.Direction   = reader.ReadUInt16();
            value.Time        = reader.ReadDateTime6();
            value.PersonCount = reader.ReadUInt16();
            return(value);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public JT808_0x8103_0xF367 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x8103_0xF367 value = new JT808_0x8103_0xF367();

            value.ParamId     = reader.ReadUInt32();
            value.ParamLength = reader.ReadByte();
            value.RearApproachAlarmTimeThreshold        = reader.ReadByte();
            value.LateralRearApproachAlarmTimeThreshold = reader.ReadByte();
            return(value);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public JT808_0x1211 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x1211 value = new JT808_0x1211();

            value.FileNameLength = reader.ReadByte();
            value.FileName       = reader.ReadString(value.FileNameLength);
            value.FileType       = reader.ReadByte();
            value.FileSize       = reader.ReadUInt32();
            return(value);
        }
        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);
        }
Ejemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public JT808_0x8602 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x8602 jT808_0X8602 = new JT808_0x8602();

            jT808_0X8602.SettingAreaProperty = reader.ReadByte();
            jT808_0X8602.AreaCount           = reader.ReadByte();
            jT808_0X8602.AreaItems           = new List <JT808RectangleAreaProperty>();
            for (var i = 0; i < jT808_0X8602.AreaCount; i++)
            {
                JT808RectangleAreaProperty areaProperty = new JT808RectangleAreaProperty();
                areaProperty.AreaId           = reader.ReadUInt32();
                areaProperty.AreaProperty     = reader.ReadUInt16();
                areaProperty.UpLeftPointLat   = reader.ReadUInt32();
                areaProperty.UpLeftPointLng   = reader.ReadUInt32();
                areaProperty.LowRightPointLat = reader.ReadUInt32();
                areaProperty.LowRightPointLng = reader.ReadUInt32();
                ReadOnlySpan <char> areaProperty16Bit = Convert.ToString(areaProperty.AreaProperty, 2).PadLeft(16, '0').AsSpan();
                bool bit0Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 1).ToString().Equals("0");
                if (!bit0Flag)
                {
                    areaProperty.StartTime = reader.ReadDateTime6();
                    areaProperty.EndTime   = reader.ReadDateTime6();
                }
                bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0");
                if (!bit1Flag)
                {
                    areaProperty.HighestSpeed      = reader.ReadUInt16();
                    areaProperty.OverspeedDuration = reader.ReadByte();
                    if (reader.Version == JT808Version.JTT2019)
                    {
                        areaProperty.NightMaximumSpeed = reader.ReadUInt16();
                    }
                }
                if (reader.Version == JT808Version.JTT2019)
                {
                    areaProperty.NameLength = reader.ReadUInt16();
                    areaProperty.AreaName   = reader.ReadString(areaProperty.NameLength);
                }
                jT808_0X8602.AreaItems.Add(areaProperty);
            }
            return(jT808_0X8602);
        }
Ejemplo n.º 8
0
        public JT808_0x8606 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x8606 jT808_0X8606 = new JT808_0x8606();

            jT808_0X8606.RouteId       = reader.ReadUInt32();
            jT808_0X8606.RouteProperty = reader.ReadUInt16();
            ReadOnlySpan <char> routeProperty16Bit = Convert.ToString(jT808_0X8606.RouteProperty, 2).PadLeft(16, '0').AsSpan();
            bool bit0Flag = routeProperty16Bit.Slice(routeProperty16Bit.Length - 1).ToString().Equals("0");

            if (!bit0Flag)
            {
                jT808_0X8606.StartTime = reader.ReadDateTime6();
                jT808_0X8606.EndTime   = reader.ReadDateTime6();
            }
            jT808_0X8606.InflectionPointCount = reader.ReadUInt16();
            jT808_0X8606.InflectionPointItems = new List <JT808InflectionPointProperty>();
            for (var i = 0; i < jT808_0X8606.InflectionPointCount; i++)
            {
                JT808InflectionPointProperty jT808InflectionPointProperty = new JT808InflectionPointProperty();
                jT808InflectionPointProperty.InflectionPointId  = reader.ReadUInt32();
                jT808InflectionPointProperty.SectionId          = reader.ReadUInt32();
                jT808InflectionPointProperty.InflectionPointLat = reader.ReadUInt32();
                jT808InflectionPointProperty.InflectionPointLng = reader.ReadUInt32();
                jT808InflectionPointProperty.SectionWidth       = reader.ReadByte();
                jT808InflectionPointProperty.SectionProperty    = reader.ReadByte();
                ReadOnlySpan <char> sectionProperty16Bit = Convert.ToString(jT808InflectionPointProperty.SectionProperty, 2).PadLeft(16, '0').AsSpan();
                bool sectionBit0Flag = sectionProperty16Bit.Slice(sectionProperty16Bit.Length - 1).ToString().Equals("0");
                if (!sectionBit0Flag)
                {
                    jT808InflectionPointProperty.SectionLongDrivingThreshold  = reader.ReadUInt16();
                    jT808InflectionPointProperty.SectionDrivingUnderThreshold = reader.ReadUInt16();
                }
                bool sectionBit1Flag = sectionProperty16Bit.Slice(sectionProperty16Bit.Length - 2, 1).ToString().Equals("0");
                if (!sectionBit1Flag)
                {
                    jT808InflectionPointProperty.SectionHighestSpeed      = reader.ReadUInt16();
                    jT808InflectionPointProperty.SectionOverspeedDuration = reader.ReadByte();
                }
                jT808_0X8606.InflectionPointItems.Add(jT808InflectionPointProperty);
            }
            return(jT808_0X8606);
        }
Ejemplo n.º 9
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8103_0x0092 jT808_0x8103_0x0092 = new JT808_0x8103_0x0092();

            jT808_0x8103_0x0092.ParamId     = reader.ReadUInt32();
            jT808_0x8103_0x0092.ParamLength = reader.ReadByte();
            jT808_0x8103_0x0092.ParamValue  = reader.ReadByte();
            writer.WriteNumber($"[{ jT808_0x8103_0x0092.ParamId.ReadNumber()}]参数ID", jT808_0x8103_0x0092.ParamId);
            writer.WriteNumber($"[{jT808_0x8103_0x0092.ParamLength.ReadNumber()}]参数长度", jT808_0x8103_0x0092.ParamLength);
            writer.WriteNumber($"[{ jT808_0x8103_0x0092.ParamValue.ReadNumber()}]GNSS模块详细定位数据输出频率ms", jT808_0x8103_0x0092.ParamValue == 0?500: jT808_0x8103_0x0092.ParamValue * 1000);
        }
Ejemplo n.º 10
0
        public JT808_0x0200_DT2_0x81 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x0200_DT2_0x81 jT808_0X0200_DT2_0X81 = new JT808_0x0200_DT2_0x81();

            jT808_0X0200_DT2_0X81.AttachInfoId     = reader.ReadByte();
            jT808_0X0200_DT2_0X81.AttachInfoLength = reader.ReadByte();
            jT808_0X0200_DT2_0X81.Age    = reader.ReadUInt32();
            jT808_0X0200_DT2_0X81.Gender = reader.ReadByte();
            jT808_0X0200_DT2_0X81.MsgNum = reader.ReadUInt16();
            return(jT808_0X0200_DT2_0X81);
        }
Ejemplo n.º 11
0
        public JT808_0x0200_DT1_0x81 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x0200_DT1_0x81 jT808_0X0200_DT1_0X81 = new JT808_0x0200_DT1_0x81();

            jT808_0X0200_DT1_0X81.AttachInfoId     = reader.ReadByte();
            jT808_0X0200_DT1_0X81.AttachInfoLength = reader.ReadByte();
            jT808_0X0200_DT1_0X81.Age      = reader.ReadUInt32();
            jT808_0X0200_DT1_0X81.Gender   = reader.ReadByte();
            jT808_0X0200_DT1_0X81.UserName = reader.ReadRemainStringContent();
            return(jT808_0X0200_DT1_0X81);
        }
Ejemplo n.º 12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="writer"></param>
        /// <param name="config"></param>
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8103_0x0032 value = new JT808_0x8103_0x0032();

            value.ParamId     = reader.ReadUInt32();
            value.ParamLength = reader.ReadByte();
            value.ParamValue  = reader.ReadArray(4).ToArray();
            writer.WriteNumber($"[{ value.ParamId.ReadNumber()}]参数ID", value.ParamId);
            writer.WriteNumber($"[{value.ParamLength.ReadNumber()}]参数长度", value.ParamLength);
            writer.WriteString($"[{ value.ParamValue.ToHexString()}]参数值[违规行驶时段范围]", $"开始时间{value.ParamValue[0]}时{value.ParamValue[1]}分,结束时间{value.ParamValue[2]}时{value.ParamValue[3]}分");
        }
Ejemplo n.º 13
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8103_0x0084 jT808_0x8103_0x0084 = new JT808_0x8103_0x0084();

            jT808_0x8103_0x0084.ParamId     = reader.ReadUInt32();
            jT808_0x8103_0x0084.ParamLength = reader.ReadByte();
            jT808_0x8103_0x0084.ParamValue  = reader.ReadByte();
            writer.WriteNumber($"[{ jT808_0x8103_0x0084.ParamId.ReadNumber()}]参数ID", jT808_0x8103_0x0084.ParamId);
            writer.WriteNumber($"[{jT808_0x8103_0x0084.ParamLength.ReadNumber()}]参数长度", jT808_0x8103_0x0084.ParamLength);
            writer.WriteNumber($"[{ jT808_0x8103_0x0084.ParamValue.ReadNumber()}]参数值[车牌颜色,按照 JT/T415-2006 的 5.4.12]", jT808_0x8103_0x0084.ParamValue);
        }
Ejemplo n.º 14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="writer"></param>
        /// <param name="config"></param>
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8103_0x0091 jT808_0x8103_0x0091 = new JT808_0x8103_0x0091();

            jT808_0x8103_0x0091.ParamId     = reader.ReadUInt32();
            jT808_0x8103_0x0091.ParamLength = reader.ReadByte();
            jT808_0x8103_0x0091.ParamValue  = reader.ReadByte();
            writer.WriteNumber($"[{ jT808_0x8103_0x0091.ParamId.ReadNumber()}]参数ID", jT808_0x8103_0x0091.ParamId);
            writer.WriteNumber($"[{jT808_0x8103_0x0091.ParamLength.ReadNumber()}]参数长度", jT808_0x8103_0x0091.ParamLength);
            writer.WriteNumber($"[{ jT808_0x8103_0x0091.ParamValue.ReadNumber()}]参数值[GNSS波特率]", Math.Pow(4800, jT808_0x8103_0x0091.ParamValue));
        }
Ejemplo n.º 15
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8805 value = new JT808_0x8805();

            value.MultimediaId      = reader.ReadUInt32();
            value.MultimediaDeleted = reader.ReadByte();
            JT808MultimediaDeleted multimediaDeleted = (JT808MultimediaDeleted)value.MultimediaDeleted;

            writer.WriteNumber($"[{value.MultimediaId.ReadNumber()}]多媒体ID", value.MultimediaId);
            writer.WriteNumber($"[{value.MultimediaDeleted.ReadNumber()}]删除标志-{multimediaDeleted}", value.MultimediaDeleted);
        }
Ejemplo n.º 16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="writer"></param>
        /// <param name="config"></param>
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8103_0xF370 value = new JT808_0x8103_0xF370();

            value.ParamId     = reader.ReadUInt32();
            value.ParamLength = reader.ReadByte();
            writer.WriteNumber($"[{ value.ParamId.ReadNumber()}]参数ID", value.ParamId);
            writer.WriteNumber($"[{value.ParamLength.ReadNumber()}]参数长度", value.ParamLength);
            value.SmartVideoProtocolVersion = reader.ReadByte();
            writer.WriteNumber($"[{value.SmartVideoProtocolVersion.ReadNumber()}]智能视频协议版本信息", value.SmartVideoProtocolVersion);
        }
Ejemplo n.º 17
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8103_0x0031 jT808_0x8103_0x0031 = new JT808_0x8103_0x0031();

            jT808_0x8103_0x0031.ParamId     = reader.ReadUInt32();
            jT808_0x8103_0x0031.ParamLength = reader.ReadByte();
            jT808_0x8103_0x0031.ParamValue  = reader.ReadUInt16();
            writer.WriteNumber($"[{ jT808_0x8103_0x0031.ParamId.ReadNumber()}]参数ID", jT808_0x8103_0x0031.ParamId);
            writer.WriteNumber($"[{jT808_0x8103_0x0031.ParamLength.ReadNumber()}]参数长度", jT808_0x8103_0x0031.ParamLength);
            writer.WriteNumber($"[{ jT808_0x8103_0x0031.ParamValue.ReadNumber()}]参数值[电子围栏半径m]", jT808_0x8103_0x0031.ParamValue);
        }
Ejemplo n.º 18
0
        public JT808_CarDVR_Down_0xE1 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_CarDVR_Down_0xE1 value = new JT808_CarDVR_Down_0xE1();

            value.UniqueNumber     = reader.ReadASCII(35);
            value.PulseCoefficient = reader.ReadUInt16();
            value.Speed            = reader.ReadUInt16();
            value.TotalMileage     = reader.ReadUInt32();
            value.StatusSignal     = reader.ReadByte();
            return(value);
        }
Ejemplo n.º 19
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8103_0x005E jT808_0x8103_0x005E = new JT808_0x8103_0x005E();

            jT808_0x8103_0x005E.ParamId     = reader.ReadUInt32();
            jT808_0x8103_0x005E.ParamLength = reader.ReadByte();
            jT808_0x8103_0x005E.ParamValue  = reader.ReadUInt16();
            writer.WriteNumber($"[{ jT808_0x8103_0x005E.ParamId.ReadNumber()}]参数ID", jT808_0x8103_0x005E.ParamId);
            writer.WriteNumber($"[{jT808_0x8103_0x005E.ParamLength.ReadNumber()}]参数长度", jT808_0x8103_0x005E.ParamLength);
            writer.WriteString($"[{ jT808_0x8103_0x005E.ParamValue.ReadNumber()}]参数值[侧翻报警参数设置]", $"侧翻角度:{jT808_0x8103_0x005E.ParamValue}(度)");
        }
Ejemplo n.º 20
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8103_0x0101 jT808_0x8103_0x0101 = new JT808_0x8103_0x0101();

            jT808_0x8103_0x0101.ParamId     = reader.ReadUInt32();
            jT808_0x8103_0x0101.ParamLength = reader.ReadByte();
            jT808_0x8103_0x0101.ParamValue  = reader.ReadUInt16();
            writer.WriteNumber($"[{ jT808_0x8103_0x0101.ParamId.ReadNumber()}]参数ID", jT808_0x8103_0x0101.ParamId);
            writer.WriteNumber($"[{jT808_0x8103_0x0101.ParamLength.ReadNumber()}]参数长度", jT808_0x8103_0x0101.ParamLength);
            writer.WriteNumber($"[{ jT808_0x8103_0x0101.ParamValue.ReadNumber()}]参数值[CAN总线通道1, 上传时间间隔(s),0 表示不上传]", jT808_0x8103_0x0101.ParamValue);
        }
Ejemplo n.º 21
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="writer"></param>
        /// <param name="config"></param>
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x0200_0xF1 value = new JT808_0x0200_0xF1();

            value.AttachInfoId = reader.ReadByte();
            writer.WriteNumber($"[{value.AttachInfoId.ReadNumber()}]附加信息Id", value.AttachInfoId);
            value.AttachInfoLength = reader.ReadByte();
            writer.WriteNumber($"[{value.AttachInfoLength.ReadNumber()}]附加信息长度", value.AttachInfoLength);
            value.Retain = reader.ReadUInt32();
            writer.WriteNumber($"[{value.Retain.ReadNumber()}]厂家自定义", value.Retain);
        }
Ejemplo n.º 22
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8103_0x005D jT808_0x8103_0x005D = new JT808_0x8103_0x005D();

            jT808_0x8103_0x005D.ParamId     = reader.ReadUInt32();
            jT808_0x8103_0x005D.ParamLength = reader.ReadByte();
            jT808_0x8103_0x005D.ParamValue  = reader.ReadUInt16();
            writer.WriteNumber($"[{ jT808_0x8103_0x005D.ParamId.ReadNumber()}]参数ID", jT808_0x8103_0x005D.ParamId);
            writer.WriteNumber($"[{jT808_0x8103_0x005D.ParamLength.ReadNumber()}]参数长度", jT808_0x8103_0x005D.ParamLength);
            writer.WriteString($"[{ jT808_0x8103_0x005D.ParamValue.ReadNumber()}]参数值[碰撞报警参数设置]", $"碰撞时间:{(byte)jT808_0x8103_0x005D.ParamValue}(ms),碰撞加速度:{(byte)(jT808_0x8103_0x005D.ParamValue>>8)}(0.1g)");
        }
Ejemplo n.º 23
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        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);
        }
Ejemplo n.º 24
0
        public JT808_0x0800 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x0800 value = new JT808_0x0800();

            value.MultimediaId           = reader.ReadUInt32();
            value.MultimediaType         = reader.ReadByte();
            value.MultimediaCodingFormat = reader.ReadByte();
            value.EventItemCoding        = reader.ReadByte();
            value.ChannelId = reader.ReadByte();
            return(value);
        }
Ejemplo n.º 25
0
        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);
        }
Ejemplo n.º 26
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public JT808_0x8604 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x8604 jT808_0X8604 = new JT808_0x8604();

            jT808_0X8604.AreaId       = reader.ReadUInt32();
            jT808_0X8604.AreaProperty = reader.ReadUInt16();
            ReadOnlySpan <char> areaProperty16Bit = Convert.ToString(jT808_0X8604.AreaProperty, 2).PadLeft(16, '0').AsSpan();
            bool bit0Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 1).ToString().Equals("0");

            if (!bit0Flag)
            {
                jT808_0X8604.StartTime = reader.ReadDateTime6();
                jT808_0X8604.EndTime   = reader.ReadDateTime6();
            }
            bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0");

            if (!bit1Flag)
            {
                jT808_0X8604.HighestSpeed      = reader.ReadUInt16();
                jT808_0X8604.OverspeedDuration = reader.ReadByte();
            }
            jT808_0X8604.PeakCount = reader.ReadUInt16();
            jT808_0X8604.PeakItems = new List <JT808PeakProperty>();
            for (var i = 0; i < jT808_0X8604.PeakCount; i++)
            {
                var item = new JT808PeakProperty();
                item.Lat = reader.ReadUInt32();
                item.Lng = reader.ReadUInt32();
                jT808_0X8604.PeakItems.Add(item);
            }
            if (reader.Version == JT808Version.JTT2019)
            {
                if (!bit1Flag)
                {
                    jT808_0X8604.NightMaximumSpeed = reader.ReadUInt16();
                }
                jT808_0X8604.NameLength = reader.ReadUInt16();
                jT808_0X8604.AreaName   = reader.ReadString(jT808_0X8604.NameLength);
            }
            return(jT808_0X8604);
        }
Ejemplo n.º 27
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8B01 value = new JT808_0x8B01();

            value.GprsId = reader.ReadUInt32();
            writer.WriteNumber($"[{value.GprsId.ReadNumber()}]线路编号", value.GprsId);
            value.GuideBoard = reader.ReadStringEndChar0();
            writer.WriteString($"[Length:{value.GuideBoard.Length}]路牌", value.GuideBoard);
            value.TrainNumber = reader.ReadStringEndChar0();
            writer.WriteString($"[Length:{value.TrainNumber.Length}]车次编号", value.TrainNumber);
            value.SelfId = reader.ReadStringEndChar0();
            writer.WriteString($"[Length:{value.SelfId.Length}]车辆编号", value.SelfId);
            value.TrafficType = reader.ReadByte();
            writer.WriteNumber($"[{value.TrafficType.ReadNumber()}]业务类型-{Enum.GetName(typeof(TrafficType), value.TrafficType)}", value.TrafficType);
            value.DispatchType = reader.ReadByte();
            writer.WriteNumber($"[{value.DispatchType.ReadNumber()}]调度类型-{Enum.GetName(typeof(DispatchType), value.DispatchType)}", value.DispatchType);
            value.DriverId = reader.ReadStringEndChar0();
            writer.WriteString($"[Length:{value.DriverId.Length}]驾驶员编号", value.DriverId);
            value.DriverName = reader.ReadStringEndChar0();
            writer.WriteString($"[Length:{value.DriverName.Length}]驾驶员姓名", value.DriverName);
            value.AttendantId1 = reader.ReadStringEndChar0();
            writer.WriteString($"[Length:{value.AttendantId1.Length}]乘务员1编号", value.AttendantId1);
            value.AttendantId2 = reader.ReadStringEndChar0();
            writer.WriteString($"[Length:{value.AttendantId2.Length}]乘务员2编号", value.AttendantId2);
            value.StartTime = reader.ReadDateTime6();
            writer.WriteString($"[{value.StartTime:yyMMddHHmmss}]起始时间", value.StartTime.ToString("yyyy-MM-dd HH:mm:ss"));
            value.EndTime = reader.ReadDateTime6();
            writer.WriteString($"[{value.EndTime:yyMMddHHmmss}]终止时间", value.EndTime.ToString("yyyy-MM-dd HH:mm:ss"));
            value.StartStationId = reader.ReadUInt32();
            writer.WriteNumber($"[{value.StartStationId.ReadNumber()}]起始站点编号", value.StartStationId);
            value.StartStationName = reader.ReadStringEndChar0();
            writer.WriteString($"[Length:{value.StartStationName.Length}]起始场站车站名称", value.StartStationName);
            value.EndStationId = reader.ReadUInt32();
            writer.WriteNumber($"[{value.EndStationId.ReadNumber()}]终止站点编号", value.EndStationId);
            value.EndStationName = reader.ReadStringEndChar0();
            writer.WriteString($"[Length:{value.EndStationName.Length}]终止场站车站名称", value.EndStationName);
            value.Additional = reader.ReadStringEndChar0();
            writer.WriteString($"[Length:{value.Additional.Length}]附加内容", value.Additional);
            value.Time = reader.ReadDateTime6();
            writer.WriteString($"[{value.Time:yyMMddHHmmss}]发送通知的时间", value.Time.ToString("yyyy-MM-dd HH:mm:ss"));
        }
Ejemplo n.º 28
0
        public JT808_0x8106 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x8106 jT808_0X8106 = new JT808_0x8106();

            jT808_0X8106.ParameterCount = reader.ReadByte();
            jT808_0X8106.Parameters     = new uint[jT808_0X8106.ParameterCount];
            for (int i = 0; i < jT808_0X8106.ParameterCount; i++)
            {
                jT808_0X8106.Parameters.SetValue(reader.ReadUInt32(), i);
            }
            return(jT808_0X8106);
        }
Ejemplo n.º 29
0
        public void ReadNumericalTest()
        {
            byte[] bytes = "7E 01 00 10 00 00 00 20 00 00 00 40 7E".ToHexBytes();
            JT808MessagePackReader jT808MessagePackReader = new JT808MessagePackReader(bytes);

            Assert.Equal(JT808Package.BeginFlag, jT808MessagePackReader.ReadStart());
            Assert.Equal(0x01, jT808MessagePackReader.ReadByte());
            Assert.Equal(16, jT808MessagePackReader.ReadUInt16());
            Assert.Equal(32, jT808MessagePackReader.ReadInt32());
            Assert.Equal((uint)64, jT808MessagePackReader.ReadUInt32());
            Assert.Equal(JT808Package.EndFlag, jT808MessagePackReader.ReadEnd());
        }
Ejemplo n.º 30
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public JT808_0x8603 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x8603 jT808_0X8603 = new JT808_0x8603();

            jT808_0X8603.AreaCount = reader.ReadByte();
            jT808_0X8603.AreaIds   = new List <uint>();
            for (var i = 0; i < jT808_0X8603.AreaCount; i++)
            {
                jT808_0X8603.AreaIds.Add(reader.ReadUInt32());
            }
            return(jT808_0X8603);
        }