mcl_data_source_configuration.h File Reference

Data source configuration module interface header file. More...

Include dependency graph for mcl_data_source_configuration.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct mcl_data_source_configuration_t mcl_data_source_configuration_t
 

Enumerations

enum  E_MCL_DATA_SOURCE_CONFIGURATION_PARAMETER { MCL_DATA_SOURCE_CONFIGURATION_PARAMETER_ID }
 
enum  E_MCL_DATA_SOURCE_CONFIGURATION_VERSION { MCL_DATA_SOURCE_CONFIGURATION_1_0 = 0, MCL_DATA_SOURCE_CONFIGURATION_END }
 

Functions

MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_data_source_configuration_initialize (E_MCL_DATA_SOURCE_CONFIGURATION_VERSION version, mcl_data_source_configuration_t **data_source_configuration)
 
MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_data_source_configuration_set_parameter (mcl_data_source_configuration_t *data_source_configuration, E_MCL_DATA_SOURCE_CONFIGURATION_PARAMETER parameter, const void *value)
 
MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_data_source_configuration_add_data_source (mcl_data_source_configuration_t *data_source_configuration, mcl_data_source_t *data_source)
 
MCL_CONNECTIVITY_EXPORT void mcl_data_source_configuration_destroy (mcl_data_source_configuration_t **data_source_configuration)
 

Detailed Description

Data source configuration module interface header file.

If an agent needs to upload timeseries data to MindSphere, MindSphere needs additional configuration to know how to interpret the agent's data stream. This is called data source configuration. Before uploading any timeseries, data source configuration must be uploaded to MindSphere.

This module enables the agent to initialize a data source configuration using mcl_data_source_configuration_initialize function. Following initialization, a unique configuration id is assigned (which can be generated using mcl_random_generate_guid function) to the data source configuration using mcl_data_source_configuration_set_parameter function. This configuration id must be kept for the related timeseries exchange. Finally, the data source(s) can be added to data source configuration using mcl_data_source_configuration_add_data_source function.

Data source configuration is destroyed using mcl_data_source_configuration_destroy funtion.

Check the example file "mcl_connectivity/examples/dsc_upload.c".

Definition in file mcl_data_source_configuration.h.

Typedef Documentation

Handle for data source configuration.

Definition at line 36 of file mcl_data_source_configuration.h.

Enumeration Type Documentation

Parameters for data source configuration.

Enumerator
MCL_DATA_SOURCE_CONFIGURATION_PARAMETER_ID 

Data source configuration ID parameter as char*.

Definition at line 41 of file mcl_data_source_configuration.h.

Version enumeration for data source configuration.

Enumerator
MCL_DATA_SOURCE_CONFIGURATION_1_0 

Data source configuration version 1.0.

MCL_DATA_SOURCE_CONFIGURATION_END 

End of data source configuration version.

Definition at line 49 of file mcl_data_source_configuration.h.

Function Documentation

MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_data_source_configuration_add_data_source ( mcl_data_source_configuration_t data_source_configuration,
mcl_data_source_t data_source 
)

This function adds data_source to data_source_configuration.

Parameters
[in]data_source_configurationmcl_data_source_configuration_t object handle which data_source is added to.
[in]data_sourcemcl_data_source_t object handle which contains data source information.
Returns

Definition at line 94 of file data_source_configuration.c.

References MCL_ASSERT_NOT_NULL, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FUNCTION_LEAVE_LABEL, and mcl_list_add().

Here is the call graph for this function:

MCL_CONNECTIVITY_EXPORT void mcl_data_source_configuration_destroy ( mcl_data_source_configuration_t **  data_source_configuration)

This function destroys data_source_configuration.

Parameters
[in]data_source_configurationmcl_data_source_configuration_t object handle that will be destroyed.

Definition at line 155 of file data_source_configuration.c.

References mcl_data_source_destroy(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FREE, mcl_list_destroy_with_content(), and MCL_NULL.

Referenced by _item_destroy(), _parse_data_source_configuration(), and mcl_data_source_configuration_initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_data_source_configuration_initialize ( E_MCL_DATA_SOURCE_CONFIGURATION_VERSION  version,
mcl_data_source_configuration_t **  data_source_configuration 
)

This function initializes data_source_configuration.

Parameters
[in]versionVersion of the data source configuration.
[out]data_source_configurationInitialized mcl_data_source_configuration_t object handle.
Returns

Definition at line 17 of file data_source_configuration.c.

References MCL_ASSERT_CODE_MESSAGE, MCL_ASSERT_NOT_NULL, mcl_data_source_configuration_destroy(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FUNCTION_LEAVE_LABEL, MCL_INVALID_PARAMETER, MCL_ITEM_PREAMBLE, MCL_ITEM_TYPE_DATA_SOURCE_CONFIGURATION, mcl_list_initialize(), MCL_NEW, MCL_NULL, MCL_OK, and MCL_OUT_OF_MEMORY.

Referenced by _parse_data_source_configuration().

Here is the call graph for this function:

Here is the caller graph for this function:

MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_data_source_configuration_set_parameter ( mcl_data_source_configuration_t data_source_configuration,
E_MCL_DATA_SOURCE_CONFIGURATION_PARAMETER  parameter,
const void *  value 
)

This function is used to set a parameter of a data source configuration.

Parameters
[in]data_source_configurationData source configuration to set its parameter.
[in]parameterOne of the parameters listed in E_MCL_DATA_SOURCE_CONFIGURATION_PARAMETER.
[in]valueNew value of the parameter.
Returns

Definition at line 68 of file data_source_configuration.c.

References MCL_ASSERT_NOT_NULL, MCL_DATA_SOURCE_CONFIGURATION_PARAMETER_ID, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FUNCTION_LEAVE_LABEL, MCL_INVALID_PARAMETER, and mcl_string_util_reset().

Here is the call graph for this function: