在 AiVideo 中能看到图像
增加了在线状态同步逻辑
This commit is contained in:
@@ -437,4 +437,25 @@ public class CameraManager : IDisposable, IAsyncDisposable
|
||||
// 复用现有的 GetAllDevices 逻辑
|
||||
return GetAllDevices();
|
||||
}
|
||||
|
||||
#region --- [新增] 状态事件总线 (SDK 对外接口) ---
|
||||
|
||||
/// <summary>
|
||||
/// 当设备在线/离线状态发生变更时触发
|
||||
/// <para>参数1: DeviceId</para>
|
||||
/// <para>参数2: IsOnline (true=在线, false=离线)</para>
|
||||
/// <para>参数3: Reason (变更原因)</para>
|
||||
/// </summary>
|
||||
public event Action<long, bool, string>? OnDeviceStatusChanged;
|
||||
|
||||
/// <summary>
|
||||
/// [内部方法] 供 Sentinel 调用,触发事件冒泡
|
||||
/// </summary>
|
||||
internal void NotifyStatusChange(long deviceId, bool isOnline, string reason)
|
||||
{
|
||||
// 仅仅是触发 C# 事件,完全不知道网络发送的存在
|
||||
OnDeviceStatusChanged?.Invoke(deviceId, isOnline, reason);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user