namespace EM.LowLevel
{
///
/// Builds device/peripheral commands from C#-friendly types (enums, records, structs, etc.).
///
public interface ICommandBuilder
{
///
/// Build a command payload (already framed or raw depending on implementation contract) from a
/// strongly-typed command description.
///
///
/// Command type (e.g., an enum or a record/struct)
///
///
/// Command value to build
///
///
/// Command bytes
///
ReadOnlyMemory Build(TCommand command) where TCommand: notnull;
///
/// Try-build variant to avoid throwing and allow buffer reuse strategies.
///
bool TryBuild(TCommand command, out ReadOnlyMemory bytes) where TCommand: notnull;
}
}