Exemplo n.º 1
0
        public static MSG_GET_ACCESSSPECS_RESPONSE FromBitArray(
            ref BitArray bit_array,
            ref int cursor,
            int length)
        {
            if (cursor > length)
            {
                return((MSG_GET_ACCESSSPECS_RESPONSE)null);
            }
            ArrayList arrayList1 = new ArrayList();
            MSG_GET_ACCESSSPECS_RESPONSE accessspecsResponse = new MSG_GET_ACCESSSPECS_RESPONSE();

            cursor += 6;
            if ((int)(ulong)Util.CalculateVal(ref bit_array, ref cursor, 10) != (int)accessspecsResponse.msgType)
            {
                cursor -= 16;
                return((MSG_GET_ACCESSSPECS_RESPONSE)null);
            }
            accessspecsResponse.msgLen     = (uint)(ulong)Util.CalculateVal(ref bit_array, ref cursor, 32);
            accessspecsResponse.msgID      = (uint)(ulong)Util.CalculateVal(ref bit_array, ref cursor, 32);
            accessspecsResponse.LLRPStatus = PARAM_LLRPStatus.FromBitArray(ref bit_array, ref cursor, length);
            ArrayList        arrayList2 = new ArrayList();
            PARAM_AccessSpec paramAccessSpec;

            while ((paramAccessSpec = PARAM_AccessSpec.FromBitArray(ref bit_array, ref cursor, length)) != null)
            {
                arrayList2.Add((object)paramAccessSpec);
            }
            if (arrayList2.Count > 0)
            {
                accessspecsResponse.AccessSpec = new PARAM_AccessSpec[arrayList2.Count];
                for (int index = 0; index < arrayList2.Count; ++index)
                {
                    accessspecsResponse.AccessSpec[index] = (PARAM_AccessSpec)arrayList2[index];
                }
            }
            return(accessspecsResponse);
        }
Exemplo n.º 2
0
        public static MSG_ADD_ACCESSSPEC FromBitArray(
            ref BitArray bit_array,
            ref int cursor,
            int length)
        {
            if (cursor > length)
            {
                return((MSG_ADD_ACCESSSPEC)null);
            }
            ArrayList          arrayList        = new ArrayList();
            MSG_ADD_ACCESSSPEC msgAddAccessspec = new MSG_ADD_ACCESSSPEC();

            cursor += 6;
            if ((int)(ulong)Util.CalculateVal(ref bit_array, ref cursor, 10) != (int)msgAddAccessspec.msgType)
            {
                cursor -= 16;
                return((MSG_ADD_ACCESSSPEC)null);
            }
            msgAddAccessspec.msgLen     = (uint)(ulong)Util.CalculateVal(ref bit_array, ref cursor, 32);
            msgAddAccessspec.msgID      = (uint)(ulong)Util.CalculateVal(ref bit_array, ref cursor, 32);
            msgAddAccessspec.AccessSpec = PARAM_AccessSpec.FromBitArray(ref bit_array, ref cursor, length);
            return(msgAddAccessspec);
        }