API Documentation

Messages

PolySync Data Model Core Module.

ps_diagnostic_trace_msg

Diagnostic trace message. Arbitration key member(s): header.src_guid

publish_subscribe.c.

Data Type Name Description
ps_msg_header header Message header.
ps_interface_address host_address Producer’s host interface address value. Value PSYNC_INTERFACE_ADDRESS_INVALID means invalid. Value PSYNC_INTERFACE_ADDRESS_AUTO means address is set to ‘AUTO’.
ps_version api_version PolySync API version used by the producer.
ps_version core_version PolySync data model ‘core’ module version used by the producer.
sequence< ps_diagnostic_state > trace Trace buffer.

ps_byte_array_msg

Byte array message. Arbitration key member(s): header.src_guid, dest_guid

Data Type Name Description
ps_msg_header header Message header.
ps_guid dest_guid Destination GUID.
DDS_unsigned_long data_type User-defined data type.
DDS_sequence_char bytes Data buffer.

ps_can_frame_msg

CAN frame message. Arbitration key member(s): header.src_guid

Data Type Name Description
ps_msg_header header Message header.
ps_timestamp timestamp Receive timestamp. [microseconds]
ps_native_timestamp native_timestamp Native receive timestamp, not enforced.
ps_identifier hardware_id Hardware identifier. This is usually the serial number of the adapter hardware, not the channels (i.e. for a 2 channel PCI adapter, it would provide channel ID’s 0 and 1, both with the same hardware ID).
DDS_unsigned_short circuit_id Circuit identifier. This is usually the index of the channel/circuit on a given piece of hardware (i.e. for a 2 channel PCI adapter, it would provide circuit ID’s 0 and 1).
DDS_sequence_char data_buffer CAN frame data buffer.

ps_event_msg

Event message. Arbitration key member(s): header.src_guid

Event message example.

Data Type Name Description
ps_msg_header header Message header.
ps_guid dest_guid Destination GUID.
ps_event_id id Event ID.
ps_parameter_value data Generic parameter value associated with the event, union of supported types, discriminator is in value type.

ps_parameters_msg

Parameters message. Arbitration key member(s): header.src_guid

Parameters message example.

Data Type Name Description
ps_msg_header header Message header.
ps_guid dest_guid Destination GUID.
ps_parameter_message_kind type Parameter message type.
DDS_sequence_ps_parameter parameter Parameter buffer. To request all parameters, set element zero parameter ID to PSYNC_PARAM_ID_ALL.

ps_rnr_msg

Record and Replay message. This will provide the status and control of PolySync Nodes using the Logfile and RnR API utilities. Arbitration key member(s): header.src_guid

Record and replay example.

Data Type Name Description
ps_msg_header header Message header.
ps_rnr_session_id session_id Session identifier.
ps_interface_address host_address Producer’s host interface address value. Value PSYNC_INTERFACE_ADDRESS_INVALID means invalid. Value PSYNC_INTERFACE_ADDRESS_AUTO means address is set to ‘AUTO’.
ps_guid dest_guid Optional destination node GUID. Used to target a specific destination node by GUID. Value PSYNC_GUID_INVALID means all nodes should handle the message.
ps_rnr_msg_kind type RnR message type. Provides details on interpreting the message fields.
ps_logfile_mode_kind mode Logfile mode.
ps_logfile_state_kind state Logfile state.
ps_timestamp current_timestamp Current logfile timestamp. [microseconds]
ps_timestamp begin_timestamp Beginning logfile entry’s timestamp. When in LOGFILE_MODE_READ, this represents the Nearest Common Replay Timestamp. When in LOGFILE_MODE_WRITE, this represents the first entry’s timestamp. [microseconds]
ps_timestamp end_timestamp Ending logfile entry’s timestamp. [microseconds]
DDS_double clock_scale Replay clock tick scale. Value PSYNC_CLOCK_SCALE_INVALID means not available.
DDS_sequence_char file_path Logfile’s binary file path.
ps_parameter_value control_data Control data used by certain ps_rnr_message_kind values.

ps_sdf_state_msg

SDF state message. This will provide the state of the SDF configuration as seen by the publisher. Arbitration key member(s): header.src_guid

Data Type Name Description
ps_msg_header header Message header.
ps_sdf_runtime_configuration runtime_configuration SDF runtime configuration used by the publisher.

ps_rnr_sessions_msg

Record and Replay sessions message. This will provide the currently available RnR sessions as seen by the publisher. Arbitration key member(s): header.src_guid

Record and replay example.

Data Type Name Description
ps_msg_header header Message header.
ps_interface_address host_address Producer’s host interface address value. Value PSYNC_INTERFACE_ADDRESS_INVALID means invalid. Value PSYNC_INTERFACE_ADDRESS_AUTO means address is set to ‘AUTO’.
DDS_sequence_ps_rnr_session sessions RnR sessions.

ps_file_transfer_msg

File transfer message. This will be used to initialize a file transfer between publisher and subscriber. Arbitration key member(s): header.src_guid, dest_guid

Data Type Name Description
ps_msg_header header Message header.
ps_interface_address host_address Producer’s host interface address value. Value PSYNC_INTERFACE_ADDRESS_INVALID means invalid. Value PSYNC_INTERFACE_ADDRESS_AUTO means address is set to ‘AUTO’.
ps_guid dest_guid Destination node GUID. Used to target a specific destination node by GUID. Value PSYNC_GUID_INVALID means all nodes should handle the message.
ps_file_transfer_mode_kind mode File transfer mode. Determines whether this is a read/write/append operation. Value FILE_TRANSFER_MODE_INVALID means invalid.
DDS_sequence_char absolute_path Absolute path to the file, including the file name.
DDS_unsigned_long chunk_size File fragmentation chunk size. Files will be fragmented in to chunks of this size when published in ps_file_msg. Value zero means use the receivers default value. [bytes]
ps_timestamp inter_chunk_delay Amount of time between file data chunks, see ps_msg_msg. Value zero means use the receivers default value. [microseconds]
DDS_octet require_hash File hash required flag. Value zero means not required. Value one means required.

ps_file_msg

File data message. This will be used to transfer file data between publisher and subscriber. Files are typically fragmented using the chunk size. The chunk identifier and chunk offset allows the subscriber to reconstruct the data fragments.

Data Type Name Description
ps_msg_header header Message header.
ps_interface_address host_address Producer’s host interface address value. Value PSYNC_INTERFACE_ADDRESS_INVALID means invalid. Value PSYNC_INTERFACE_ADDRESS_AUTO means address is set to ‘AUTO’.
ps_guid dest_guid Destination node GUID. Used to target a specific destination node by GUID. Value PSYNC_GUID_INVALID means all nodes should handle the message.
DDS_sequence_char absolute_path Absolute path to the file, including the file name.
DDS_unsigned_long file_size File size. [bytes]
DDS_octet file_hash [PSYNC_MODULE_VERIFY_HASH_LEN] File hash. Typically the MD5 hash of the file, see psync_get_file_hash.
DDS_unsigned_long chunk_id Current data chunk identifier. Value zero means invalid. The first chunk will have the value one.
DDS_unsigned_long chunk_offset Offset of this data chunk in the file. The first chunk will have an offset value of zero. [bytes]
DDS_unsigned_long total_chunks Total number of chunks used to fragment the file data.
ps_dtc dtc Diagnostic trouble code associated with the last update to the file transfer operation.
DDS_sequence_char bytes Data bytes associated with the chunk.

ps_command_msg

Generic command message. Arbitration key member(s): header.src_guid, dest_guid, id

Data Type Name Description
ps_msg_header header Message header.
ps_guid dest_guid Destination GUID.
ps_command_id id Command identifier. Value PSYNC_COMMAND_ID_INVALID means invalid.
ps_timestamp timestamp Timestamp associated with the command. [microseconds]
DDS_sequence_ps_parameter_value data Command data buffer. Not used by all commands.

ps_response_msg

Generic response message. Arbitration key member(s): header.src_guid, dest_guid, id

Data Type Name Description
ps_msg_header header Message header.
ps_guid dest_guid Destination GUID.
ps_command_id id Command identifier this is responding to. Value PSYNC_COMMAND_ID_INVALID means invalid.
ps_timestamp timestamp Timestamp associated with the response. [microseconds]
ps_dtc dtc Diagnostic trouble code associated with the command this is responding to.
DDS_sequence_ps_parameter_value data Response data buffer. Not used by all commands/responses.

ps_manager_status_msg

Manager node status message. Arbitration key member(s): header.src_guid

Data Type Name Description
ps_msg_header header Message header.
ps_interface_address host_address Producer’s host interface address value. Value PSYNC_INTERFACE_ADDRESS_INVALID means invalid. Value PSYNC_INTERFACE_ADDRESS_AUTO means address is set to ‘AUTO’.
DDS_unsigned_long sdf_runtime_id SDF runtime configuration primary key. Value PSYNC_SDF_ID_INVALID means invalid.
DDS_sequence_ps_runtime_node_status runtime_nodes Contains the status of each runtime node being managed by the Manager node.