Custom data module implementation file. More...
#include "mcl_connectivity/mcl_custom_data.h"
#include "custom_data.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_custom_data_initialize (const char *version, mcl_custom_data_t **custom_data) |
mcl_error_t | mcl_custom_data_set_parameter (mcl_custom_data_t *custom_data, E_MCL_CUSTOM_DATA_PARAMETER parameter, const void *value) |
mcl_error_t | custom_data_validate (custom_data_t *custom_data) |
void | mcl_custom_data_destroy (mcl_custom_data_t **custom_data) |
Custom data module implementation file.
Definition in file custom_data.c.
mcl_error_t custom_data_validate | ( | custom_data_t * | custom_data | ) |
This function checks whether all mandatory parameters of a custom data are set or not.
[in] | custom_data | Custom data to validate. |
Definition at line 104 of file custom_data.c.
References custom_data_payload_t::buffer, custom_data_payload_t::content_type, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_INVALID_PARAMETER, MCL_NULL, MCL_OK, custom_data_t::payload, custom_data_payload_t::size, custom_data_payload_t::type, and custom_data_payload_t::version.
Referenced by _store_add_data(), and connectivity_processor_exchange().
void mcl_custom_data_destroy | ( | mcl_custom_data_t ** | custom_data | ) |
This function destroys custom data data structure.
[in] | custom_data | Custom data handle which is going to be destroyed. |
Definition at line 122 of file custom_data.c.
References MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FREE, mcl_json_util_destroy(), and MCL_NULL.
Referenced by _item_destroy(), and mcl_custom_data_initialize().
mcl_error_t mcl_custom_data_initialize | ( | const char * | version, |
mcl_custom_data_t ** | custom_data | ||
) |
This function creates and initializes a data struct of mcl_custom_data_t.
[in] | version | Version of the custom data. |
[out] | custom_data | Custom data handle which is going to be initialized. |
custom_data
or version
is null. Definition at line 14 of file custom_data.c.
References MCL_ASSERT_NOT_NULL, mcl_custom_data_destroy(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FUNCTION_LEAVE_LABEL, MCL_ITEM_PREAMBLE, MCL_ITEM_TYPE_CUSTOM_DATA, MCL_NEW, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, and mcl_string_util_reset().
mcl_error_t mcl_custom_data_set_parameter | ( | mcl_custom_data_t * | custom_data, |
E_MCL_CUSTOM_DATA_PARAMETER | parameter, | ||
const void * | value | ||
) |
This function is used to set a parameter of a custom data.
[in] | custom_data | Custom data to set its parameter. |
[in] | parameter | One of the parameters listed in E_MCL_CUSTOM_DATA_PARAMETER. |
[in] | value | New value of the parameter . |
custom_data
or value
is NULL. parameter
is invalid. Definition at line 61 of file custom_data.c.
References MCL_ASSERT_NOT_NULL, MCL_CUSTOM_DATA_PARAMETER_BUFFER, MCL_CUSTOM_DATA_PARAMETER_BUFFER_SIZE, MCL_CUSTOM_DATA_PARAMETER_CONTENT_TYPE, MCL_CUSTOM_DATA_PARAMETER_DETAILS, MCL_CUSTOM_DATA_PARAMETER_TYPE, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FUNCTION_LEAVE_LABEL, MCL_INVALID_PARAMETER, mcl_json_util_destroy(), mcl_json_util_duplicate(), MCL_OK, and mcl_string_util_reset().