Esempio n. 1
0
        public static PARAM_UHFBandCapabilities FromXmlNode(XmlNode node)
        {
            string val;
            PARAM_UHFBandCapabilities param = new PARAM_UHFBandCapabilities();


            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "TransmitPowerLevelTableEntry");
                if (xnl != null)
                {
                    if (xnl.Count != 0)
                    {
                        param.TransmitPowerLevelTableEntry = new PARAM_TransmitPowerLevelTableEntry[xnl.Count];
                        for (int i = 0; i < xnl.Count; i++)
                            param.TransmitPowerLevelTableEntry[i] = PARAM_TransmitPowerLevelTableEntry.FromXmlNode(xnl[i]);
                    }
                }

            }
            catch { }

            try
            {

                XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "FrequencyInformation");
                if (null != xnl)
                {
                    if (xnl.Count != 0)
                        param.FrequencyInformation = PARAM_FrequencyInformation.FromXmlNode(xnl[0]);
                }

            }
            catch { }

            {

                param.AirProtocolUHFRFModeTable = new UNION_AirProtocolUHFRFModeTable();

                try
                {

                    {
                        XmlNodeList xnl = XmlUtil.GetXmlNodes(node, "C1G2UHFRFModeTable");
                        if (xnl.Count != 0)
                        {
                            for (int i = 0; i < xnl.Count; i++)
                                param.AirProtocolUHFRFModeTable.Add(PARAM_C1G2UHFRFModeTable.FromXmlNode(xnl[i]));
                        }
                    }

                }
                catch { }

            }

            return param;
        }
Esempio n. 2
0
        public new static PARAM_UHFBandCapabilities FromBitArray(ref BitArray bit_array, ref int cursor, int length)
        {
            if (cursor >= length) return null;

            int field_len = 0;
            object obj_val;
            int parameter_len = 0;
            ArrayList param_list = new ArrayList();

            PARAM_UHFBandCapabilities param = new PARAM_UHFBandCapabilities();

            int param_type = 0;

            if (bit_array[cursor]) param.tvCoding = true;
            if (param.tvCoding)
            {
                cursor++;
                param_type = (int)(UInt64)Util.CalculateVal(ref bit_array, ref cursor, 7);

                if (param_type != param.TypeID)
                {
                    cursor -= 8;
                    return null;
                }
            }
            else
            {
                cursor += 6;
                param_type = (int)(UInt64)Util.CalculateVal(ref bit_array, ref cursor, 10);

                if (param_type != param.TypeID)
                {
                    cursor -= 16;
                    return null;
                }
                param.length = (UInt16)(int)Util.DetermineFieldLength(ref bit_array, ref cursor);
            }


            param_list = new ArrayList();
            PARAM_TransmitPowerLevelTableEntry _param_TransmitPowerLevelTableEntry = PARAM_TransmitPowerLevelTableEntry.FromBitArray(ref bit_array, ref cursor, length);
            if (_param_TransmitPowerLevelTableEntry != null)
            {
                param_list.Add(_param_TransmitPowerLevelTableEntry);
                while ((_param_TransmitPowerLevelTableEntry = PARAM_TransmitPowerLevelTableEntry.FromBitArray(ref bit_array, ref cursor, length)) != null) param_list.Add(_param_TransmitPowerLevelTableEntry);
                if (param_list.Count > 0)
                {
                    param.TransmitPowerLevelTableEntry = new PARAM_TransmitPowerLevelTableEntry[param_list.Count];
                    for (int i = 0; i < param_list.Count; i++)
                        param.TransmitPowerLevelTableEntry[i] = (PARAM_TransmitPowerLevelTableEntry)param_list[i];
                }
            }

            param.FrequencyInformation = PARAM_FrequencyInformation.FromBitArray(ref bit_array, ref cursor, length);

            PARAM_C1G2UHFRFModeTable _param_C1G2UHFRFModeTable = PARAM_C1G2UHFRFModeTable.FromBitArray(ref bit_array, ref cursor, length);
            if (_param_C1G2UHFRFModeTable != null)
            {
                param.AirProtocolUHFRFModeTable.Add(_param_C1G2UHFRFModeTable);
                while ((_param_C1G2UHFRFModeTable = PARAM_C1G2UHFRFModeTable.FromBitArray(ref bit_array, ref cursor, length)) != null)
                    param.AirProtocolUHFRFModeTable.Add(_param_C1G2UHFRFModeTable);
            }

            return param;
        }