void Page_Load(object sender, EventArgs e) { var detector = new DuinoPortDetector (null); var port = detector.Guess (); if (port != null) Port = port.PortName; else Port = "[no device detected]"; }
private static SerialPort getPort(string identifier) { var detector = new DuinoPortDetector (identifier); var port = detector.Detect (); if (port != null) port = portNotFound (identifier); return port; }
public static DuinoCommunicator New(string identifier) { var portDetector = new DuinoPortDetector (identifier); return new DuinoCommunicator (portDetector); }
public DuinoCommunicator(DuinoPortDetector portDetector) { Port = portDetector.Detect (); }