private IEnumerator GetSupportedProjectorPortNames(Action <List <string> > cb) { List <string> supportedProjectorPortNames = new List <string>(); string[] portNames = ProjectorManagerScript.availablePortNames; for (int i = 0; i < portNames.Length; i++) { string portName = portNames[i]; if (!portNameDetectRegex.Match(portName).Success) { continue; } if (projectorPortNamesExcluded.Contains(portName)) { Debug.Log(portName + " is blacklisted"); continue; } BenqProjectorPort port = new BenqProjectorPort(portName); yield return(port.Open()); Debug.Log(portName + " is " + (port.IsPortSupported ? "good" : "bad")); if (port.IsPortSupported) { supportedProjectorPortNames.Add(portName); } port.Close(); } cb(supportedProjectorPortNames); }
public void End() { if (pPort != null) { pPort.Close(); } }