Json module implementation file. More...
#include "json.h"
#include "mcl_core/mcl_string_util.h"
#include "mcl_core/mcl_memory.h"
#include "mcl_connectivity/mcl_event.h"
#include "event.h"
#include "data_source_configuration.h"
#include "timeseries.h"
#include "file.h"
#include "custom_data.h"
#include "mcl_connectivity/mcl_data_source_configuration.h"
Go to the source code of this file.
Macros | |
#define | ITEM_TYPE "item" |
#define | ITEM_VERSION "1.0" |
#define | DOUBLE_BRACE_SIZE 2 |
#define | DELIMITER_SIZE 1 |
#define | ITEM_META_BASE_SIZE (sizeof("{\"type\":\""ITEM_TYPE"\",\"version\":\""ITEM_VERSION"\",\"payload\":}") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_TIMESERIES_META_PAYLOAD_BASE_SIZE (sizeof("{\"type\":\"standardTimeSeries\",\"version\":\"\",\"details\":{\"configurationId\":\"\"}}") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_TIMESERIES_VALUE_BASE_SIZE (sizeof("{\"dataPointId\":\"\",\"value\":\"\",\"qualityCode\":\"\"}") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_TIMESERIES_VALUE_LIST_BASE_SIZE (sizeof("{\"timestamp\":\"\",\"values\":[]}") + MCL_TIMESTAMP_LENGTH - 2 * MCL_NULL_CHAR_SIZE) |
#define | ITEM_EVENT_META_PAYLOAD_BASE_SIZE (sizeof("{\"type\":\"businessEvent\",\"version\":\"\"}") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_EVENT_PAYLOAD_BASE_SIZE (sizeof("{\"id\":\"\",\"timestamp\":\"\",\"severity\":,\"type\":\"\",\"version\":\"\",\"details\":}") + MCL_TIMESTAMP_LENGTH - 2 * MCL_NULL_CHAR_SIZE) |
#define | ITEM_EVENT_PAYLOAD_CORRELATION_ID_SIZE (sizeof(",\"correlationId\":\"\"") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_EVENT_PAYLOAD_DESCRIPTION_SIZE (sizeof(",\"description\":\"\"") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_FILE_META_PAYLOAD_BASE_SIZE (sizeof("{\"type\":\"file\",\"version\":\"\",\"details\":{\"fileName\":\"\",\"creationDate\":\"\"}}") + MCL_TIMESTAMP_LENGTH - 2 * MCL_NULL_CHAR_SIZE) |
#define | ITEM_FILE_META_PAYLOAD_FILE_TYPE_SIZE (sizeof(",\"fileType\":\"\"") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_CUSTOM_DATA_META_PAYLOAD_BASE_SIZE (sizeof("{\"type\":\"\",\"version\":\"\"}") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_CUSTOM_DATA_META_PAYLOAD_DETAILS_SIZE (sizeof(",\"details\":") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_DATA_SOURCE_CONFIGURATION_META_PAYLOAD_BASE_SIZE (sizeof("{\"type\":\"dataSourceConfiguration\",\"version\":\"\"}") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_DATA_SOURCE_CONFIGURATION_PAYLOAD_BASE_SIZE (sizeof("{\"configurationId\":\"\",\"dataSources\":[]}") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_DATA_SOURCE_BASE_SIZE (sizeof("{\"name\":\"\",\"description\":\"\",\"dataPoints\":[]}") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_DATA_POINT_BASE_SIZE (sizeof("{\"id\":\"\",\"name\":\"\",\"description\":\"\",\"type\":\"\",\"unit\":\"\"}") - MCL_NULL_CHAR_SIZE) |
#define | ITEM_DATA_SOURCE_CONFIGURATION_PAYLOAD_CUSTOM_DATA_SIZE (sizeof(",\"customData\":") - MCL_NULL_CHAR_SIZE) |
Typedefs | |
typedef mcl_error_t(* | json_converter_callback) (void *any_struct, mcl_json_t **json) |
typedef mcl_error_t(* | json_parser_callback) (mcl_json_t *json, void **any_struct) |
Variables | |
static const char * | meta_field_names [META_FIELD_NAMES_END] |
static const char * | meta_field_values [META_FIELD_VALUES_END] |
static const char * | payload_field_names [PAYLOAD_FIELD_NAMES_END] |
Json module implementation file.
Definition in file json.c.
#define DELIMITER_SIZE 1 |
Definition at line 24 of file json.c.
Referenced by _item_payload_size_for_data_source(), _item_payload_size_for_data_source_configuration(), _item_payload_size_for_timeseries(), and _item_payload_size_for_timeseries_value_list().
#define DOUBLE_BRACE_SIZE 2 |
Definition at line 23 of file json.c.
Referenced by _custom_data_meta_size(), _item_payload_size_for_data_point(), _item_payload_size_for_data_source(), _item_payload_size_for_event(), and _item_payload_size_for_timeseries().
#define ITEM_CUSTOM_DATA_META_PAYLOAD_BASE_SIZE (sizeof("{\"type\":\"\",\"version\":\"\"}") - MCL_NULL_CHAR_SIZE) |
Definition at line 62 of file json.c.
Referenced by _custom_data_meta_size().
#define ITEM_CUSTOM_DATA_META_PAYLOAD_DETAILS_SIZE (sizeof(",\"details\":") - MCL_NULL_CHAR_SIZE) |
Definition at line 65 of file json.c.
Referenced by _custom_data_meta_size().
#define ITEM_DATA_POINT_BASE_SIZE (sizeof("{\"id\":\"\",\"name\":\"\",\"description\":\"\",\"type\":\"\",\"unit\":\"\"}") - MCL_NULL_CHAR_SIZE) |
Definition at line 77 of file json.c.
Referenced by _item_payload_size_for_data_point().
#define ITEM_DATA_SOURCE_BASE_SIZE (sizeof("{\"name\":\"\",\"description\":\"\",\"dataPoints\":[]}") - MCL_NULL_CHAR_SIZE) |
Definition at line 74 of file json.c.
Referenced by _item_payload_size_for_data_source().
#define ITEM_DATA_SOURCE_CONFIGURATION_META_PAYLOAD_BASE_SIZE (sizeof("{\"type\":\"dataSourceConfiguration\",\"version\":\"\"}") - MCL_NULL_CHAR_SIZE) |
Definition at line 68 of file json.c.
Referenced by _item_meta_size().
#define ITEM_DATA_SOURCE_CONFIGURATION_PAYLOAD_BASE_SIZE (sizeof("{\"configurationId\":\"\",\"dataSources\":[]}") - MCL_NULL_CHAR_SIZE) |
Definition at line 71 of file json.c.
Referenced by _item_payload_size_for_data_source_configuration().
#define ITEM_DATA_SOURCE_CONFIGURATION_PAYLOAD_CUSTOM_DATA_SIZE (sizeof(",\"customData\":") - MCL_NULL_CHAR_SIZE) |
Definition at line 80 of file json.c.
Referenced by _item_payload_size_for_data_point(), and _item_payload_size_for_data_source().
#define ITEM_EVENT_META_PAYLOAD_BASE_SIZE (sizeof("{\"type\":\"businessEvent\",\"version\":\"\"}") - MCL_NULL_CHAR_SIZE) |
Definition at line 42 of file json.c.
Referenced by _item_meta_size().
#define ITEM_EVENT_PAYLOAD_BASE_SIZE (sizeof("{\"id\":\"\",\"timestamp\":\"\",\"severity\":,\"type\":\"\",\"version\":\"\",\"details\":}") + MCL_TIMESTAMP_LENGTH - 2 * MCL_NULL_CHAR_SIZE) |
Definition at line 45 of file json.c.
Referenced by _item_payload_size_for_event().
#define ITEM_EVENT_PAYLOAD_CORRELATION_ID_SIZE (sizeof(",\"correlationId\":\"\"") - MCL_NULL_CHAR_SIZE) |
Definition at line 49 of file json.c.
Referenced by _item_payload_size_for_event().
#define ITEM_EVENT_PAYLOAD_DESCRIPTION_SIZE (sizeof(",\"description\":\"\"") - MCL_NULL_CHAR_SIZE) |
Definition at line 52 of file json.c.
Referenced by _item_payload_size_for_event().
#define ITEM_FILE_META_PAYLOAD_BASE_SIZE (sizeof("{\"type\":\"file\",\"version\":\"\",\"details\":{\"fileName\":\"\",\"creationDate\":\"\"}}") + MCL_TIMESTAMP_LENGTH - 2 * MCL_NULL_CHAR_SIZE) |
Definition at line 55 of file json.c.
Referenced by _item_meta_size().
#define ITEM_FILE_META_PAYLOAD_FILE_TYPE_SIZE (sizeof(",\"fileType\":\"\"") - MCL_NULL_CHAR_SIZE) |
Definition at line 59 of file json.c.
Referenced by _item_meta_size().
#define ITEM_META_BASE_SIZE (sizeof("{\"type\":\""ITEM_TYPE"\",\"version\":\""ITEM_VERSION"\",\"payload\":}") - MCL_NULL_CHAR_SIZE) |
Definition at line 29 of file json.c.
Referenced by _item_meta_size().
#define ITEM_TIMESERIES_META_PAYLOAD_BASE_SIZE (sizeof("{\"type\":\"standardTimeSeries\",\"version\":\"\",\"details\":{\"configurationId\":\"\"}}") - MCL_NULL_CHAR_SIZE) |
Definition at line 32 of file json.c.
Referenced by _item_meta_size().
#define ITEM_TIMESERIES_VALUE_BASE_SIZE (sizeof("{\"dataPointId\":\"\",\"value\":\"\",\"qualityCode\":\"\"}") - MCL_NULL_CHAR_SIZE) |
Definition at line 36 of file json.c.
Referenced by _item_payload_size_for_timeseries_value().
#define ITEM_TIMESERIES_VALUE_LIST_BASE_SIZE (sizeof("{\"timestamp\":\"\",\"values\":[]}") + MCL_TIMESTAMP_LENGTH - 2 * MCL_NULL_CHAR_SIZE) |
Definition at line 39 of file json.c.
Referenced by _item_payload_size_for_timeseries_value_list().
#define ITEM_TYPE "item" |
Definition at line 20 of file json.c.
Referenced by json_from_item_meta().
#define ITEM_VERSION "1.0" |
Definition at line 21 of file json.c.
Referenced by json_from_item_meta().
typedef mcl_error_t(* json_converter_callback) (void *any_struct, mcl_json_t **json) |
typedef mcl_error_t(* json_parser_callback) (mcl_json_t *json, void **any_struct) |
enum E_META_FIELD_NAMES |
This is used with meta_field_names array to get the related string. ex: meta_field_names[META_FIELD_TYPE] returns the string of "type".
enum E_META_FIELD_VALUES |
This is used with meta_field_values array to get the related string. ex: meta_field_values[META_FIELD_TYPE_ITEM] returns the string of "item". Please refer to the MindConnectAPI Specifications for detailed info.
This is used with payload_field_names to get the related string. ex: payload_field_names[PAYLOAD_FIELD_TIMESTAMP] returns the string of "timeStamp".
|
static |
Definition at line 606 of file json.c.
References event_payload_t::correlation_id, event_payload_t::description, event_payload_t::details, event_payload_t::id, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_JSON_OBJECT, mcl_json_util_add_item_to_array(), mcl_json_util_add_object(), mcl_json_util_add_string(), mcl_json_util_add_uint(), mcl_json_util_destroy(), mcl_json_util_duplicate(), mcl_json_util_initialize(), MCL_NULL, MCL_NULL_CHAR, MCL_OK, event_t::payload, PAYLOAD_FIELD_CORRELATION_ID, PAYLOAD_FIELD_DESCRIPTION, PAYLOAD_FIELD_DETAILS, PAYLOAD_FIELD_ID, payload_field_names, PAYLOAD_FIELD_SEVERITY, PAYLOAD_FIELD_TIMESTAMP, PAYLOAD_FIELD_TYPE, PAYLOAD_FIELD_VERSION, event_payload_t::severity, event_payload_t::timestamp, event_payload_t::type, and event_payload_t::version.
Referenced by _json_from_event_payload().
|
static |
Definition at line 695 of file json.c.
References MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FAIL, MCL_ITEM_TYPE_CUSTOM_DATA, MCL_ITEM_TYPE_DATA_SOURCE_CONFIGURATION, MCL_ITEM_TYPE_EVENT, MCL_ITEM_TYPE_FILE, MCL_ITEM_TYPE_TIMESERIES, MCL_OK, and mcl_item_t::type.
Referenced by json_from_item_meta().
|
static |
Definition at line 488 of file json.c.
References _add_item_meta_payload_details(), mcl_data_source_configuration_versions, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_event_versions, MCL_FAIL, mcl_file_versions, MCL_ITEM_TYPE_CUSTOM_DATA, MCL_ITEM_TYPE_DATA_SOURCE_CONFIGURATION, MCL_ITEM_TYPE_EVENT, MCL_ITEM_TYPE_FILE, MCL_ITEM_TYPE_TIMESERIES, mcl_json_util_add_string(), mcl_json_util_destroy(), mcl_json_util_start_object(), MCL_NULL, MCL_OK, mcl_timeseries_versions, meta_field_names, META_FIELD_PAYLOAD, META_FIELD_PAYLOAD_TYPE, META_FIELD_PAYLOAD_TYPE_BUSINESS_EVENT, META_FIELD_PAYLOAD_TYPE_DATA_SOURCE_CONFIGURATION, META_FIELD_PAYLOAD_TYPE_FILE, META_FIELD_PAYLOAD_TYPE_TIME_SERIES, META_FIELD_PAYLOAD_VERSION, meta_field_values, mcl_item_t::type, and mcl_item_t::version.
Referenced by json_from_item_meta().
|
static |
Definition at line 558 of file json.c.
References _add_item_meta_payload_file_details(), _add_item_meta_payload_timeseries_details(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FAIL, MCL_ITEM_TYPE_CUSTOM_DATA, MCL_ITEM_TYPE_DATA_SOURCE_CONFIGURATION, MCL_ITEM_TYPE_EVENT, MCL_ITEM_TYPE_FILE, MCL_ITEM_TYPE_TIMESERIES, mcl_json_util_add_object(), mcl_json_util_destroy(), mcl_json_util_duplicate(), MCL_NULL, MCL_OK, meta_field_names, META_FIELD_PAYLOAD_DETAILS, and mcl_item_t::type.
Referenced by _add_item_meta_payload().
|
static |
Definition at line 1380 of file json.c.
References file_payload_t::creation_date, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_json_util_add_string(), mcl_json_util_start_object(), MCL_NULL, MCL_OK, meta_field_names, META_FIELD_PAYLOAD_DETAILS, META_FIELD_PAYLOAD_DETAILS_CREATION_DATE, META_FIELD_PAYLOAD_DETAILS_FILE_NAME, META_FIELD_PAYLOAD_DETAILS_FILE_TYPE, file_t::payload, file_payload_t::remote_name, and file_payload_t::type.
Referenced by _add_item_meta_payload_details().
|
static |
Definition at line 1361 of file json.c.
References timeseries_payload_t::configuration_id, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_json_util_add_string(), mcl_json_util_start_object(), MCL_NULL, MCL_OK, meta_field_names, META_FIELD_PAYLOAD_DETAILS, META_FIELD_PAYLOAD_DETAILS_CONFIGURATION_ID, and timeseries_t::payload.
Referenced by _add_item_meta_payload_details().
|
static |
Definition at line 1329 of file json.c.
References custom_data_payload_t::details, DOUBLE_BRACE_SIZE, ITEM_CUSTOM_DATA_META_PAYLOAD_BASE_SIZE, ITEM_CUSTOM_DATA_META_PAYLOAD_DETAILS_SIZE, MCL_FREE, mcl_json_util_to_string(), MCL_NULL, mcl_string_util_strlen(), MCL_VERBOSE_ENTRY, MCL_VERBOSE_LEAVE, custom_data_t::payload, custom_data_payload_t::type, and custom_data_payload_t::version.
Referenced by _item_meta_size().
|
static |
Definition at line 797 of file json.c.
References mcl_list_t::count, mcl_list_node_t::data, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_json_util_add_item_to_array(), mcl_json_util_destroy(), mcl_list_next(), mcl_list_reset(), MCL_NULL, and MCL_OK.
Referenced by _json_from_data_source(), _json_from_data_source_configuration_payload(), _json_from_timeseries_payload(), and _json_from_timeseries_value_list().
|
static |
Definition at line 1411 of file json.c.
References MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_json_util_get_array_item(), mcl_json_util_get_array_size(), mcl_list_add(), MCL_NULL, and MCL_OK.
Referenced by _parse_data_source(), and _parse_data_source_configuration().
|
static |
Definition at line 1280 of file json.c.
References _custom_data_meta_size(), ITEM_DATA_SOURCE_CONFIGURATION_META_PAYLOAD_BASE_SIZE, ITEM_EVENT_META_PAYLOAD_BASE_SIZE, ITEM_FILE_META_PAYLOAD_BASE_SIZE, ITEM_FILE_META_PAYLOAD_FILE_TYPE_SIZE, ITEM_META_BASE_SIZE, ITEM_TIMESERIES_META_PAYLOAD_BASE_SIZE, mcl_data_source_configuration_versions, mcl_event_versions, mcl_file_versions, MCL_ITEM_TYPE_CUSTOM_DATA, MCL_ITEM_TYPE_DATA_SOURCE_CONFIGURATION, MCL_ITEM_TYPE_EVENT, MCL_ITEM_TYPE_FILE, MCL_ITEM_TYPE_TIMESERIES, MCL_NULL, mcl_string_util_strlen(), mcl_timeseries_versions, MCL_VERBOSE_ENTRY, MCL_VERBOSE_LEAVE, mcl_item_t::type, and mcl_item_t::version.
Referenced by json_get_item_size().
|
static |
Definition at line 1244 of file json.c.
References data_point_t::custom_data, data_point_t::description, DOUBLE_BRACE_SIZE, data_point_t::id, ITEM_DATA_POINT_BASE_SIZE, ITEM_DATA_SOURCE_CONFIGURATION_PAYLOAD_CUSTOM_DATA_SIZE, MCL_FREE, mcl_json_util_to_string(), MCL_NULL, mcl_string_util_strlen(), MCL_VERBOSE_ENTRY, MCL_VERBOSE_LEAVE, data_point_t::name, data_point_t::type, and data_point_t::unit.
Referenced by _item_payload_size_for_data_source().
|
static |
Definition at line 1195 of file json.c.
References _item_payload_size_for_data_point(), mcl_list_t::count, data_source_t::custom_data, mcl_list_node_t::data, data_source_t::data_points, DELIMITER_SIZE, data_source_t::description, DOUBLE_BRACE_SIZE, ITEM_DATA_SOURCE_BASE_SIZE, ITEM_DATA_SOURCE_CONFIGURATION_PAYLOAD_CUSTOM_DATA_SIZE, MCL_FREE, mcl_json_util_to_string(), mcl_list_next(), mcl_list_reset(), MCL_NULL, mcl_string_util_strlen(), MCL_VERBOSE_ENTRY, MCL_VERBOSE_LEAVE, and data_source_t::name.
Referenced by _item_payload_size_for_data_source_configuration().
|
static |
Definition at line 1167 of file json.c.
References _item_payload_size_for_data_source(), data_source_configuration_payload_t::configuration_id, mcl_list_t::count, mcl_list_node_t::data, data_source_configuration_payload_t::data_sources, DELIMITER_SIZE, ITEM_DATA_SOURCE_CONFIGURATION_PAYLOAD_BASE_SIZE, mcl_list_next(), mcl_list_reset(), mcl_string_util_strlen(), MCL_VERBOSE_ENTRY, MCL_VERBOSE_LEAVE, and data_source_configuration_t::payload.
Referenced by json_get_item_size().
|
static |
Definition at line 1109 of file json.c.
References event_payload_t::correlation_id, event_payload_t::description, event_payload_t::details, DOUBLE_BRACE_SIZE, event_payload_t::id, event_t::item_base, ITEM_EVENT_PAYLOAD_BASE_SIZE, ITEM_EVENT_PAYLOAD_CORRELATION_ID_SIZE, ITEM_EVENT_PAYLOAD_DESCRIPTION_SIZE, MCL_EVENT_VERSION_1_0, MCL_EVENT_VERSION_2_0, MCL_FREE, mcl_json_util_to_string(), MCL_NULL, mcl_string_util_strlen(), MCL_VERBOSE_ENTRY, MCL_VERBOSE_LEAVE, event_t::payload, event_payload_t::type, event_payload_t::version, and mcl_item_t::version.
Referenced by json_get_item_size().
|
static |
Definition at line 1041 of file json.c.
References _item_payload_size_for_timeseries_value_list(), mcl_list_t::count, mcl_list_node_t::data, DELIMITER_SIZE, DOUBLE_BRACE_SIZE, mcl_list_next(), mcl_list_reset(), MCL_VERBOSE_ENTRY, MCL_VERBOSE_LEAVE, timeseries_t::payload, and timeseries_payload_t::value_lists.
Referenced by json_get_item_size().
|
static |
Definition at line 1094 of file json.c.
References timeseries_value_t::data_point_id, ITEM_TIMESERIES_VALUE_BASE_SIZE, mcl_string_util_strlen(), MCL_VERBOSE_ENTRY, MCL_VERBOSE_LEAVE, timeseries_value_t::quality_code, and timeseries_value_t::value.
Referenced by _item_payload_size_for_timeseries_value_list().
|
static |
Definition at line 1068 of file json.c.
References _item_payload_size_for_timeseries_value(), mcl_list_t::count, mcl_list_node_t::data, DELIMITER_SIZE, ITEM_TIMESERIES_VALUE_LIST_BASE_SIZE, mcl_list_next(), mcl_list_reset(), MCL_VERBOSE_ENTRY, MCL_VERBOSE_LEAVE, and timeseries_value_list_t::values.
Referenced by _item_payload_size_for_timeseries().
|
static |
Definition at line 837 of file json.c.
References data_point_t::custom_data, data_point_t::description, data_point_t::id, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_JSON_OBJECT, mcl_json_util_add_object(), mcl_json_util_add_string(), mcl_json_util_destroy(), mcl_json_util_duplicate(), mcl_json_util_initialize(), MCL_NULL, MCL_OK, data_point_t::name, PAYLOAD_FIELD_CUSTOM_DATA, PAYLOAD_FIELD_DATA_SOURCES_DATA_POINTS_NAME, PAYLOAD_FIELD_DATA_SOURCES_DATA_POINTS_TYPE, PAYLOAD_FIELD_DATA_SOURCES_DATA_POINTS_UNIT, PAYLOAD_FIELD_DESCRIPTION, PAYLOAD_FIELD_ID, payload_field_names, data_point_t::type, and data_point_t::unit.
Referenced by _json_from_data_source().
|
static |
Definition at line 903 of file json.c.
References _fill_array_using_list(), _json_from_data_point(), data_source_t::custom_data, data_source_t::data_points, data_source_t::description, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_JSON_OBJECT, mcl_json_util_add_object(), mcl_json_util_add_string(), mcl_json_util_destroy(), mcl_json_util_duplicate(), mcl_json_util_initialize(), mcl_json_util_start_array(), MCL_NULL, MCL_OK, data_source_t::name, PAYLOAD_FIELD_CUSTOM_DATA, PAYLOAD_FIELD_DATA_SOURCES_DATA_POINTS, PAYLOAD_FIELD_DATA_SOURCES_NAME, PAYLOAD_FIELD_DESCRIPTION, and payload_field_names.
Referenced by _json_from_data_source_configuration_payload().
|
static |
Definition at line 723 of file json.c.
References _fill_array_using_list(), _json_from_data_source(), data_source_configuration_payload_t::configuration_id, data_source_configuration_payload_t::data_sources, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_JSON_OBJECT, mcl_json_util_add_string(), mcl_json_util_destroy(), mcl_json_util_initialize(), mcl_json_util_start_array(), mcl_json_util_to_string(), MCL_NULL, MCL_OK, data_source_configuration_t::payload, PAYLOAD_FIELD_CONFIGURATION_ID, PAYLOAD_FIELD_DATA_SOURCES, and payload_field_names.
Referenced by json_from_item_payload().
|
static |
Definition at line 399 of file json.c.
References _add_event_to_payload_array(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_JSON_ARRAY, mcl_json_util_destroy(), mcl_json_util_initialize(), mcl_json_util_to_string(), MCL_NULL, and MCL_OK.
Referenced by json_from_item_payload().
|
static |
Definition at line 768 of file json.c.
References _fill_array_using_list(), _json_from_timeseries_value_list(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_JSON_ARRAY, mcl_json_util_destroy(), mcl_json_util_initialize(), mcl_json_util_to_string(), MCL_NULL, MCL_OK, timeseries_t::payload, and timeseries_payload_t::value_lists.
Referenced by json_from_item_payload().
|
static |
Definition at line 966 of file json.c.
References timeseries_value_t::data_point_id, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_JSON_OBJECT, mcl_json_util_add_string(), mcl_json_util_destroy(), mcl_json_util_initialize(), MCL_OK, payload_field_names, PAYLOAD_FIELD_VALUES_DATA_POINT_ID, PAYLOAD_FIELD_VALUES_QUALITY_CODE, PAYLOAD_FIELD_VALUES_VALUE, timeseries_value_t::quality_code, and timeseries_value_t::value.
Referenced by _json_from_timeseries_value_list().
|
static |
Definition at line 1002 of file json.c.
References _fill_array_using_list(), _json_from_timeseries_value(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_JSON_OBJECT, mcl_json_util_add_string(), mcl_json_util_destroy(), mcl_json_util_initialize(), mcl_json_util_start_array(), MCL_NULL, MCL_OK, payload_field_names, PAYLOAD_FIELD_TIMESTAMP, PAYLOAD_FIELD_VALUES, timeseries_value_list_t::timestamp, and timeseries_value_list_t::values.
Referenced by _json_from_timeseries_payload().
|
static |
Definition at line 1626 of file json.c.
References MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_json_util_get_object_item(), mcl_json_util_get_string(), and MCL_OK.
Referenced by _parse_data_point(), _parse_data_source(), and _parse_data_source_configuration().
|
static |
Definition at line 1454 of file json.c.
References _parse_and_get_string_value(), mcl_data_point_destroy(), mcl_data_point_initialize(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_JSON_NON_EXISTING_CHILD, mcl_json_util_duplicate(), mcl_json_util_get_object_item(), MCL_NULL, MCL_OK, PAYLOAD_FIELD_CUSTOM_DATA, PAYLOAD_FIELD_DATA_SOURCES_DATA_POINTS_NAME, PAYLOAD_FIELD_DATA_SOURCES_DATA_POINTS_TYPE, PAYLOAD_FIELD_DATA_SOURCES_DATA_POINTS_UNIT, PAYLOAD_FIELD_DESCRIPTION, PAYLOAD_FIELD_ID, and payload_field_names.
Referenced by _parse_data_source().
|
static |
Definition at line 1523 of file json.c.
References _fill_list_using_json_array(), _parse_and_get_string_value(), _parse_data_point(), mcl_data_point_destroy(), mcl_data_source_destroy(), mcl_data_source_initialize(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_JSON_NON_EXISTING_CHILD, mcl_json_util_duplicate(), mcl_json_util_get_object_item(), MCL_NULL, MCL_OK, PAYLOAD_FIELD_CUSTOM_DATA, PAYLOAD_FIELD_DATA_SOURCES_DATA_POINTS, PAYLOAD_FIELD_DATA_SOURCES_NAME, PAYLOAD_FIELD_DESCRIPTION, and payload_field_names.
Referenced by _parse_data_source_configuration().
|
static |
Definition at line 1588 of file json.c.
References _fill_list_using_json_array(), _parse_and_get_string_value(), _parse_data_source(), MCL_DATA_SOURCE_CONFIGURATION_1_0, mcl_data_source_configuration_destroy(), mcl_data_source_configuration_initialize(), mcl_data_source_destroy(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_json_util_get_object_item(), MCL_NULL, MCL_OK, PAYLOAD_FIELD_CONFIGURATION_ID, PAYLOAD_FIELD_DATA_SOURCES, and payload_field_names.
Referenced by json_parse_item().
mcl_error_t json_from_item_meta | ( | void * | item, |
char ** | json_string | ||
) |
This function creates json representation of an item meta.
[in] | item | MCL item (Event, Timeseries, etc.). |
[out] | json_string | Json string representation of item meta. |
Definition at line 326 of file json.c.
References _add_item_meta_details(), _add_item_meta_payload(), ITEM_TYPE, ITEM_VERSION, MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_JSON_OBJECT, mcl_json_util_add_string(), mcl_json_util_destroy(), mcl_json_util_initialize(), mcl_json_util_to_string(), MCL_NULL, MCL_OK, meta_field_names, META_FIELD_TYPE, and META_FIELD_VERSION.
Referenced by _add_item_meta_json().
mcl_error_t json_from_item_payload | ( | void * | item, |
char ** | json_string | ||
) |
This function creates json representation of an item payload in a json array.
[in] | item | Item which will be used to create json string. |
[out] | json_string | Json string representation of item payload. |
Definition at line 370 of file json.c.
References _json_from_data_source_configuration_payload(), _json_from_event_payload(), _json_from_timeseries_payload(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_FAIL, MCL_ITEM_TYPE_DATA_SOURCE_CONFIGURATION, MCL_ITEM_TYPE_EVENT, and MCL_ITEM_TYPE_TIMESERIES.
Referenced by _add_item_payload().
mcl_size_t json_get_item_size | ( | void * | item | ) |
This function calculates the item size.
[in] | item | Item to calculate its size. |
Definition at line 429 of file json.c.
References _item_meta_size(), _item_payload_size_for_data_source_configuration(), _item_payload_size_for_event(), _item_payload_size_for_timeseries(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, MCL_ITEM_TYPE_CUSTOM_DATA, MCL_ITEM_TYPE_DATA_SOURCE_CONFIGURATION, MCL_ITEM_TYPE_EVENT, MCL_ITEM_TYPE_FILE, and MCL_ITEM_TYPE_TIMESERIES.
Referenced by multipart_get_tuple_size().
mcl_error_t json_parse_item | ( | const char * | json_string, |
mcl_size_t | string_length, | ||
void ** | item | ||
) |
This function parses json representation of an item to its struct (Currently, only for data source configuration).
[in] | json_string | Json string. |
[in] | string_length | Length of json string. |
[out] | item | Item struct. |
Definition at line 467 of file json.c.
References _parse_data_source_configuration(), MCL_DEBUG_ENTRY, MCL_DEBUG_LEAVE, mcl_json_util_destroy(), mcl_json_util_parse(), MCL_NULL, and MCL_OK.
Referenced by connectivity_processor_get_data_source_configuration().
|
static |
Meta field names.
Definition at line 165 of file json.c.
Referenced by _add_item_meta_payload(), _add_item_meta_payload_details(), _add_item_meta_payload_file_details(), _add_item_meta_payload_timeseries_details(), and json_from_item_meta().
|
static |
Meta field values.
Definition at line 187 of file json.c.
Referenced by _add_item_meta_payload().
|
static |
Payload field names.
Definition at line 198 of file json.c.
Referenced by _add_event_to_payload_array(), _json_from_data_point(), _json_from_data_source(), _json_from_data_source_configuration_payload(), _json_from_timeseries_value(), _json_from_timeseries_value_list(), _parse_data_point(), _parse_data_source(), and _parse_data_source_configuration().