Show / Hide Table of Contents

# Class Exported

Exported static functions

##### Inheritance

object
Exported

##### Inherited Members

object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()

###### Namespace: NixUniversalSDK.Wrapper

###### Assembly: NixUniversalSDK.Wrapper.dll

##### Syntax

    public static class Exported

### Methods

#### Device_Connect(nint)

Opens a connection to the device with the specified ID. Only a single device can be connected at one time; opening a connection to a second device will disconnect the first. Connecting is an async process; either the ConnectedDelegate will be invoked on success, or the DisconnectedDelegate will be invoked on failure. To cancel a connection in progress, call Device_Disconnect().

##### Declaration

    public static void Device_Connect(nint idPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | idPtr | Pointer to device ID string. This should match the Id of a device found by the DeviceScanner in this app session. If this device has not already been found, a search will automatically be started before starting the connection process.

#### Device_Disconnect()

Closes the current device connection.

##### Declaration

    public static void Device_Disconnect()

#### Device_GetBatteryLevel()

BatteryLevel for the current device as an Int32. Range is 0 - 100, or -1 if not available. This value is valid only after a connection been opened.

##### Declaration

    public static int Device_GetBatteryLevel()

##### Returns

Type | Description
--- | ---
int |

#### Device_GetExtPowerState()

ExtPowerState for the current device. This value is valid only after a connection been opened.

##### Declaration

    public static bool Device_GetExtPowerState()

##### Returns

Type | Description
--- | ---
bool |

#### Device_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.

##### Declaration

    public static bool Device_GetFieldCalibrationDue()

##### Returns

Type | Description
--- | ---
bool |

#### Device_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.

##### Declaration

    public static bool Device_GetFieldCalibrationEnabled()

##### Returns

Type | Description
--- | ---
bool |

#### Device_GetFieldCalibrationMaxDelta()

Gets the current threshold/maximum Delta E threshold used when performing in-field calibration. Value is NaN if the device does not support field calibration.

##### Declaration

    public static double Device_GetFieldCalibrationMaxDelta()

##### Returns

Type | Description
--- | ---
double |

#### Device_GetFirmwareVersion()

FirmwareVersion for the current device as an ANSI string. This value is valid only after a connection been opened.

##### Declaration

    public static nint Device_GetFirmwareVersion()

##### Returns

Type | Description
--- | ---
nint |

#### Device_GetHapticFeedbackEnabled()

Flag to indicate if device haptic feedback is enabled.

##### Declaration

    public static bool Device_GetHapticFeedbackEnabled()

##### Returns

Type | Description
--- | ---
bool |

#### Device_GetHardwareVersion()

HardwareVersion for the current device as an ANSI string. This value is valid only after a connection been opened.

##### Declaration

    public static nint Device_GetHardwareVersion()

##### Returns

Type | Description
--- | ---
nint |

#### Device_GetId()

Id for the current device as an ANSI string, or empty if no device is selected.

##### Declaration

    public static nint Device_GetId()

##### Returns

Type | Description
--- | ---
nint |

#### Device_GetInterfaceType()

InterfaceType for the current device as an Int32. See InterfaceType for the possible values.

##### Declaration

    public static int Device_GetInterfaceType()

##### Returns

Type | Description
--- | ---
int |

#### Device_GetLastCalibrationDebug()

Gets debug information for the last field calibration performed in this application session, formatted as a JSON string

##### Declaration

    public static nint Device_GetLastCalibrationDebug()

##### Returns

Type | Description
--- | ---
nint |

#### Device_GetLastCalibrationStatus()

Gets the CommandStatus for the last field calibration performed in this application session, represented as an Int32.

##### Declaration

    public static int Device_GetLastCalibrationStatus()

##### Returns

Type | Description
--- | ---
int |

#### Device_GetName()

Name for the current device as an ANSI string, or empty if no device is selected.

##### Declaration

    public static nint Device_GetName()

##### Returns

Type | Description
--- | ---
nint |

#### Device_GetNote()

Note for the current device as an ANSI string. This value is valid only after a connection been opened.

##### Declaration

    public static nint Device_GetNote()

##### Returns

Type | Description
--- | ---
nint |

#### Device_GetPowerState()

PowerState for the current device; `true` if sufficient power is available to complete a measurement, `false` if a measurement will be aborted. This value is valid only after a connection been opened.

##### Declaration

    public static bool Device_GetPowerState()

##### Returns

Type | Description
--- | ---
bool |

#### Device_GetProvidesDensity()

ProvidesDensity for the current device. This value is valid only after a connection been opened.

##### Declaration

    public static bool Device_GetProvidesDensity()

##### Returns

Type | Description
--- | ---
bool |

#### Device_GetProvidesSpectral()

ProvidesSpectral for the current device. This value is valid only after a connection been opened.

##### Declaration

    public static bool Device_GetProvidesSpectral()

##### Returns

Type | Description
--- | ---
bool |

#### Device_GetReferenceJavaTicks()

ReferenceDate for the current device, represented as a UInt64, or 0 if not supported. This corresponds to the milliseconds since the Unix epoch (January 1, 1970 00:00 UTC).

##### Declaration

    public static ulong Device_GetReferenceJavaTicks()

##### Returns

Type | Description
--- | ---
ulong |

#### Device_GetReferenceTemperature()

ReferenceTemperature for the current device a 32-bit float, or TemperatureError it not available. This value is valid only after a connection been opened.

##### Declaration

    public static float Device_GetReferenceTemperature()

##### Returns

Type | Description
--- | ---
float |

#### Device_GetRgbFeedbackEnabled()

Flag to indicate if device RGB feedback is enabled.

##### Declaration

    public static bool Device_GetRgbFeedbackEnabled()

##### Returns

Type | Description
--- | ---
bool |

#### Device_GetScanCount()

ScanCount for the current device as an UInt32, or 0 if not supported.

##### Declaration

    public static uint Device_GetScanCount()

##### Returns

Type | Description
--- | ---
uint |

#### Device_GetScanTemperature()

ScanTemperature for the current device as a 32-bit float, or TemperatureError if not available. This value is valid only if a device is connected and a measurement has completed.

##### Declaration

    public static float Device_GetScanTemperature()

##### Returns

Type | Description
--- | ---
float |

#### Device_GetSerialNumber()

SerialNumber for the current device as an ANSI string. This value is valid only after a connection been opened.

##### Declaration

    public static nint Device_GetSerialNumber()

##### Returns

Type | Description
--- | ---
nint |

#### Device_GetSoftwareVersion()

SoftwareVersion for the current device as an ANSI string. This value is valid only after a connection been opened.

##### Declaration

    public static nint Device_GetSoftwareVersion()

##### Returns

Type | Description
--- | ---
nint |

#### Device_GetState()

State for the current device as an Int32. See DeviceState for the possible values.

##### Declaration

    public static int Device_GetState()

##### Returns

Type | Description
--- | ---
int |

#### Device_GetSupportedModes()

SupportedModes for the current device, formatted as a JSON array of string values (scan mode names). This value is valid only after a connection been opened.

##### Declaration

    public static nint Device_GetSupportedModes()

##### Returns

Type | Description
--- | ---
nint |

#### Device_GetSupportedReferences()

SupportedReferences for the current device, formatted as a JSON array of string values (reference names). This value is valid only after a connection been opened.

##### Declaration

    public static nint Device_GetSupportedReferences()

##### Returns

Type | Description
--- | ---
nint |

#### Device_GetSupportsFieldCalibration()

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

##### Declaration

    public static bool Device_GetSupportsFieldCalibration()

##### Returns

Type | Description
--- | ---
bool |

#### Device_GetSupportsHapticFeedback()

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

##### Declaration

    public static bool Device_GetSupportsHapticFeedback()

##### Returns

Type | Description
--- | ---
bool |

#### Device_GetSupportsRgbFeedback()

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

##### Declaration

    public static bool Device_GetSupportsRgbFeedback()

##### Returns

Type | Description
--- | ---
bool |

#### Device_GetSupportsTemperatureCompensation()

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

##### Declaration

    public static bool Device_GetSupportsTemperatureCompensation()

##### Returns

Type | Description
--- | ---
bool |

#### Device_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.

##### Declaration

    public static bool Device_GetTemperatureCompensationEnabled()

##### Returns

Type | Description
--- | ---
bool |

#### Device_GetType()

Type for the current device as an Int32. See DeviceType for the possible values.

##### Declaration

    public static int Device_GetType()

##### Returns

Type | Description
--- | ---
int |

#### Device_HasOptions()

Flag to indicate if any on-device options are available. Value is `true` if any one of SupportsFieldCalibration, SupportsTemperatureCompensation, SupportsHapticFeedback, or SupportsRgbFeedback is true.

##### Declaration

    public static bool Device_HasOptions()

##### Returns

Type | Description
--- | ---
bool |

#### Device_InvalidateFieldCalibration()

Calls InvalidateFieldCalibrationAsync() on the current device. This is an async operation; it will invoke the CommandCompletedDelegate on completion with the CommandStatus of the result passed as an integer.

##### Declaration

    public static void Device_InvalidateFieldCalibration()

#### Device_IsModeSupported(nint)

Checks if a specific scan mode is supported. This value is valid only after a connection been opened.

##### Declaration

    public static bool Device_IsModeSupported(nint scanModeNamePtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | scanModeNamePtr | Pointer to scan mode string to query. Must match names defined in the ScanMode enum (e.g. - "M0", "M1", or "M2")

##### Returns

Type | Description
--- | ---
bool | True if mode is supported, false if not supported or invalid

#### Device_IsTileStringValid(nint)

Used to check if a decoded string from the reference tile is valid.

##### Declaration

    public static bool Device_IsTileStringValid(nint tileStringPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | tileStringPtr | Pointer to string value decoded from the reference tile QR code

##### Returns

Type | Description
--- | ---
bool |

#### Device_LedTest()

Calls LedTestAsync() on the current device. This is an async operation; it will invoke the CommandCompletedDelegate on completion with the CommandStatus of the result passed as an Int32.

##### Declaration

    public static void Device_LedTest()

#### Device_Measure(nint)

Calls MeasureAsync(params ScanMode[]) on the current device. This is an async operation; it will invoke the CommandCompletedDelegate on completion with the CommandStatus of the result passed as an Int32.

##### Declaration

    public static void Device_Measure(nint modesJsonPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | modesJsonPtr | Pointer to string with scan mode(s) to select, formatted as a JSON array, or empty string to select all supported modes. Scan mode names must match the names in the ScanMode enum.

#### Device_ProvidesColor(nint)

Helper to check if a particular reference white point is supported by the colorimetry data from this device.

##### Declaration

    public static bool Device_ProvidesColor(nint referenceNamePtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | referenceNamePtr | Pointer to reference white string, by its name defined in the ReferenceWhite enum (e.g. - "D50_2") to query

##### Returns

Type | Description
--- | ---
bool | True if reference is supported, false if not supported or invalid

#### Device_RegisterBatteryStateChanged(nint)

Registers a callback handler for the BatteryStateChangedDelegate, which is linked to the BatteryStateChanged event on the internal IDeviceCompat instance. The handler takes two arguments: a string argument (name of the calling event) and an int corresponding to the updated battery level (0 - 100). See BatteryStateChangedDelegate for an example handler definition.

##### Declaration

    public static void Device_RegisterBatteryStateChanged(nint handlerPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | handlerPtr | Pointer to callback function

#### Device_RegisterCommandCompleted(nint)

Registers a callback handler for the CommandCompletedDelegate, which is invoked on completion of any async operations on the internal IDeviceCompat instance. The handler takes two arguments: a string argument (name of the internal calling function) and an int corresponding to the CommandStatus of the operation. See CommandCompletedDelegate for an example handler definition.

##### Declaration

    public static void Device_RegisterCommandCompleted(nint handlerPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | handlerPtr | Pointer to callback function

#### Device_RegisterConnected(nint)

Registers a callback handler for the ConnectedDelegate, which is linked to the Connected event on the internal IDeviceCompat instance. The handler takes one string argument (name of the calling event). See ConnectedDelegate for an example handler definition.

##### Declaration

    public static void Device_RegisterConnected(nint handlerPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | handlerPtr | Pointer to callback function

#### Device_RegisterDisconnected(nint)

Registers a callback handler for the DisconnectedDelegate, which is linked to the Disconnected event on the internal IDeviceCompat instance. The handler takes two arguments: a string argument (name of the calling event) and an int corresponding to the DeviceStatus reason for disconnection. See DisconnectedDelegate for an example handler definition.

##### Declaration

    public static void Device_RegisterDisconnected(nint handlerPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | handlerPtr | Pointer to callback function

#### Device_RegisterExtPowerStateChanged(nint)

Registers a callback handler for the ExtPowerStageChangedDelegate, which is linked to the ExtPowerStateChanged event on the internal IDeviceCompat instance. The handler takes two arguments: a string argument (name of the calling event) and an bool corresponding to the external power state. See ExtPowerStageChangedDelegate for an example handler definition.

##### Declaration

    public static void Device_RegisterExtPowerStateChanged(nint handlerPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | handlerPtr | Pointer to callback function

#### Device_RunFieldCalibration(nint)

Calls RunFieldCalibrationAsync(string) on the current device. This is an async operation; it will invoke the CommandCompletedDelegate on completion with the CommandStatus of the result passed as an integer.

##### Declaration

    public static void Device_RunFieldCalibration(nint tileStringPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | tileStringPtr | Pointer to string value decoded from the reference tile QR code. For Spectro2 devices, the 5 digit code printed on the reference tile case is also accepted

#### Device_SetFieldCalibrationEnabled(bool)

Calls SetFieldCalibrationEnabledAsync(bool) on the current device. This is an async operation; it will invoke the CommandCompletedDelegate on completion with the CommandStatus of the result passed as an integer.

##### Declaration

    public static void Device_SetFieldCalibrationEnabled(bool enabled)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | enabled | New state for this option

#### Device_SetFieldCalibrationMaxDelta(double)

Updates the maximum Delta E threshold used when performing in-field calibration. This is ignored if the device does not support field calibration.

##### Declaration

    public static void Device_SetFieldCalibrationMaxDelta(double newValue)

##### Parameters

Type | Name | Description
--- | --- | ---
double | newValue |

#### Device_SetHapticFeedbackEnabled(bool)

Calls SetHapticFeedbackEnabledAsync(bool) on the current device. This is an async operation; it will invoke the CommandCompletedDelegate on completion with the CommandStatus of the result passed as an integer.

##### Declaration

    public static void Device_SetHapticFeedbackEnabled(bool enabled)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | enabled | New state for this option

#### Device_SetRgbFeedbackEnabled(bool)

Calls SetRgbFeedbackEnabledAsync(bool) on the current device. This is an async operation; it will invoke the CommandCompletedDelegate on completion with the CommandStatus of the result passed as an integer.

##### Declaration

    public static void Device_SetRgbFeedbackEnabled(bool enabled)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | enabled | New state for this option

#### Device_SetTemperatureCompensationEnabled(bool)

Calls SetTemperatureCompensationEnabledAsync(bool) on the current device. This is an async operation; it will invoke the CommandCompletedDelegate on completion with the CommandStatus of the result passed as an integer.

##### Declaration

    public static void Device_SetTemperatureCompensationEnabled(bool enabled)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | enabled | New state for this option

#### GetSdkId()

Gets the vendor identifier for the current license.

##### Declaration

    [Obsolete("Use License_GetUuid() instead", false)]
    public static nint GetSdkId()

##### Returns

Type | Description
--- | ---
nint |

#### License_Activate(nint, nint)

Activates a license. The options and signature parameters must exactly match the values provided in the SDK license. Calling this function invalidates any currently active license. Any connected device will be disconnected.

##### Declaration

    public static int License_Activate(nint optionsPtr, nint signaturePtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | optionsPtr | Pointer to license options string.
nint | signaturePtr | Pointer to license signature, used to validate the license options.

##### Returns

Type | Description
--- | ---
int | License manager state after activation as an integer. See LicenseManagerState for possible values.

#### License_Deactivate()

Deactivates the current license. Any connected device will be disconnected.

##### Declaration

    public static void License_Deactivate()

#### License_GetAllocations()

Gets a list of Nix device allocation codes associated with the current license formatted as a JSON array.

##### Declaration

    public static nint License_GetAllocations()

##### Returns

Type | Description
--- | ---
nint |

#### License_GetAllowedDeviceTypes()

Gets a list of device types supported by the current license, formatted as a JSON array of integer values. See DeviceType for possible integer values.

##### Declaration

    public static nint License_GetAllowedDeviceTypes()

##### Returns

Type | Description
--- | ---
nint |

#### License_GetExpiryJavaTicks()

Gets the expiry time for the current license represented as a ulong. This corresponds to the milliseconds since the Unix epoch (January 1, 1970 00:00 UTC).

##### Declaration

    public static ulong License_GetExpiryJavaTicks()

##### Returns

Type | Description
--- | ---
ulong |

#### License_GetFeatures()

Gets a list of supported features for the current license, formatted as a JSON array of integer values. See LicenseFeature for possible integer values.

##### Declaration

    public static nint License_GetFeatures()

##### Returns

Type | Description
--- | ---
nint |

#### License_GetLibraryVersion()

Gets the current version of the `NixUniversalSDK`.

##### Declaration

    public static nint License_GetLibraryVersion()

##### Returns

Type | Description
--- | ---
nint |

#### License_GetLibraryWrapperVersion()

Gets the current version of the wrapper library for the `NixUniversalSDK`.

##### Declaration

    public static nint License_GetLibraryWrapperVersion()

##### Returns

Type | Description
--- | ---
nint |

#### License_GetState()

Gets the current State as an int. See LicenseManagerState for possible values.

##### Declaration

    public static int License_GetState()

##### Returns

Type | Description
--- | ---
int |

#### License_GetUuid()

Gets the vendor identifier for the current license.

##### Declaration

    public static nint License_GetUuid()

##### Returns

Type | Description
--- | ---
nint |

#### License_IsDeviceTypeSupported(int)

Checks if the current license supports the specified device type. See DeviceType for valid device type values.

##### Declaration

    public static bool License_IsDeviceTypeSupported(int typeInt)

##### Parameters

Type | Name | Description
--- | --- | ---
int | typeInt |

##### Returns

Type | Description
--- | ---
bool |

#### License_IsFeatureEnabled(int)

Checks if the current license supports the specified feature. See LicenseFeature for valid feature values.

##### Declaration

    public static bool License_IsFeatureEnabled(int featureInt)

##### Parameters

Type | Name | Description
--- | --- | ---
int | featureInt |

##### Returns

Type | Description
--- | ---
bool |

#### Measurement_GetLastColorJson(nint, nint, nint)

Gets tristimulus colorimetry data for the last measurement in the selected scan mode, reference white, and color type, formatted as JSON. Result is empty ("") if the measurement mode or reference white is not available for the last measurement.

##### Declaration

    public static nint Measurement_GetLastColorJson(nint scanModeNamePtr, nint referenceNamePtr, nint typeNamePtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | scanModeNamePtr | Pointer to scan mode name to select, which must match one of the names in the ScanMode enum (e.g. - "M0", "M1", or "M2")
nint | referenceNamePtr | Pointer to reference white to select, which must match one of the names in the ReferenceWhite enum (e.g. - "D50_2")
nint | typeNamePtr | Pointer to color type to select, which must match one of the names in the ColorType enum (e.g. - "CIEXYZ", "CIELAB", "CIELCH", "CIELUV")

##### Returns

Type | Description
--- | ---
nint | Colorimetry data formatted as JSON

##### Examples

An example of calling this function is shown below:

    string color = Measurement_GetLastColorJson("M2", "D50_2", "CIEXYZ");

Example JSON output:

    {
        "mode": "M2",
        "reference": "D50_2",
        "type": "CIEXYZ",
        "value": [
            0.3444101768980547,
            0.18339852869976314,
            0.15600230435248466
        ]
    }

#### Measurement_GetLastDensityJson(nint, nint)

Gets ISO density data for the last measurement in the selected scan mode and density status setting, formatted as JSON. Result is empty ("") if density data is not available.

##### Declaration

    public static nint Measurement_GetLastDensityJson(nint scanModeNamePtr, nint densityStatusNamePtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | scanModeNamePtr | Pointer to name of the scan mode to select, which must match one of the names in the ScanMode enum (e.g. - "M0", "M1", or "M2")
nint | densityStatusNamePtr | Pointer to name of the ISO density setting to select, which must match one of the names in the DensityStatus enum (e.g. - "A", "E", "I", "T")

##### Returns

Type | Description
--- | ---
nint | Density data formatted as JSON

##### Examples

An example of calling this function is shown below:

    string density = Measurement_GetLastDensityJson("M2", "T");

Example JSON output:

    {
        "mode": "M2",
        "isoStatus": "T",
        "autoIndex": 1,
        "value": [
            0.2709233297197278,
            1.2105773026488242,
            0.7482882315988111,
            0.6266073723704548
        ]
    }

#### Measurement_GetLastHexCode(nint, nint)

Gets sRGB value for the last measurement in the selected scan mode and reference white, as a HEX triplet. Result is empty ("") if the measurement mode or reference white is not available for the last measurement.

##### Declaration

    public static nint Measurement_GetLastHexCode(nint scanModeNamePtr, nint referenceNamePtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | scanModeNamePtr | Pointer to scan mode name to select, which must match one of the names in the ScanMode enum (e.g. - "M0", "M1", or "M2")
nint | referenceNamePtr | Pointer to reference white to select, which must match one of the names in the ReferenceWhite enum (e.g. - "D50_2")

##### Returns

Type | Description
--- | ---
nint | sRGB value as a HEX triplet (e.g. "#RRGGBB"), or empty string ("") on error

##### Examples

An example of calling this function is shown below:

    string hexCode = Measurement_GetLastHexCode("M2", "D50_2");

Example output:

    #DB267C

#### Measurement_GetLastJavaTicks()

Gets the time stamp for the last measurement, represented as a UInt64, or 0 if not available. This corresponds to the milliseconds since the Unix epoch (January 1, 1970 00:00 UTC).

##### Declaration

    public static ulong Measurement_GetLastJavaTicks()

##### Returns

Type | Description
--- | ---
ulong |

#### Measurement_GetLastMetadataJson(nint)

Gets metadata (device type, device settings, temperature) for the last measurement, formatted as JSON.

##### Declaration

    public static nint Measurement_GetLastMetadataJson(nint scanModeNamePtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | scanModeNamePtr | Pointer to name of the scan mode to select, which must match one of the names in the ScanMode enum (e.g. - "M0", "M1", or "M2")

##### Returns

Type | Description
--- | ---
nint | Measurement metadata formatted as JSON

##### Examples

An example of calling this function is shown below:

    string metadata = Measurement_GetLastMetadataJson("M2");

Example JSON output:

    {
        "dateMs": 1682005505841,
        "status": 1,
        "deviceName": "Nix Spectro 2",
        "deviceType": 5,
        "mode": "M2",
        "tRef": 24.25,
        "tScan": 24.5625,
        "tReal": true,
        "tCompEnabled": true,
        "tileEnabled": true
    }

#### Measurement_GetLastModesJson()

Gets a list of modes available for the last measurement, formatted as JSON.

##### Declaration

    public static nint Measurement_GetLastModesJson()

##### Returns

Type | Description
--- | ---
nint |

##### Examples

Example JSON output:

    ["M0","M1","M2"]

#### Measurement_GetLastReferencesJson(nint)

Gets a list of reference white names available for the last measurement, formatted as JSON.

##### Declaration

    public static nint Measurement_GetLastReferencesJson(nint scanModeNamePtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | scanModeNamePtr | Pointer to scan mode name to select, which must match one of the names in the ScanMode enum (e.g. - "M0", "M1", or "M2")

##### Returns

Type | Description
--- | ---
nint |

##### Examples

An example of calling this function is shown below:

    string references = Measurement_GetLastReferencesJson("M2");

Example JSON output:

    ["D50_2","D65_10"]

#### Measurement_GetLastSpectralJson(nint)

Gets spectral data for the last measurement in the selected scan mode, formatted as JSON. Result is empty ("") if spectral data is not available.

##### Declaration

    public static nint Measurement_GetLastSpectralJson(nint scanModeNamePtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | scanModeNamePtr | Pointer to name of the scan mode to select, which must match one of the names in the ScanMode enum (e.g. - "M0", "M1", or "M2")

##### Returns

Type | Description
--- | ---
nint | Spectral data formatted as JSON

##### Examples

An example of calling this function is shown below:

    string spectral = Measurement_GetLastSpectralJson("M2");

Example JSON output:

    {
        "mode": "M2",
        "lambdaMin": 400,
        "lambdaInterval": 10,
        "value": [
            0.09571632,
            0.143246919,
            0.201270252,
            0.233701661,
            0.229667112,
            0.219201699,
            0.197433069,
            0.171539515,
            0.14366518,
            0.118656777,
            0.102365054,
            0.0851489082,
            0.066573441,
            0.0530253462,
            0.0496698469,
            0.0497059524,
            0.0470496677,
            0.0388559736,
            0.0423551463,
            0.123382688,
            0.342879653,
            0.608318865,
            0.770111382,
            0.84290266,
            0.88257581,
            0.898779333,
            0.898909926,
            0.902816713,
            0.904295564,
            0.906794488,
            0.906649113
        ]
    }

#### Measurement_GetLastStatus()

Gets the CommandStatus of the last measurement, represented as an Int32.

##### Declaration

    public static int Measurement_GetLastStatus()

##### Returns

Type | Description
--- | ---
int |

#### Scanner_GetSortedResults(int)

Gets a snapshot of the nearby devices list, sorted by signal strength and serialized as a JSON string. This command only provides a snapshot of the list, but does not update it. The list is updated while the IDeviceScanner is running; to update the list, call Scanner_Start(int, int, int) or Scanner_SearchForId(nint, int).

##### Declaration

    public static nint Scanner_GetSortedResults(int maxCount = -1)

##### Parameters

Type | Name | Description
--- | --- | ---
int | maxCount | Maximum number of devices to report. Set to -1 to report all devices

##### Returns

Type | Description
--- | ---
nint | List of nearby devices serialized as JSON string

##### Examples

An example of calling this function is shown below:

    string list = Scanner_GetSortedResults(5);

Example JSON output:

    [
        {
            "id": "COM3",
            "interfaceType": 2,
            "name": "Nix Spectro 2",
            "rssi": 0,
            "type": 5
        },
        {
            "id": "D2:4F:5C:5C:54:40",
            "interfaceType": 1,
            "name": "Nix Mini 3",
            "rssi": -50,
            "type": 6
        },
        {
            "id": "F8:CA:CF:4A:3C:03",
            "interfaceType": 1,
            "name": "Nix Spectro 2",
            "rssi": -53,
            "type": 5
        },
        {
            "id": "D0:92:BA:D3:13:3A",
            "interfaceType": 1,
            "name": "Nix Spectro 2",
            "rssi": -54,
            "type": 5
        },
        {
            "id": "CB:80:63:06:CD:9F",
            "interfaceType": 1,
            "name": "Nix Spectro 2",
            "rssi": -55,
            "type": 5
        }
    ]

#### Scanner_GetState()

Gets the current State as an Int32

##### Declaration

    public static int Scanner_GetState()

##### Returns

Type | Description
--- | ---
int |

#### Scanner_HasFoundDevice(nint)

Checks if the specified device ID has been found by the IDeviceScanner.

##### Declaration

    public static bool Scanner_HasFoundDevice(nint idPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | idPtr | Pointer to ID string, corresponding to (Id)

##### Returns

Type | Description
--- | ---
bool | True if the device has been found

#### Scanner_ListUsbDevices()

Runs a listing for all available Nix devices attached via USB. This will invoke the ScanResultDelegate callback when the listing is complete.

##### Declaration

    public static void Scanner_ListUsbDevices()

#### Scanner_RegisterCreated(nint)

Registers a callback handler for the ScannerCreatedDelegate, which is linked to the ScannerCreated event on the internal DeviceScanner instance. The handler takes two arguments: a string argument (name of the calling event) and an int corresponding to the DeviceScannerState after initialization. See ScannerCreatedDelegate for an example handler definition.

##### Declaration

    public static void Scanner_RegisterCreated(nint handlerPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | handlerPtr | Pointer to callback function

#### Scanner_RegisterScanResult(nint)

Registers a callback handler for the ScanResultDelegate, which is linked to the ScanResult event on the internal DeviceScanner instance. The handler takes two arguments: a string argument (name of the calling event) and a string containing scan results. The scan results are formatted in the same manner as Scanner_GetSortedResults(int). See ScanResultDelegate for an example handler definition.

##### Declaration

    public static void Scanner_RegisterScanResult(nint handlerPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | handlerPtr | Pointer to callback function

#### Scanner_RegisterStarted(nint)

Registers a callback handler for the ScannerStartedDelegate, which is linked to the ScannerStarted event on the internal DeviceScanner instance. The handler takes one string argument (name of the calling event). See ScannerStartedDelegate for an example handler definition.

##### Declaration

    public static void Scanner_RegisterStarted(nint handlerPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | handlerPtr | Pointer to callback function

#### Scanner_RegisterStopped(nint)

Registers a callback handler for the ScannerStoppedDelegate, which is linked to the ScannerStopped event on the internal DeviceScanner instance. The handler takes one string argument (name of the calling event). See ScannerStoppedDelegate for an example handler definition.

##### Declaration

    public static void Scanner_RegisterStopped(nint handlerPtr)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | handlerPtr | Pointer to callback function

#### Scanner_Reset()

Checks the Bluetooth adapter state again and resets the IDeviceScanner instance. This will invoke the ScannerCreatedDelegate callback upon completion.

##### Declaration

    public static void Scanner_Reset()

#### Scanner_SearchForId(nint, int)

Searches for a specific Nix device via USB and Bluetooth. The search will run until the specified device is found, or until the specified time interval elapses, whichever is shorter. This will invoke the ScanResultDelegate callback when the device is found.

##### Declaration

    public static void Scanner_SearchForId(nint idPtr, int scanPeriodMs = 10000)

##### Parameters

Type | Name | Description
--- | --- | ---
nint | idPtr | Pointer to specific device ID to find
int | scanPeriodMs | Maximum time period in milliseconds to run the search, as an Int32

#### Scanner_Start(int, int, int)

Starts a device search for the specified length of time, maximum callback interval, and report length. This will invoke the ScannerStartedDelegate callback on start, ScannerStoppedDelegate callback on stop, and ScanResultDelegate callback when the device list updates.

##### Declaration

    public static void Scanner_Start(int scanPeriodMs = 20000, int maxReportIntervalMs = 250, int maxReportCount = 25)

##### Parameters

Type | Name | Description
--- | --- | ---
int | scanPeriodMs | Length of time in milliseconds to run the device search, as an Int32
int | maxReportIntervalMs | Maximum interval in milliseconds to invoke the ScanResultDelegate callback, as an Int32
int | maxReportCount | Maximum number of devices to report in the ScanResultDelegate callback, as an Int32

#### Scanner_Stop()

Stops a device search if one is currently running. This will invoke the ScannerStoppedDelegate callback once the scanner changes from a running state to a stopped state.

##### Declaration

    public static void Scanner_Stop()