コード例 #1
0
        public JT808_0x8800 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8800 jT808_0X8800 = new JT808_0x8800
            {
                MultimediaId           = JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset),
                RetransmitPackageCount = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset)
            };

            jT808_0X8800.RetransmitPackageIds = JT808BinaryExtensions.ReadBytesLittle(bytes, ref offset, jT808_0X8800.RetransmitPackageCount * 2);
            readSize = offset;
            return(jT808_0X8800);
        }
コード例 #2
0
        public JT808_0x8900 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8900 jT808_0X8900 = new JT808_0x8900();

            jT808_0X8900.PassthroughType = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            if (JT808_0x8900_BodyBase.JT808_0x8900Method.TryGetValue(jT808_0X8900.PassthroughType, out Type type))
            {
                jT808_0X8900.JT808_0X8900_BodyBase = JT808FormatterResolverExtensions.JT808DynamicDeserialize(JT808FormatterExtensions.GetFormatter(type), bytes.Slice(offset), out readSize);
            }
            readSize = offset;
            return(jT808_0X8900);
        }
コード例 #3
0
        public JT808_0x0200_0x25 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int offset = 0;
            JT808_0x0200_0x25 jT808LocationAttachImpl0x13 = new JT808_0x0200_0x25
            {
                AttachInfoId     = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                AttachInfoLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                CarSignalStatus  = JT808BinaryExtensions.ReadInt32Little(bytes, ref offset)
            };

            readSize = offset;
            return(jT808LocationAttachImpl0x13);
        }
コード例 #4
0
        public JT808_0x0200_0x02 Deserialize(ReadOnlySpan <byte> bytes, out int readSize, IJT808Config config)
        {
            int offset = 0;
            JT808_0x0200_0x02 jT808LocationAttachImpl0X02 = new JT808_0x0200_0x02
            {
                AttachInfoId     = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                AttachInfoLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                Oil = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset)
            };

            readSize = offset;
            return(jT808LocationAttachImpl0X02);
        }
コード例 #5
0
        public JT808_0x8400 Deserialize(ReadOnlySpan <byte> bytes, out int readSize, IJT808Config config)
        {
            int          offset       = 0;
            JT808_0x8400 jT808_0X8400 = new JT808_0x8400
            {
                CallBack = (JT808CallBackType)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                // 最长为 20 字节
                PhoneNumber = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset)
            };

            readSize = offset;
            return(jT808_0X8400);
        }
コード例 #6
0
        public JT808_0x0200_0x31 Deserialize(ReadOnlySpan <byte> bytes, out int readSize, IJT808Config config)
        {
            int offset = 0;
            JT808_0x0200_0x31 jT808LocationAttachImpl0x31 = new JT808_0x0200_0x31
            {
                AttachInfoId     = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                AttachInfoLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                GNSSCount        = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset)
            };

            readSize = offset;
            return(jT808LocationAttachImpl0x31);
        }
コード例 #7
0
        public JT808_0x0200_0x2B Deserialize(ReadOnlySpan <byte> bytes, out int readSize, IJT808Config config)
        {
            int offset = 0;
            JT808_0x0200_0x2B jT808LocationAttachImpl0x2B = new JT808_0x0200_0x2B
            {
                AttachInfoId     = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                AttachInfoLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                Analog           = JT808BinaryExtensions.ReadInt32Little(bytes, ref offset)
            };

            readSize = offset;
            return(jT808LocationAttachImpl0x2B);
        }
コード例 #8
0
        public JT808_0x8001 Deserialize(ReadOnlySpan <byte> bytes, out int readSize, IJT808Config config)
        {
            int          offset       = 0;
            JT808_0x8001 jT808_0X8001 = new JT808_0x8001
            {
                MsgNum = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset),
                MsgId  = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset),
                JT808PlatformResult = (JT808PlatformResult)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset)
            };

            readSize = offset;
            return(jT808_0X8001);
        }
コード例 #9
0
        public JT808LocationAttachImpl0x01 Deserialize(ReadOnlySpan <byte> bytes, int offset, IJT808FormatterResolver formatterResolver, out int readSize)
        {
            offset = 0;
            JT808LocationAttachImpl0x01 jT808LocationAttachImpl0X01 = new JT808LocationAttachImpl0x01()
            {
            };

            jT808LocationAttachImpl0X01.AttachInfoId     = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808LocationAttachImpl0X01.AttachInfoLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808LocationAttachImpl0X01.Mileage          = JT808BinaryExtensions.ReadInt32Little(bytes, ref offset);
            readSize = offset;
            return(jT808LocationAttachImpl0X01);
        }
コード例 #10
0
        public JT808_0x0800 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x0800 jT808_0X0800 = new JT808_0x0800();

            jT808_0X0800.MultimediaId           = JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset);
            jT808_0X0800.MultimediaType         = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0800.MultimediaCodingFormat = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0800.EventItemCoding        = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0800.ChannelId = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            readSize = offset;
            return(jT808_0X0800);
        }
コード例 #11
0
ファイル: DemoTest.cs プロジェクト: xuniuer/JT808
            public JT808_0x0200_DT2_0x81 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
            {
                int offset = 0;
                JT808_0x0200_DT2_0x81 jT808_0X0200_DT2_0X81 = new JT808_0x0200_DT2_0x81();

                jT808_0X0200_DT2_0X81.AttachInfoId     = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                jT808_0X0200_DT2_0X81.AttachInfoLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                jT808_0X0200_DT2_0X81.Age    = JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset);
                jT808_0X0200_DT2_0X81.Gender = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                jT808_0X0200_DT2_0X81.MsgNum = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
                readSize = offset;
                return(jT808_0X0200_DT2_0X81);
            }
コード例 #12
0
        public JT808_0x8304 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8304 jT808_0X8304 = new JT808_0x8304
            {
                InformationType   = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                InformationLength = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset)
            };

            jT808_0X8304.InformationContent = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0X8304.InformationLength);
            readSize = offset;
            return(jT808_0X8304);
        }
コード例 #13
0
        public JT808_0x0200_0x12 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int offset = 0;
            JT808_0x0200_0x12 jT808LocationAttachImpl0x12 = new JT808_0x0200_0x12();

            jT808LocationAttachImpl0x12.AttachInfoId      = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808LocationAttachImpl0x12.AttachInfoLength  = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808LocationAttachImpl0x12.JT808PositionType = (JT808PositionType)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808LocationAttachImpl0x12.AreaId            = JT808BinaryExtensions.ReadInt32Little(bytes, ref offset);
            jT808LocationAttachImpl0x12.Direction         = (JT808DirectionType)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            readSize = offset;
            return(jT808LocationAttachImpl0x12);
        }
コード例 #14
0
        public JT808_0x8105 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8105 jT808_0x8105 = new JT808_0x8105();

            jT808_0x8105.CommandWord = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            if (jT808_0x8105.CommandWord == 1 || jT808_0x8105.CommandWord == 2)
            {
                jT808_0x8105.CommandValue = new CommandParams();
                jT808_0x8105.CommandValue.SetCommandParams(JT808BinaryExtensions.ReadStringLittle(bytes, ref offset));
            }
            readSize = offset;
            return(jT808_0x8105);
        }
コード例 #15
0
        public JT808_0x8302 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8302 jT808_0X8302 = new JT808_0x8302();

            jT808_0X8302.Flag = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8302.IssueContentLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8302.Issue               = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0X8302.IssueContentLength);
            jT808_0X8302.AnswerId            = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8302.AnswerContentLength = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
            jT808_0X8302.AnswerContent       = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0X8302.AnswerContentLength);
            readSize = offset;
            return(jT808_0X8302);
        }
コード例 #16
0
        public JT808_0x8804 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8804 jT808_0X8804 = new JT808_0x8804
            {
                RecordCmd       = (JT808RecordCmd)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                RecordTime      = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset),
                RecordSave      = (JT808RecordSave)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                AudioSampleRate = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset)
            };

            readSize = offset;
            return(jT808_0X8804);
        }
コード例 #17
0
        public JT808_0x8803 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8803 jT808_0X8803 = new JT808_0x8803();

            jT808_0X8803.MultimediaType    = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8803.ChannelId         = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8803.EventItemCoding   = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8803.StartTime         = JT808BinaryExtensions.ReadDateTime6Little(bytes, ref offset);
            jT808_0X8803.EndTime           = JT808BinaryExtensions.ReadDateTime6Little(bytes, ref offset);
            jT808_0X8803.MultimediaDeleted = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            readSize = offset;
            return(jT808_0X8803);
        }
コード例 #18
0
        public JT808_0x8108 Deserialize(ReadOnlySpan <byte> bytes, int offset, IJT808FormatterResolver formatterResolver, out int readSize)
        {
            offset = 0;
            JT808_0x8108 jT808_0X8108 = new JT808_0x8108();

            jT808_0X8108.UpgradeType          = (JT808UpgradeType)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8108.MakerId              = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, 5);
            jT808_0X8108.VersionNumLength     = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8108.VersionNum           = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0X8108.VersionNumLength);
            jT808_0X8108.UpgradePackageLength = JT808BinaryExtensions.ReadInt32Little(bytes, ref offset);
            jT808_0X8108.UpgradePackage       = JT808BinaryExtensions.ReadBytesLittle(bytes, ref offset, jT808_0X8108.UpgradePackageLength);
            readSize = offset;
            return(jT808_0X8108);
        }
コード例 #19
0
        public JT808_0x8106 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8106 jT808_0X8106 = new JT808_0x8106();

            jT808_0X8106.ParameterCount = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8106.Parameters     = new uint[jT808_0X8106.ParameterCount];
            for (int i = 0; i < jT808_0X8106.ParameterCount; i++)
            {
                jT808_0X8106.Parameters.SetValue(JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset), i);
            }
            readSize = offset;
            return(jT808_0X8106);
        }
コード例 #20
0
        public JT808_0x0200_0x13 Deserialize(ReadOnlySpan <byte> bytes, out int readSize, IJT808Config config)
        {
            int offset = 0;
            JT808_0x0200_0x13 jT808LocationAttachImpl0x13 = new JT808_0x0200_0x13
            {
                AttachInfoId     = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                AttachInfoLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                DrivenRouteId    = JT808BinaryExtensions.ReadInt32Little(bytes, ref offset),
                Time             = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset),
                DrivenRoute      = (JT808DrivenRouteType)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset)
            };

            readSize = offset;
            return(jT808LocationAttachImpl0x13);
        }
コード例 #21
0
        public JT808LocationAttachImpl0x06 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int offset = 0;
            JT808LocationAttachImpl0x06 jT808LocationAttachImpl0x06 = new JT808LocationAttachImpl0x06()
            {
            };

            jT808LocationAttachImpl0x06.AttachInfoId     = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808LocationAttachImpl0x06.AttachInfoLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808LocationAttachImpl0x06.Age      = JT808BinaryExtensions.ReadInt32Little(bytes, ref offset);
            jT808LocationAttachImpl0x06.Gender   = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808LocationAttachImpl0x06.UserName = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset);
            readSize = offset;
            return(jT808LocationAttachImpl0x06);
        }
コード例 #22
0
        public JT808_0x8802 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8802 jT808_0X8802 = new JT808_0x8802
            {
                MultimediaType  = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                ChannelId       = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                EventItemCoding = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                StartTime       = JT808BinaryExtensions.ReadDateTime6Little(bytes, ref offset),
                EndTime         = JT808BinaryExtensions.ReadDateTime6Little(bytes, ref offset)
            };

            readSize = offset;
            return(jT808_0X8802);
        }
コード例 #23
0
        public JT808_0x0100 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x0100 jT808_0X0100 = new JT808_0x0100();

            jT808_0X0100.AreaID         = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
            jT808_0X0100.CityOrCountyId = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
            jT808_0X0100.MakerId        = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, 5);
            jT808_0X0100.TerminalModel  = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, 20);
            jT808_0X0100.TerminalId     = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, 7);
            jT808_0X0100.PlateColor     = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0100.PlateNo        = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset);
            readSize = offset;
            return(jT808_0X0100);
        }
コード例 #24
0
        public JT808LocationAttachImpl0x11 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int offset = 0;
            JT808LocationAttachImpl0x11 jT808LocationAttachImpl0x11 = new JT808LocationAttachImpl0x11();

            jT808LocationAttachImpl0x11.AttachInfoId      = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808LocationAttachImpl0x11.AttachInfoLength  = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808LocationAttachImpl0x11.JT808PositionType = (JT808PositionType)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            if (jT808LocationAttachImpl0x11.JT808PositionType != JT808PositionType.无特定位置)
            {
                jT808LocationAttachImpl0x11.AreaId = JT808BinaryExtensions.ReadInt32Little(bytes, ref offset);
            }
            readSize = offset;
            return(jT808LocationAttachImpl0x11);
        }
コード例 #25
0
        public JT808_0x8100 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8100 jT808_0X8100 = new JT808_0x8100();

            jT808_0X8100.MsgNum = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
            jT808_0X8100.JT808TerminalRegisterResult = (JT808TerminalRegisterResult)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            // 只有在成功后才有该字段
            if (jT808_0X8100.JT808TerminalRegisterResult == JT808TerminalRegisterResult.成功)
            {
                jT808_0X8100.Code = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset);
            }
            readSize = offset;
            return(jT808_0X8100);
        }
コード例 #26
0
        public JT808_0x8108 Deserialize(ReadOnlySpan <byte> bytes, out int readSize, IJT808Config config)
        {
            int          offset       = 0;
            JT808_0x8108 jT808_0X8108 = new JT808_0x8108
            {
                UpgradeType      = (JT808UpgradeType)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                MakerId          = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, 5),
                VersionNumLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset)
            };

            jT808_0X8108.VersionNum           = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0X8108.VersionNumLength);
            jT808_0X8108.UpgradePackageLength = JT808BinaryExtensions.ReadInt32Little(bytes, ref offset);
            jT808_0X8108.UpgradePackage       = JT808BinaryExtensions.ReadBytesLittle(bytes, ref offset, jT808_0X8108.UpgradePackageLength);
            readSize = offset;
            return(jT808_0X8108);
        }
コード例 #27
0
        public JT808_0x0801 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x0801 jT808_0X0801 = new JT808_0x0801();

            jT808_0X0801.MultimediaId           = JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset);
            jT808_0X0801.MultimediaType         = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0801.MultimediaCodingFormat = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0801.EventItemCoding        = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0801.ChannelId = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0801.Position  = JT808FormatterExtensions.GetFormatter <JT808_0x0200>().Deserialize(bytes.Slice(offset), out int bufReadSize);
            offset += 28;
            jT808_0X0801.MultimediaDataPackage = JT808BinaryExtensions.ReadBytesLittle(bytes, ref offset);
            readSize = offset;
            return(jT808_0X0801);
        }
コード例 #28
0
        public JT808_0x8606 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8606 jT808_0X8606 = new JT808_0x8606
            {
                RouteId       = JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset),
                RouteProperty = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset)
            };
            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 = JT808BinaryExtensions.ReadDateTime6Little(bytes, ref offset);
                jT808_0X8606.EndTime   = JT808BinaryExtensions.ReadDateTime6Little(bytes, ref offset);
            }
            jT808_0X8606.InflectionPointCount = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
            jT808_0X8606.InflectionPointItems = new List <JT808InflectionPointProperty>();
            for (var i = 0; i < jT808_0X8606.InflectionPointCount; i++)
            {
                JT808InflectionPointProperty jT808InflectionPointProperty = new JT808InflectionPointProperty
                {
                    InflectionPointId  = JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset),
                    SectionId          = JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset),
                    InflectionPointLat = JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset),
                    InflectionPointLng = JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset),
                    SectionWidth       = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                    SectionProperty    = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset)
                };
                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  = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
                    jT808InflectionPointProperty.SectionDrivingUnderThreshold = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
                }
                bool sectionBit1Flag = sectionProperty16Bit.Slice(sectionProperty16Bit.Length - 2, 1).ToString().Equals("0");
                if (!sectionBit1Flag)
                {
                    jT808InflectionPointProperty.SectionHighestSpeed      = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
                    jT808InflectionPointProperty.SectionOverspeedDuration = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                }
                jT808_0X8606.InflectionPointItems.Add(jT808InflectionPointProperty);
            }
            readSize = offset;
            return(jT808_0X8606);
        }
コード例 #29
0
        public JT808_0x8601 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8601 jT808_0X8601 = new JT808_0x8601();

            jT808_0X8601.AreaCount = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8601.AreaIds   = new List <uint>();
            if (jT808_0X8601.AreaCount > 0)
            {
                for (var i = 0; i < jT808_0X8601.AreaCount; i++)
                {
                    jT808_0X8601.AreaIds.Add(JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset));
                }
            }
            readSize = offset;
            return(jT808_0X8601);
        }
コード例 #30
0
        public JT808_0x0805 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x0805 jT808_0X0805 = new JT808_0x0805();

            jT808_0X0805.MsgNum            = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
            jT808_0X0805.Result            = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0805.MultimediaIdCount = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
            jT808_0X0805.MultimediaIds     = new List <uint>();
            for (var i = 0; i < jT808_0X0805.MultimediaIdCount; i++)
            {
                uint id = JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset);
                jT808_0X0805.MultimediaIds.Add(id);
            }
            readSize = offset;
            return(jT808_0X0805);
        }