/// <summary> /// Discover all active serial ports connected. /// When a new serial port is connected, send the IDENTITY request, to get the name of the arduino /// </summary> /// <param name="portNames">All Serial Ports names, dependings of the current OS</param> void Discover(string[] portNames) { if (portNames.Length == 0) { Log.Error("Found 0 ports open. Are you sure your arduino is connected ?"); } List <string> tmpPortOpen = new List <string>(); foreach (string portName in portNames) { if (!_manager.BlackListedPorts.Contains(portName)) { if (!tmpPortOpen.Contains(portName)) { tmpPortOpen.Add(portName); UduinoDevice tmpDevice = OpenUduinoDevice(portName); tmpDevice.Open(); DetectUduino(tmpDevice); } } else { Log.Info("Port <color=#2196F3>[" + portName + "]</color> is blacklisted."); } } }