Table of Contents

Class Exported

Namespace
NixUniversalSDK.Wrapper
Assembly
NixUniversalSDK.Wrapper.dll

Exported static functions

public static class Exported
Inheritance
Exported
Inherited Members

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().

public static void Device_Connect(nint idPtr)

Parameters

idPtr nint

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.

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.

public static int Device_GetBatteryLevel()

Returns

int

Device_GetExtPowerState()

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

public static bool Device_GetExtPowerState()

Returns

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.

public static bool Device_GetFieldCalibrationDue()

Returns

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.

public static bool Device_GetFieldCalibrationEnabled()

Returns

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.

public static double Device_GetFieldCalibrationMaxDelta()

Returns

double

Device_GetFirmwareVersion()

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

public static nint Device_GetFirmwareVersion()

Returns

nint

Device_GetHapticFeedbackEnabled()

Flag to indicate if device haptic feedback is enabled.

public static bool Device_GetHapticFeedbackEnabled()

Returns

bool

Device_GetHardwareVersion()

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

public static nint Device_GetHardwareVersion()

Returns

nint

Device_GetId()

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

public static nint Device_GetId()

Returns

nint

Device_GetInterfaceType()

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

public static int Device_GetInterfaceType()

Returns

int

Device_GetLastCalibrationDebug()

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

public static nint Device_GetLastCalibrationDebug()

Returns

nint

Device_GetLastCalibrationStatus()

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

public static int Device_GetLastCalibrationStatus()

Returns

int

Device_GetName()

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

public static nint Device_GetName()

Returns

nint

Device_GetNote()

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

public static nint Device_GetNote()

Returns

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.

public static bool Device_GetPowerState()

Returns

bool

Device_GetProvidesDensity()

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

public static bool Device_GetProvidesDensity()

Returns

bool

Device_GetProvidesSpectral()

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

public static bool Device_GetProvidesSpectral()

Returns

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).

public static ulong Device_GetReferenceJavaTicks()

Returns

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.

public static float Device_GetReferenceTemperature()

Returns

float

Device_GetRgbFeedbackEnabled()

Flag to indicate if device RGB feedback is enabled.

public static bool Device_GetRgbFeedbackEnabled()

Returns

bool

Device_GetScanCount()

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

public static uint Device_GetScanCount()

Returns

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.

public static float Device_GetScanTemperature()

Returns

float

Device_GetSerialNumber()

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

public static nint Device_GetSerialNumber()

Returns

nint

Device_GetSoftwareVersion()

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

public static nint Device_GetSoftwareVersion()

Returns

nint

Device_GetState()

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

public static int Device_GetState()

Returns

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.

public static nint Device_GetSupportedModes()

Returns

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.

public static nint Device_GetSupportedReferences()

Returns

nint

Device_GetSupportsFieldCalibration()

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

public static bool Device_GetSupportsFieldCalibration()

Returns

bool

Device_GetSupportsHapticFeedback()

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

public static bool Device_GetSupportsHapticFeedback()

Returns

bool

Device_GetSupportsRgbFeedback()

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

public static bool Device_GetSupportsRgbFeedback()

Returns

bool

Device_GetSupportsTemperatureCompensation()

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

public static bool Device_GetSupportsTemperatureCompensation()

Returns

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.

public static bool Device_GetTemperatureCompensationEnabled()

Returns

bool

Device_GetType()

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

public static int Device_GetType()

Returns

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.

public static bool Device_HasOptions()

Returns

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.

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.

public static bool Device_IsModeSupported(nint scanModeNamePtr)

Parameters

scanModeNamePtr nint

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

Returns

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.

public static bool Device_IsTileStringValid(nint tileStringPtr)

Parameters

tileStringPtr nint

Pointer to string value decoded from the reference tile QR code

Returns

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.

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.

public static void Device_Measure(nint modesJsonPtr)

Parameters

modesJsonPtr nint

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.

public static bool Device_ProvidesColor(nint referenceNamePtr)

Parameters

referenceNamePtr nint

Pointer to reference white string, by its name defined in the ReferenceWhite enum (e.g. - "D50_2") to query

Returns

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.

public static void Device_RegisterBatteryStateChanged(nint handlerPtr)

Parameters

handlerPtr nint

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.

public static void Device_RegisterCommandCompleted(nint handlerPtr)

Parameters

handlerPtr nint

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.

public static void Device_RegisterConnected(nint handlerPtr)

Parameters

handlerPtr nint

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.

public static void Device_RegisterDisconnected(nint handlerPtr)

Parameters

handlerPtr nint

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.

public static void Device_RegisterExtPowerStateChanged(nint handlerPtr)

Parameters

handlerPtr nint

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.

public static void Device_RunFieldCalibration(nint tileStringPtr)

Parameters

tileStringPtr nint

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.

public static void Device_SetFieldCalibrationEnabled(bool enabled)

Parameters

enabled bool

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.

public static void Device_SetFieldCalibrationMaxDelta(double newValue)

Parameters

newValue double

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.

public static void Device_SetHapticFeedbackEnabled(bool enabled)

Parameters

enabled bool

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.

public static void Device_SetRgbFeedbackEnabled(bool enabled)

Parameters

enabled bool

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.

public static void Device_SetTemperatureCompensationEnabled(bool enabled)

Parameters

enabled bool

New state for this option

GetSdkId()

Gets the vendor identifier for the current license.

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

Returns

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.

public static int License_Activate(nint optionsPtr, nint signaturePtr)

Parameters

optionsPtr nint

Pointer to license options string.

signaturePtr nint

Pointer to license signature, used to validate the license options.

Returns

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.

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.

public static nint License_GetAllocations()

Returns

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.

public static nint License_GetAllowedDeviceTypes()

Returns

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).

public static ulong License_GetExpiryJavaTicks()

Returns

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.

public static nint License_GetFeatures()

Returns

nint

License_GetLibraryVersion()

Gets the current version of the NixUniversalSDK.

public static nint License_GetLibraryVersion()

Returns

nint

License_GetLibraryWrapperVersion()

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

public static nint License_GetLibraryWrapperVersion()

Returns

nint

License_GetState()

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

public static int License_GetState()

Returns

int

License_GetUuid()

Gets the vendor identifier for the current license.

public static nint License_GetUuid()

Returns

nint

License_IsDeviceTypeSupported(int)

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

public static bool License_IsDeviceTypeSupported(int typeInt)

Parameters

typeInt int

Returns

bool

License_IsFeatureEnabled(int)

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

public static bool License_IsFeatureEnabled(int featureInt)

Parameters

featureInt int

Returns

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.

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

Parameters

scanModeNamePtr nint

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

referenceNamePtr nint

Pointer to reference white to select, which must match one of the names in the ReferenceWhite enum (e.g. - "D50_2")

typeNamePtr nint

Pointer to color type to select, which must match one of the names in the ColorType enum (e.g. - "CIEXYZ", "CIELAB", "CIELCH", "CIELUV")

Returns

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.

public static nint Measurement_GetLastDensityJson(nint scanModeNamePtr, nint densityStatusNamePtr)

Parameters

scanModeNamePtr nint

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")

densityStatusNamePtr nint

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

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.

public static nint Measurement_GetLastHexCode(nint scanModeNamePtr, nint referenceNamePtr)

Parameters

scanModeNamePtr nint

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

referenceNamePtr nint

Pointer to reference white to select, which must match one of the names in the ReferenceWhite enum (e.g. - "D50_2")

Returns

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).

public static ulong Measurement_GetLastJavaTicks()

Returns

ulong

Measurement_GetLastMetadataJson(nint)

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

public static nint Measurement_GetLastMetadataJson(nint scanModeNamePtr)

Parameters

scanModeNamePtr nint

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

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.

public static nint Measurement_GetLastModesJson()

Returns

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.

public static nint Measurement_GetLastReferencesJson(nint scanModeNamePtr)

Parameters

scanModeNamePtr nint

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

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.

public static nint Measurement_GetLastSpectralJson(nint scanModeNamePtr)

Parameters

scanModeNamePtr nint

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

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.

public static int Measurement_GetLastStatus()

Returns

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).

public static nint Scanner_GetSortedResults(int maxCount = -1)

Parameters

maxCount int

Maximum number of devices to report. Set to -1 to report all devices

Returns

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

public static int Scanner_GetState()

Returns

int

Scanner_HasFoundDevice(nint)

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

public static bool Scanner_HasFoundDevice(nint idPtr)

Parameters

idPtr nint

Pointer to ID string, corresponding to (Id)

Returns

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.

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.

public static void Scanner_RegisterCreated(nint handlerPtr)

Parameters

handlerPtr nint

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.

public static void Scanner_RegisterScanResult(nint handlerPtr)

Parameters

handlerPtr nint

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.

public static void Scanner_RegisterStarted(nint handlerPtr)

Parameters

handlerPtr nint

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.

public static void Scanner_RegisterStopped(nint handlerPtr)

Parameters

handlerPtr nint

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.

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.

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

Parameters

idPtr nint

Pointer to specific device ID to find

scanPeriodMs int

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.

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

Parameters

scanPeriodMs int

Length of time in milliseconds to run the device search, as an Int32

maxReportIntervalMs int

Maximum interval in milliseconds to invoke the ScanResultDelegate callback, as an Int32

maxReportCount int

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.

public static void Scanner_Stop()