AppDynamics IoT C++ SDK
AppDynamics IoT C++ library contains code that facilitates capturing availability, usage, network performance and errors of an IoT Application.
beacon.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 AppDynamics, Inc., and its affiliates
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef _BEACON_HPP
18 #define _BEACON_HPP
19 
20 #include <string>
21 #include <map>
22 #include <list>
23 #include "appd_iot_interface.h"
24 
25 #define APPD_IOT_MAX_CUSTOM_EVENTS 200
26 #define APPD_IOT_MAX_NETWORK_EVENTS 200
27 #define APPD_IOT_MAX_ERROR_EVENTS 200
28 
29 typedef struct
30 {
31  std::map<std::string, std::string> stringmap;
32  std::map<std::string, int64_t>integermap;
33  std::map<std::string, double>doublemap;
34  std::map<std::string, bool>boolmap;
35  std::map<std::string, int64_t>datetimemap;
36 } data_t;
37 
38 typedef struct
39 {
40  std::string type; /* Type of the event */
41  std::string summary; /* Summary of the event */
42  int64_t timestamp_ms; /* Timestamp UTC format in milliseconds */
43  int duration_ms; /* Duration of the event in milliseconds */
46 
47 typedef struct
48 {
49  std::string url;
50  std::string error;
53  int resp_code;
54  int64_t timestamp_ms;
59 
60 typedef struct
61 {
62  std::string symbol_name;
63  std::string package_name;
64  std::string file_name;
65  int lineno;
66  uint64_t absolute_addr;
70 
71 typedef struct
72 {
73  std::string thread;
74  std::string runtime;
75  std::list<stack_frame_t> stack_frame_list;
77 
78 typedef struct
79 {
80  std::string name;
81  std::string message;
82  std::string severity;
83  int64_t timestamp_ms;
86  std::list<stack_trace_t> stack_trace_list;
89 
90 typedef struct
91 {
92  std::string device_name;
93  std::string device_type;
94  std::string device_id;
95  std::string hw_version;
96  std::string fw_version;
97  std::string sw_version;
98  std::string os_version;
99 } device_cfg_t;
100 
101 typedef struct
102 {
104  std::list<custom_event_t> custom_event_list;
105  std::list<network_request_event_t> network_request_event_list;
106  std::list<error_event_t> error_event_list;
107 } beacon_t;
108 
116 
117 
124 
125 
132 
133 
140 
141 
147 
148 
154 
155 #endif // _BEACON_HPP
int image_offset
Definition: beacon.hpp:67
std::string os_version
Definition: beacon.hpp:98
int symbol_offset
Definition: beacon.hpp:68
appd_iot_error_code_t appd_iot_add_network_request_event_to_beacon(network_request_event_t event)
Adds Network Request Event to Beacon.
Definition: beacon.cpp:115
std::string package_name
Definition: beacon.hpp:63
uint64_t absolute_addr
Definition: beacon.hpp:66
int duration_ms
Definition: beacon.hpp:55
int req_content_length
Definition: beacon.hpp:51
appd_iot_error_code_t appd_iot_init_device_config(appd_iot_device_config_t devcfg)
Initializes Device Configuration It is madatory to set Device ID and Device Type.
Definition: beacon.cpp:37
Definition: beacon.hpp:29
appd_iot_error_code_t appd_iot_add_error_event_to_beacon(error_event_t event)
Adds Error Event to Beacon.
Definition: beacon.cpp:141
std::string fw_version
Definition: beacon.hpp:96
AppDynamics Device Information Mandatory: Device Type and Device ID Fields.
Definition: appd_iot_def.h:163
std::string error
Definition: beacon.hpp:50
Definition: beacon.hpp:60
std::string summary
Definition: beacon.hpp:41
data_t data
Definition: beacon.hpp:87
std::list< network_request_event_t > network_request_event_list
Definition: beacon.hpp:105
int duration_ms
Definition: beacon.hpp:43
int64_t timestamp_ms
Definition: beacon.hpp:54
int duration_ms
Definition: beacon.hpp:84
std::map< std::string, bool > boolmap
Definition: beacon.hpp:34
Definition: beacon.hpp:71
std::map< std::string, std::string > stringmap
Definition: beacon.hpp:31
appd_iot_error_code_t
Error Code Enums for SDK log.
Definition: appd_iot_def.h:27
appd_iot_error_code_t appd_iot_clear_all_beacons(void)
Clears Beacons in memory.
Definition: beacon.cpp:167
int error_stack_trace_index
Definition: beacon.hpp:85
Definition: beacon.hpp:101
Definition: beacon.hpp:38
device_cfg_t devcfg
Definition: beacon.hpp:103
std::string severity
Definition: beacon.hpp:82
std::list< stack_trace_t > stack_trace_list
Definition: beacon.hpp:86
int64_t timestamp_ms
Definition: beacon.hpp:42
std::map< std::string, int64_t > integermap
Definition: beacon.hpp:32
std::string symbol_name
Definition: beacon.hpp:62
std::map< std::string, int64_t > datetimemap
Definition: beacon.hpp:35
int resp_code
Definition: beacon.hpp:53
std::string device_type
Definition: beacon.hpp:93
std::string message
Definition: beacon.hpp:81
std::string name
Definition: beacon.hpp:80
data_t resp_headers
Definition: beacon.hpp:56
Definition: beacon.hpp:90
std::string device_name
Definition: beacon.hpp:92
int lineno
Definition: beacon.hpp:65
appd_iot_error_code_t appd_iot_send_all_beacons(void)
Sends Beacons in memory to collector.
Definition: beacon.cpp:189
data_t data
Definition: beacon.hpp:44
std::string device_id
Definition: beacon.hpp:94
std::map< std::string, double > doublemap
Definition: beacon.hpp:33
Definition: beacon.hpp:78
data_t data
Definition: beacon.hpp:57
std::list< stack_frame_t > stack_frame_list
Definition: beacon.hpp:75
std::string thread
Definition: beacon.hpp:73
Definition: beacon.hpp:47
std::string file_name
Definition: beacon.hpp:64
int64_t timestamp_ms
Definition: beacon.hpp:83
std::list< custom_event_t > custom_event_list
Definition: beacon.hpp:104
std::list< error_event_t > error_event_list
Definition: beacon.hpp:106
std::string type
Definition: beacon.hpp:40
std::string url
Definition: beacon.hpp:49
std::string hw_version
Definition: beacon.hpp:95
int resp_content_length
Definition: beacon.hpp:52
appd_iot_error_code_t appd_iot_add_custom_event_to_beacon(custom_event_t event)
Adds Custom Event to Beacon.
Definition: beacon.cpp:90
std::string runtime
Definition: beacon.hpp:74
std::string sw_version
Definition: beacon.hpp:97