Add Sharp7Plc.ToString()
Some checks failed
Release / build (push) Has been cancelled

This commit is contained in:
Peter Butzhammer
2024-07-30 12:24:01 +02:00
parent 61e04c7f63
commit 75a893f51f
2 changed files with 3 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ internal class Sharp7Connector : IDisposable
}
public IObservable<ConnectionState> ConnectionState => connectionStateSubject.DistinctUntilChanged().AsObservable();
public ConnectionState CurrentConnectionState => connectionStateSubject.Value;
public ILogger Logger { get; set; }

View File

@@ -240,6 +240,8 @@ public class Sharp7Plc : IPlc
.ToTask(token);
}
public override string ToString() => $"S7 {s7Connector} ({s7Connector.CurrentConnectionState})";
/// <summary>
/// Initialize PLC and trigger connection. This method will not wait for the connection to be established.
/// <para>