You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.TouchSocket.Entity
{
public class BaseMessagePack
{
/// <summary>
/// 功能码
/// </summary>
public byte[] FunctionCode { get; set; } = new byte[2];
/// <summary>
/// 长度(版本号、序列号、时间戳、数据内容)
/// </summary>
public byte[] Length { get; set; } = new byte[2];
/// <summary>
/// 版本号协议版本号初始值为1
/// </summary>
public byte VersionCode { get; set; }
/// <summary>
/// 报文序列号循环加1
/// </summary>
public byte[] SerialCode { get; set; } = new byte[4];
/// <summary>
/// 时间戳(毫秒)
/// </summary>
public byte[] TimeStamp { get; set; } = new byte[8];
/// <summary>
/// 数据内容
/// </summary>
public byte[] DataContent { get; set; }
/// <summary>
/// 校验和功能码到内容结束为sum255-(sum%255)。)
/// </summary>
public byte CheckSum { get; set; }
}
}