public static JeromeController create(JeromeConnectionParams p) { JeromeController jc = new JeromeController(); jc.password = p.password; jc.connectionParams = p; jc.connection.onConnected += jc._onConnected; jc.connection.onDisconnected += jc._onDisconnected; jc.connection.lineReceived += jc.processReply; jc.connection.reconnect = true; if (p.usartPort != 0) { jc.usartConnection = new AsyncConnection(); } return(jc); }
public static JeromeController create(JeromeConnectionParams p) { IPAddress hostIP; if (IPAddress.TryParse(p.host, out hostIP)) { JeromeController jc = new JeromeController(); jc.remoteEP = new IPEndPoint(hostIP, p.port); jc.password = p.password; jc.connectionParams = p; return(jc); } else { return(null); } }