Arrange code structure. Introduce dynamic scheduler and multi leader.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
namespace EM.LowLevel
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds device/peripheral commands from C#-friendly types (enums, records, structs, etc.).
|
||||
/// </summary>
|
||||
public interface ICommandBuilder
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Build a command payload (already framed or raw depending on implementation contract) from a
|
||||
/// strongly-typed command description.
|
||||
/// </summary>
|
||||
/// <typeparam name="TCommand">
|
||||
/// Command type (e.g., an enum or a record/struct)
|
||||
/// </typeparam>
|
||||
/// <param name="command">
|
||||
/// Command value to build
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// Command bytes
|
||||
/// </returns>
|
||||
ReadOnlyMemory<byte> Build<TCommand>(TCommand command) where TCommand: notnull;
|
||||
|
||||
/// <summary>
|
||||
/// Try-build variant to avoid throwing and allow buffer reuse strategies.
|
||||
/// </summary>
|
||||
bool TryBuild<TCommand>(TCommand command, out ReadOnlyMemory<byte> bytes) where TCommand: notnull;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user