API Documentation

Host

The Host API provides access to runtime information about the local machine. The API allows applications to monitor the system status, CPU utilization, and to ensure correct runtime configurations prior to recording data. The API also allows the ability to get and set license utilities, such as license server and certificates.

Usage #include <polysync_host.h>

Functions

psync_host_get_cpu_count ( … )

This function will get the number of online CPU’s on the host.

Parameters
in/out type name description
out unsigned long *const count A pointer to an unsigned long that receives the count value.
Returns

Diagnostic trouble code reference

psync_host_get_cpu_load ( … )

This will get the host CPU load average over an interval of time.

Recommended intervals are greater than 500,000 microseconds (500 ms).

Parameters
in/out type name description
in const ps_timestamp interval The amount of time to calculate the load over. [microseconds]
out double *const load_average A pointer to a double that receives the normalized load value.
Returns

Diagnostic trouble code reference

psync_host_get_interface_address ( … )

This function will get the host’s PolySync interface address. This is usually an IP address, but can also be ‘AUTO’ (integer value PSYNC_INTERFACE_ADDRESS_AUTO).

Parameters
in/out type name description
in const ps_node_ref node_ref A node reference, used to get the node’s environment. If NULL, it uses the system environment.
out char *const buffer A pointer to a char buffer that receives the address value. The value “AUTO” is possible.
in const size_t buffer_len The length of a provided buffer. The buffer should be at least 16 bytes in length.
Returns

Diagnostic trouble code reference

psync_host_get_cloud_server_url ( … )

This will get the host’s cloud server URL. The cloud server provides device registration and license entitlement.

Parameters
in/out type name description
in const ps_node_ref node_ref A node reference, used to get the node’s environment. If NULL, it uses the system environment.
out char *const buffer A pointer to a char buffer that receives the URL value. An empty string is possible and means the value is not set.
in const size_t buffer_len The length of a provided buffer. A recommended default length is PSYNC_DEFAULT_STRING_LEN.
Returns

Diagnostic trouble code reference

psync_host_set_cloud_server_url ( … )

This function will set the host’s cloud server URL. The cloud server provides device registration and license entitlement.

Parameters
in/out type name description
in const ps_node_ref node_ref A node reference, used to get a node’s environment. If NULL, it uses the system environment.
in const char *const url A pointer to a char buffer that specifies the URL value. An empty string is valid.
Returns

Diagnostic trouble code reference

psync_host_get_cloud_server_certificate_file ( … )

This will get the host’s cloud server SSL certificate file path.

Parameters
in/out type name description
in const ps_node_ref node_ref A node reference, used to get a node’s environment. If NULL, it uses the system environment.
out char *const buffer A pointer to a char buffer that receives the file path value. An empty string is possible and means the value is not set.
in const size_t buffer_len The length of a provided buffer. A recommended default length is PSYNC_DEFAULT_STRING_LEN.
Returns

Diagnostic trouble code reference

psync_host_set_cloud_server_certificate_file ( … )

This function will set the host’s cloud server SSL certificate file path.

Parameters
in/out type name description
in const ps_node_ref node_ref A node reference that is used to get a node’s environment. If NULL, it uses the system environment.
in const char *const file_path A pointer to char buffer that specifies the file path value. An empty string is valid.
Returns

Diagnostic trouble code reference

psync_host_get_license_server_url ( … )

This will get the host’s license server URL. The license server provides license entitlement pools.

Parameters
in/out type name description
in const ps_node_ref node_ref A node reference that is used to get a node’s environment. If NULL, it uses the system environment.
out char *const buffer A pointer to a char buffer that receives the URL value. An empty string is possible and means the value is not set.
in const size_t buffer_len The length of a provided buffer. A recommended default length is PSYNC_DEFAULT_STRING_LEN.
Returns

Diagnostic trouble code reference

psync_host_set_license_server_url ( … )

This will set the host’s license server URL. The license server provides license entitlement pools.

Parameters
in/out type name description
in const ps_node_ref node_ref A node reference that is used to get a node’s environment. If NULL, it uses the system environment.
in const char *const url A pointer to a char buffer that specifies the URL value. An empty string is valid.
Returns

Diagnostic trouble code reference

psync_host_get_license_server_certificate_file ( … )

This function will get the host’s license server SSL certificate file path.

Parameters
in/out type name description
in const ps_node_ref node_ref A node reference that is used to get a node’s environment. If NULL, it uses the system environment.
out char const buffer A pointer to a char buffer that receives the file path value. An empty string is possible and means the value is not set.
in const size_t buffer_len The length of a provided buffer. A recommended default length is PSYNC_DEFAULT_STRING_LEN.
Returns

Diagnostic trouble code reference

psync_host_set_license_server_certificate_file ( … )

This will set the host’s license server SSL certificate file path.

Parameters
in/out type name description
in const ps_node_ref node_ref A node reference that is used to get a node’s environment. If NULL, it uses a system environment.
in const char const file_path A pointer to char buffer that specifies the file path value. An empty string is valid.
Returns

Diagnostic trouble code reference

psync_host_get_floating_activation_id ( … )

This will get the host’s floating license activation ID. The floating activation ID is used by the floating license model to check-in and check-out licensing components.

Parameters
in/out type name description
in const ps_node_ref node_ref A node reference that is used to get a node’s environment. If NULL, it uses the system environment.
out char *const buffer A pointer to a char buffer that receives the activation ID value. An empty string is possible and means the value is not set.
in const size_t buffer_len The length of a provided buffer. Buffer should be at least 64 bytes in length.
Returns

Diagnostic trouble code reference

psync_host_set_floating_activation_id ( … )

This function will set the host’s floating license activation ID. The floating activation ID is used by the floating license model to check-in and check-out licensing components.

Parameters
in/out type name description
in const ps_node_ref node_ref A node reference that is used to get a node’s environment. If NULL, it uses the system environment.
in const char *const activation_id A pointer to char buffer that specifies the activation ID value. An empty string is valid.
Returns

Diagnostic trouble code reference

psync_host_get_manager_pid ( … )

This will get the process ID of the PolySync Manager service, if active on the host. psync_host_get_manager_pid will set the pid value to PSYNC_IDENTIFIER_INVALID if no PID is available. See PSYNC_MANAGER_PID_FILE_PATH for file path.

Parameters
in/out type name description
in ps_identifier *const pid A pointer to the ps_identifier that receives the PID value.
Returns

Diagnostic trouble code reference

psync_host_get_ptp_pid ( … )

This will get the process ID of the PolySync PTP service if it is active on the host. psync_host_get_ptp_pid sets the PID value to PSYNC_IDENTIFIER_INVALID if no PID is available. See PSYNC_MANAGER_PID_FILE_PATH for file path.

Parameters
in/out type name description
in ps_identifier const* pid A pointer to the ps_identifier that receives the PID value.
Returns

Diagnostic trouble code reference