EnumerationOptions
public sealed class EnumerationOptions
Filters applied while looking for cameras.
Write it as Optris.Sdk.EnumerationOptions, or add using EnumerationOptions = Optris.Sdk.EnumerationOptions;, in a project with implicit usings switched on, which every project made from the default templates has: those import System.IO, and with it System.IO.EnumerationOptions, so the short name is ambiguous there (error CS0104).
Example
var options = new Optris.Sdk.EnumerationOptions { IncludeNetwork = true, NetworkDiscoveryTimeout = TimeSpan.FromSeconds(2), }; foreach (DeviceInfo device in Sdk.EnumerateDevices(options)) { Console.WriteLine(device); }
EnumerationOptions: constructors
public EnumerationOptions()
EnumerationOptions: properties
public Nullable<ConnectionType> ConnectionType { get; set; }
Only look for cameras attached this way, or null for any.
This decides where the sweep looks rather than what it reports, so it is as cheap as it reads: ConnectionType.Usb sends no broadcast whatever EnumerationOptions.IncludeNetwork says, ConnectionType.Network does not read the local buses, and ConnectionType.Simulated touches no hardware at all and returns immediately -- pair it with EnumerationOptions.IncludeSimulated, which is what puts the synthetic cameras in the list.
Before SDK 12 all three filtered the results of a sweep that had already run, so asking for simulated cameras read every attached camera and waited out a network broadcast first.
public Nullable<DeviceType> DeviceType { get; set; }
Only report cameras of this model, or null for any.
Applied to the results, and it can be nothing else: a camera's model is only known once the sweep has found it. So this makes a sweep narrower and not cheaper, unlike EnumerationOptions.ConnectionType.
public bool IncludeNetwork { get; set; }
Search the network as well as the local buses.
This is what makes enumeration slow: it waits up to EnumerationOptions.NetworkDiscoveryTimeout for devices to answer.
public bool IncludeSimulated { get; set; }
Include a simulated camera in the results.
public TimeSpan NetworkDiscoveryTimeout { get; set; }
How long to wait for network cameras to answer.
Ignored unless EnumerationOptions.IncludeNetwork is set.
Carried as whole milliseconds, rounded, and never down to zero from a positive value. TimeSpan.Zero itself still means zero: the sweep broadcasts once and waits for nothing.