public JTNE_0x06 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int       offset    = 0;
            JTNE_0x06 jTNE_0X06 = new JTNE_0x06();

            jTNE_0X06.LogoutTime = JTNEBinaryExtensions.ReadDateTime6Little(bytes, ref offset);
            jTNE_0X06.LogoutNum  = JTNEBinaryExtensions.ReadUInt16Little(bytes, ref offset);
            readSize             = offset;
            return(jTNE_0X06);
        }
Exemple #2
0
        public JTNE_0x80 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int       offset    = 0;
            JTNE_0x80 jTNE_0X80 = new JTNE_0x80();

            jTNE_0X80.QueryTime = JTNEBinaryExtensions.ReadDateTime6Little(bytes, ref offset);
            jTNE_0X80.ParamNum  = JTNEBinaryExtensions.ReadByteLittle(bytes, ref offset);
            jTNE_0X80.ParamList = JTNEBinaryExtensions.ReadBytesLittle(bytes, ref offset, jTNE_0X80.ParamNum);
            readSize            = offset;
            return(jTNE_0X80);
        }
Exemple #3
0
        public JTNE_0x05_Platform Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int offset = 0;
            JTNE_0x05_Platform jTNE_0X05 = new JTNE_0x05_Platform();

            jTNE_0X05.LoginTime        = JTNEBinaryExtensions.ReadDateTime6Little(bytes, ref offset);
            jTNE_0X05.LoginNum         = JTNEBinaryExtensions.ReadUInt16Little(bytes, ref offset);
            jTNE_0X05.PlatformUserName = JTNEBinaryExtensions.ReadStringLittle(bytes, ref offset, 12);
            jTNE_0X05.PlatformPassword = JTNEBinaryExtensions.ReadStringLittle(bytes, ref offset, 20);
            jTNE_0X05.EncryptMethod    = JTNEBinaryExtensions.ReadByteLittle(bytes, ref offset);
            readSize = offset;
            return(jTNE_0X05);
        }
        public JTNE_0x82 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int       offset    = 0;
            JTNE_0x82 jTNE_0x82 = new JTNE_0x82();

            jTNE_0x82.ControlTime = JTNEBinaryExtensions.ReadDateTime6Little(bytes, ref offset);
            jTNE_0x82.ParamID     = JTNEBinaryExtensions.ReadByteLittle(bytes, ref offset);//参数ID

            if (JTNE_0x82_Body.JTNE_0x82Method.TryGetValue(jTNE_0x82.ParamID, out Type type))
            {
                int readSubBodySize = 0;
                jTNE_0x82.Parameter = JTNEFormatterResolverExtensions.JTNEDynamicDeserialize(JTNEFormatterExtensions.GetFormatter(type), bytes.Slice(offset), out readSubBodySize);
                offset = offset + readSubBodySize;
            }
            readSize = offset;
            return(jTNE_0x82);
        }
Exemple #5
0
        public JTNE_0x81 Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int       offset    = 0;
            JTNE_0x81 jTNE_0X81 = new JTNE_0x81();

            jTNE_0X81.OperateTime = JTNEBinaryExtensions.ReadDateTime6Little(bytes, ref offset);
            jTNE_0X81.ParamNum    = JTNEBinaryExtensions.ReadByteLittle(bytes, ref offset);
            for (int i = 0; i < jTNE_0X81.ParamNum; i++)
            {
                var paramId         = JTNEBinaryExtensions.ReadByteLittle(bytes, ref offset);//参数ID
                int readSubBodySize = 0;
                if (JTNE_0x81_Body.JTNE_0x81Method.TryGetValue(paramId, out Type type))
                {
                    ReadOnlySpan <byte> readOnlySpan = new ReadOnlySpan <byte>();
                    if (JTNE_0x81_Body.JTNE_0x81LengthOfADependOnValueOfB.TryGetValue(paramId, out byte dependOnParamId))
                    {
                        var length     = jTNE_0X81.ParamList.FirstOrDefault(m => m.ParamId == dependOnParamId).ParamLength;
                        int tempOffset = 0;
                        int lengthVal  = JTNEBinaryExtensions.ReadByteLittle(bytes.Slice(offset - length - 1, length), ref tempOffset);
                        readOnlySpan = bytes.Slice(offset, lengthVal);
                    }
                    else
                    {
                        readOnlySpan = bytes.Slice(offset);
                    }
                    if (jTNE_0X81.ParamList != null)
                    {
                        jTNE_0X81.ParamList.Add(JTNEFormatterResolverExtensions.JTNEDynamicDeserialize(JTNEFormatterExtensions.GetFormatter(type), readOnlySpan, out readSubBodySize));
                    }
                    else
                    {
                        jTNE_0X81.ParamList = new List <JTNE_0x81_Body> {
                            JTNEFormatterResolverExtensions.JTNEDynamicDeserialize(JTNEFormatterExtensions.GetFormatter(type), readOnlySpan, out readSubBodySize)
                        };
                    }
                }
                offset = offset + readSubBodySize;
            }
            readSize = offset;
            return(jTNE_0X81);
        }
        public JTNE_0x01_Platform Deserialize(ReadOnlySpan <byte> bytes, out int readSize)
        {
            int offset = 0;
            JTNE_0x01_Platform jTNE_0X01_Platform = new JTNE_0x01_Platform();

            jTNE_0X01_Platform.PDATime       = JTNEBinaryExtensions.ReadDateTime6Little(bytes, ref offset);
            jTNE_0X01_Platform.LoginNum      = JTNEBinaryExtensions.ReadUInt16Little(bytes, ref offset);
            jTNE_0X01_Platform.SIM           = JTNEBinaryExtensions.ReadStringLittle(bytes, ref offset, 20);
            jTNE_0X01_Platform.BatteryCount  = JTNEBinaryExtensions.ReadByteLittle(bytes, ref offset);
            jTNE_0X01_Platform.BatteryLength = JTNEBinaryExtensions.ReadByteLittle(bytes, ref offset);
            jTNE_0X01_Platform.BatteryNos    = new List <string>();
            if ((jTNE_0X01_Platform.BatteryCount * jTNE_0X01_Platform.BatteryLength) > 0)
            {
                for (int i = 0; i < jTNE_0X01_Platform.BatteryCount; i++)
                {
                    jTNE_0X01_Platform.BatteryNos.Add(JTNEBinaryExtensions.ReadStringLittle(bytes, ref offset, jTNE_0X01_Platform.BatteryLength));
                }
            }
            readSize = offset;
            return(jTNE_0X01_Platform);
        }