Class DeviceCompat
- Namespace
- NixUniversalSDK
- Assembly
- NixUniversalSDK.dll
Class describing the supported properties and methods for a Nix device.
public class DeviceCompat : IDeviceCompat, IDeviceCompatEvents, IComparable
- Inheritance
-
DeviceCompat
- Implements
- Inherited Members
- Extension Methods
Fields
BuildUuid
Build ID for this NixUniversalSDK
binary.
[Obsolete("Use LicenseManager.Uuid instead", false)]
public readonly string BuildUuid
Field Value
Properties
BatteryLevel
Current battery level for this device (0 - 100), or null
if not available. The value is valid only after a connection has successfully been opened.
public int? BatteryLevel { get; }
Property Value
- int?
ExtPowerState
External power connection state for this device. The value is valid only after a connection has successfully been opened.
public bool ExtPowerState { get; }
Property Value
FieldCalibrationDue
Flag to indicate if in-field calibration is recommended for this device at this time (if supported). This value is only valid after opening a connection and is a function of both time and ambient temperature. This value also updates each time a measurement is completed.
public bool FieldCalibrationDue { get; }
Property Value
FieldCalibrationEnabled
Flag to indicate if in-field calibration results are applied (true
) or bypassed (false
) when evaluating the final calibrated measurement result. Value is true
by default if supported by the device. It is recommended to leave this set to true
if supported.
public bool FieldCalibrationEnabled { get; }
Property Value
FieldCalibrationMaxDelta
Maximum Delta E threshold used when performing in-field calibration (if supported), or NaN if the device does not support this operation. If a difference from the reference greater than this value is detected during RunFieldCalibrationAsync(string), the command will fail with status ErrorScanDelta.
public double FieldCalibrationMaxDelta { get; set; }
Property Value
FirmwareVersion
Firmware version of this device. The value is valid only after a connection has successfully been opened.
public DeviceVersion FirmwareVersion { get; }
Property Value
HapticFeedbackEnabled
Flag to indicate if device haptic feedback is enabled.
public bool HapticFeedbackEnabled { get; }
Property Value
HardwareVersion
Hardware version of this device. The value is valid only after a connection has successfully been opened.
public DeviceVersion HardwareVersion { get; }
Property Value
Id
Unique identifier for this device
public string Id { get; }
Property Value
InterfaceType
Interface / connection type for this device
public InterfaceType InterfaceType { get; }
Property Value
Name
Name for this device
public string Name { get; }
Property Value
Note
Factory note for this device, containing allocation code. The value is valid only after a connection has successfully been opened.
public string Note { get; }
Property Value
PowerState
Flag: true
if sufficient power is available to complete a measurement, false
if a measurement will be aborted (function of external power connection and battery level)
public bool PowerState { get; }
Property Value
ProvidesDensity
Flag to indicate if this device type provides density information in its supplied IMeasurementData results.
public bool ProvidesDensity { get; }
Property Value
ProvidesSpectral
Flag to indicate if this device type provides spectral information in its supplied IMeasurementData results.
public bool ProvidesSpectral { get; }
Property Value
ReferenceDate
Date that the last in-field normalization was last performed, or null
if this device does not support this feature.
public DateTime? ReferenceDate { get; }
Property Value
ReferenceTemperature
Baseline temperature for this device. Corresponds to in-field normalization temperature for Spectro2 and Mini3, or factory temperature for others. Value is null
if the device does not support this feature. The value is valid only after a connection has successfully been opened.
public float? ReferenceTemperature { get; }
Property Value
RgbFeedbackEnabled
Flag to indicate if device RGB feedback is enabled.
public bool RgbFeedbackEnabled { get; }
Property Value
Rssi
Signal strength for this device
public int Rssi { get; }
Property Value
ScanCount
Lifetime scan count for this device, or null
if this device does not support this feature.
public uint? ScanCount { get; }
Property Value
- uint?
ScanTemperature
Last known temperature of the device, corresponding to the most recently completed scan since the device was connected. Value is null
if the device does not support this feature. This value is only valid if the device is connected and a measurement has completed.
public float? ScanTemperature { get; }
Property Value
SdkId
Build ID for this NixUniversalSDK
binary
public string SdkId { get; }
Property Value
SerialNumber
Serial number for this device. The value is valid only after a connection has successfully been opened.
public string SerialNumber { get; }
Property Value
SoftwareVersion
Software version of this device. The value is valid only after a connection has successfully been opened.
public DeviceVersion SoftwareVersion { get; }
Property Value
State
Current state of this device
public DeviceState State { get; }
Property Value
SupportedModes
List of scan modes that are supported by this device. The list is valid only after a connection has successfully been opened.
public IEnumerable<ScanMode> SupportedModes { get; }
Property Value
SupportedReferences
List of supported reference white points for the colorimetry data available from the IMeasurementData results provided by this device.
public IEnumerable<ReferenceWhite> SupportedReferences { get; }
Property Value
SupportsFieldCalibration
Flag to indicate if this device supports in-field calibration using the provided reference tile.
public bool SupportsFieldCalibration { get; }
Property Value
SupportsHapticFeedback
Flag to indicate if the device supports built-in haptic feedback.
public bool SupportsHapticFeedback { get; }
Property Value
SupportsRgbFeedback
Flag to indicate if the device supports built-in RGB feedback.
public bool SupportsRgbFeedback { get; }
Property Value
SupportsTemperatureCompensation
Flag to indicate if this device supports automatic temperature compensation to correct for small changes in ambient temperature.
public bool SupportsTemperatureCompensation { get; }
Property Value
TemperatureCompensationEnabled
Flag to indicate if ambient temperature compensation / correction is applied (true
) or bypassed (false
) when evaluating the final calibrated measurement. Value is true
by default if supported by the device. It is recommended to leave this set to true
if supported.
public bool TemperatureCompensationEnabled { get; }
Property Value
Type
Type for this device
public DeviceType Type { get; }
Property Value
Methods
CompareTo(object)
Compares this device instance to another (via signal strength / RSSI)
public int CompareTo(object other)
Parameters
other
object
Returns
ConnectAsync()
Open a connection to this Nix device. A connection in progress can be cancelled by calling Disconnect().
public Task<DeviceStatus> ConnectAsync()
Returns
- Task<DeviceStatus>
DeviceStatus indicating success or failure of the connection operation
Disconnect()
Disconnect from this Nix device, or cancel a connection attempt currently in progress.
public void Disconnect()
InvalidateFieldCalibrationAsync()
Invalidates current field calibration date, so that FieldCalibrationDue is reported as true
, if supported by the device.
public Task<DeviceResult> InvalidateFieldCalibrationAsync()
Returns
- Task<DeviceResult>
DeviceResult containing status code of the completed operation
IsTileStringValid(string)
Used to check if a decoded string from the reference tile is valid.
public bool? IsTileStringValid(string tileString)
Parameters
tileString
stringString value decoded from the reference tile QR code
Returns
- bool?
Returns
null
if the string is not in the expected format,false
if the string is in a valid format but does not match this particular device,true
if the string is valid.
LedTestAsync()
Manually run a LED test routine. On devices featuring RGB feedback, this will use the RGB LEDs. On other devices, this will flash the white LEDs.
public Task<DeviceResult> LedTestAsync()
Returns
- Task<DeviceResult>
DeviceResult containing status code of the completed operation
MeasureAsync(params ScanMode[])
Run a measurement for the specified scan modes, or all supported scan modes if none are specified. If unsupported modes are selected, the measurement will fail with status code ErrorNotSupported.
public Task<DeviceResult> MeasureAsync(params ScanMode[] modes)
Parameters
modes
ScanMode[]Scan modes to select. If omitted, the device will measure for all supported modes
Returns
- Task<DeviceResult>
DeviceResult containing the status code of the completed operation and measurement data, if applicable.
RunFieldCalibrationAsync(string)
Start field calibration using provided reference tile, if supported. Upon executing this command, the scan of the reference tile will begin immediately. The user MUST be prompted to place the device onto the reference tile BEFORE this method is executed. This method is asynchronous and will return immediately. This command requires data from the reference tile QR code. As the format varies between different device types, the string data should be provided exactly as decoded from the QR code.
public Task<DeviceResult> RunFieldCalibrationAsync(string tileString)
Parameters
tileString
stringString value decoded from the reference tile QR code
Returns
- Task<DeviceResult>
DeviceResult containing the status code of the completed operation and measurement data, if applicable.
SetFieldCalibrationEnabledAsync(bool)
Set the value for FieldCalibrationEnabled.
public Task<DeviceResult> SetFieldCalibrationEnabledAsync(bool enabled)
Parameters
enabled
boolNew state for this option
Returns
- Task<DeviceResult>
DeviceResult containing status code of the completed operation
SetHapticFeedbackEnabledAsync(bool)
Set the value for HapticFeedbackEnabled.
public Task<DeviceResult> SetHapticFeedbackEnabledAsync(bool enabled)
Parameters
enabled
boolNew state for this option
Returns
- Task<DeviceResult>
DeviceResult containing status code of the completed operation
SetRgbFeedbackEnabledAsync(bool)
Set the value for RgbFeedbackEnabled.
public Task<DeviceResult> SetRgbFeedbackEnabledAsync(bool enabled)
Parameters
enabled
boolNew state for this option
Returns
- Task<DeviceResult>
DeviceResult containing status code of the completed operation
SetTemperatureCompensationEnabledAsync(bool)
Set the value for TemperatureCompensationEnabled.
public Task<DeviceResult> SetTemperatureCompensationEnabledAsync(bool enabled)
Parameters
enabled
boolNew state for this option
Returns
- Task<DeviceResult>
DeviceResult containing status code of the completed operation
Events
BatteryStateChanged
Called when the Nix device has updated its battery level measurement
public event EventHandler<BatteryStateEventArgs> BatteryStateChanged
Event Type
Connected
Called when the Nix device has completed the connection process and is now idle
public event EventHandler Connected
Event Type
Disconnected
Called when the Nix device has disconnected from the host
public event EventHandler<DeviceStatusArgs> Disconnected
Event Type
ExtPowerStateChanged
Called when the Nix device has been connected or disconnected from an external power source.
public event EventHandler<ExtPowerStateEventArgs> ExtPowerStateChanged