Skip to content

Group Miscellaneous

Modules > Miscellaneous

These functions are general helpers to dealing with errors etc.

These methods are not used in the setup and usage of the scan system and profile gathering. They do provide useful diagnostic information, such as firmware version, scan head status, and error descriptions.

Public Functions

Type Name
void jsGetAPISemanticVersion (uint32_t * major, uint32_t * minor, uint32_t * patch)
Obtains the semantic version of the client API presented as unsigned integer values.
void jsGetAPIVersion (const char ** version_str)
Obtains the semantic version of the client API presented in this header. The version string will be of the form vX.Y.Z , whereX is the major version number,Y is the minor version number, andZ is the patch number. In some cases, additional information may be appended to the version string, separated by hyphens.
void jsGetError (int32_t return_code, const char ** error_str)
Converts a jsError error value returned from an API function call to a string value.
int32_t jsPowerCycleScanHead (uint32_t serial_number)
Performs a remote soft power cycle of a scan head.
int32_t jsScanHeadGetCapabilities (jsScanHead scan_head, jsScanHeadCapabilities * capabilities)
Obtains the capabilities for a given scan head.
int32_t jsScanHeadGetFirmwareVersion (jsScanHead scan_head, uint32_t * major, uint32_t * minor, uint32_t * patch)
Obtains the firmware version of the scan head presented as unsigned integer values.
uint32_t jsScanHeadGetId (jsScanHead scan_head)
Obtains the ID of the scan head.
int32_t jsScanHeadGetLastErrorExtended (jsScanHead scan_head, const char ** error_extended_str)
When a jsScanHead function returns an error, this function can be called immediately after to obtain a more detailed message regarding the error.
uint32_t jsScanHeadGetSerial (jsScanHead scan_head)
Obtains the serial number of the scan head.
int32_t jsScanHeadGetStatus (jsScanHead scan_head, jsScanHeadStatus * status)
Reads the last reported status update from a scan head.
int jsScanSystemGetEncoder (jsScanSystem scan_system, jsEncoder encoder, int64_t * value)
int32_t jsScanSystemGetLastErrorExtended (jsScanSystem scan_system, const char ** error_extended_str)
When a jsScanSystem function returns an error, this function can be called immediately after to obtain a more detailed message regarding the error.
jsScanHead jsScanSystemGetScanHeadById (jsScanSystem scan_system, uint32_t id)
Obtains a reference to an existing jsScanHead object.

Public Functions Documentation

jsGetAPISemanticVersion

Obtains the semantic version of the client API presented as unsigned integer values.

void jsGetAPISemanticVersion(
    uint32_t * major,
    uint32_t * minor,
    uint32_t * patch
) 

Parameters:

  • major The major version number.
  • minor The minor version number.
  • patch The patch version number.

jsGetAPIVersion

Obtains the semantic version of the client API presented in this header. The version string will be of the form vX.Y.Z , whereX is the major version number,Y is the minor version number, andZ is the patch number. In some cases, additional information may be appended to the version string, separated by hyphens.

void jsGetAPIVersion(
    const char ** version_str
) 

Parameters:

  • version_str Address to be updated with API version string.

jsGetError

Converts a jsError error value returned from an API function call to a string value.

void jsGetError(
    int32_t return_code,
    const char ** error_str
) 

Parameters:

  • return_code The jsError value returned from API call.
  • error_str Address to be updated with error string.

jsPowerCycleScanHead

Performs a remote soft power cycle of a scan head.

int32_t jsPowerCycleScanHead(
    uint32_t serial_number
) 

Note:

This function will only work with scan heads running v16.x.x firmware or higher.

Note:

Extreme care should be used when using this function. The scan head being power cycled should NOT be connected or scanning. It is recommended to have the entire scan system in a disconnected state.

Note:

After this function successfully completes, it will take several seconds before the scan head will appear on the network and be available for use. On average, the scan head will take 30 seconds to reboot.

Parameters:

  • serial_number The serial number of the scan head to power cycle.

Returns:

0 on success, negative value jsError on error.


jsScanHeadGetCapabilities

Obtains the capabilities for a given scan head.

int32_t jsScanHeadGetCapabilities(
    jsScanHead scan_head,
    jsScanHeadCapabilities * capabilities
) 

Parameters:

  • type The scan head product type to obtain capabilities for.
  • capabilities Pointer to struct to be filled with capabilities.

Returns:

0 on success, negative value mapping to jsError on error.


jsScanHeadGetFirmwareVersion

Obtains the firmware version of the scan head presented as unsigned integer values.

int32_t jsScanHeadGetFirmwareVersion(
    jsScanHead scan_head,
    uint32_t * major,
    uint32_t * minor,
    uint32_t * patch
) 

Parameters:

  • major The major version number.
  • minor The minor version number.
  • patch The patch version number.

Returns:

0 on success, negative value mapping to jsError on error.


jsScanHeadGetId

Obtains the ID of the scan head.

uint32_t jsScanHeadGetId(
    jsScanHead scan_head
) 

Parameters:

  • scan_head Reference to scan head.

Returns:

The numeric ID of the scan head.


jsScanHeadGetLastErrorExtended

When a jsScanHead function returns an error, this function can be called immediately after to obtain a more detailed message regarding the error.

int32_t jsScanHeadGetLastErrorExtended(
    jsScanHead scan_head,
    const char ** error_extended_str
) 

Note:

Calling another jsScanHead function will clear the error message set from a previous function call.

Parameters:

  • scan_head The scan head that encountered an error.
  • error_extended_str Address to be updated with detailed error string.

jsScanHeadGetSerial

Obtains the serial number of the scan head.

uint32_t jsScanHeadGetSerial(
    jsScanHead scan_head
) 

Parameters:

  • scan_head Reference to scan head.

Returns:

The serial number of the scan head.


jsScanHeadGetStatus

Reads the last reported status update from a scan head.

int32_t jsScanHeadGetStatus(
    jsScanHead scan_head,
    jsScanHeadStatus * status
) 

Parameters:

  • scan_head Reference to scan head.
  • status Pointer to be updated with status contents.

Returns:

0 on success, negative value mapping to jsError on error.


jsScanSystemGetEncoder

int jsScanSystemGetEncoder(
    jsScanSystem scan_system,
    jsEncoder encoder,
    int64_t * value
) 

Deprecated

Will be removed in a future release. Use jsScanSystemGetScanSyncStatus instead.

Returns:

JS_ERROR_DEPRECATED.


jsScanSystemGetLastErrorExtended

When a jsScanSystem function returns an error, this function can be called immediately after to obtain a more detailed message regarding the error.

int32_t jsScanSystemGetLastErrorExtended(
    jsScanSystem scan_system,
    const char ** error_extended_str
) 

Note:

Calling another jsScanSystem function will clear the error message set from a previous function call.

Parameters:

  • scan_system The scan system that encountered an error.
  • error_extended_str Address to be updated with detailed error string.

jsScanSystemGetScanHeadById

Obtains a reference to an existing jsScanHead object.

jsScanHead jsScanSystemGetScanHeadById(
    jsScanSystem scan_system,
    uint32_t id
) 

Parameters:

  • scan_system Reference to system that owns the scan head.
  • id The numeric ID of the jsScanHead object.

Returns:

Positive valued token on success, negative value mapping to jsError on error.