Exemplo n.º 1
0
        /// <summary>
        /// list all bridge X port
        /// </summary>
        /// <returns></returns>
        public static SerialDeviceInfo[] EnumBridgeXPorts()
        {
            ArrayList list = new ArrayList();

            SerialDeviceInfo [] infos = EnumPorts();
            for (int i = 0; i < infos.Length; i++)
            {
                NCDCom com = new NCDCom(infos[i].PortName);
                if (com.Open())
                {
                    if (com.IsI2CBridgeX())
                    {
                        list.Add(infos[i]);
                    }
                    com.Close();
                }
            }
            return((SerialDeviceInfo[])list.ToArray(typeof(SerialDeviceInfo)));
        }
Exemplo n.º 2
0
        /// <summary>
        /// list all bridge X port
        /// </summary>
        /// <returns></returns>
        public static SerialDeviceInfo[] EnumBridgeXPorts()
        {
            ArrayList list = new ArrayList();
            SerialDeviceInfo [] infos= EnumPorts();
            for (int i = 0; i < infos.Length; i++)
            {
                NCDCom com = new NCDCom(infos[i].PortName);
                if (com.Open())
                {
                    if (com.IsI2CBridgeX())
                    {
                        list.Add(infos[i]);
                    }
                    com.Close();
                }

            }
            return (SerialDeviceInfo[])list.ToArray(typeof(SerialDeviceInfo));
        }