using SHH.CameraSdk.HikFeatures;

namespace SHH.CameraSdk;

/// <summary>
/// 能力接口：时间同步
/// 只有实现了此接口的设备，才支持 WebAPI 的时间查询与设置
/// </summary>
public interface ITimeSyncFeature
{
    /// <summary> 获取设备当前时间 </summary>
    Task<DateTime> GetTimeAsync();

    /// <summary> 设置设备时间 </summary>
    Task SetTimeAsync(DateTime time);
}

/// <summary>
/// 能力接口：设备重启
/// </summary>
public interface IRebootFeature
{
    /// <summary>发送重启指令</summary>
    Task RebootAsync();
}

/// <summary>能力接口：云台控制</summary>
public interface IPtzFeature
{
    /// <summary>原有的手动控制 (按下/松开)</summary>
    Task PtzControlAsync(PtzAction action, bool stop, int speed = 4);

    /// <summary>点动控制 (自动复位)</summary>
    Task PtzStepAsync(PtzAction action, int durationMs, int speed = 4);
}

/// <summary>
/// [功能接口] 预置点管理服务
/// <para>核心职责：抽象各品牌 SDK 的预置点操作，包括跳转、保存与删除</para>
/// </summary>
public interface IPresetFeature
{
    /// <summary>跳转到指定预置点</summary>
    /// <param name="presetIndex">预置点编号 (通常范围 1-255)</param>
    /// <returns>异步任务</returns>
    Task GotoPresetAsync(int presetIndex);

    /// <summary>将当前位置保存为预置点</summary>
    /// <param name="presetIndex">预置点编号 (若已存在则通常会覆盖)</param>
    /// <returns>异步任务</returns>
    Task SetPresetAsync(int presetIndex);

    /// <summary>删除指定的预置点</summary>
    /// <param name="presetIndex">预置点编号</param>
    /// <returns>异步任务</returns>
    Task RemovePresetAsync(int presetIndex);
}