mcl_timeseries.h File Reference

Timeseries module interface header file. More...

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

Go to the source code of this file.

Typedefs

typedef struct mcl_timeseries_t mcl_timeseries_t
 

Enumerations

enum  E_MCL_TIMESERIES_VERSION { MCL_TIMESERIES_VERSION_1_0 = 0, MCL_TIMESERIES_VERSION_END }
 
enum  E_MCL_TIMESERIES_PARAMETER { MCL_TIMESERIES_PARAMETER_CONFIGURATION_ID = 0, MCL_TIMESERIES_PARAMETER_END }
 

Functions

MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_timeseries_initialize (E_MCL_TIMESERIES_VERSION version, mcl_timeseries_t **timeseries)
 
MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_timeseries_set_parameter (mcl_timeseries_t *timeseries, E_MCL_TIMESERIES_PARAMETER parameter, const void *value)
 
MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_timeseries_add_value_list (mcl_timeseries_t *timeseries, mcl_timeseries_value_list_t *timeseries_value_list)
 
MCL_CONNECTIVITY_EXPORT void mcl_timeseries_destroy (mcl_timeseries_t **timeseries)
 

Detailed Description

Timeseries module interface header file.

Agents can upload timeseries data to MindSphere. Before exchanging any timeseries, data source configuration must be uploaded to MindSphere which describes timeseries. Timeseries data is coupled with the data source configuration by the configuration id of the data source configuration which is assigned when uploading data source configuration.

This module enables the agent to initialize a timeseries using mcl_timeseries_initialize function. Following initialization, the parameters of this timeseries can be set using mcl_timeseries_set_parameter function. Then timeseries value list(s) can be added to the timeseries using mcl_timeseries_add_value_list function. See mcl_connectivity/mcl_timeseries_value_list.h for information about timeseries value lists. Once the timeseries is ready, it can be uploaded to MindSphere using mcl_connectivity_exchange function. Optionally, the timeseries can be added to mcl_store_t and the store containing the timeseries and possible other data can be uploaded to MindSphere. If the timeseries is exchanged as a single item, the agent is expected to destroy the timeseries after the exchange operation using mcl_timeseries_destroy function. If the timeseries is exchanged in a store, store will handle the destroy operation of the timeseries and the agent does not need to take any action.

For more information, please look at example file "mcl_connectivity/examples/timeseries_upload.c".

Definition in file mcl_timeseries.h.

Typedef Documentation

Handle for timeseries.

Definition at line 41 of file mcl_timeseries.h.

Enumeration Type Documentation

Parameters for timeseries.

Enumerator
MCL_TIMESERIES_PARAMETER_CONFIGURATION_ID 

Timeseries configuration ID parameter as char*.

MCL_TIMESERIES_PARAMETER_END 

Definition at line 55 of file mcl_timeseries.h.

Version of timeseries item payload.

Enumerator
MCL_TIMESERIES_VERSION_1_0 

Timeseries version 1.0.

MCL_TIMESERIES_VERSION_END 

End of timeseries version enumeration.

Definition at line 46 of file mcl_timeseries.h.

Function Documentation

MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_timeseries_add_value_list ( mcl_timeseries_t timeseries,
mcl_timeseries_value_list_t timeseries_value_list 
)

This function adds timeseries_value_list to timeseries.

Parameters
[in]timeseriesmcl_timeseries_t object handle which timeseries_value_list is added to.
[in]timeseries_value_listmcl_timeseries_value_list_t object handle which contains timeseries value list information.
Returns

Definition at line 88 of file timeseries.c.

References MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_list_add(), MCL_NULL, and MCL_TRIGGERED_WITH_NULL.

Here is the call graph for this function:

MCL_CONNECTIVITY_EXPORT void mcl_timeseries_destroy ( mcl_timeseries_t **  timeseries)

This function destroys timeseries data structure.

Parameters
[in]timeseriesTimeseries handle which is going to be destroyed.

Definition at line 138 of file timeseries.c.

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

Referenced by _item_destroy(), and mcl_timeseries_initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_timeseries_initialize ( E_MCL_TIMESERIES_VERSION  version,
mcl_timeseries_t **  timeseries 
)

This function creates and initializes a data struct of mcl_timeseries_t.

Parameters
[in]versionOne of the versions listed in E_MCL_TIMESERIES_VERSION.
[out]timeseriesTimeseries handle which is going to be initialized.
Returns

Definition at line 16 of file timeseries.c.

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

Here is the call graph for this function:

MCL_CONNECTIVITY_EXPORT mcl_error_t mcl_timeseries_set_parameter ( mcl_timeseries_t timeseries,
E_MCL_TIMESERIES_PARAMETER  parameter,
const void *  value 
)

This function is used to set a parameter of a timeseries.

Parameters
[in]timeseriesTimeseries to set its parameter.
[in]parameterOne of the parameters listed in E_MCL_TIMESERIES_PARAMETER.
[in]valueNew value of the parameter.
Returns

Definition at line 64 of file timeseries.c.

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

Here is the call graph for this function: