示例#1
0
        public JT808_0x8401 Deserialize(ReadOnlySpan <byte> bytes, out int readSize, IJT808Config config)
        {
            int          offset       = 0;
            JT808_0x8401 jT808_0X8401 = new JT808_0x8401
            {
                SettingTelephoneBook = (JT808SettingTelephoneBook)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                ContactCount         = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset)
            };
            List <JT808ContactProperty> jT808_0X8401s = new List <JT808ContactProperty>();

            for (var i = 0; i < jT808_0X8401.ContactCount; i++)
            {
                JT808ContactProperty jT808ContactProperty = new JT808ContactProperty
                {
                    TelephoneBookContactType = (JT808TelephoneBookContactType)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                    PhoneNumberLength        = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset)
                };
                jT808ContactProperty.PhoneNumber   = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808ContactProperty.PhoneNumberLength);
                jT808ContactProperty.ContactLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                jT808ContactProperty.Contact       = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808ContactProperty.ContactLength);
                jT808_0X8401s.Add(jT808ContactProperty);
            }
            jT808_0X8401.JT808ContactProperties = jT808_0X8401s;
            readSize = offset;
            return(jT808_0X8401);
        }
示例#2
0
        public JT808_0x0702 Deserialize(ReadOnlySpan <byte> bytes, out int readSize, IJT808Config config)
        {
            int          offset       = 0;
            JT808_0x0702 jT808_0X0702 = new JT808_0x0702
            {
                IC_Card_Status       = (JT808ICCardStatus)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                IC_Card_PlugDateTime = JT808BinaryExtensions.ReadDateTime6Little(bytes, ref offset)
            };

            if (jT808_0X0702.IC_Card_Status == JT808ICCardStatus.从业资格证IC卡插入_驾驶员上班)
            {
                jT808_0X0702.IC_Card_ReadResult = (JT808ICCardReadResult)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                if (jT808_0X0702.IC_Card_ReadResult == JT808ICCardReadResult.IC卡读卡成功)
                {
                    jT808_0X0702.DriverUserNameLength   = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                    jT808_0X0702.DriverUserName         = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0X0702.DriverUserNameLength);
                    jT808_0X0702.QualificationCode      = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, 20);
                    jT808_0X0702.LicenseIssuingLength   = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                    jT808_0X0702.LicenseIssuing         = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0X0702.LicenseIssuingLength);
                    jT808_0X0702.CertificateExpiresDate = JT808BinaryExtensions.ReadDateTime4Little(bytes, ref offset);
                }
            }
            readSize = offset;
            return(jT808_0X0702);
        }
        public JT808_0x0102 Deserialize(ReadOnlySpan <byte> bytes, int offset, IJT808FormatterResolver formatterResolver, out int readSize)
        {
            offset = 0;
            JT808_0x0102 jT808_0X0102 = new JT808_0x0102();

            jT808_0X0102.Code = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset);
            readSize          = offset;
            return(jT808_0X0102);
        }
示例#4
0
 public JT808_0x8103_0x0041 Deserialize(ReadOnlySpan<byte> bytes, out int readSize)
 {
     int offset = 0;
     JT808_0x8103_0x0041 jT808_0x8103_0x0041 = new JT808_0x8103_0x0041();
     jT808_0x8103_0x0041.ParamLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
     jT808_0x8103_0x0041.ParamValue = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0x8103_0x0041.ParamLength);
     readSize = offset;
     return jT808_0x8103_0x0041;
 }
示例#5
0
        public JT808_0x0900_0x83 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int offset = 0;
            JT808_0x0900_0x83 jT808PassthroughType0x83 = new JT808_0x0900_0x83();

            jT808PassthroughType0x83.PassthroughContent = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset);
            readSize = offset;
            return(jT808PassthroughType0x83);
        }
        public JT808_0x8300 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8300 jT808_0X8300 = new JT808_0x8300();

            jT808_0X8300.TextFlag = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8300.TextInfo = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset);
            readSize = offset;
            return(jT808_0X8300);
        }
示例#7
0
        public JT808_0x0701TestBodiesImpl Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int offset = 0;
            JT808_0x0701TestBodiesImpl jT808_0X0701TestBodiesImpl = new JT808_0x0701TestBodiesImpl();

            jT808_0X0701TestBodiesImpl.Id             = JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset);
            jT808_0X0701TestBodiesImpl.UserNameLength = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
            jT808_0X0701TestBodiesImpl.UserName       = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0X0701TestBodiesImpl.UserNameLength);
            readSize = offset;
            return(jT808_0X0701TestBodiesImpl);
        }
        public JT808_0x0102 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x0102 jT808_0X0102 = new JT808_0x0102
            {
                Code = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset)
            };

            readSize = offset;
            return(jT808_0X0102);
        }
示例#9
0
        public JT808_0x8304 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8304 jT808_0X8304 = new JT808_0x8304();

            jT808_0X8304.InformationType    = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8304.InformationLength  = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
            jT808_0X8304.InformationContent = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0X8304.InformationLength);
            readSize = offset;
            return(jT808_0X8304);
        }
示例#10
0
        public JT808_0x8400 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8400 jT808_0X8400 = new JT808_0x8400();

            jT808_0X8400.CallBack = (JT808CallBackType)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            // 最长为 20 字节
            jT808_0X8400.PhoneNumber = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset);
            readSize = offset;
            return(jT808_0X8400);
        }
示例#11
0
        public JT808_0x8103_0x0017 Deserialize(ReadOnlySpan <byte> bytes, out int readSize, IJT808Config config)
        {
            int offset = 0;
            JT808_0x8103_0x0017 jT808_0x8103_0x0017 = new JT808_0x8103_0x0017
            {
                ParamLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset)
            };

            jT808_0x8103_0x0017.ParamValue = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0x8103_0x0017.ParamLength);
            readSize = offset;
            return(jT808_0x8103_0x0017);
        }
示例#12
0
            public JT808_0x0200_DT1_0x81 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
            {
                int offset = 0;
                JT808_0x0200_DT1_0x81 jT808_0X0200_DT1_0X81 = new JT808_0x0200_DT1_0x81();

                jT808_0X0200_DT1_0X81.AttachInfoId     = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                jT808_0X0200_DT1_0X81.AttachInfoLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                jT808_0X0200_DT1_0X81.Age      = JT808BinaryExtensions.ReadUInt32Little(bytes, ref offset);
                jT808_0X0200_DT1_0X81.Gender   = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                jT808_0X0200_DT1_0X81.UserName = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset);
                readSize = offset;
                return(jT808_0X0200_DT1_0X81);
            }
示例#13
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);
        }
示例#14
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);
        }
示例#15
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);
        }
示例#16
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);
        }
        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);
        }
示例#18
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);
        }
示例#19
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);
        }
示例#20
0
        public JT808_0x0100 Deserialize(ReadOnlySpan <byte> bytes, out int readSize, IJT808Config config)
        {
            int          offset       = 0;
            JT808_0x0100 jT808_0X0100 = new JT808_0x0100
            {
                AreaID         = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset),
                CityOrCountyId = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset),
                MakerId        = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, 5),
                TerminalModel  = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, 20),
                TerminalId     = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, 7),
                PlateColor     = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset),
                PlateNo        = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset)
            };

            readSize = offset;
            return(jT808_0X0100);
        }
示例#21
0
        public JT808_0x8303 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8303 jT808_0X8303 = new JT808_0x8303();

            jT808_0X8303.SettingType          = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8303.InformationItemCount = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8303.InformationItems     = new List <JT808Properties.JT808InformationItemProperty>();
            for (var i = 0; i < jT808_0X8303.InformationItemCount; i++)
            {
                JT808Properties.JT808InformationItemProperty jT808InformationItemProperty = new JT808Properties.JT808InformationItemProperty();
                jT808InformationItemProperty.InformationType   = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                jT808InformationItemProperty.InformationLength = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
                jT808InformationItemProperty.InformationName   = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808InformationItemProperty.InformationLength);
                jT808_0X8303.InformationItems.Add(jT808InformationItemProperty);
            }
            readSize = offset;
            return(jT808_0X8303);
        }
示例#22
0
        public JT808_0x8301 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x8301 jT808_0X8301 = new JT808_0x8301();

            jT808_0X8301.SettingType  = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8301.SettingCount = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X8301.EventItems   = new List <JT808EventProperty>();
            for (var i = 0; i < jT808_0X8301.SettingCount; i++)
            {
                JT808EventProperty jT808EventProperty = new JT808EventProperty();
                jT808EventProperty.EventId            = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                jT808EventProperty.EventContentLength = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
                jT808EventProperty.EventContent       = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808EventProperty.EventContentLength);
                jT808_0X8301.EventItems.Add(jT808EventProperty);
            }
            readSize = offset;
            return(jT808_0X8301);
        }
示例#23
0
        public JT808_0x0107 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x0107 jT808_0X0107 = new JT808_0x0107();

            jT808_0X0107.TerminalType       = JT808BinaryExtensions.ReadUInt16Little(bytes, ref offset);
            jT808_0X0107.MakerId            = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, 5);
            jT808_0X0107.TerminalModel      = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, 20);
            jT808_0X0107.TerminalId         = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, 7);
            jT808_0X0107.Terminal_SIM_ICCID = JT808BinaryExtensions.ReadBCDLittle(bytes, ref offset, 10);
            jT808_0X0107.Terminal_Hardware_Version_Length = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0107.Terminal_Hardware_Version_Num    = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0X0107.Terminal_Hardware_Version_Length);
            jT808_0X0107.Terminal_Firmware_Version_Length = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0107.Terminal_Firmware_Version_Num    = JT808BinaryExtensions.ReadStringLittle(bytes, ref offset, jT808_0X0107.Terminal_Firmware_Version_Length);
            jT808_0X0107.GNSSModule          = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0107.CommunicationModule = JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            readSize = offset;
            return(jT808_0X0107);
        }