Skip to content

Group Connecting

Modules > Connecting

Functions for building and connecting to a ScanSystem.

These function allow you to add ScanHeads to a ScanSystem and Connect or Disconnect.

Public Functions

Type Name
bool jsScanHeadIsConnected (jsScanHead scan_head)
Obtains the connection state of a given scan head.
int32_t jsScanSystemConnect (jsScanSystem scan_system, int32_t timeout_s)
Attempts to connect to all scan heads within the system.
jsScanSystem jsScanSystemCreate (jsUnits units)
Creates a jsScanSystem used to manage and coordinatejsScanHead objects.
jsScanHead jsScanSystemCreateScanHead (jsScanSystem scan_system, uint32_t serial, uint32_t id)
Creates a jsScanHead object representing a physical scan head within the system.
int32_t jsScanSystemDisconnect (jsScanSystem scan_system)
Disconnects all scan heads from a given system.
int jsScanSystemDiscover (jsScanSystem scan_system)
Performs a network discovery to determine what scan heads are on the network.
void jsScanSystemFree (jsScanSystem scan_system)
Frees a jsScanSystem and all resources associated with it. In particular, this will free alljsScanHead objects created by this object.
int jsScanSystemGetDiscovered (jsScanSystem scan_system, jsDiscovered * results, uint32_t max_results)
Obtains a list of all of the scan heads discovered on the network.
int32_t jsScanSystemGetNumberScanHeads (jsScanSystem scan_system)
Returns the total number of scan heads within a given system. This should equal the number of times jsScanSystemCreateScanHead() was successfully called with a new serial number.
int jsScanSystemGetScanSyncDiscovered (jsScanSystem scan_system, jsScanSyncDiscovered * results, uint32_t max_results)
Obtains a list of all of the ScanSyncs discovered on the network.
bool jsScanSystemIsConnected (jsScanSystem scan_system)
Gets connected state for a scan system.
int jsScanSystemScanSyncDiscover (jsScanSystem scan_system)
Performs a network discovery to determine what ScanSyncs are on the network.

Public Functions Documentation

jsScanHeadIsConnected

Obtains the connection state of a given scan head.

bool jsScanHeadIsConnected(
    jsScanHead scan_head
) 

Parameters:

  • scan_head Reference to scan head.

Returns:

Boolean true on connected, false otherwise.


jsScanSystemConnect

Attempts to connect to all scan heads within the system.

int32_t jsScanSystemConnect(
    jsScanSystem scan_system,
    int32_t timeout_s
) 

Parameters:

  • scan_system Reference to system owning scan heads to connect to.
  • timeout_s TCP timeout for all managed scan heads in seconds.

Returns:

The total number of connected scan heads on success, negative value mapping to jsError on error.


jsScanSystemCreate

Creates a jsScanSystem used to manage and coordinatejsScanHead objects.

jsScanSystem jsScanSystemCreate(
    jsUnits units
) 

Parameters:

  • units The units the scan system and all scan heads will use.

Returns:

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


jsScanSystemCreateScanHead

Creates a jsScanHead object representing a physical scan head within the system.

jsScanHead jsScanSystemCreateScanHead(
    jsScanSystem scan_system,
    uint32_t serial,
    uint32_t id
) 

Note:

This function can only be called when the scan system is disconnected. Once jsScanSystemConnect() is called, jsScanSystemDisconnect() must be called if new scan heads are desired to be created.

Parameters:

  • scan_system Reference to system that will own the scan head.
  • serial The serial number of the physical scan head.
  • id A user defined numerically unique id to assign to this scan head.

Returns:

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


jsScanSystemDisconnect

Disconnects all scan heads from a given system.

int32_t jsScanSystemDisconnect(
    jsScanSystem scan_system
) 

Parameters:

  • scan_system Reference to system of scan heads.

Returns:

0 on success, negative value jsError on error.


jsScanSystemDiscover

Performs a network discovery to determine what scan heads are on the network.

int jsScanSystemDiscover(
    jsScanSystem scan_system
) 

Parameters:

  • scan_system The scan system to perform discovery.

Returns:

The total number of discovered scan heads on success, negative value mapping to jsError on error.


jsScanSystemFree

Frees a jsScanSystem and all resources associated with it. In particular, this will free alljsScanHead objects created by this object.

void jsScanSystemFree(
    jsScanSystem scan_system
) 

Parameters:

  • scan_system Reference to system that will be freed.

jsScanSystemGetDiscovered

Obtains a list of all of the scan heads discovered on the network.

int jsScanSystemGetDiscovered(
    jsScanSystem scan_system,
    jsDiscovered * results,
    uint32_t max_results
) 

Parameters:

  • scan_system The scan system that previously performed discovery.
  • results Pointer to memory to store discover data. Note, the memory pointed to by results must be at least sizeof(jsDiscovered) * max_results in total number of bytes.
  • max_results The maximum number of discovered results to read.

Returns:

The total number of discovered scan heads on success, negative value mapping to jsError on error.


jsScanSystemGetNumberScanHeads

Returns the total number of scan heads within a given system. This should equal the number of times jsScanSystemCreateScanHead() was successfully called with a new serial number.

int32_t jsScanSystemGetNumberScanHeads(
    jsScanSystem scan_system
) 

Parameters:

  • scan_system Reference to system that owns the scan heads.

Returns:

The number of scan heads on success, negative value mapping to jsError on error.


jsScanSystemGetScanSyncDiscovered

Obtains a list of all of the ScanSyncs discovered on the network.

int jsScanSystemGetScanSyncDiscovered(
    jsScanSystem scan_system,
    jsScanSyncDiscovered * results,
    uint32_t max_results
) 

Parameters:

  • scan_system The scan system that previously performed discovery.
  • results Pointer to memory to store discover data. Note, the memory pointed to by results must be at least sizeof(jsScanSyncDiscovered) * max_results in total number of bytes.
  • max_results The maximum number of discovered results to read.

Returns:

The total number of discovered ScanSyncs on success, negative value mapping to jsError on error.


jsScanSystemIsConnected

Gets connected state for a scan system.

bool jsScanSystemIsConnected(
    jsScanSystem scan_system
) 

Note:

A scan system is said to be connected if all of the scan heads associated with it are connected.

Parameters:

  • scan_system Reference to system of scan heads.

Returns:

Boolean true if connected, false if disconnected.


jsScanSystemScanSyncDiscover

Performs a network discovery to determine what ScanSyncs are on the network.

int jsScanSystemScanSyncDiscover(
    jsScanSystem scan_system
) 

Parameters:

  • scan_system The scan system to perform discovery.

Returns:

The total number of discovered ScanSyncs on success, negative value mapping to jsError on error.