Exemplo n.º 1
0
        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 jT808CircleAreaProperty = new JT808RectangleAreaProperty();
                jT808CircleAreaProperty.AreaId           = reader.ReadUInt32();
                jT808CircleAreaProperty.AreaProperty     = reader.ReadUInt16();
                jT808CircleAreaProperty.UpLeftPointLat   = reader.ReadUInt32();
                jT808CircleAreaProperty.UpLeftPointLng   = reader.ReadUInt32();
                jT808CircleAreaProperty.LowRightPointLat = reader.ReadUInt32();
                jT808CircleAreaProperty.LowRightPointLng = reader.ReadUInt32();
                ReadOnlySpan <char> areaProperty16Bit = Convert.ToString(jT808CircleAreaProperty.AreaProperty, 2).PadLeft(16, '0').AsSpan();
                bool bit0Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 1).ToString().Equals("0");
                if (!bit0Flag)
                {
                    jT808CircleAreaProperty.StartTime = reader.ReadDateTime6();
                    jT808CircleAreaProperty.EndTime   = reader.ReadDateTime6();
                }
                bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0");
                if (!bit1Flag)
                {
                    jT808CircleAreaProperty.HighestSpeed      = reader.ReadUInt16();
                    jT808CircleAreaProperty.OverspeedDuration = reader.ReadByte();
                }
                jT808_0X8602.AreaItems.Add(jT808CircleAreaProperty);
            }
            return(jT808_0X8602);
        }
        public JT808_0x0200_0x67 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x0200_0x67 jT808_0X0200_0X67 = new JT808_0x0200_0x67();

            jT808_0X0200_0X67.AttachInfoId        = reader.ReadByte();
            jT808_0X0200_0X67.AttachInfoLength    = reader.ReadByte();
            jT808_0X0200_0X67.AlarmId             = reader.ReadUInt32();
            jT808_0X0200_0X67.FlagState           = reader.ReadByte();
            jT808_0X0200_0X67.AlarmOrEventType    = reader.ReadByte();
            jT808_0X0200_0X67.AlarmLevel          = reader.ReadByte();
            jT808_0X0200_0X67.Speed               = reader.ReadByte();
            jT808_0X0200_0X67.Altitude            = reader.ReadUInt16();
            jT808_0X0200_0X67.Latitude            = (int)reader.ReadUInt32();
            jT808_0X0200_0X67.Longitude           = (int)reader.ReadUInt32();
            jT808_0X0200_0X67.AlarmTime           = reader.ReadDateTime6();
            jT808_0X0200_0X67.VehicleState        = reader.ReadUInt16();
            jT808_0X0200_0X67.AlarmIdentification = new AlarmIdentificationProperty
            {
                TerminalID  = reader.ReadString(7),
                Time        = reader.ReadDateTime6(),
                SN          = reader.ReadByte(),
                AttachCount = reader.ReadByte(),
                Retain      = reader.ReadByte()
            };
            return(jT808_0X0200_0X67);
        }
Exemplo n.º 3
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)
        {
            var value = new JT808_0x9201();

            value.ServerIpLength = reader.ReadByte();
            writer.WriteNumber($"[{value.ServerIpLength.ReadNumber()}]服务器IP地址长度", value.ServerIpLength);
            string ipHex = reader.ReadVirtualArray(value.ServerIpLength).ToArray().ToHexString();

            value.ServerIp = reader.ReadString(value.ServerIpLength);
            writer.WriteString($"[{ipHex}]服务器IP地址", value.ServerIp);
            value.TcpPort = reader.ReadUInt16();
            writer.WriteNumber($"[{value.TcpPort.ReadNumber()}]服务器视频通道监听端口号(TCP)", value.TcpPort);
            value.UdpPort = reader.ReadUInt16();
            writer.WriteNumber($"[{value.UdpPort.ReadNumber()}]服务器视频通道监听端口号(UDP)", value.UdpPort);
            value.ChannelNo = reader.ReadByte();
            writer.WriteString($"[{value.ChannelNo.ReadNumber()}]逻辑通道号", LogicalChannelNoDisplay(value.ChannelNo));
            value.MediaType = reader.ReadByte();
            writer.WriteString($"[{value.MediaType.ReadNumber()}]音视频类型", AVItemTypeDisplay(value.MediaType));
            value.StreamType = reader.ReadByte();
            writer.WriteString($"[{value.StreamType.ReadNumber()}]码流类型", StreamTypeDisplay(value.StreamType));
            value.MemoryType = reader.ReadByte();
            writer.WriteString($"[{value.MemoryType.ReadNumber()}]存储器类型", MemTypeDisplay(value.MemoryType));
            value.PlaybackWay = reader.ReadByte();
            writer.WriteString($"[{value.PlaybackWay.ReadNumber()}]回访方式", PlayBackWayDisplay(value.PlaybackWay));
            value.PlaySpeed = reader.ReadByte();
            writer.WriteString($"[{value.PlaySpeed.ReadNumber()}]快进或快退倍数", FastForwardOrFastRewindMultiplesDisplay(value.PlaySpeed));
            value.BeginTime = reader.ReadDateTime6();
            writer.WriteString($"[{value.BeginTime:yyMMddHHmmss}]起始时间", value.BeginTime.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"));
Exemplo n.º 4
0
        public JT808_0x0200_0x64 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x0200_0x64 value = new JT808_0x0200_0x64();

            value.AttachInfoId                 = reader.ReadByte();
            value.AttachInfoLength             = reader.ReadByte();
            value.AlarmId                      = reader.ReadUInt32();
            value.FlagState                    = reader.ReadByte();
            value.AlarmOrEventType             = reader.ReadByte();
            value.AlarmLevel                   = reader.ReadByte();
            value.VehicleSpeed                 = reader.ReadByte();
            value.CarOrPedestrianDistanceAhead = reader.ReadByte();
            value.DeviateType                  = reader.ReadByte();
            value.RoadSignIdentificationType   = reader.ReadByte();
            value.RoadSignIdentificationData   = reader.ReadByte();
            value.Speed               = reader.ReadByte();
            value.Altitude            = reader.ReadUInt16();
            value.Latitude            = (int)reader.ReadUInt32();
            value.Longitude           = (int)reader.ReadUInt32();
            value.AlarmTime           = reader.ReadDateTime6();
            value.VehicleState        = reader.ReadUInt16();
            value.AlarmIdentification = new AlarmIdentificationProperty
            {
                TerminalID  = reader.ReadString(7),
                Time        = reader.ReadDateTime6(),
                SN          = reader.ReadByte(),
                AttachCount = reader.ReadByte(),
                Retain      = reader.ReadByte()
            };
            return(value);
        }
Exemplo n.º 5
0
        public JT808_0x0200_0x65 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x0200_0x65 value = new JT808_0x0200_0x65();

            value.AttachInfoId        = reader.ReadByte();
            value.AttachInfoLength    = reader.ReadByte();
            value.AlarmId             = reader.ReadUInt32();
            value.FlagState           = reader.ReadByte();
            value.AlarmOrEventType    = reader.ReadByte();
            value.AlarmLevel          = reader.ReadByte();
            value.Fatigue             = reader.ReadByte();
            value.Retain              = reader.ReadArray(4).ToArray();
            value.Speed               = reader.ReadByte();
            value.Altitude            = reader.ReadUInt16();
            value.Latitude            = (int)reader.ReadUInt32();
            value.Longitude           = (int)reader.ReadUInt32();
            value.AlarmTime           = reader.ReadDateTime6();
            value.VehicleState        = reader.ReadUInt16();
            value.AlarmIdentification = new AlarmIdentificationProperty
            {
                TerminalID  = reader.ReadString(7),
                Time        = reader.ReadDateTime6(),
                SN          = reader.ReadByte(),
                AttachCount = reader.ReadByte(),
                Retain      = reader.ReadByte()
            };
            return(value);
        }
Exemplo n.º 6
0
        public JT808_CarDVR_Up_0x15 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_CarDVR_Up_0x15 value = new JT808_CarDVR_Up_0x15();

            value.JT808_CarDVR_Up_0x15_SpeedStatusLogs = new List <JT808_CarDVR_Up_0x15_SpeedStatusLog>();
            var count = (reader.ReadCurrentRemainContentLength() - 1) / 133;//记录块个数, -1 去掉校验位

            for (int i = 0; i < count; i++)
            {
                JT808_CarDVR_Up_0x15_SpeedStatusLog jT808_CarDVR_Up_0x15_SpeedStatusLog = new JT808_CarDVR_Up_0x15_SpeedStatusLog();
                jT808_CarDVR_Up_0x15_SpeedStatusLog.SpeedStatus          = reader.ReadByte();
                jT808_CarDVR_Up_0x15_SpeedStatusLog.SpeedStatusStartTime = reader.ReadDateTime6();
                jT808_CarDVR_Up_0x15_SpeedStatusLog.SpeedStatusEndTime   = reader.ReadDateTime6();
                jT808_CarDVR_Up_0x15_SpeedStatusLog.JT808_CarDVR_Up_0x15_SpeedPerSeconds = new List <JT808_CarDVR_Up_0x15_SpeedPerSecond>();
                for (int j = 0; j < 60; j++)//60组
                {
                    JT808_CarDVR_Up_0x15_SpeedPerSecond jT808_CarDVR_Up_0X15_SpeedPerSecond = new JT808_CarDVR_Up_0x15_SpeedPerSecond();
                    jT808_CarDVR_Up_0X15_SpeedPerSecond.RecordSpeed    = reader.ReadByte();
                    jT808_CarDVR_Up_0X15_SpeedPerSecond.ReferenceSpeed = reader.ReadByte();
                    jT808_CarDVR_Up_0x15_SpeedStatusLog.JT808_CarDVR_Up_0x15_SpeedPerSeconds.Add(jT808_CarDVR_Up_0X15_SpeedPerSecond);
                }
                value.JT808_CarDVR_Up_0x15_SpeedStatusLogs.Add(jT808_CarDVR_Up_0x15_SpeedStatusLog);
            }
            return(value);
        }
Exemplo n.º 7
0
        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);
            }
            return(jT808_0X8604);
        }
Exemplo n.º 8
0
        public JT808_0x8B09 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x8B09 value = new JT808_0x8B09();

            value.Serial           = reader.ReadUInt16();
            value.Response         = reader.ReadByte();
            value.Time             = reader.ReadDateTime6();
            value.GprsId           = reader.ReadUInt32();
            value.GuideBoard       = reader.ReadStringEndChar0();
            value.TrainNumber      = reader.ReadStringEndChar0();
            value.SelfId           = reader.ReadStringEndChar0();
            value.TrafficType      = reader.ReadByte();
            value.DispatchType     = reader.ReadByte();
            value.DriverId         = reader.ReadStringEndChar0();
            value.DriverName       = reader.ReadStringEndChar0();
            value.AttendantId1     = reader.ReadStringEndChar0();
            value.AttendantId2     = reader.ReadStringEndChar0();
            value.StartTime        = reader.ReadDateTime6();
            value.EndTime          = reader.ReadDateTime6();
            value.StartStationId   = reader.ReadUInt32();
            value.StartStationName = reader.ReadStringEndChar0();
            value.EndStationId     = reader.ReadUInt32();
            value.EndStationName   = reader.ReadStringEndChar0();
            value.Additional       = reader.ReadStringEndChar0();
            return(value);
        }
Exemplo n.º 9
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8602 value = new JT808_0x8602();

            value.SettingAreaProperty = reader.ReadByte();
            writer.WriteNumber($"[{ value.SettingAreaProperty.ReadNumber()}]设置属性", value.SettingAreaProperty);
            value.AreaCount = reader.ReadByte();
            writer.WriteNumber($"[{ value.AreaCount.ReadNumber()}]区域总数", value.AreaCount);
            writer.WriteStartArray("区域项");
            for (var i = 0; i < value.AreaCount; i++)
            {
                writer.WriteStartObject();
                JT808RectangleAreaProperty areaProperty = new JT808RectangleAreaProperty();
                areaProperty.AreaId = reader.ReadUInt32();
                writer.WriteNumber($"[{areaProperty.AreaId.ReadNumber()}]区域ID", areaProperty.AreaId);
                areaProperty.AreaProperty = reader.ReadUInt16();
                writer.WriteNumber($"[{areaProperty.AreaProperty.ReadNumber()}]区域属性", areaProperty.AreaProperty);
                areaProperty.UpLeftPointLat = reader.ReadUInt32();
                writer.WriteNumber($"[{areaProperty.UpLeftPointLat.ReadNumber()}]左上点纬度", areaProperty.UpLeftPointLat);
                areaProperty.UpLeftPointLng = reader.ReadUInt32();
                writer.WriteNumber($"[{areaProperty.UpLeftPointLng.ReadNumber()}]左上点经度", areaProperty.UpLeftPointLng);
                areaProperty.LowRightPointLat = reader.ReadUInt32();
                writer.WriteNumber($"[{areaProperty.LowRightPointLat.ReadNumber()}]右下点纬度", areaProperty.LowRightPointLat);
                areaProperty.LowRightPointLng = reader.ReadUInt32();
                writer.WriteNumber($"[{areaProperty.LowRightPointLng.ReadNumber()}]右下点经度", areaProperty.LowRightPointLng);
                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();
                    writer.WriteString($"[{ areaProperty.StartTime.Value.ToString("yyMMddHHmmss")}]起始时间", areaProperty.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss"));
                    areaProperty.EndTime = reader.ReadDateTime6();
                    writer.WriteString($"[{ areaProperty.EndTime.Value.ToString("yyMMddHHmmss")}]起始时间", areaProperty.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss"));
                }
                bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0");
                if (!bit1Flag)
                {
                    areaProperty.HighestSpeed = reader.ReadUInt16();
                    writer.WriteNumber($"[{areaProperty.HighestSpeed.Value.ReadNumber()}]最高速度", areaProperty.HighestSpeed.Value);
                    areaProperty.OverspeedDuration = reader.ReadByte();
                    writer.WriteNumber($"[{areaProperty.OverspeedDuration.Value.ReadNumber()}]超速持续时间", areaProperty.OverspeedDuration.Value);
                    if (reader.Version == JT808Version.JTT2019)
                    {
                        areaProperty.NightMaximumSpeed = reader.ReadUInt16();
                        writer.WriteNumber($"[{areaProperty.NightMaximumSpeed.ReadNumber()}]夜间最高速度", areaProperty.NightMaximumSpeed);
                    }
                }
                if (reader.Version == JT808Version.JTT2019)
                {
                    areaProperty.NameLength = reader.ReadUInt16();
                    writer.WriteNumber($"[{areaProperty.NameLength.ReadNumber()}]夜间最高速度", areaProperty.NameLength);
                    var areaNameBuffer = reader.ReadVirtualArray(areaProperty.NameLength);
                    areaProperty.AreaName = reader.ReadString(areaProperty.NameLength);
                    writer.WriteString($"[{ areaNameBuffer.ToArray().ToHexString()}]区域名称", areaProperty.AreaName);
                }
                writer.WriteEndObject();
            }
            writer.WriteEndArray();
        }
Exemplo n.º 10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public JT808_CarDVR_Down_0x09 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_CarDVR_Down_0x09 value = new JT808_CarDVR_Down_0x09();

            value.StartTime = reader.ReadDateTime6();
            value.EndTime   = reader.ReadDateTime6();
            value.Count     = reader.ReadUInt16();
            return(value);
        }
Exemplo n.º 11
0
        public JT808_CarDVR_Up_0x03 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_CarDVR_Up_0x03 value = new JT808_CarDVR_Up_0x03();

            value.RealTime         = reader.ReadDateTime6();
            value.FirstInstallTime = reader.ReadDateTime6();
            value.FirstMileage     = reader.ReadBCD(8);
            value.TotalMilage      = reader.ReadBCD(8);
            return(value);
        }
Exemplo n.º 12
0
        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);
        }
Exemplo n.º 13
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x8604 value = new JT808_0x8604();

            value.AreaId = reader.ReadUInt32();
            writer.WriteNumber($"[{ value.AreaId.ReadNumber()}]区域ID", value.AreaId);
            value.AreaProperty = reader.ReadUInt16();
            writer.WriteNumber($"[{ value.AreaProperty.ReadNumber()}]区域属性", value.AreaProperty);
            ReadOnlySpan <char> areaProperty16Bit = Convert.ToString(value.AreaProperty, 2).PadLeft(16, '0').AsSpan();
            bool bit0Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 1).ToString().Equals("0");

            if (!bit0Flag)
            {
                value.StartTime = reader.ReadDateTime6();
                writer.WriteString($"[{ value.StartTime.Value.ToString("yyMMddHHmmss")}]起始时间", value.StartTime.Value.ToString("yyyy-MM-dd HH:mm:ss"));
                value.EndTime = reader.ReadDateTime6();
                writer.WriteString($"[{ value.EndTime.Value.ToString("yyMMddHHmmss")}]结束时间", value.EndTime.Value.ToString("yyyy-MM-dd HH:mm:ss"));
            }
            bool bit1Flag = areaProperty16Bit.Slice(areaProperty16Bit.Length - 2, 1).ToString().Equals("0");

            if (!bit1Flag)
            {
                value.HighestSpeed = reader.ReadUInt16();
                writer.WriteNumber($"[{ value.HighestSpeed.Value.ReadNumber()}]最高速度", value.HighestSpeed.Value);
                value.OverspeedDuration = reader.ReadByte();
                writer.WriteNumber($"[{ value.OverspeedDuration.Value.ReadNumber()}]超速持续时间", value.OverspeedDuration.Value);
            }
            value.PeakCount = reader.ReadUInt16();
            writer.WriteNumber($"[{ value.PeakCount.ReadNumber()}]区域总顶点数", value.PeakCount);
            writer.WriteStartArray("区域顶");
            for (var i = 0; i < value.PeakCount; i++)
            {
                writer.WriteStartObject();
                var item = new JT808PeakProperty();
                item.Lat = reader.ReadUInt32();
                writer.WriteNumber($"[{item.Lat.ReadNumber()}]顶点纬度", item.Lat);
                item.Lng = reader.ReadUInt32();
                writer.WriteNumber($"[{item.Lng.ReadNumber()}]顶点经度", item.Lng);
                writer.WriteEndObject();
            }
            writer.WriteEndArray();
            if (reader.Version == JT808Version.JTT2019)
            {
                if (!bit1Flag)
                {
                    value.NightMaximumSpeed = reader.ReadUInt16();
                    writer.WriteNumber($"[{value.NightMaximumSpeed .ReadNumber()}]夜间最高速度", value.NightMaximumSpeed);
                }
                value.NameLength = reader.ReadUInt16();
                writer.WriteNumber($"[{value.NameLength.ReadNumber()}]名称长度", value.NameLength);
                var nameBuffer = reader.ReadVirtualArray(value.NameLength);
                value.AreaName = reader.ReadString(value.NameLength);
                writer.WriteString($"[{ nameBuffer.ToArray().ToHexString()}]区域名称", value.AreaName);
            }
        }
Exemplo n.º 14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public JT808_0x8802 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x8802 jT808_0X8802 = new JT808_0x8802();

            jT808_0X8802.MultimediaType  = reader.ReadByte();
            jT808_0X8802.ChannelId       = reader.ReadByte();
            jT808_0X8802.EventItemCoding = reader.ReadByte();
            jT808_0X8802.StartTime       = reader.ReadDateTime6();
            jT808_0X8802.EndTime         = reader.ReadDateTime6();
            return(jT808_0X8802);
        }
Exemplo n.º 15
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_CarDVR_Down_0x09 value = new JT808_CarDVR_Down_0x09();

            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.Count = reader.ReadUInt16();
            writer.WriteNumber($"[{value.Count.ReadNumber()}]最大单位数据块个数", value.Count);
        }
Exemplo n.º 16
0
        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.ReadUInt64();
            jT808_0x9205.AVResourceType = reader.ReadByte();
            jT808_0x9205.StreamType     = reader.ReadByte();
            jT808_0x9205.MemoryType     = reader.ReadByte();
            return(jT808_0x9205);
        }
Exemplo n.º 17
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x1005 value = new JT808_0x1005();

            value.BeginTime = reader.ReadDateTime6();
            writer.WriteString($"[{value.BeginTime.ToString("yyMMddHHmmss")}]开始时间", value.BeginTime.ToString("yyyy-MM-dd HH:mm:ss"));
            value.EndTime = reader.ReadDateTime6();
            writer.WriteString($"[{value.EndTime.ToString("yyMMddHHmmss")}]结束时间", value.EndTime.ToString("yyyy-MM-dd HH:mm:ss"));
            value.GettingOnNumber = reader.ReadUInt16();
            writer.WriteNumber($"[{value.GettingOnNumber.ReadNumber()}]从开始时间到结束时间的上车人数", value.GettingOnNumber);
            value.GettingOffNumber = reader.ReadUInt16();
            writer.WriteNumber($"[{value.GettingOffNumber.ReadNumber()}]从开始时间到结束时间的下车人数", value.GettingOffNumber);
        }
Exemplo n.º 18
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_CarDVR_Down_0xC4 value = new JT808_CarDVR_Down_0xC4();

            value.RealTime = reader.ReadDateTime6();
            writer.WriteString($"[{value.RealTime:yyMMddHHmmss}]当前时间", value.RealTime.ToString("yyyy-MM-dd HH:mm:ss"));
            value.FirstInstallTime = reader.ReadDateTime6();
            writer.WriteString($"[{value.FirstInstallTime:yyMMddHHmmss}]初次安装时间", value.FirstInstallTime.ToString("yyyy-MM-dd HH:mm:ss"));
            value.FirstMileage = reader.ReadBCD(8);
            writer.WriteString($"[{value.FirstMileage}]初始里程", value.FirstMileage);
            value.TotalMilage = reader.ReadBCD(8);
            writer.WriteString($"[{value.TotalMilage}]累计里程", value.TotalMilage);
        }
Exemplo n.º 19
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();
                    if (reader.Version == JT808Version.JTT2019)
                    {
                        jT808InflectionPointProperty.NightMaximumSpeed = reader.ReadUInt16();
                    }
                }
                jT808_0X8606.InflectionPointItems.Add(jT808InflectionPointProperty);
            }
            if (reader.Version == JT808Version.JTT2019)
            {
                jT808_0X8606.RouteNameLength = reader.ReadUInt16();
                jT808_0X8606.RouteName       = reader.ReadString(jT808_0X8606.RouteNameLength);
            }
            return(jT808_0X8606);
        }
Exemplo n.º 20
0
        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);
        }
Exemplo n.º 21
0
        public JT808_CarDVR_Up_0x10 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_CarDVR_Up_0x10 value = new JT808_CarDVR_Up_0x10();

            value.JT808_CarDVR_Up_0x10_AccidentSuspectins = new List <JT808_CarDVR_Up_0x10_AccidentSuspectin>();
            var count = (reader.ReadCurrentRemainContentLength() - 1) / 234;//记录块个数, -1 去掉校验位

            for (int i = 0; i < count; i++)
            {
                JT808_CarDVR_Up_0x10_AccidentSuspectin jT808_CarDVR_Up_0x10_AccidentSuspectin = new JT808_CarDVR_Up_0x10_AccidentSuspectin();
                jT808_CarDVR_Up_0x10_AccidentSuspectin.EndTime         = reader.ReadDateTime6();
                jT808_CarDVR_Up_0x10_AccidentSuspectin.DriverLicenseNo = reader.ReadASCII(18);
                jT808_CarDVR_Up_0x10_AccidentSuspectin.JT808_CarDVR_Up_0x10_DrivingStatuss = new List <JT808_CarDVR_Up_0x10_DrivingStatus>();
                for (int j = 0; j < 100; j++)//100组
                {
                    jT808_CarDVR_Up_0x10_AccidentSuspectin.JT808_CarDVR_Up_0x10_DrivingStatuss.Add(new JT808_CarDVR_Up_0x10_DrivingStatus
                    {
                        Speed        = reader.ReadByte(),
                        StatusSignal = reader.ReadByte()
                    });
                }
                jT808_CarDVR_Up_0x10_AccidentSuspectin.GpsLng = reader.ReadInt32();
                jT808_CarDVR_Up_0x10_AccidentSuspectin.GpsLat = reader.ReadInt32();
                jT808_CarDVR_Up_0x10_AccidentSuspectin.Height = reader.ReadInt16();
                value.JT808_CarDVR_Up_0x10_AccidentSuspectins.Add(jT808_CarDVR_Up_0x10_AccidentSuspectin);
            }
            return(value);
        }
Exemplo n.º 22
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public JT808_0x8004 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x8004 value = new JT808_0x8004();

            value.Time = reader.ReadDateTime6();
            return(value);
        }
Exemplo n.º 23
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_CarDVR_Down_0x84 value = new JT808_CarDVR_Down_0x84();

            value.RealTime = reader.ReadDateTime6();
            writer.WriteString($"[{value.RealTime:yyMMddHHmmss}]实时时间", value.RealTime.ToString("yyyy-MM-dd HH:mm:ss"));
            value.SignalOperate = reader.ReadByte();
            writer.WriteNumber($"[{value.SignalOperate.ReadNumber()}]信号个数", value.SignalOperate);
            var display = reader.ReadVirtualArray(10);

            value.D0 = reader.ReadString(10);
            writer.WriteString($"[{display.ToArray().ToHexString()}]D0", value.D0);
            display  = reader.ReadVirtualArray(10);
            value.D1 = reader.ReadString(10);
            writer.WriteString($"[{display.ToArray().ToHexString()}]D1", value.D1);
            display  = reader.ReadVirtualArray(10);
            value.D2 = reader.ReadString(10);
            writer.WriteString($"[{display.ToArray().ToHexString()}]D2", value.D2);
            display         = reader.ReadVirtualArray(10);
            value.NearLight = reader.ReadString(10);
            writer.WriteString($"[{display.ToArray().ToHexString()}]近光灯", value.NearLight);
            display        = reader.ReadVirtualArray(10);
            value.FarLight = reader.ReadString(10);
            writer.WriteString($"[{display.ToArray().ToHexString()}]远光灯", value.FarLight);
            display         = reader.ReadVirtualArray(10);
            value.RightTurn = reader.ReadString(10);
            writer.WriteString($"[{display.ToArray().ToHexString()}]右转向", value.RightTurn);
            display        = reader.ReadVirtualArray(10);
            value.LeftTurn = reader.ReadString(10);
            writer.WriteString($"[{display.ToArray().ToHexString()}]左转向", value.LeftTurn);
            display     = reader.ReadVirtualArray(10);
            value.Brake = reader.ReadString(10);
            writer.WriteString($"[{display.ToArray().ToHexString()}]制动", value.Brake);
        }
Exemplo n.º 24
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_CarDVR_Up_0x13 value = new JT808_CarDVR_Up_0x13();

            writer.WriteStartArray("请求发送指定的时间范围内 N 个单位数据块的数据");
            var count = (reader.ReadCurrentRemainContentLength() - 1) / 7;//记录块个数, -1 去掉校验位

            for (int i = 0; i < count; i++)
            {
                JT808_CarDVR_Up_0x13_ExternalPowerSupply jT808_CarDVR_Up_0x13_ExternalPowerSupply = new JT808_CarDVR_Up_0x13_ExternalPowerSupply();
                writer.WriteStartObject();
                writer.WriteStartObject($"从指定的结束时间之前最近的第{i+1}条外部电源记录");
                var hex = reader.ReadVirtualArray(6);
                jT808_CarDVR_Up_0x13_ExternalPowerSupply.EventTime = reader.ReadDateTime6();
                writer.WriteString($"[{hex.ToArray().ToHexString()}]事件发生时间", jT808_CarDVR_Up_0x13_ExternalPowerSupply.EventTime);
                jT808_CarDVR_Up_0x13_ExternalPowerSupply.EventType = reader.ReadByte();
                writer.WriteString($"[{  jT808_CarDVR_Up_0x13_ExternalPowerSupply.EventType.ReadNumber()}]事件类型", EventTypeDisplay(jT808_CarDVR_Up_0x13_ExternalPowerSupply.EventType));
                writer.WriteEndObject();
                writer.WriteEndObject();
            }
            writer.WriteEndArray();
            string EventTypeDisplay(byte eventType)
            {
                if (eventType == 1)
                {
                    return("供电");
                }
                else
                {
                    return("断电");
                }
            }
        }
Exemplo n.º 25
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_CarDVR_Up_0x06 value = new JT808_CarDVR_Up_0x06();
            var hex = reader.ReadVirtualArray(6);

            value.RealTime = reader.ReadDateTime6();
            writer.WriteString($"[{hex.ToArray().ToHexString()}]实时时间", value.RealTime);
            value.SignalOperate = reader.ReadByte();
            writer.WriteNumber($"[{value.SignalOperate.ReadNumber()}]信号个数", value.SignalOperate);
            hex      = reader.ReadVirtualArray(10);
            value.D0 = reader.ReadString(10);
            writer.WriteString($"[{hex.ToArray().ToHexString()}]D0", value.D0);
            hex      = reader.ReadVirtualArray(10);
            value.D1 = reader.ReadString(10);
            writer.WriteString($"[{hex.ToArray().ToHexString()}]D1", value.D1);
            hex      = reader.ReadVirtualArray(10);
            value.D2 = reader.ReadString(10);
            writer.WriteString($"[{hex.ToArray().ToHexString()}]D2", value.D2);
            hex             = reader.ReadVirtualArray(10);
            value.NearLight = reader.ReadString(10);
            writer.WriteString($"[{hex.ToArray().ToHexString()}]近光灯", value.NearLight);
            hex            = reader.ReadVirtualArray(10);
            value.FarLight = reader.ReadString(10);
            writer.WriteString($"[{hex.ToArray().ToHexString()}]远光灯", value.FarLight);
            hex             = reader.ReadVirtualArray(10);
            value.RightTurn = reader.ReadString(10);
            writer.WriteString($"[{hex.ToArray().ToHexString()}]右转向", value.RightTurn);
            hex            = reader.ReadVirtualArray(10);
            value.LeftTurn = reader.ReadString(10);
            writer.WriteString($"[{hex.ToArray().ToHexString()}]左转向", value.LeftTurn);
            hex         = reader.ReadVirtualArray(10);
            value.Brake = reader.ReadString(10);
            writer.WriteString($"[{hex.ToArray().ToHexString()}]制动", value.Brake);
        }
Exemplo n.º 26
0
        public JT808_0x0702 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x0702 value = new JT808_0x0702();

            value.IC_Card_Status       = (JT808ICCardStatus)reader.ReadByte();
            value.IC_Card_PlugDateTime = reader.ReadDateTime6();
            if (value.IC_Card_Status == JT808ICCardStatus.从业资格证IC卡插入_驾驶员上班)
            {
                value.IC_Card_ReadResult = (JT808ICCardReadResult)reader.ReadByte();
                if (value.IC_Card_ReadResult == JT808ICCardReadResult.IC卡读卡成功)
                {
                    value.DriverUserNameLength   = reader.ReadByte();
                    value.DriverUserName         = reader.ReadString(value.DriverUserNameLength);
                    value.QualificationCode      = reader.ReadString(20);
                    value.LicenseIssuingLength   = reader.ReadByte();
                    value.LicenseIssuing         = reader.ReadString(value.LicenseIssuingLength);
                    value.CertificateExpiresDate = reader.ReadDateTime4();
                    if (reader.Version == JT808Version.JTT2019)
                    {
                        value.DriverIdentityCard = reader.ReadString(20);
                    }
                }
            }
            return(value);
        }
Exemplo n.º 27
0
        public JT808_0x1210 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_0x1210 value = new JT808_0x1210();

            value.MakerID             = reader.ReadString(7);
            value.AlarmIdentification = new AlarmIdentificationProperty
            {
                TerminalID  = reader.ReadString(7),
                Time        = reader.ReadDateTime6(),
                SN          = reader.ReadByte(),
                AttachCount = reader.ReadByte(),
                Retain      = reader.ReadByte()
            };
            value.AlarmId     = reader.ReadString(32);
            value.InfoType    = reader.ReadByte();
            value.AttachCount = reader.ReadByte();
            if (value.AttachCount > 0)
            {
                value.AttachInfos = new List <AttachProperty>();
                for (int i = 0; i < value.AttachCount; i++)
                {
                    AttachProperty attachProperty = new AttachProperty();
                    attachProperty.FileNameLength = reader.ReadByte();
                    attachProperty.FileName       = reader.ReadString(attachProperty.FileNameLength);
                    attachProperty.FileSize       = reader.ReadUInt32();
                    value.AttachInfos.Add(attachProperty);
                }
            }
            return(value);
        }
Exemplo n.º 28
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_CarDVR_Down_0xC2 value = new JT808_CarDVR_Down_0xC2();

            value.RealTime = reader.ReadDateTime6();
            writer.WriteString($"[{value.RealTime.ToString("yyMMddHHmmss")}]实时时间", value.RealTime.ToString("yyyy-MM-dd HH:mm:ss"));
        }
Exemplo n.º 29
0
        public JT808_CarDVR_Down_0xC2 Deserialize(ref JT808MessagePackReader reader, IJT808Config config)
        {
            JT808_CarDVR_Down_0xC2 value = new JT808_CarDVR_Down_0xC2();

            value.RealTime = reader.ReadDateTime6();
            return(value);
        }
Exemplo n.º 30
0
        public void Analyze(ref JT808MessagePackReader reader, Utf8JsonWriter writer, IJT808Config config)
        {
            JT808_0x0B03 value = new JT808_0x0B03();

            value.GprsId = reader.ReadUInt32();
            writer.WriteNumber($"[{value.GprsId.ReadNumber()}]线路编号", value.GprsId);
            value.IOType = reader.ReadByte();
            writer.WriteNumber($"[{value.IOType.ReadNumber()}]进出类型", value.IOType);
            value.TrafficType = reader.ReadByte();
            writer.WriteNumber($"[{value.TrafficType.ReadNumber()}]业务类型-{Enum.GetName(typeof(TrafficType), value.TrafficType)}", value.TrafficType);
            value.StationId = reader.ReadUInt32();
            writer.WriteNumber($"[{value.StationId.ReadNumber()}]场站站点编号", value.StationId);
            value.Tag = reader.ReadByte();
            writer.WriteNumber($"[{value.Tag.ReadNumber()}]标志字段", value.Tag);
            value.Latitude = reader.ReadUInt32();
            writer.WriteNumber($"[{value.Latitude.ReadNumber()}]纬度", value.Latitude);
            value.Longitude = reader.ReadUInt32();
            writer.WriteNumber($"[{value.Longitude.ReadNumber()}]经度", value.Longitude);
            value.Altitude = reader.ReadUInt16();
            writer.WriteNumber($"[{value.Altitude.ReadNumber()}]高程", value.Altitude);
            value.Speed = reader.ReadUInt16();
            writer.WriteNumber($"[{value.Speed.ReadNumber()}]车速", value.Speed);
            value.Direction = reader.ReadUInt16();
            writer.WriteNumber($"[{value.Direction.ReadNumber()}]方向", value.Direction);
            value.Time = reader.ReadDateTime6();
            writer.WriteString($"[{value.Time:yyMMddHHmmss}]时间", value.Time.ToString("yyyy-MM-dd HH:mm:ss"));
            value.FixedPointType = reader.ReadByte();
            writer.WriteNumber($"[{value.FixedPointType.ReadNumber()}]定点类型-{Enum.GetName(typeof(FixedPointType), value.FixedPointType)}", value.FixedPointType);
        }