using YunDa.Server.ISMSTcp.Models;
namespace YunDa.Server.ISMSTcp.Interfaces
{
///
/// 命令状态机接口
///
public interface ICommandStateMachine
{
///
/// 当前命令状态
///
CommandState CurrentCommand { get; }
///
/// 是否有命令正在执行
///
bool HasPendingCommand { get; }
///
/// 开始执行命令
///
/// 命令名称
/// 完整消息
/// 超时时间(秒)
/// 是否成功开始执行
bool StartCommand(string commandName, string fullMessage, int timeoutSeconds = 180);
///
/// 完成当前命令
///
/// 响应的命令名称(用于验证)
/// 是否成功完成
bool CompleteCommand(string commandName = null);
///
/// 设置命令超时
///
/// 是否有命令被设置为超时
bool TimeoutCommand();
///
/// 检查并处理超时
///
/// 是否有命令超时
bool CheckAndHandleTimeout();
///
/// 处理OK响应,解锁命令状态
///
/// 是否成功处理OK响应
bool HandleOkResponse();
///
/// 重置状态机
///
void Reset();
}
}