# IDeviceCompat

public interface IDeviceCompat implements Comparable<IDeviceCompat>

Interface describing the supported properties and methods for a Nix device. IDeviceCompat objects are found nearby using the DeviceScanner.

#### Inheritors

DeviceCompat

## Types

InterfaceType
Link copied to clipboard
public enum InterfaceType extends Enum<IDeviceCompat.InterfaceType>

Enum describing the supported connection interface types for Nix devices.

OnDeviceStateChangeListener
Link copied to clipboard
public interface OnDeviceStateChangeListener

Definition for a callback from an IDeviceCompat instance on a connection state change, battery state change, or external power state change.

## Functions

compareTo
Link copied to clipboard
public Integer compareTo(IDeviceCompat other)

Compares this device instance to another (via signal strength / RSSI)

connect
Link copied to clipboard
public Unit connect(IDeviceCompat.OnDeviceStateChangeListener listener)

Open a connection to this Nix device. This operation is asynchronous and this method returns immediately. Status of this operation is updated via the provided OnDeviceStateChangeListener callback.

disconnect
Link copied to clipboard
public abstract Unit disconnect()

Disconnect from this Nix device, or cancel a connection attempt currently in progress.

getBatteryLevel
Link copied to clipboard
public abstract Integer getBatteryLevel()

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.

getExtPowerState
Link copied to clipboard
public abstract Boolean getExtPowerState()

External power connection state for this device. The value is valid only after a connection has successfully been opened.

getFieldCalibrationDue
Link copied to clipboard
public abstract Boolean getFieldCalibrationDue()

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.

getFieldCalibrationEnabled
Link copied to clipboard
public abstract Boolean getFieldCalibrationEnabled()

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.

getFieldCalibrationMaxDelta
Link copied to clipboard
public abstract Double getFieldCalibrationMaxDelta()

Maximum Delta E threshold used when performing in-field calibration (if supported), or NaN if the device does not support this operation. It is recommended to leave this set to its default value, which can vary by device type. If a difference from the reference greater than this value is detected during runFieldCalibration, the command will fail with status CommandStatus.ERROR_SCAN_DELTA.

getFirmwareVersion
Link copied to clipboard
public abstract DeviceVersion getFirmwareVersion()

Firmware version of this device. The value is valid only after a connection has successfully been opened.

getHapticFeedbackEnabled
Link copied to clipboard
public abstract Boolean getHapticFeedbackEnabled()

Flag to indicate if device haptic feedback is enabled.

getHardwareVersion
Link copied to clipboard
public abstract DeviceVersion getHardwareVersion()

Hardware version of this device. The value is valid only after a connection has successfully been opened.

getHasOptions
Link copied to clipboard
public Boolean getHasOptions()

Helper function to describe if any on-device options are available. Value is `true` if any one of supportsFieldCalibration, supportsTemperatureCompensation, supportsHapticFeedback, or supportsRgbFeedback is `true`.

getId
Link copied to clipboard
public String getId()

Unique identifier for this device

getInterfaceType
Link copied to clipboard
public IDeviceCompat.InterfaceType getInterfaceType()

Interface / connection type for this device

getName
Link copied to clipboard
public String getName()

Name for this device.

getNote
Link copied to clipboard
public abstract String getNote()

Factory note for this device, containing allocation code. The value is valid only after a connection has successfully been opened.

getPowerState
Link copied to clipboard
public abstract Boolean getPowerState()

Flag set to `true` if sufficient power is available to complete a measurement, or `false` if a measurement will be aborted (function of external power connection and battery level).

getProvidesDensity
Link copied to clipboard
public Boolean getProvidesDensity()

Flag indicating if this device is capable of providing absolute density values in its IMeasurementData results. This value only indicates the hardware capability; the LicenseFeature.DENSITY_DATA feature must also be be enabled by the active license. See also LicenseManager.Shared.isFeatureEnabled.

getProvidesSpectral
Link copied to clipboard
public Boolean getProvidesSpectral()

Flag indicating if this device is capable of providing spectral values in its IMeasurementData results. This value only indicates the hardware capability; the LicenseFeature.SPECTRAL_DATA feature must also be be enabled by the active license. See also LicenseManager.Shared.isFeatureEnabled.

getReferenceDate
Link copied to clipboard
public abstract Date getReferenceDate()

Date that the last in-field normalization was last performed, or `null` if this device does not support this feature.

getReferenceTemperature
Link copied to clipboard
public abstract Float getReferenceTemperature()

Baseline temperature for this device. Corresponds to in-field normalization temperature for DeviceType.SPECTRO2 and DeviceType.MINI3, or factory temperature for others. Value is `null` if the device does not support this feature.

getRgbFeedbackEnabled
Link copied to clipboard
public abstract Boolean getRgbFeedbackEnabled()

Flag to indicate if device RGB feedback is enabled.

getRssi
Link copied to clipboard
public Integer getRssi()

Signal strength for this device

getScanCount
Link copied to clipboard
public abstract Integer getScanCount()

Lifetime scan count for this device, or `null` if this device does not support this feature.

getScanTemperature
Link copied to clipboard
public abstract Float getScanTemperature()

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.

getSdkId
Link copied to clipboard
public String getSdkId()

Build ID for this Nix SDK binary

getSerialNumber
Link copied to clipboard
public abstract String getSerialNumber()

Serial number for this device. The value is valid only after a connection has successfully been opened.

getSoftwareVersion
Link copied to clipboard
public abstract DeviceVersion getSoftwareVersion()

Software version of this device. The value is valid only after a connection has successfully been opened.

getState
Link copied to clipboard
public abstract DeviceState getState()

Current state of this device

getSupportedModes
Link copied to clipboard
public abstract Array<ScanMode> getSupportedModes()

List of scan modes that are supported by this device. The list is valid only after a connection has successfully been opened.

getSupportedReferences
Link copied to clipboard
public abstract Array<ReferenceWhite> getSupportedReferences()

List of supported reference white points for the colorimetry data available from the IMeasurementData results provided by this device.

getSupportsFieldCalibration
Link copied to clipboard
public abstract Boolean getSupportsFieldCalibration()

Flag to indicate if this device supports in-field calibration using the provided reference tile.

getSupportsHapticFeedback
Link copied to clipboard
public abstract Boolean getSupportsHapticFeedback()

Flag to indicate if the device supports built-in haptic feedback.

getSupportsRgbFeedback
Link copied to clipboard
public abstract Boolean getSupportsRgbFeedback()

Flag to indicate if the device supports built-in RGB feedback.

getSupportsTemperatureCompensation
Link copied to clipboard
public abstract Boolean getSupportsTemperatureCompensation()

Flag to indicate if this device supports automatic temperature compensation to correct for small changes in ambient temperature.

getTemperatureCompensationEnabled
Link copied to clipboard
public abstract Boolean getTemperatureCompensationEnabled()

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.

getType
Link copied to clipboard
public abstract DeviceType getType()

Type for this device.

invalidateFieldCalibration
Link copied to clipboard
public Unit invalidateFieldCalibration(OnDeviceResultListener listener)

Invalidates current field calibration date, so that fieldCalibrationDue is reported as `true`, if supported by the device.

isFeatureSupported
Link copied to clipboard
public Boolean isFeatureSupported(LicenseFeature feature)

Helper to check if a particular LicenseFeature is supported by this device.

isModeSupported
Link copied to clipboard
public Boolean isModeSupported(ScanMode scanMode)

Helper to check if a particular scan mode is supported by this device (i.e. - checks if the mode is present in the supportedModes list). This value is valid only after a connection has successfully been opened.

isTileStringValid
Link copied to clipboard
public Boolean isTileStringValid(String tileString)

Used to check if a decoded string from the reference tile is valid. 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.

ledTest
Link copied to clipboard
public Unit ledTest(OnDeviceResultListener listener)

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. This method is asynchronous and will return immediately. Status of this operation is updated via the provided OnDeviceResultListener callback.

measure
Link copied to clipboard
public Unit measure(OnDeviceResultListener listener, ScanMode modes)

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 CommandStatus.ERROR_NOT_SUPPORTED. This method is asynchronous and will return immediately. Status of this operation is provided by the OnDeviceResultListener callback

providesColor
Link copied to clipboard
public Boolean providesColor(ReferenceWhite reference)
public Boolean providesColor(Illuminant illuminant, Observer observer)

Helper to check if a particular reference white point is supported by the colorimetry data from this device (i.e - checks if the reference is present in the supportedReferences list`).

runFieldCalibration
Link copied to clipboard
public Unit runFieldCalibration(OnDeviceResultListener listener, String tileString)

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.

setFieldCalibrationEnabled
Link copied to clipboard
public Unit setFieldCalibrationEnabled(OnDeviceResultListener listener, Boolean enabled)

Set the value for fieldCalibrationEnabled. This method is asynchronous and will return immediately.

setFieldCalibrationMaxDelta
Link copied to clipboard
public abstract Unit setFieldCalibrationMaxDelta(Double value)

Maximum Delta E threshold used when performing in-field calibration (if supported), or NaN if the device does not support this operation. It is recommended to leave this set to its default value, which can vary by device type. If a difference from the reference greater than this value is detected during runFieldCalibration, the command will fail with status CommandStatus.ERROR_SCAN_DELTA.

setHapticFeedbackEnabled
Link copied to clipboard
public Unit setHapticFeedbackEnabled(OnDeviceResultListener listener, Boolean enabled)

Set the value for hapticFeedbackEnabled. This method is asynchronous and will return immediately.

setRgbFeedbackEnabled
Link copied to clipboard
public Unit setRgbFeedbackEnabled(OnDeviceResultListener listener, Boolean enabled)

Set the value for rgbFeedbackEnabled. This method is asynchronous and will return immediately.

setRssi
Link copied to clipboard
public Unit setRssi(Integer <unused var>)

Signal strength for this device

setTemperatureCompensationEnabled
Link copied to clipboard
public Unit setTemperatureCompensationEnabled(OnDeviceResultListener listener, Boolean enabled)

Set the value for temperatureCompensationEnabled. This method is asynchronous and will return immediately.