Arrange code structure. Introduce dynamic scheduler and multi leader.

This commit is contained in:
Youmu Liu
2025-10-22 14:00:13 +08:00
parent 91a0add1d1
commit 3788db4cd0
6 changed files with 163 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
namespace EM.LowLevel
{
/// <summary>
/// Decodes device-specific binary responses into C#-friendly models.
/// </summary>
public interface IDataDecoder
{
/// <summary>
/// Decode a response of a known type into a model.
/// </summary>
/// <typeparam name="TModel">
/// Target model type
/// </typeparam>
/// <param name="payload">
/// Raw or deframed payload depending on transport contract
/// </param>
/// <returns>
/// Decoded model
/// </returns>
TModel Decode<TModel>(ReadOnlySpan<byte> payload);
/// <summary>
/// Try-decode variant to avoid throwing on partial/bad frames.
/// </summary>
bool TryDecode<TModel>(ReadOnlySpan<byte> payload, out TModel model);
}
}