2024-11-12 18:18:43 +08:00

58 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TouchSocket.Core;
namespace JiShe.CollectBus.Protocol.Contracts.Interfaces
{
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; }
}
}