19#define TEK_SA_API_VERSION_MAJOR 0
20#define TEK_SA_API_VERSION_MINOR 1
21#define TEK_SA_API_VERSION_PATCH 0
22#define TEK_SA_API_VERSION "0.1.0"
30#define TEK_SA_STRUCT_ALIGN_SELECT(O32, O64) (sizeof(void*) == 8 ? O64 : O32)
32#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L
34#define TEK_SA_VERIFY_STRUCT_OFFSET(S, M, O32, O64) \
36 _Static_assert(offsetof(struct S, M) == TEK_SA_STRUCT_ALIGN_SELECT(O32, O64), \
37 "struct offset of field " #M " in " #S " must be correct")
39#define TEK_SA_VERIFY_STRUCT_OFFSET(S, M, O32, O64) \
43 1 / (int)(!!(offsetof(struct S, M) == TEK_SA_STRUCT_ALIGN_SELECT(O32, O64))) \
323TEK_SA_VERIFY_STRUCT_OFFSET(
tek_sa_guid, data1, 0, 0);
324TEK_SA_VERIFY_STRUCT_OFFSET(
tek_sa_guid, data2, 4, 4);
325TEK_SA_VERIFY_STRUCT_OFFSET(
tek_sa_guid, data3, 6, 6);
326TEK_SA_VERIFY_STRUCT_OFFSET(
tek_sa_guid, data4, 8, 8);
784#define TEK_SA_ERR_SUCCESS 0
795#define TEK_SA_ERR_NON_BLOCKING_IMPOSSIBLE 10
801#define TEK_SA_ERR_OUT_OF_MEMORY 11
804#define TEK_SA_ERR_INVALID_PARAMETER 12
816#define TEK_SA_ERR_RETRY_LATER 0xffffffff
819#define TEK_SA_READ_RESULT_STATUS_OK 0
822#define TEK_SA_READ_RESULT_STATUS_NOK 1
825#define TEK_SA_READ_RESULT_STATUS_TIMEOUT 2
829#define TEK_SA_READ_RESULT_STATUS_INVALID_HANDLE 3
837#define TEK_SA_BLOCK_TRANSFER_END_OF_FILE 26
846#define TEK_SA_BLOCK_TRANSFER_ABORT 24
852#define TEK_SA_ERR_UNSPECIFIED 1000
971TEK_SA_VERIFY_STRUCT_OFFSET(
tek_sa_dc_event, number_of_parameters, 20, 20);
1195 uint64_t request_id,
1197 uint32_t number_of_items,
1219 uint64_t request_id,
1221 uint32_t number_of_items,
1246 uint64_t request_id,
1247 const char* filepath,
1273 uint64_t request_id,
1274 const char* filepath,
1298 uint32_t number_of_items);
1312 uint32_t number_of_items);
1339 uint64_t request_id,
1341 const uint32_t number_of_parameters);
1484 uint32_t number_of_input_parameters,
1486 uint32_t number_of_output_parameters,
1525 const int16_t severity,
1680 uint64_t request_id,
1705 uint64_t request_id,
1708 uint32_t number_of_results);
1719 uint32_t number_of_changes);
1732 uint64_t request_id,
1735 uint32_t number_of_results);
1749 uint64_t request_id,
1752 uint32_t number_of_results);
1771 uint64_t request_id,
1773 unsigned char buffer[],
1774 uint32_t buffer_length);
1791 uint64_t request_id,
1792 unsigned char buffer[],
1793 uint32_t buffer_length,
1794 uint32_t* bytes_written);
1805 uint64_t request_id,
1852#ifdef TEK_SA_DATA_CLIENT_IMPL
1855#define TEK_SA_API_EXPORT __declspec(dllexport) __stdcall
1857#define TEK_SA_API_EXPORT __attribute__((__visibility__("default")))
1875#undef TEK_SA_STRUCT_ALIGN_SELECT
1876#undef TEK_SA_VERIFY_STRUCT_OFFSET
enum tek_sa_threading_model threading_model
Requirements for the thread calling any communication function in the data client API.
uint32_t number_of_inflight_calls
Number of uncompleted async api calls. Unlimited number of uncompleted calls are signaled using 0 A b...
TEK_SA_RESULT(* tek_sa_load_plugin_fn)(struct tek_sa_transformation_engine *api, const struct tek_sa_data_client_configuration *plugin_configuration, struct tek_sa_data_client_plugin *plugin, struct tek_sa_configuration *tek_configuration)
Signature for the load plugin function.
tek_sa_threading_model
Describes the threading model of a data client instance of a data client plugin.
void * tek_sa_data_client_handle
The type of the data client handle.
@ TEK_SA_THREADING_MODEL_SAME_THREAD
The same thread must always be used to call the data client instance.
@ TEK_SA_THREADING_MODEL_PARALLEL
DLL is thread safe, multiple parallel calls are allowed.
@ TEK_SA_THREADING_MODEL_SEQUENTIAL
Only one thread of a thread pool is doing a single call at a time at the data client instance.
capabilities of the data client. These capabilities are applied to the complete data client as well a...
uint16_t data3
The Data3 field.
uint32_t data1
The Data1 field.
uint32_t item_count
The number of defined enum values.
uint32_t data_length
The number of bytes in the data field.
tek_sa_type_handle type
The type handle of the registered type of the array items.
unsigned char * data
The bytes of the serialized value.
uint32_t * dimensions
The array dimensions.
char const * name
The name of the method parameter.
tek_sa_type_handle type
The type handle of the registered data type.
uint8_t type
The type of the value.
uint32_t data_length
The number of bytes in the data field.
uint32_t length
The number of elements in the array.
char const * name
The name of the parameter.
struct tek_sa_complex_data_array_item * data
The array data, which consists of the concatenation of all serialized items.
TEK_SA_RESULT status
The read operation result.
struct tek_sa_variant_array data
The array values.
uint32_t number_of_parameters
The number of event parameters.
uint16_t data2
The Data2 field.
struct tek_sa_struct_field_type_definition * items
The definition of the record fields.
union tek_sa_variant_array::@0 data
The array values.
char * name
The name of the type.
tek_sa_field_value value
The value of the event parameter.
uint32_t number_of_items
The number of items in the array.
tek_sa_event_handle event_type
The event type handle as returned by the call to tek_sa_transformation_engine::register_event.
uint32_t additional_files_count
char * name
The name of the enum item.
enum tek_sa_variant_type type
The type of the method parameter.
uint32_t request_timeout_ms
tek_sa_field_value value
The value to be written to the field.
unsigned char * data
The UTF-8 encoded characters of the string.
tek_sa_field_value value
The read value.
uint32_t item_count
The number of fields in the record type.
tek_sa_field_handle handle
The field handle as returned from tek_sa_transformation_engine::register_field.
int32_t length
The length of the byte string.
struct tek_sa_additional_file * additional_files
char * name
The name of the data field.
tek_sa_field_handle source
The handle of the source of the event.
tek_sa_field_handle handle
The handle of the field written.
uint32_t dimension_length
The number of array dimensions.
uint32_t dimension_length
The number of dimensions in the array.
tek_sa_field_handle handle
The handle of the read field.
tek_sa_type_handle type
The type handle of the registered type of the array items.
int32_t value
The numeric value of the enum item.
struct tek_sa_enum_item_definition * items
The defined enum values of this type.
struct tek_sa_complex_data_array_item * data
The array data, which consists of the concatenation of all serialized items.
int32_t length
The length of the byte string.
int16_t severity
The severity level of the event.
struct tek_sa_event_parameter * parameters
The event parameters.
union tek_sa_variant::@1 data
The value.
uint32_t * dimensions
The array dimensions.
tek_sa_type_handle_or_type_enum type
The type of the field, represented as type_handle or type enum.
unsigned char * data
The bytes of the serialized value.
tek_sa_datetime timestamp
The Timestamp of the event.
TEK_SA_RESULT status
The write operation result.
char * name
The name of the type.
uint8_t data4[8]
The Data4 field.
int64_t tek_sa_type_handle
The type of a handle which is returned for user defined types.
tek_sa_variant_type
The predefined types which can be processed in the TE.
tek_sa_field_attributes
Flags type which contains the attributes of a data client field.
int64_t tek_sa_type_handle_or_type_enum
The type for a reference handle which references either a user defined type (see tek_sa_type_handle) ...
uint32_t tek_sa_alarm_handle
Handle type for an alarm definition.
uint32_t tek_sa_method_handle
Handle type for a method definition.
uint32_t tek_sa_field_handle
Handle type for a field definition.
int64_t tek_sa_datetime
The type of date and time values wen used as a field type.
int TEK_SA_RESULT
The return value type of all interface functions (which need to return information about success of t...
uint32_t tek_sa_event_handle
Handle type for an event definition.
tek_sa_log_level_t
Definition of the possible logging levels which can be used in tek_sa_transformation_engine::log.
@ TEK_SA_VARIANT_TYPE_UINT8_T
The type id of an unsigned byte value.
@ TEK_SA_VARIANT_TYPE_INT16_T
The type id of a signed short value.
@ TEK_SA_VARIANT_TYPE_UINT16_T
The type id of an unsigned short value.
@ TEK_SA_VARIANT_TYPE_UINT32_T
The type id of an unsigned 32bit integer value.
@ TEK_SA_VARIANT_TYPE_FLAG_MATRIX
The flag which is set to declare an array with more than one dimension of the base type.
@ TEK_SA_VARIANT_TYPE_GUID
The type id of a GUID value. See tek_sa_guid.
@ TEK_SA_VARIANT_TYPE_NULL
The invalid type id.
@ TEK_SA_VARIANT_TYPE_BYTE_STRING
The type id of a byte string value. See tek_sa_byte_string.
@ TEK_SA_VARIANT_TYPE_STRING
The type id of a string value. See tek_sa_string.
@ TEK_SA_VARIANT_TYPE_DOUBLE
The type id of a 64bit floating point value.
@ TEK_SA_VARIANT_TYPE_INT64_T
The type id of a signed 64bit integer value.
@ TEK_SA_VARIANT_TYPE_BOOL
The type id of a bool value.
@ TEK_SA_VARIANT_TYPE_DATETIME
The type id of a date and time value. See tek_sa_datetime.
@ TEK_SA_VARIANT_TYPE_FLOAT
The type id of a 32bit floating point value.
@ TEK_SA_VARIANT_TYPE_FLAG_ARRAY
The flag which is set to declare an array with one dimension of the base type.
@ TEK_SA_VARIANT_TYPE_COMPLEX
The type id of a value with a complex data type. See tek_sa_transformation_engine::register_struct_ty...
@ TEK_SA_VARIANT_TYPE_INT32_T
The type id of a signed 32bit integer value value.
@ TEK_SA_VARIANT_TYPE_UINT64_T
The type id of an unsigned 64bit integer value.
@ TEK_SA_VARIANT_TYPE_INT8_T
The type id of a signed byte value.
@ TEK_SA_FIELD_ATTRIBUTES_WRITABLE
The attribute to mark a field as writeable.
@ TEK_SA_FIELD_ATTRIBUTES_READABLE
The attribute to mark a field as readable.
@ TEK_SA_FIELD_ATTRIBUTES_SUBSCRIBABLE
The attribute to mark a field which can be subscribed to.
@ TEK_SA_LOG_LEVEL_WARNING
@ TEK_SA_LOG_LEVEL_CRITICAL
Configuration class which describes an additional file which is passed to the data client.
The representation of a byte array with variable length when used as a field type.
The representation of a field value which has a type which is not a predefined type.
The representation of an array of complex data with exactly one dimension.
The representation of the items of an array of complex data values with exactly one dimension.
The representation of array of complex data with more than one dimension.
Configuration struct that contains generic properties and settings for TEK instance.
Configuration object containing the contents of the configuration files for the tek_sa_data_client_pl...
An event which may be sent from the data client to tek_sa_transformation_engine::post_event.
The type definition of a user defined enum type.
The definition of an enum item which is defined in a user defined enum type.
Structure to encapsulate an event parameter.
Structure to encapsulate the parameters of a write field request.
The representation of a GUID when used as a field type.
The description of a method parameter.
Structure to encapsulate the result of a read operation of a single field.
The representation of a string with variable length when used as a field type.
The type definition of a user defined record type.
The type definition of a record field in a user defined struct type.
The representation of a single value (which may be of array type too).
The representation of a one dimensional array of the supported base types.
The representation of an array with more than one dimension of the supported base types.
Structure to encapsulate the result of a write field request.
Interface of the data client plugin.
void * plugin_context
The (private) plugin context. Must be freed using free_context on unloading the plugin.
TEK_SA_RESULT(* data_client_new)(void *plugin_context, const struct tek_sa_data_client_configuration *config, struct tek_sa_data_client *created_client, struct tek_sa_data_client_capabilities *capabilities)
Allocates and initializes the data client with a configuration. Prepare callbacks in data_client.
void(* free_context)(void *plugin_context)
Frees the private context of the plugin.
The interface of one instance of a data client.
TEK_SA_RESULT(* connect)(tek_sa_data_client_handle dc)
Connect the data client to the data source.
TEK_SA_RESULT(* block_write)(const tek_sa_data_client_handle dc, uint64_t request_id, const char *filepath, uint64_t offset, int64_t length, bool do_not_block)
Start a block transfer from the TEK to the data client.
TEK_SA_RESULT(* subscribe)(tek_sa_data_client_handle dc, const tek_sa_field_handle items_to_subscribe[], uint32_t number_of_items)
Subscribe to changes of one ore more data client fields.
TEK_SA_RESULT(* write_fields)(tek_sa_data_client_handle dc, uint64_t request_id, const struct tek_sa_field_write_request items_to_write[], uint32_t number_of_items, bool do_not_block)
Function to write values to data client fields.
TEK_SA_RESULT(* read_fields)(tek_sa_data_client_handle dc, uint64_t request_id, const tek_sa_field_handle items_to_read[], uint32_t number_of_items, bool do_not_block)
Function to read one or more fields from the data client. The call may be executed in a synchronous o...
TEK_SA_RESULT(* block_read)(const tek_sa_data_client_handle dc, uint64_t request_id, const char *filepath, uint64_t offset, int64_t length, bool do_not_block, int64_t *filesize)
Starts a block transfer from the client to the TEK.
TEK_SA_RESULT(* acknowledge_alarm)(tek_sa_data_client_handle dc, const tek_sa_alarm_handle alarm)
Acknowledge an alarm in the data client.
TEK_SA_RESULT(* invoke)(const tek_sa_data_client_handle dc, const tek_sa_method_handle method, uint64_t request_id, const tek_sa_field_value parameters[], const uint32_t number_of_parameters)
Invoke a method on the data client.
tek_sa_data_client_handle handle
The handle that is passed as first parameter in all functions of this interface.
void(* free)(tek_sa_data_client_handle dc)
Frees the data client and releases all its resources.
TEK_SA_RESULT(* register_features)(tek_sa_data_client_handle dc)
Register all known features of the data client.
TEK_SA_RESULT(* unsubscribe)(tek_sa_data_client_handle dc, const tek_sa_field_handle items_to_unsubscribe[], uint32_t number_of_items)
Unsubscribe to changes of one ore more data client fields.