Esempio n. 1
0
        public int DeserializeToStruct(byte[] bytes, int offset)
        {
            if (bytes.Length - offset < Len)
            {
                return(-1);
            }

            int used = 0;
            int u    = head.DeserializeToStruct(bytes, offset + used);

            if (-1 == u)
            {
                return(-1);
            }
            used += u;

            u = SerializeHelper.SerializeBytes(ref s8SrcPath, 0, bytes, offset + used, SiMacroDef.SI_FILEPATH_MAX_LEN);
            if (-1 == u)
            {
                return(-1);
            }
            used += u;

            return(used);
        }
Esempio n. 2
0
        public static SI_LMTENBSI_MsgHead GetSiMsgHead(byte[] data, int offset = 0)
        {
            SI_LMTENBSI_MsgHead head = new SI_LMTENBSI_MsgHead();

            if (-1 == head.DeserializeToStruct(data, offset))
            {
                return(null);
            }

            return(head);
        }
Esempio n. 3
0
        public int DeserializeToStruct(byte[] bytes, int offset)
        {
            if (bytes.Length - offset < Len)
            {
                return(-1);
            }

            int used = 0;

            used += head.DeserializeToStruct(bytes, offset + used);
            used += SerializeHelper.SerializeBytes(ref s8FileName, 0, bytes, offset + used, SiMacroDef.SI_FILEPATH_MAX_LEN);
            used += SerializeHelper.DeserializeByte(bytes, offset + used, ref u8RdWrAttribute);
            return(used);
        }
Esempio n. 4
0
        public int DeserializeToStruct(byte[] bytes, int offset)
        {
            if (bytes.Length - offset < Len)
            {
                return(-1);
            }

            int used = 0;
            int u    = head.DeserializeToStruct(bytes, offset + used);

            if (-1 == u)
            {
                return(-1);
            }
            used += u;

            u = SerializeHelper.SerializeBytes(ref s8SrcPath, 0, bytes, offset + used, SiMacroDef.SI_FILEPATH_MAX_LEN);
            if (-1 == u)
            {
                return(-1);
            }
            used += u;

            u = SerializeHelper.DeserializeByte(bytes, offset + used, ref s8GetResult);
            if (-1 == u)
            {
                return(-1);
            }
            used += u;

            u = SerializeHelper.DeserializeUshort(bytes, offset + used, ref u16FileNum);
            if (-1 == u)
            {
                return(-1);
            }
            used += u;

            //解出来所有的数据
            for (int i = 0; i < SiMacroDef.SI_DIR_MAX_FILENUM; i++)
            {
                u = struFileInfo[i].DeserializeToStruct(bytes, offset + used);
                if (-1 == u)
                {
                    return(-1);
                }
                used += u;
            }

            return(used);
        }
Esempio n. 5
0
        public int DeserializeToStruct(byte[] bytes, int offset)
        {
            if (bytes.Length - offset < Len)
            {
                return(-1);
            }

            int used = 0;

            used += head.DeserializeToStruct(bytes, offset + used);
            used += SerializeHelper.SerializeBytes(ref s8FilePath, 0, bytes, offset + used, SiMacroDef.SI_FILEPATH_MAX_LEN);
            used += struFileInfo.DeserializeToStruct(bytes, offset + used);
            used += SerializeHelper.DeserializeByte(bytes, used + offset, ref s8GetResult);
            return(used);
        }
Esempio n. 6
0
        public int DeserializeToStruct(byte[] bytes, int offset)
        {
            if (bytes.Length - offset < Len)
            {
                return(-1);
            }

            int used = 0;

            used += head.DeserializeToStruct(bytes, offset + used);
            used += SerializeHelper.SerializeBytes(ref s8DevName, 0, bytes, offset + used, SiMacroDef.SI_FILEPATH_MAX_LEN);
            used += SerializeHelper.DeserializeInt32(bytes, offset + used, ref u32TotalCapability);
            used += SerializeHelper.DeserializeInt32(bytes, offset + used, ref u32AvailCapability);
            used += SerializeHelper.DeserializeByte(bytes, offset + used, ref s8GetResult);
            return(used);
        }