new DeviceFingerprintUtility(adapter)
A general-purpose set of utility and helper functions for computing what K4 Device Class a given device belongs to.
Parameters:
| Name | Type | Description |
|---|---|---|
adapter |
Adapter |
Methods
calculateDeviceClass(identifierFieldNames, inputDeviceCandidateValues, fallbackClsNameopt) → {String}
Based on the supplied identifier field names/types to check against, and a fallback default class name, computes the appropriate device class.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
identifierFieldNames |
Array.<String> | A list of accepted field names to use from the device mapping fingerprint against which to compare a supplied set of input candidate values. |
|
inputDeviceCandidateValues |
Object | Key-value pairs of information from the device candidate to investigate and compare against the specified field names from each device fingerprint in the mappings. |
|
fallbackClsName |
String |
<optional> |
If no device class match is found, use this device class. |
Returns:
Returns the matching device class for the candidate values supplied compared against the select fields from the device fingerprint. If no class is found, the fallback class string is returned. If that too is not specified, an empty string is returned.
- Type
- String