Table of Contents

Class IpDeviceMonitor

Namespace
Huddly.Sdk
Assembly
Huddly.Sdk.dll
public sealed class IpDeviceMonitor : IIpDeviceMonitor, IDeviceMonitor, IDisposable
Inheritance
IpDeviceMonitor
Implements
Inherited Members

Constructors

IpDeviceMonitor(IpDeviceMonitorOptions, IDiscovery, IGrpcClientFactory, IDeviceHeartbeat, ILoggerFactory?)

public IpDeviceMonitor(IpDeviceMonitorOptions options, IDiscovery discovery, IGrpcClientFactory grpcClientFactory, IDeviceHeartbeat deviceHeartbeat, ILoggerFactory? loggerFactory = null)

Parameters

options IpDeviceMonitorOptions
discovery IDiscovery
grpcClientFactory IGrpcClientFactory
deviceHeartbeat IDeviceHeartbeat
loggerFactory ILoggerFactory

Properties

IsMonitoring

Indicates whether the device monitor is currently monitoring devices. Returns false when the monitor is not started or the underlying discovery implementation is suspended or stopped.

public bool IsMonitoring { get; }

Property Value

bool

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetDiscoveryType()

[Obsolete("Method will be removed in SDK version 3.")]
public Type GetDiscoveryType()

Returns

Type

RestartDiscovery()

Restarts IP device discovery and heartbeat if the monitor is started.

public Task RestartDiscovery()

Returns

Task

Resume()

[Obsolete("Use RestartDiscovery() instead. Method will be removed in SDK version 3.")]
public void Resume()

Start(SdkSession, int, CancellationToken)

[Obsolete("Use Start(SdkSession session, CancellationToken ct) instead. Method will be removed in SDK version 3.")]
public Task Start(SdkSession session, int timeout_ms, CancellationToken ct)

Parameters

session SdkSession
timeout_ms int
ct CancellationToken

Returns

Task

Start(SdkSession, CancellationToken)

Start the device monitor. May only be called once.

public Task Start(SdkSession session, CancellationToken ct = default)

Parameters

session SdkSession
ct CancellationToken

Returns

Task

Exceptions

InvalidOperationException

Thrown if the monitor is already started.

StopDiscovery()

Stops IP device discovery and heartbeat; then triggers DeviceDisconnected events for all connected devices. The monitor keeps its started state; discovery can be restarted with RestartDiscovery().

public Task StopDiscovery()

Returns

Task

Suspend()

[Obsolete("Use StopDiscovery() instead. Method will be removed in SDK version 3.")]
public void Suspend()

Events

DeviceAccessDenied

This event is triggered when a connected device is inaccessible, e.g., when it is claimed by another process or when permission is denied.

public event EventHandler<DeviceAccessDeniedEventArgs>? DeviceAccessDenied

Event Type

EventHandler<DeviceAccessDeniedEventArgs>

DeviceConnected

This event is triggered when a device is connected. It will also trigger for all currently connected devices when device discovery starts.

public event EventHandler<DeviceConnectionChangeEventArgs>? DeviceConnected

Event Type

EventHandler<DeviceConnectionChangeEventArgs>

DeviceDisconnected

This event is triggered when a device is disconnected. It will only occur for devices that have previously triggered the DeviceConnected event.

public event EventHandler<DeviceConnectionChangeEventArgs>? DeviceDisconnected

Event Type

EventHandler<DeviceConnectionChangeEventArgs>