/// <summary> /// Connects to an INSTEON network using the specified connection. /// </summary> /// <param name="connection">Specifies the connection to the INSTEON powerline controller device, which can accessed serially or over the network. Examples: "serial: COM1" or "net: 192.168.2.5".</param> public void Connect(InsteonConnection connection) { Messenger.Connect(connection); Connection = connection; Controller = new InsteonController(this); OnConnected(); LastConnectStatus = null; }
/// <summary> /// Connects to an INSTEON network using the specified connection. /// </summary> /// <param name="connection">Specifies the connection to the INSTEON controller device, which can accessed serially or over the network. Examples: "serial: COM1" or "net: 192.168.2.5".</param> /// <returns>Returns true if a connection was successfully made, or false if unable to find a connection.</returns> /// <remarks> /// This method does not throw an exception. /// </remarks> public bool TryConnect(InsteonConnection connection) { if (!Messenger.TryConnect(connection)) { return(false); } Connection = connection; Controller = new InsteonController(this); OnConnected(); LastConnectStatus = null; return(true); }
/// <summary> /// Connects to an INSTEON network using the specified connection. /// </summary> /// <param name="connection">Specifies the connection to the INSTEON controller device, which can accessed serially or over the network. Examples: "serial: COM1" or "net: 192.168.2.5".</param> /// <returns>Returns true if a connection was successfully made, or false if unable to find a connection.</returns> /// <remarks> /// This method does not throw an exception. /// </remarks> public bool TryConnect(InsteonConnection connection) { if (!Messenger.TryConnect(connection)) { return false; } Connection = connection; Controller = new InsteonController(this); OnConnected(); LastConnectStatus = null; return true; }