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
loggerFactory
ILoggerFactorymonitors
IEnumerable<IDeviceMonitor>session
SdkSession
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
loggerFactory
ILoggerFactorymonitors
IDeviceMonitor[]
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
loggerFactory
ILoggerFactorymonitors
IEnumerable<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
loggerFactory
ILoggerFactorysession
SdkSession
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_ms
intct
CancellationToken
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
DeviceConnected
Fires on device connection.
public event EventHandler<DeviceConnectionChangeEventArgs>? DeviceConnected
Event Type
DeviceDisconnected
Fires on device disconnect. The included device instance can no longer be used for communicating with the device.
In order to reconnect to the device, listen for a DeviceConnected event containing an IDevice with a matching Id.
public event EventHandler<DeviceConnectionChangeEventArgs>? DeviceDisconnected