コード例 #1
0
        public JT808_0x0702 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int          offset       = 0;
            JT808_0x0702 jT808_0X0702 = new JT808_0x0702();

            jT808_0X0702.IC_Card_Status       = (JT808ICCardStatus)JT808BinaryExtensions.ReadByteLittle(bytes, ref offset);
            jT808_0X0702.IC_Card_PlugDateTime = JT808BinaryExtensions.ReadDateTimeLittle(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.ReadDateLittle(bytes, ref offset);
                }
            }
            readSize = offset;
            return(jT808_0X0702);
        }