From 7c22f140d889f69f3a7909680a625e22425fa20d Mon Sep 17 00:00:00 2001 From: Fabio Pintus Date: Wed, 20 Jan 2021 18:13:06 +0100 Subject: [PATCH] improvement in lwm2m newinstance call timing --- Samples/AZX_Docs/html/annotated.html | 2 +- Samples/AZX_Docs/html/app__cfg_8h.html | 4 +- Samples/AZX_Docs/html/app__cfg_8h_source.html | 4 +- Samples/AZX_Docs/html/azx__log_8h.html | 97 +++++- Samples/AZX_Docs/html/azx__log_8h.js | 6 +- Samples/AZX_Docs/html/azx__log_8h_source.html | 176 +++++----- Samples/AZX_Docs/html/azx__utils_8h.html | 26 +- Samples/AZX_Docs/html/azx__utils_8h.js | 4 +- .../AZX_Docs/html/azx__utils_8h_source.html | 53 +-- Samples/AZX_Docs/html/classes.html | 2 +- .../dir_0045f852bf8045b6d5abd9c9eb54a446.html | 2 +- Samples/AZX_Docs/html/files.html | 2 +- Samples/AZX_Docs/html/functions.html | 2 +- Samples/AZX_Docs/html/functions_vars.html | 2 +- Samples/AZX_Docs/html/globals.html | 12 +- Samples/AZX_Docs/html/globals_defs.html | 2 +- Samples/AZX_Docs/html/globals_enum.html | 2 +- Samples/AZX_Docs/html/globals_eval.html | 2 +- Samples/AZX_Docs/html/globals_func.html | 12 +- Samples/AZX_Docs/html/graph_legend.html | 2 +- Samples/AZX_Docs/html/group__log_conf.html | 18 +- Samples/AZX_Docs/html/group__log_conf.js | 4 +- Samples/AZX_Docs/html/group__log_usage.html | 2 +- Samples/AZX_Docs/html/index.html | 2 +- Samples/AZX_Docs/html/modules.html | 2 +- Samples/AZX_Docs/html/navtreeindex0.js | 46 +-- Samples/AZX_Docs/html/search/all_0.js | 56 ++-- Samples/AZX_Docs/html/search/all_1.js | 2 +- Samples/AZX_Docs/html/search/all_2.js | 8 +- Samples/AZX_Docs/html/search/all_3.js | 2 +- Samples/AZX_Docs/html/search/all_4.js | 2 +- Samples/AZX_Docs/html/search/classes_0.js | 2 +- Samples/AZX_Docs/html/search/defines_0.js | 4 +- Samples/AZX_Docs/html/search/defines_1.js | 4 +- Samples/AZX_Docs/html/search/defines_2.js | 2 +- Samples/AZX_Docs/html/search/enums_0.js | 6 +- Samples/AZX_Docs/html/search/enumvalues_0.js | 30 +- Samples/AZX_Docs/html/search/files_0.js | 6 +- Samples/AZX_Docs/html/search/functions_0.js | 18 +- Samples/AZX_Docs/html/search/groups_0.js | 2 +- Samples/AZX_Docs/html/search/groups_1.js | 2 +- Samples/AZX_Docs/html/search/pages_0.js | 2 +- Samples/AZX_Docs/html/search/variables_0.js | 6 +- .../struct_a_z_x___l_o_g___c_f_g___t.html | 2 +- .../azx/hdr/azx_log.h | 54 +++- .../azx/hdr/azx_utils.h | 11 +- .../azx/src/azx_log.c | 301 +++++++++++++++++- .../azx/src/azx_utils.c | 14 +- .../BRAVO_Environment_BSEC_Demo/hdr/app_cfg.h | 2 +- .../src/demo_utils/lwm2m.c | 28 +- Samples/BRAVO_Rotation_Demo/azx/hdr/azx_log.h | 54 +++- .../BRAVO_Rotation_Demo/azx/hdr/azx_utils.h | 11 +- Samples/BRAVO_Rotation_Demo/azx/src/azx_log.c | 301 +++++++++++++++++- .../BRAVO_Rotation_Demo/azx/src/azx_utils.c | 14 +- Samples/BRAVO_Rotation_Demo/hdr/app_cfg.h | 2 +- .../src/demo_utils/lwm2m.c | 28 +- .../BRAVO_Tampering_Demo/azx/hdr/azx_log.h | 54 +++- .../BRAVO_Tampering_Demo/azx/hdr/azx_utils.h | 11 +- .../BRAVO_Tampering_Demo/azx/src/azx_log.c | 301 +++++++++++++++++- .../BRAVO_Tampering_Demo/azx/src/azx_utils.c | 14 +- Samples/BRAVO_Tampering_Demo/hdr/app_cfg.h | 2 +- .../src/demo_utils/lwm2m.c | 28 +- Samples/README.md | 2 +- 63 files changed, 1487 insertions(+), 389 deletions(-) diff --git a/Samples/AZX_Docs/html/annotated.html b/Samples/AZX_Docs/html/annotated.html index dc731f7..d1fc7bb 100644 --- a/Samples/AZX_Docs/html/annotated.html +++ b/Samples/AZX_Docs/html/annotated.html @@ -34,7 +34,7 @@ Logo
AZX (AppZone eXtensions) documentation -  1.0.4 +  1.0.5
A set of companion utilities that make AZ development easier
diff --git a/Samples/AZX_Docs/html/app__cfg_8h.html b/Samples/AZX_Docs/html/app__cfg_8h.html index 0efb57a..81a8050 100644 --- a/Samples/AZX_Docs/html/app__cfg_8h.html +++ b/Samples/AZX_Docs/html/app__cfg_8h.html @@ -34,7 +34,7 @@ Logo
AZX (AppZone eXtensions) documentation -  1.0.4 +  1.0.5
A set of companion utilities that make AZ development easier
@@ -116,7 +116,7 @@

Macros

-#define VERSION   "1.0.4" +#define VERSION   "1.0.5"  The current version of the Samples.
 
Log Settings
diff --git a/Samples/AZX_Docs/html/app__cfg_8h_source.html b/Samples/AZX_Docs/html/app__cfg_8h_source.html index 212f128..717bb02 100644 --- a/Samples/AZX_Docs/html/app__cfg_8h_source.html +++ b/Samples/AZX_Docs/html/app__cfg_8h_source.html @@ -34,7 +34,7 @@ Logo
AZX (AppZone eXtensions) documentation -  1.0.4 +  1.0.5
A set of companion utilities that make AZ development easier
@@ -102,7 +102,7 @@
20 
21 
22 
-
26 #define VERSION "1.0.4"
+
26 #define VERSION "1.0.5"
27 
32 #define LOG_LEVEL AZX_LOG_LEVEL_DEBUG
33 #define LOG_CHANNEL AZX_LOG_TO_MAIN_UART
diff --git a/Samples/AZX_Docs/html/azx__log_8h.html b/Samples/AZX_Docs/html/azx__log_8h.html index 50e7f47..cafa99b 100644 --- a/Samples/AZX_Docs/html/azx__log_8h.html +++ b/Samples/AZX_Docs/html/azx__log_8h.html @@ -34,7 +34,7 @@ Logo
AZX (AppZone eXtensions) documentation -  1.0.4 +  1.0.5
A set of companion utilities that make AZ development easier
@@ -135,14 +135,14 @@

Enumerations

enum  AZX_LOG_LEVEL_E {
-  AZX_LOG_LEVEL_NONE = 0, -AZX_LOG_LEVEL_TRACE = 1, +  AZX_LOG_LEVEL_TRACE = 1, AZX_LOG_LEVEL_DEBUG = 2, AZX_LOG_LEVEL_INFO = 3, +AZX_LOG_LEVEL_WARN = 4,
-  AZX_LOG_LEVEL_WARN = 4, -AZX_LOG_LEVEL_ERROR = 5, -AZX_LOG_LEVEL_CRITICAL = 6 +  AZX_LOG_LEVEL_ERROR = 5, +AZX_LOG_LEVEL_CRITICAL = 6, +AZX_LOG_LEVEL_NONE = 0x7F
}  Logging levels. More...
@@ -184,10 +184,16 @@ AZX_LOG_LEVEL_E azx_log_getLevel (void)  Returns the current value of the log level. More...
  +BOOLEAN azx_log_send_to_file (const CHAR *filename, UINT32 circular_chunks, AZX_LOG_LEVEL_E min_level, UINT32 max_size_kb) + Gets the logging component to output to a file. More...
+  +void azx_log_flush_to_file (void) + Flushes any outstanding logs to the file. More...

Detailed Description

Logging utilities to print on available output channels.

-
Version
1.0.2
+
Version
1.0.5
Dependencies

Author
Fabio Pintus
@@ -218,6 +224,27 @@

See also
azx_log_init

Example

azx_log_deinit();
 
+
+ + +

◆ azx_log_flush_to_file()

+ +
+
+ + + + + + + + +
void azx_log_flush_to_file (void )
+
+ +

Flushes any outstanding logs to the file.

+

Without calling this, there is no guarantee of when the logs will be written to the filesystem. It may take longer due to caching.

+
@@ -242,6 +269,62 @@

See also
azx_log_init()

Example

AZX_LOG_LEVEL_E level = azx_log_get_log_level();
 
+ + + +

◆ azx_log_send_to_file()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BOOLEAN azx_log_send_to_file (const CHAR * filename,
UINT32 circular_chunks,
AZX_LOG_LEVEL_E min_level,
UINT32 max_size_kb 
)
+
+ +

Gets the logging component to output to a file.

+

Once this is called all the logs will be sent to a named file. The file will be appended to, so existing logs there will not be removed.

+

Logs will continue to be sent to USB/UART if that is so configured.

+

Only one file can be used at the same time, so calling this again with a new filename means that all logs will go to the new file instead of the old one.

+

The logging can be configured to be done in a circular way by setting circular_chunks to a value greater than 0. Each chunk will have at most max_size_kb KB.

+
Parameters
+ + + + + +
filenameThe name of the file to log to. If NULL, this function does nothing.
circular_chunksThe number of chunks to store circularly (apart from the original one).
min_levelThe minimum level of the logs to be stored.
max_size_kbThe maximum size in KB of each size of the log file. Once the file reaches that limit, no further logging will be made to it.
+
+
+
Returns
TRUE if the file can be created and opened, FALSE otherwise
+
diff --git a/Samples/AZX_Docs/html/azx__log_8h.js b/Samples/AZX_Docs/html/azx__log_8h.js index 7be6f89..6c1d00e 100644 --- a/Samples/AZX_Docs/html/azx__log_8h.js +++ b/Samples/AZX_Docs/html/azx__log_8h.js @@ -17,17 +17,19 @@ var azx__log_8h = [ "AZX_LOG_TO_MAX", "group__log_conf.html#gga03b618927cb5d884386832ab76781760acd8c06c121bab2a0f3aede4b76afde39", null ] ] ], [ "AZX_LOG_LEVEL_E", "group__log_conf.html#gae9fa7be40e4fcae6093707def57f82a5", [ - [ "AZX_LOG_LEVEL_NONE", "group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a8f609b972c7fd17cec42b2c216dc68b4", null ], [ "AZX_LOG_LEVEL_TRACE", "group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5adc5cc122c3a06700e09e4c6d1cc17497", null ], [ "AZX_LOG_LEVEL_DEBUG", "group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5aa77afa2490f92d58d965e30ce97c8048", null ], [ "AZX_LOG_LEVEL_INFO", "group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a2bdb3bd46fb4a347265f0c966ded4f25", null ], [ "AZX_LOG_LEVEL_WARN", "group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a0d4c7c18f82729850d7a1c3e35e2f0b8", null ], [ "AZX_LOG_LEVEL_ERROR", "group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5acc52fcbd7aa2088fe583a11661b4abf2", null ], - [ "AZX_LOG_LEVEL_CRITICAL", "group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a51671d346b1e7d44f8993fa9d2ca174c", null ] + [ "AZX_LOG_LEVEL_CRITICAL", "group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a51671d346b1e7d44f8993fa9d2ca174c", null ], + [ "AZX_LOG_LEVEL_NONE", "group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a8f609b972c7fd17cec42b2c216dc68b4", null ] ] ], [ "azx_log_deinit", "azx__log_8h.html#a1cff830ca498f89db8a6ba0882441231", null ], + [ "azx_log_flush_to_file", "azx__log_8h.html#a3e999a06dd697da3196e357039081124", null ], [ "azx_log_formatted", "azx__log_8h.html#a024e23064b2dc69cbeeab7b728d4d010", null ], [ "azx_log_getLevel", "azx__log_8h.html#ab2c4e9406084c9f69c1314a718cc90d8", null ], [ "azx_log_init", "group__log_conf.html#ga08e797515ecc2b71223a72c77c6dc6af", null ], + [ "azx_log_send_to_file", "azx__log_8h.html#af64520b985c9e8b97fda9dd77279bdd3", null ], [ "azx_log_setLevel", "azx__log_8h.html#a7b0daaed2d1a5700a26365e409593a4b", null ] ]; \ No newline at end of file diff --git a/Samples/AZX_Docs/html/azx__log_8h_source.html b/Samples/AZX_Docs/html/azx__log_8h_source.html index 1255c0c..f55b61b 100644 --- a/Samples/AZX_Docs/html/azx__log_8h_source.html +++ b/Samples/AZX_Docs/html/azx__log_8h_source.html @@ -34,7 +34,7 @@ Logo
AZX (AppZone eXtensions) documentation -  1.0.4 +  1.0.5
A set of companion utilities that make AZ development easier
@@ -95,107 +95,115 @@
azx_log.h
-Go to the documentation of this file.
1 /* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
-
2 /* See LICENSE file in the project root for full license information. */
-
3 #ifndef HDR_AZX_LOG_H_
-
4 #define HDR_AZX_LOG_H_
-
5 
-
18 #include "m2mb_types.h"
-
19 #include "app_cfg.h"
-
20 
-
21 /* Global declarations =======================================================*/
-
22 
+Go to the documentation of this file.
1 /*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
+
2 /* See LICENSE file in the project root for full license information. */
+
3 
+
4 #ifndef HDR_AZX_LOG_H_
+
5 #define HDR_AZX_LOG_H_
+
6 
+
19 #include "m2mb_types.h"
+
20 #include "app_cfg.h"
+
21 
+
22 /* Global declarations =======================================================*/
23 
-
24 /* Global typedefs ===========================================================*/
-
25 
-
40 typedef enum
-
41 {
- - - - - - - - -
50 
+
24 
+
25 /* Global typedefs ===========================================================*/
+
26 
+
41 typedef enum
+
42 {
+ + + + + + + +
51 
-
56 typedef enum
-
57 {
- - - - -
63  AZX_LOG_MAX_ERROR_LEN
- -
65 
-
67 typedef INT32 (*_azx_log_function)(const char *, void*);
-
68 
+
52 
+
57 typedef enum
+
58 {
+ + + + +
64  AZX_LOG_MAX_ERROR_LEN
+ +
66 
+
68 typedef INT32 (*_azx_log_function)(const char *, void*);
69 
-
74 typedef enum
-
75 {
- - - - -
81  AZX_LOG_TO_MAX
- -
83 
+
70 
+
75 typedef enum
+
76 {
+ + + + +
82  AZX_LOG_TO_MAX
+
84 
-
90 typedef struct
-
91 {
- - -
94  BOOLEAN log_colours;
- -
96 
+
85 
+
91 typedef struct
+
92 {
+ + +
95  BOOLEAN log_colours;
+
97 
-
98 /* Global functions ==========================================================*/
-
99 
-
100 /*INTERNAL FUNCTION, used by public macros*/
-
130 INT32 azx_log_formatted(AZX_LOG_LEVEL_E level,
-
131  const CHAR *function, const CHAR *file, int line, const CHAR *fmt, ... );
-
132 
-
133 /* Public functions ==========================================================*/
-
134 
-
161 void azx_log_init(AZX_LOG_CFG_T *cfg);
-
162 
-
179 INT32 azx_log_deinit(void);
-
180 
- -
195 
- -
210 
-
211 #endif /* HDR_AZX_LOG_H_ */
+
98 
+
99 /* Global functions ==========================================================*/
+
100 
+
101 /*INTERNAL FUNCTION, used by public macros*/
+
131 INT32 azx_log_formatted(AZX_LOG_LEVEL_E level,
+
132  const CHAR *function, const CHAR *file, int line, const CHAR *fmt, ... );
+
133 
+
134 /* Public functions ==========================================================*/
+
135 
+
162 void azx_log_init(AZX_LOG_CFG_T *cfg);
+
163 
+
180 INT32 azx_log_deinit(void);
+
181 
+ +
196 
+ +
211 
+
234 BOOLEAN azx_log_send_to_file(const CHAR* filename, UINT32 circular_chunks,
+
235  AZX_LOG_LEVEL_E min_level, UINT32 max_size_kb);
+
236 
+
243 void azx_log_flush_to_file(void);
+
244 
+
245 #endif /* HDR_AZX_LOG_H_ */
-
Definition: azx_log.h:61
+
Definition: azx_log.h:62
Definition: azx_log.h:46
-
Definition: azx_log.h:60
-
Definition: azx_log.h:76
-
AZX_LOG_LEVEL_E log_level
Definition: azx_log.h:92
-
Definition: azx_log.h:59
-
Definition: azx_log.h:42
-
Definition: azx_log.h:79
-
AZX_LOG_HANDLE_E
Logging output channels.
Definition: azx_log.h:74
+
Definition: azx_log.h:61
+
Definition: azx_log.h:77
+
AZX_LOG_LEVEL_E log_level
Definition: azx_log.h:93
+
void azx_log_flush_to_file(void)
Flushes any outstanding logs to the file.
+
Definition: azx_log.h:60
+
Definition: azx_log.h:49
+
Definition: azx_log.h:80
+
AZX_LOG_HANDLE_E
Logging output channels.
Definition: azx_log.h:75
Definition: azx_log.h:44
-
Logging configuration structure.
Definition: azx_log.h:90
-
Definition: azx_log.h:58
+
Logging configuration structure.
Definition: azx_log.h:91
+
BOOLEAN azx_log_send_to_file(const CHAR *filename, UINT32 circular_chunks, AZX_LOG_LEVEL_E min_level, UINT32 max_size_kb)
Gets the logging component to output to a file.
+
Definition: azx_log.h:59
Definition: azx_log.h:47
-
Definition: azx_log.h:77
+
Definition: azx_log.h:78
Application configuration settings conveniently located here.
INT32 azx_log_deinit(void)
Deinitializes the log functionality.
Definition: azx_log.h:45
void azx_log_setLevel(AZX_LOG_LEVEL_E level)
Sets the new log level to be used.
void azx_log_init(AZX_LOG_CFG_T *cfg)
Initializes the log functionality.
-
AZX_LOG_LEVEL_E
Logging levels.
Definition: azx_log.h:40
+
AZX_LOG_LEVEL_E
Logging levels.
Definition: azx_log.h:41
AZX_LOG_LEVEL_E azx_log_getLevel(void)
Returns the current value of the log level.
-
AZX_LOG_HANDLE_E log_channel
Definition: azx_log.h:93
-
AZX_LOG_ERRORS_E
Logging errors.
Definition: azx_log.h:56
+
AZX_LOG_HANDLE_E log_channel
Definition: azx_log.h:94
+
AZX_LOG_ERRORS_E
Logging errors.
Definition: azx_log.h:57
Definition: azx_log.h:48
-
BOOLEAN log_colours
Definition: azx_log.h:94
+
BOOLEAN log_colours
Definition: azx_log.h:95
Definition: azx_log.h:43
-
Definition: azx_log.h:78
+
Definition: azx_log.h:79