Normalize all existing files to LF

This commit is contained in:
Youmu Liu
2026-03-06 18:31:11 +08:00
parent 0a0af53af1
commit 2149bbeede
323 changed files with 113191 additions and 113191 deletions
+54 -54
View File
@@ -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;
}
}