Data point module implementation file. More...
#include "mcl_connectivity/mcl_data_point.h"
#include "data_point.h"
#include "mcl_core/mcl_memory.h"
#include "mcl_core/mcl_string_util.h"
Go to the source code of this file.
Functions | |
mcl_error_t | mcl_data_point_initialize (mcl_data_point_t **data_point) |
mcl_error_t | mcl_data_point_set_parameter (mcl_data_point_t *data_point, E_MCL_DATA_POINT_PARAMETER parameter, const void *value) |
mcl_error_t | data_point_validate (data_point_t *data_point) |
void | mcl_data_point_destroy (mcl_data_point_t **data_point) |
Data point module implementation file.
Definition in file data_point.c.
mcl_error_t data_point_validate | ( | data_point_t * | data_point | ) |
This function checks whether all mandatory parameters of a data point are set or not.
[in] | data_point | Data point to validate. |
Definition at line 92 of file data_point.c.
References data_point_t::id, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_INVALID_PARAMETER, MCL_NULL, MCL_OK, data_point_t::name, data_point_t::type, and data_point_t::unit.
Referenced by data_source_validate().
void mcl_data_point_destroy | ( | mcl_data_point_t ** | data_point | ) |
This function destroys data point data structure.
[in] | data_point | Data point handle which is going to be destroyed. |
Definition at line 108 of file data_point.c.
References MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FREE, mcl_json_util_destroy(), and MCL_NULL.
Referenced by _parse_data_point(), _parse_data_source(), and mcl_data_source_destroy().
mcl_error_t mcl_data_point_initialize | ( | mcl_data_point_t ** | data_point | ) |
This function creates and initializes a data struct of mcl_data_point_t.
[out] | data_point | Data point handle which is going to be initialized. |
data_point
is null. Definition at line 14 of file data_point.c.
References MCL_ASSERT_NOT_NULL, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_ERROR_STRING, MCL_FUNCTION_LEAVE_LABEL, MCL_NEW, MCL_NULL, MCL_OK, and MCL_OUT_OF_MEMORY.
Referenced by _parse_data_point().
mcl_error_t mcl_data_point_set_parameter | ( | mcl_data_point_t * | data_point, |
E_MCL_DATA_POINT_PARAMETER | parameter, | ||
const void * | value | ||
) |
This function is used to set a parameter of a data point.
[in] | data_point | Data point to set its parameter. |
[in] | parameter | One of the parameters listed in E_MCL_DATA_POINT_PARAMETER. |
[in] | value | New value of the parameter . |
data_point
or value
is NULL. parameter
is invalid. Definition at line 45 of file data_point.c.
References MCL_ASSERT_NOT_NULL, MCL_DATA_POINT_PARAMETER_CUSTOM_DATA, MCL_DATA_POINT_PARAMETER_DESCRIPTION, MCL_DATA_POINT_PARAMETER_ID, MCL_DATA_POINT_PARAMETER_NAME, MCL_DATA_POINT_PARAMETER_TYPE, MCL_DATA_POINT_PARAMETER_UNIT, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FUNCTION_LEAVE_LABEL, MCL_INVALID_PARAMETER, mcl_json_util_destroy(), mcl_json_util_duplicate(), and mcl_string_util_reset().