Normalize all existing files to LF
This commit is contained in:
@@ -1,54 +1,54 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EM.LowLevel
|
||||
{
|
||||
/// <summary>
|
||||
/// Generic high-level controller that composes a PortStream, an ICommandBuilder and an
|
||||
/// IDataDecoder to provide a complete peripheral control workflow.
|
||||
/// </summary>
|
||||
/// <typeparam name="TPort">
|
||||
/// Concrete transport deriving from PortStream
|
||||
/// </typeparam>
|
||||
/// <typeparam name="TBuilder">
|
||||
/// Concrete command builder
|
||||
/// </typeparam>
|
||||
/// <typeparam name="TDecoder">
|
||||
/// Concrete data decoder
|
||||
/// </typeparam>
|
||||
public interface IPortController<TPort, TBuilder, TDecoder> where TPort: PortStream where TBuilder: ICommandBuilder
|
||||
where TDecoder: IDataDecoder
|
||||
{
|
||||
|
||||
TBuilder CommandBuilder { get; }
|
||||
|
||||
TDecoder Decoder { get; }
|
||||
|
||||
TPort Port { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Close the underlying port.
|
||||
/// </summary>
|
||||
void Close();
|
||||
|
||||
/// <summary>
|
||||
/// Ensure the underlying port is opened and ready (delegates to Port.OpenAsync).
|
||||
/// </summary>
|
||||
ValueTask OpenAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Build a command, send it via the port and decode the response into a model.
|
||||
/// </summary>
|
||||
ValueTask<TResponse> RoundTripAsync<TCommand, TResponse>(
|
||||
TCommand command,
|
||||
CancellationToken cancellationToken = default)
|
||||
where TCommand: notnull;
|
||||
|
||||
/// <summary>
|
||||
/// Build a command and send it without expecting a typed response.
|
||||
/// </summary>
|
||||
ValueTask WriteAsync<TCommand>(TCommand command, CancellationToken cancellationToken = default)
|
||||
where TCommand: notnull;
|
||||
|
||||
}
|
||||
}
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EM.LowLevel
|
||||
{
|
||||
/// <summary>
|
||||
/// Generic high-level controller that composes a PortStream, an ICommandBuilder and an
|
||||
/// IDataDecoder to provide a complete peripheral control workflow.
|
||||
/// </summary>
|
||||
/// <typeparam name="TPort">
|
||||
/// Concrete transport deriving from PortStream
|
||||
/// </typeparam>
|
||||
/// <typeparam name="TBuilder">
|
||||
/// Concrete command builder
|
||||
/// </typeparam>
|
||||
/// <typeparam name="TDecoder">
|
||||
/// Concrete data decoder
|
||||
/// </typeparam>
|
||||
public interface IPortController<TPort, TBuilder, TDecoder> where TPort: PortStream where TBuilder: ICommandBuilder
|
||||
where TDecoder: IDataDecoder
|
||||
{
|
||||
|
||||
TBuilder CommandBuilder { get; }
|
||||
|
||||
TDecoder Decoder { get; }
|
||||
|
||||
TPort Port { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Close the underlying port.
|
||||
/// </summary>
|
||||
void Close();
|
||||
|
||||
/// <summary>
|
||||
/// Ensure the underlying port is opened and ready (delegates to Port.OpenAsync).
|
||||
/// </summary>
|
||||
ValueTask OpenAsync(CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Build a command, send it via the port and decode the response into a model.
|
||||
/// </summary>
|
||||
ValueTask<TResponse> RoundTripAsync<TCommand, TResponse>(
|
||||
TCommand command,
|
||||
CancellationToken cancellationToken = default)
|
||||
where TCommand: notnull;
|
||||
|
||||
/// <summary>
|
||||
/// Build a command and send it without expecting a typed response.
|
||||
/// </summary>
|
||||
ValueTask WriteAsync<TCommand>(TCommand command, CancellationToken cancellationToken = default)
|
||||
where TCommand: notnull;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user