ILanYinWsClientService.cs
1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using Rcs.Cyaninetech.Models;
using Rcs.Domain.Settings;
namespace Rcs.Cyaninetech.Services
{
/// <summary>
/// 蓝音 WebSocket 客户端服务接口
/// @author zzy
/// </summary>
public interface ILanYinWsClientService
{
/// <summary>
/// 连接 WebSocket 服务器
/// </summary>
Task ConnectAsync(CancellationToken cancellationToken = default);
/// <summary>
/// 断开连接
/// </summary>
Task DisconnectAsync();
/// <summary>
/// 发送订阅请求
/// </summary>
Task SubscribeAsync(List<string> topics);
/// <summary>
/// 是否已连接
/// </summary>
bool IsConnected { get; }
/// <summary>
/// 机器人状态接收事件
/// </summary>
event EventHandler<List<LanYinRobotStatus>>? OnRobotStatusReceived;
/// <summary>
/// 机器人信息接收事件
/// </summary>
event EventHandler<List<LanYinRobotInfo>>? OnRobotInfoReceived;
/// <summary>
/// 机器人实时路径接收事件
/// </summary>
event EventHandler<LanYinRobotRealtimePath>? OnRobotRealtimePathReceived;
}
}