Class Sdk
public sealed class Sdk : ISdk, IDisposable
- Inheritance
-
Sdk
- Implements
- Inherited Members
Constructors
Sdk(ILoggerFactory?, IEnumerable<IDeviceMonitor>, SdkSession?)
public Sdk(ILoggerFactory? loggerFactory, IEnumerable<IDeviceMonitor> monitors, SdkSession? session = null)
Parameters
loggerFactoryILoggerFactorymonitorsIEnumerable<IDeviceMonitor>sessionSdkSession
Sdk(IEnumerable<IDeviceMonitor>, SdkSession?)
public Sdk(IEnumerable<IDeviceMonitor> monitors, SdkSession? session = null)
Parameters
monitorsIEnumerable<IDeviceMonitor>sessionSdkSession
Methods
Create(ILoggerFactory?, params IDeviceMonitor[])
[Obsolete("Use the Sdk constructor or CreateDefault(). Method will be removed in SDK version 3.")]
public static Sdk Create(ILoggerFactory? loggerFactory, params IDeviceMonitor[] monitors)
Parameters
loggerFactoryILoggerFactorymonitorsIDeviceMonitor[]
Returns
Create(ILoggerFactory?, IEnumerable<IDeviceMonitor>)
[Obsolete("Use the Sdk constructor or CreateDefault(). Method will be removed in SDK version 3.")]
public static Sdk Create(ILoggerFactory? loggerFactory, IEnumerable<IDeviceMonitor> monitors)
Parameters
loggerFactoryILoggerFactorymonitorsIEnumerable<IDeviceMonitor>
Returns
CreateDefault(ILoggerFactory?, SdkSession?)
Create the SDK with recommended device monitors using the default configuration and timeouts.
public static Sdk CreateDefault(ILoggerFactory? loggerFactory, SdkSession? session = null)
Parameters
loggerFactoryILoggerFactorysessionSdkSession
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
~Sdk()
protected ~Sdk()
GetMonitoredDevices()
public IImmutableDictionary<string, IDevice> GetMonitoredDevices()
Returns
- IImmutableDictionary<string, IDevice>
A collection of all currently monitored devices
IsMonitoring()
public bool IsMonitoring()
Returns
StartMonitoring(int, CancellationToken)
Starts monitoring and discovery of devices.
Consumers should subscribe to the DeviceConnected and DeviceDisconnected events before calling this method
public Task StartMonitoring(int timeout_ms = -1, CancellationToken ct = default)
Parameters
timeout_msintctCancellationToken
Returns
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.")]
public 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.
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
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.
public event EventHandler<DeviceConnectionChangeEventArgs>? DeviceDisconnected