using System; namespace Protocol376Simulator.Interfaces { /// /// 定义协议消息的基本接口 /// public interface IProtocolMessage { /// /// 将消息转换为字节数组 /// /// 表示消息的字节数组 byte[] ToBytes(); /// /// 获取消息的详细信息 /// /// 格式化的消息信息字符串 string GetMessageInfo(); /// /// 消息类型 /// MessageType Type { get; } } /// /// 定义消息类型枚举 /// public enum MessageType { Login = 1, Heartbeat = 2, ValveControl = 3, DataUpload = 4, ReadData = 5, SetParameter = 6, Response = 99 } }