2025-04-27 09:16:37 +08:00

53 lines
1.2 KiB
C#

using TouchSocket.Core;
namespace JiShe.CollectBus.Protocol.Models
{
public class CustomFixedHeaderRequestInfo : IFixedHeaderRequestInfo
{
/// <summary>
/// 报文开始前缀
/// </summary>
public string StartPrefix { get; set; } = "68";
/// <summary>
/// 报文结束后缀
/// </summary>
public string EndPrefix { get; set; } = "16";
/// <summary>
/// 头部长度
/// </summary>
public int HeadLength = 5;
/// <summary>
/// 固定长度
/// </summary>
private const int FixedLength = 17;
/// <summary>
/// 报文长度
/// </summary>
public int PacketLength { get; set; }
/// <summary>
/// 控制域 C
/// </summary>
public int ControlDomain { get; set; }
public bool OnParsingHeader(ReadOnlySpan<byte> header)
{
//throw new NotImplementedException();
return true;
}
public bool OnParsingBody(ReadOnlySpan<byte> body)
{
//throw new NotImplementedException();
return true;
}
public int BodyLength { get; }
}
}