Device Enumeration

DriverType

enum LuxFlux.fluxEngineNET.DriverType

The type of driver.

Values:

Instrument

Instrument driver

This driver accesses instrument devices, such as cameras, spectrometers, and other sensors.

LightControl

Light control device

This driver accesses light control devices that can be used to switch a light on and off, and possibly set the light intensity.

DriverState

enum LuxFlux.fluxEngineNET.DriverState

The driver state

Describes the state of the driver at the end of the enumeration process. This can be used to detect issues with the driver.

Values:

Unknown

The state is unknown

This likely indicates an internal error during enumeration.

OK

OK

The driver could successfully perform the enumeration. This is a valid state even if the driver didn’t find any device.

LoadTimeout

Driver load timeout

The driver didn’t respond at all within the specified enumeration timeout, indicating that it didn’t load in time. If a sufficiently long timeout has been provided (e.g. more than 3 seconds) this is typically an indication that there is an issue with the driver.

LoadError

Driver load error

The driver could not be loaded, for example because the driver file is not valid, or the isolation executable could not be found (in which case all drivers will suffer from this error).

EnumerationError

Enumeration error

The driver generated an error message during the enumeration process. That error can be queried from the enumeration result.

Crashed

Driver crashed

The driver crashed during enumeration. This typically indicates that there is an issue with a missing dependency of the driver.

EnumeratedDevice

class LuxFlux.fluxEngineNET.EnumeratedDevice

Enumerated device

Describes a device that was found during enumeration.

Note that some drivers can’t actually enumerate the available devices in the system, and rely on probing to actually connect to a device. In that case a device entry will appear regardless of whether the device is actually present, and connection failure is the only way of ascertaining that the device is not actually present.

Public Members

byte[] Id

A driver-specific id of the device

This id must be provided in combination with the type and name of the driver for a connection attempt.

The id is guaranteed to be stable for a short period of time after enumeration so that it may be used for connection purposes.

It is not guaranteed to be stable across reboots, software updates, etc. The user should never rely on the specific content of this id, even if it appars to be stable at the moment.

EnumeratedDriver Driver

The driver that enumerated the device

string DisplayName

The display name of the device

This is a human-readable text that is of the format Vendor Model (Serial Number), but in such a manner that if one or more of these strings is empty a sensible text will still be generated — for example, if a device has no serial number, the format will be Manufacturer Model instead.

string Manufacturer

The manufacturer of the device

string Model

The model of the device

string SerialNumber

The serial number of the device

This may be null, which can mean two things: either the device has no serial number, of the serial number could not be obtained during device enumeration and requires the user to connect to the device to actually read it.

fluxEngineNET.ParameterList ConnectionParameterList

The parameter info for the connection parameters

Contains information about all connection parameters of the device. For some devices it is necessary to set the some parameters (such as the path to a calibration file) when connecting to the device. This contains the available parameters.

EnumeratedDriver

class LuxFlux.fluxEngineNET.EnumeratedDriver

Enumerated driver

Describes a driver that was used during enumeration. Failed drivers will also have such a structure, even though they will not have any associated devices.

Public Members

string Name

The name of the driver

This is the filename component of the driver and may be used to identify the driver for connection purposes.

DriverType Type

The type of the driver

This is required for identifying the driver for connection purposes.

string Description

A human-readable name of the driver

string Version

A human-readable version of the driver

DriverState State

The state of the driver

List<EnumeratedDevice> Devices

The devices the driver has found

This list may be empty if a specific driver has found no devices.

EnumerationWarning

class LuxFlux.fluxEngineNET.EnumerationWarning

Enumeration Warning

Describes a warning that was encountered during enumeration. This could be a USB device that could not be accessed because the correct kernel driver is not installed, or a network device that was found but was on the wrong subnet for a given network interface.

Public Members

EnumeratedDriver Driver

The driver for which the warning occurred.

string Message

The warning message.

EnumerationError

class LuxFlux.fluxEngineNET.EnumerationError

Enumeration Error

Describes an error that occurred during enumeration, for example a driver that crashed.

Public Members

EnumeratedDriver Driver

The driver for which the error occurred

This may be null if an error occurred that was not specific to an individual driver.

string Message

The error message.

EnumerationResult

class LuxFlux.fluxEngineNET.EnumerationResult

The result of an enumeration process

Public Members

List<EnumeratedDevice> Devices

The devices that were found.

List<EnumeratedDriver> Drivers

The drivers that were used during enumeration.

List<EnumerationWarning> Warnings

Warnings that occurred during enumeration.

List<EnumerationError> Errors

Errors that occurred during enumeration.

DeviceEnumeration

class LuxFlux.fluxEngineNET.DeviceEnumeration

Device enumeration logic

This class provides static methods that perfrom device enumeration.

Public Static Functions

EnumerationResult EnumerateDevices (Handle handle, DriverType? driverType, TimeSpan timeout)

Enumerate devices

This method enumerates all devices that are connected to the system for which drivers have been installed. Please note that Handle.SetDriverIsolationExecutable() and Handle.SetDriverBaseDirectory() should be called before this method if the driver directory or the directory of the isolation executable are in non-standard paths.

Param handle:

The fluxEngine handle

Param driverType:

The type of driver to enumerate. Specify null to indicate that all driver types should be enumerated

Param timeout:

How long to enumerate. This method will always wait this long for the enumeration process to complete and will return all devices that were found within that given timespan. It is recommended to set this to at least 3.5 seconds.

Return:

The enumerated devices