MulAvailable

This commit is contained in:
Nitload
2025-12-16 23:13:17 +08:00
parent 28ea5d1d1e
commit 3486375470
2637 changed files with 23787 additions and 838773 deletions
+30
View File
@@ -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;
}
}