Serializes Beacon Data into JSON Format.
515 if (!event.type.empty())
520 if (!event.summary.empty())
525 if (event.timestamp_ms != 0)
530 if (event.duration_ms > 0)
558 if (event.resp_code != 0)
563 if (!event.error.empty())
568 if (event.req_content_length > 0)
573 if (event.resp_content_length > 0)
578 if (event.timestamp_ms != 0)
583 if (event.duration_ms > 0)
589 if (!(event.resp_headers.stringmap.empty()))
593 for (std::map<std::string, std::string>::iterator resp_header_it = event.resp_headers.stringmap.begin();
594 resp_header_it !=
event.resp_headers.stringmap.end(); ++resp_header_it)
626 if (!event.name.empty())
631 if (!event.message.empty())
636 if (!event.severity.empty())
641 if (event.timestamp_ms != 0)
646 if (event.duration_ms > 0)
651 if (!event.stack_trace_list.empty())
653 std::list<stack_trace_t>::iterator stack_trace_it =
event.stack_trace_list.begin();
660 for (; stack_trace_it !=
event.stack_trace_list.end(); ++stack_trace_it)
671 std::list<stack_frame_t>::iterator stack_frame_it = stack_trace.
stack_frame_list.begin();
676 for (; stack_frame_it != stack_trace.
stack_frame_list.end(); ++stack_frame_it)
697 if (stack_frame.
lineno > 0)
735 if (json_str != NULL)
static void appd_iot_serialize_properties_data_to_json(json_t *json, data_t *data)
Serializes Data into JSON Format.
Definition: beacon.cpp:339
int image_offset
Definition: beacon.hpp:67
std::string os_version
Definition: beacon.hpp:98
int symbol_offset
Definition: beacon.hpp:68
std::string package_name
Definition: beacon.hpp:63
appd_iot_error_code_t appd_iot_json_add_string_value(json_t *json, const char *value)
adds value to json object. This function is typically used to add string values to JSON arrays ...
Definition: json_serializer.cpp:580
uint64_t absolute_addr
Definition: beacon.hpp:66
void appd_iot_log(appd_iot_log_level_t log_level, const char *format,...)
Reads log message, appends log header and triggers log write callback function.
Definition: log.cpp:89
json_t * appd_iot_json_init()
Creates, Initializes and returns a new json struct.
Definition: json_serializer.cpp:49
Definition: appd_iot_def.h:107
appd_iot_error_code_t appd_iot_json_add_integer_key_value(json_t *json, const char *key, int64_t intval)
adds key:value pair to json object with value as 64 bit integer
Definition: json_serializer.cpp:451
appd_iot_error_code_t appd_iot_json_add_string_key_value(json_t *json, const char *key, const char *strval)
adds key:value pair to json object with value as string
Definition: json_serializer.cpp:438
appd_iot_error_code_t appd_iot_json_end_array(json_t *json)
ends json object by adding char ']' to json buf.
Definition: json_serializer.cpp:220
std::string fw_version
Definition: beacon.hpp:96
Definition: beacon.hpp:60
std::list< network_request_event_t > network_request_event_list
Definition: beacon.hpp:105
Definition: beacon.hpp:71
Definition: beacon.hpp:38
device_cfg_t devcfg
Definition: beacon.hpp:103
const char * appd_iot_json_pretty_print(json_t *json)
format and returns json string with line breaks, indentiation at start/end of objects/arrays ...
Definition: json_serializer.cpp:634
std::string symbol_name
Definition: beacon.hpp:62
std::string device_type
Definition: beacon.hpp:93
const char * appd_iot_json_get_string(json_t *json)
returns the json string constructed so far.
Definition: json_serializer.cpp:624
#define APPD_IOT_SDK_VERSION
Definition: beacon.cpp:25
void appd_iot_json_free(json_t *json)
frees json structure
Definition: json_serializer.cpp:731
std::string device_name
Definition: beacon.hpp:92
int lineno
Definition: beacon.hpp:65
std::string device_id
Definition: beacon.hpp:94
Definition: beacon.hpp:78
std::list< stack_frame_t > stack_frame_list
Definition: beacon.hpp:75
std::string thread
Definition: beacon.hpp:73
Definition: beacon.hpp:47
appd_iot_error_code_t appd_iot_json_end_object(json_t *json)
ends json object by adding char '}' to json buf.
Definition: json_serializer.cpp:210
std::string file_name
Definition: beacon.hpp:64
std::list< custom_event_t > custom_event_list
Definition: beacon.hpp:104
std::list< error_event_t > error_event_list
Definition: beacon.hpp:106
appd_iot_error_code_t appd_iot_json_start_array(json_t *json, const char *array_name)
starts json array by adding char '[' to json buf. If a name is given it will be "name":[ ...
Definition: json_serializer.cpp:147
appd_iot_error_code_t appd_iot_json_start_object(json_t *json, const char *object_name)
starts json object by adding char '{' to json buf. If a name is given it will be "name":{ ...
Definition: json_serializer.cpp:159
std::string hw_version
Definition: beacon.hpp:95
JSON struct which holds json string in a buffer.
Definition: json_serializer.hpp:39
std::string runtime
Definition: beacon.hpp:74
std::string sw_version
Definition: beacon.hpp:97