using DMS.Core.Models;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace DMS.Infrastructure.Interfaces.Services
{
///
/// MQTT后台服务接口,负责管理MQTT连接和数据传输
///
public interface IMqttBackgroundService : IDisposable
{
///
/// 启动MQTT后台服务
///
Task StartAsync(CancellationToken cancellationToken = default);
///
/// 停止MQTT后台服务
///
Task StopAsync(CancellationToken cancellationToken = default);
///
/// 添加MQTT服务器配置
///
void AddMqttServer(MqttServer mqttServer);
///
/// 移除MQTT服务器配置
///
Task RemoveMqttServerAsync(int mqttServerId, CancellationToken cancellationToken = default);
///
/// 更新MQTT服务器配置
///
void UpdateMqttServer(MqttServer mqttServer);
///
/// 获取所有MQTT服务器配置
///
IEnumerable GetAllMqttServers();
///
/// 发布变量数据到MQTT服务器
///
Task PublishVariableDataAsync(VariableMqttAlias variableMqtt, CancellationToken cancellationToken = default);
///
/// 发布批量变量数据到MQTT服务器
///
Task PublishVariablesDataAsync(List variableMqtts, CancellationToken cancellationToken = default);
}
}