Table of Contents

Interface ISdk

Namespace
Huddly.Sdk
Assembly
Huddly.Sdk.dll

Main interface for interacting with the Huddly SDK.

Intended to run for the lifetime of an application. Only one instance should run at a time. Derived resources should be disposed before disposing the sdk instance.

public interface ISdk : IDisposable
Inherited Members

Methods

GetMonitoredDevices()

IImmutableDictionary<string, IDevice> GetMonitoredDevices()

Returns

IImmutableDictionary<string, IDevice>

A collection of all currently monitored devices

IsMonitoring()

bool IsMonitoring()

Returns

bool

A bool indicating if the ISdk is actively monitoring devices or not. Will return false when the monitor has not been started or has been stopped.

StartMonitoring(int, CancellationToken)

[Obsolete("Use StartMonitoring(CancellationToken ct) instead. Method will be removed in SDK version 3.")]
Task StartMonitoring(int timeout_ms = -1, CancellationToken ct = default)

Parameters

timeout_ms int
ct CancellationToken

Returns

Task

StartMonitoring(CancellationToken)

Starts monitoring and discovery of devices. Call Dispose() to stop monitoring. The CancellationToken does not cancel the monitoring, it is only used to cancel the start operation.

Consumers should subscribe to the DeviceConnected and DeviceDisconnected events before calling this method.

Task StartMonitoring(CancellationToken ct)

Parameters

ct CancellationToken

A cancellation token that cancels the start operation.

Returns

Task

StopMonitoring()

Stops monitoring and discovery of devices

[Obsolete("Use Dispose() and create a new SDK instance instead. Method will be removed in SDK version 3.")]
void StopMonitoring()

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.

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.

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.

In order to reconnect to the device, listen for a DeviceConnected event containing an IDevice with a matching Id.

event EventHandler<DeviceConnectionChangeEventArgs>? DeviceDisconnected

Event Type

EventHandler<DeviceConnectionChangeEventArgs>