@@ -245,7 +245,6 @@
void azx_reboot_now
( |
- void |
| ) |
|
@@ -258,8 +257,8 @@
-◆ azx_shutdown_now()
+
+◆ azx_shutdown_now()
@@ -267,7 +266,6 @@
void azx_shutdown_now
( |
- void |
| ) |
|
diff --git a/Samples/AZX_Docs/html/azx__utils_8h.js b/Samples/AZX_Docs/html/azx__utils_8h.js
index a3f3fdf..7c2ce53 100644
--- a/Samples/AZX_Docs/html/azx__utils_8h.js
+++ b/Samples/AZX_Docs/html/azx__utils_8h.js
@@ -3,7 +3,7 @@ var azx__utils_8h =
[ "AZX_LIMIT", "azx__utils_8h.html#ae63391c8b40ed84ad60e84ed2386d1f9", null ],
[ "AZX_UTILS_HEX_DUMP_BUFFER_SIZE", "azx__utils_8h.html#a8c7358115439ddd523797f3d027df1f2", null ],
[ "azx_hex_dump", "azx__utils_8h.html#a079fc61e9774e7c7b178ddcc67617a0f", null ],
- [ "azx_reboot_now", "azx__utils_8h.html#a75795b5fabfb2be85fc105df383a82bf", null ],
- [ "azx_shutdown_now", "azx__utils_8h.html#aeaea36b3c4e80ad8a22f172aa36542df", null ],
+ [ "azx_reboot_now", "azx__utils_8h.html#a8fb8f6f485efbdbc31fc02942faf3a89", null ],
+ [ "azx_shutdown_now", "azx__utils_8h.html#ae6a6a38c2fdd6b84d9ef00b88690c97d", null ],
[ "azx_sleep_ms", "azx__utils_8h.html#adf8be666cb37d5c4d1c9c4b9694e2de5", null ]
];
\ No newline at end of file
diff --git a/Samples/AZX_Docs/html/azx__utils_8h__incl.map b/Samples/AZX_Docs/html/azx__utils_8h__incl.map
index 41ba6c3..a0e7a24 100644
--- a/Samples/AZX_Docs/html/azx__utils_8h__incl.map
+++ b/Samples/AZX_Docs/html/azx__utils_8h__incl.map
@@ -1,6 +1,6 @@
diff --git a/Samples/AZX_Docs/html/azx__utils_8h__incl.png b/Samples/AZX_Docs/html/azx__utils_8h__incl.png
index 73faea6..be4fcb9 100644
Binary files a/Samples/AZX_Docs/html/azx__utils_8h__incl.png and b/Samples/AZX_Docs/html/azx__utils_8h__incl.png differ
diff --git a/Samples/AZX_Docs/html/azx__utils_8h_source.html b/Samples/AZX_Docs/html/azx__utils_8h_source.html
index f15ea84..a0c173f 100644
--- a/Samples/AZX_Docs/html/azx__utils_8h_source.html
+++ b/Samples/AZX_Docs/html/azx__utils_8h_source.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
@@ -95,40 +95,39 @@
azx_utils.h
-
Go to the documentation of this file.
-
-
-
4 #ifndef HDR_M2M_UTILS_H_
-
5 #define HDR_M2M_UTILS_H_
-
-
16 #include "m2mb_types.h"
-
+
Go to the documentation of this file.
+
+
3 #ifndef HDR_M2M_UTILS_H_
+
4 #define HDR_M2M_UTILS_H_
+
+
15 #include "m2mb_types.h"
+
+
-
-
32 #define AZX_LIMIT(val, min, max) (val = (val < (min) ? (min) : (val > (max) ? (max) : val)))
-
-
-
-
-
44 #define AZX_UTILS_HEX_DUMP_BUFFER_SIZE 250
-
-
-
-
-
-
-
+
31 #define AZX_LIMIT(val, min, max) (val = (val < (min) ? (min) : (val > (max) ? (max) : val)))
+
+
+
+
+
43 #define AZX_UTILS_HEX_DUMP_BUFFER_SIZE 250
+
+
+
+
+
+
+
+
-
-
+
void azx_sleep_ms(UINT32 ms)
Puts the task to sleep for a specified time.
-void azx_reboot_now(void)
Reboots the modem straight away.
-void azx_shutdown_now(void)
Shuts the modem down straight away.
+void azx_shutdown_now()
Shuts the modem down straight away.
Logging utilities to print on available output channels.
+void azx_reboot_now()
Reboots the modem straight away.
const CHAR * azx_hex_dump(const void *data, UINT32 len)
Dumps HEX data to string.
diff --git a/Samples/AZX_Docs/html/classes.html b/Samples/AZX_Docs/html/classes.html
index a7181ec..dd815f0 100644
--- a/Samples/AZX_Docs/html/classes.html
+++ b/Samples/AZX_Docs/html/classes.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/AZX_Docs/html/dir_0045f852bf8045b6d5abd9c9eb54a446.html b/Samples/AZX_Docs/html/dir_0045f852bf8045b6d5abd9c9eb54a446.html
index fc1a3bc..39f49a0 100644
--- a/Samples/AZX_Docs/html/dir_0045f852bf8045b6d5abd9c9eb54a446.html
+++ b/Samples/AZX_Docs/html/dir_0045f852bf8045b6d5abd9c9eb54a446.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/AZX_Docs/html/files.html b/Samples/AZX_Docs/html/files.html
index 4a439a2..dced1ec 100644
--- a/Samples/AZX_Docs/html/files.html
+++ b/Samples/AZX_Docs/html/files.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/AZX_Docs/html/functions.html b/Samples/AZX_Docs/html/functions.html
index 436f287..4075523 100644
--- a/Samples/AZX_Docs/html/functions.html
+++ b/Samples/AZX_Docs/html/functions.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/AZX_Docs/html/functions_vars.html b/Samples/AZX_Docs/html/functions_vars.html
index 23831fa..02a3bb0 100644
--- a/Samples/AZX_Docs/html/functions_vars.html
+++ b/Samples/AZX_Docs/html/functions_vars.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/AZX_Docs/html/globals.html b/Samples/AZX_Docs/html/globals.html
index 0042459..b164b43 100644
--- a/Samples/AZX_Docs/html/globals.html
+++ b/Samples/AZX_Docs/html/globals.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
@@ -118,9 +118,6 @@ - a -
- AZX_LOG_ERRORS_E
: azx_log.h
-- azx_log_flush_to_file()
-: azx_log.h
-
- azx_log_getLevel()
: azx_log.h
@@ -166,9 +163,6 @@ - a -
- AZX_LOG_NOT_INIT
: azx_log.h
-- azx_log_send_to_file()
-: azx_log.h
-
- azx_log_setLevel()
: azx_log.h
@@ -194,10 +188,10 @@ - a -
: app_cfg.h
- azx_reboot_now()
-: azx_utils.h
+: azx_utils.h
- azx_shutdown_now()
-: azx_utils.h
+: azx_utils.h
- azx_sleep_ms()
: azx_utils.h
diff --git a/Samples/AZX_Docs/html/globals_defs.html b/Samples/AZX_Docs/html/globals_defs.html
index c9b3564..33af509 100644
--- a/Samples/AZX_Docs/html/globals_defs.html
+++ b/Samples/AZX_Docs/html/globals_defs.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/AZX_Docs/html/globals_enum.html b/Samples/AZX_Docs/html/globals_enum.html
index 26d9fc8..7a568a4 100644
--- a/Samples/AZX_Docs/html/globals_enum.html
+++ b/Samples/AZX_Docs/html/globals_enum.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/AZX_Docs/html/globals_eval.html b/Samples/AZX_Docs/html/globals_eval.html
index e57feea..90d1a74 100644
--- a/Samples/AZX_Docs/html/globals_eval.html
+++ b/Samples/AZX_Docs/html/globals_eval.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/AZX_Docs/html/globals_func.html b/Samples/AZX_Docs/html/globals_func.html
index c41fc9f..0f1ac2a 100644
--- a/Samples/AZX_Docs/html/globals_func.html
+++ b/Samples/AZX_Docs/html/globals_func.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
@@ -98,26 +98,20 @@
- azx_log_deinit()
: azx_log.h
-- azx_log_flush_to_file()
-: azx_log.h
-
- azx_log_getLevel()
: azx_log.h
- azx_log_init()
: azx_log.h
-- azx_log_send_to_file()
-: azx_log.h
-
- azx_log_setLevel()
: azx_log.h
- azx_reboot_now()
-: azx_utils.h
+: azx_utils.h
- azx_shutdown_now()
-: azx_utils.h
+: azx_utils.h
- azx_sleep_ms()
: azx_utils.h
diff --git a/Samples/AZX_Docs/html/graph_legend.html b/Samples/AZX_Docs/html/graph_legend.html
index 3d1afe1..64b48fc 100644
--- a/Samples/AZX_Docs/html/graph_legend.html
+++ b/Samples/AZX_Docs/html/graph_legend.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/AZX_Docs/html/graph_legend.png b/Samples/AZX_Docs/html/graph_legend.png
index 81788d8..93e2541 100644
Binary files a/Samples/AZX_Docs/html/graph_legend.png and b/Samples/AZX_Docs/html/graph_legend.png differ
diff --git a/Samples/AZX_Docs/html/group__log_conf.html b/Samples/AZX_Docs/html/group__log_conf.html
index d6a31c9..ca81284 100644
--- a/Samples/AZX_Docs/html/group__log_conf.html
+++ b/Samples/AZX_Docs/html/group__log_conf.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
@@ -105,14 +105,14 @@
|
enum | AZX_LOG_LEVEL_E {
- AZX_LOG_LEVEL_TRACE = 1,
+ AZX_LOG_LEVEL_NONE = 0,
+AZX_LOG_LEVEL_TRACE = 1,
AZX_LOG_LEVEL_DEBUG = 2,
AZX_LOG_LEVEL_INFO = 3,
-AZX_LOG_LEVEL_WARN = 4,
- AZX_LOG_LEVEL_ERROR = 5,
-AZX_LOG_LEVEL_CRITICAL = 6,
-AZX_LOG_LEVEL_NONE = 0x7F
+ AZX_LOG_LEVEL_WARN = 4,
+AZX_LOG_LEVEL_ERROR = 5,
+AZX_LOG_LEVEL_CRITICAL = 6
} |
| Logging levels. More...
|
@@ -178,7 +178,9 @@
diff --git a/Samples/AZX_Docs/html/group__log_conf.js b/Samples/AZX_Docs/html/group__log_conf.js
index 07cb9ac..be7bf93 100644
--- a/Samples/AZX_Docs/html/group__log_conf.js
+++ b/Samples/AZX_Docs/html/group__log_conf.js
@@ -7,13 +7,13 @@ var group__log_conf =
[ "AZX_LOG_TO_USB1", "group__log_conf.html#gga03b618927cb5d884386832ab76781760ab87a0049b27ce615b28ea77f51118286", 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_NONE", "group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a8f609b972c7fd17cec42b2c216dc68b4", null ]
+ [ "AZX_LOG_LEVEL_CRITICAL", "group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a51671d346b1e7d44f8993fa9d2ca174c", null ]
] ],
[ "azx_log_init", "group__log_conf.html#ga08e797515ecc2b71223a72c77c6dc6af", null ]
];
\ No newline at end of file
diff --git a/Samples/AZX_Docs/html/group__log_usage.html b/Samples/AZX_Docs/html/group__log_usage.html
index c55f4d6..ed6b6cd 100644
--- a/Samples/AZX_Docs/html/group__log_usage.html
+++ b/Samples/AZX_Docs/html/group__log_usage.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/AZX_Docs/html/index.html b/Samples/AZX_Docs/html/index.html
index f1afe74..ffab556 100644
--- a/Samples/AZX_Docs/html/index.html
+++ b/Samples/AZX_Docs/html/index.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/AZX_Docs/html/modules.html b/Samples/AZX_Docs/html/modules.html
index a69e48c..55a92ed 100644
--- a/Samples/AZX_Docs/html/modules.html
+++ b/Samples/AZX_Docs/html/modules.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/AZX_Docs/html/navtreeindex0.js b/Samples/AZX_Docs/html/navtreeindex0.js
index 85ea36b..a774aec 100644
--- a/Samples/AZX_Docs/html/navtreeindex0.js
+++ b/Samples/AZX_Docs/html/navtreeindex0.js
@@ -9,21 +9,19 @@ var NAVTREEINDEX0 =
"app__cfg_8h.html#a4af7b5c67a5df4ffbcafe9a91a4677bc":[3,0,0,0,4],
"app__cfg_8h_source.html":[3,0,0,0],
"azx__log_8h.html":[3,0,0,1],
-"azx__log_8h.html#a024e23064b2dc69cbeeab7b728d4d010":[3,0,0,1,7],
+"azx__log_8h.html#a024e23064b2dc69cbeeab7b728d4d010":[3,0,0,1,6],
"azx__log_8h.html#a0b1d083f518b1fac0659671b6b744bff":[3,0,0,1,1],
"azx__log_8h.html#a1cff830ca498f89db8a6ba0882441231":[3,0,0,1,5],
-"azx__log_8h.html#a3e999a06dd697da3196e357039081124":[3,0,0,1,6],
-"azx__log_8h.html#a7b0daaed2d1a5700a26365e409593a4b":[3,0,0,1,11],
-"azx__log_8h.html#ab2c4e9406084c9f69c1314a718cc90d8":[3,0,0,1,8],
-"azx__log_8h.html#af64520b985c9e8b97fda9dd77279bdd3":[3,0,0,1,10],
+"azx__log_8h.html#a7b0daaed2d1a5700a26365e409593a4b":[3,0,0,1,9],
+"azx__log_8h.html#ab2c4e9406084c9f69c1314a718cc90d8":[3,0,0,1,7],
"azx__log_8h_source.html":[3,0,0,1],
"azx__utils_8h.html":[3,0,0,2],
"azx__utils_8h.html#a079fc61e9774e7c7b178ddcc67617a0f":[3,0,0,2,2],
-"azx__utils_8h.html#a75795b5fabfb2be85fc105df383a82bf":[3,0,0,2,3],
"azx__utils_8h.html#a8c7358115439ddd523797f3d027df1f2":[3,0,0,2,1],
+"azx__utils_8h.html#a8fb8f6f485efbdbc31fc02942faf3a89":[3,0,0,2,3],
"azx__utils_8h.html#adf8be666cb37d5c4d1c9c4b9694e2de5":[3,0,0,2,5],
"azx__utils_8h.html#ae63391c8b40ed84ad60e84ed2386d1f9":[3,0,0,2,0],
-"azx__utils_8h.html#aeaea36b3c4e80ad8a22f172aa36542df":[3,0,0,2,4],
+"azx__utils_8h.html#ae6a6a38c2fdd6b84d9ef00b88690c97d":[3,0,0,2,4],
"azx__utils_8h_source.html":[3,0,0,2],
"classes.html":[2,1],
"dir_0045f852bf8045b6d5abd9c9eb54a446.html":[3,0,0],
@@ -38,8 +36,8 @@ var NAVTREEINDEX0 =
"group__log_conf.html":[1,0],
"group__log_conf.html#ga03b618927cb5d884386832ab76781760":[3,0,0,1,3],
"group__log_conf.html#ga03b618927cb5d884386832ab76781760":[1,0,0],
+"group__log_conf.html#ga08e797515ecc2b71223a72c77c6dc6af":[3,0,0,1,8],
"group__log_conf.html#ga08e797515ecc2b71223a72c77c6dc6af":[1,0,2],
-"group__log_conf.html#ga08e797515ecc2b71223a72c77c6dc6af":[3,0,0,1,9],
"group__log_conf.html#gae9fa7be40e4fcae6093707def57f82a5":[1,0,1],
"group__log_conf.html#gae9fa7be40e4fcae6093707def57f82a5":[3,0,0,1,4],
"group__log_conf.html#gga03b618927cb5d884386832ab76781760a0af771a438449471f0f1fb0a6e5d65d4":[3,0,0,1,3,1],
@@ -51,29 +49,29 @@ var NAVTREEINDEX0 =
"group__log_conf.html#gga03b618927cb5d884386832ab76781760ab87a0049b27ce615b28ea77f51118286":[3,0,0,1,3,3],
"group__log_conf.html#gga03b618927cb5d884386832ab76781760ab87a0049b27ce615b28ea77f51118286":[1,0,0,3],
"group__log_conf.html#gga03b618927cb5d884386832ab76781760acd8c06c121bab2a0f3aede4b76afde39":[3,0,0,1,3,4],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a0d4c7c18f82729850d7a1c3e35e2f0b8":[3,0,0,1,4,3],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a0d4c7c18f82729850d7a1c3e35e2f0b8":[1,0,1,3],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a2bdb3bd46fb4a347265f0c966ded4f25":[3,0,0,1,4,2],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a2bdb3bd46fb4a347265f0c966ded4f25":[1,0,1,2],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a51671d346b1e7d44f8993fa9d2ca174c":[3,0,0,1,4,5],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a51671d346b1e7d44f8993fa9d2ca174c":[1,0,1,5],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a8f609b972c7fd17cec42b2c216dc68b4":[3,0,0,1,4,6],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a8f609b972c7fd17cec42b2c216dc68b4":[1,0,1,6],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5aa77afa2490f92d58d965e30ce97c8048":[3,0,0,1,4,1],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5aa77afa2490f92d58d965e30ce97c8048":[1,0,1,1],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5acc52fcbd7aa2088fe583a11661b4abf2":[3,0,0,1,4,4],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5acc52fcbd7aa2088fe583a11661b4abf2":[1,0,1,4],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5adc5cc122c3a06700e09e4c6d1cc17497":[3,0,0,1,4,0],
-"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5adc5cc122c3a06700e09e4c6d1cc17497":[1,0,1,0],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a0d4c7c18f82729850d7a1c3e35e2f0b8":[3,0,0,1,4,4],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a0d4c7c18f82729850d7a1c3e35e2f0b8":[1,0,1,4],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a2bdb3bd46fb4a347265f0c966ded4f25":[3,0,0,1,4,3],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a2bdb3bd46fb4a347265f0c966ded4f25":[1,0,1,3],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a51671d346b1e7d44f8993fa9d2ca174c":[1,0,1,6],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a51671d346b1e7d44f8993fa9d2ca174c":[3,0,0,1,4,6],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a8f609b972c7fd17cec42b2c216dc68b4":[3,0,0,1,4,0],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a8f609b972c7fd17cec42b2c216dc68b4":[1,0,1,0],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5aa77afa2490f92d58d965e30ce97c8048":[3,0,0,1,4,2],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5aa77afa2490f92d58d965e30ce97c8048":[1,0,1,2],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5acc52fcbd7aa2088fe583a11661b4abf2":[3,0,0,1,4,5],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5acc52fcbd7aa2088fe583a11661b4abf2":[1,0,1,5],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5adc5cc122c3a06700e09e4c6d1cc17497":[3,0,0,1,4,1],
+"group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5adc5cc122c3a06700e09e4c6d1cc17497":[1,0,1,1],
"group__log_usage.html":[1,1],
"group__log_usage.html#ga47bb701aa779a05aa34ed01fcfbbdd54":[3,0,0,0,6],
"group__log_usage.html#ga47bb701aa779a05aa34ed01fcfbbdd54":[1,1,5],
"group__log_usage.html#ga4cbebf6589190814b5ee9adb22bb1d44":[1,1,0],
"group__log_usage.html#ga4cbebf6589190814b5ee9adb22bb1d44":[3,0,0,0,0],
-"group__log_usage.html#ga81e4f03b2a752e5e9cfae1e037ce7256":[3,0,0,0,2],
"group__log_usage.html#ga81e4f03b2a752e5e9cfae1e037ce7256":[1,1,2],
-"group__log_usage.html#ga847d9b9f62e31bf14b31882be7418675":[1,1,3],
+"group__log_usage.html#ga81e4f03b2a752e5e9cfae1e037ce7256":[3,0,0,0,2],
"group__log_usage.html#ga847d9b9f62e31bf14b31882be7418675":[3,0,0,0,3],
+"group__log_usage.html#ga847d9b9f62e31bf14b31882be7418675":[1,1,3],
"group__log_usage.html#gaa85ac7254570a307564019c5dfb98d83":[3,0,0,0,5],
"group__log_usage.html#gaa85ac7254570a307564019c5dfb98d83":[1,1,4],
"group__log_usage.html#gabe77e5a2f7b57b5029c6f7cdfa7e3dd0":[1,1,6],
diff --git a/Samples/AZX_Docs/html/search/all_0.js b/Samples/AZX_Docs/html/search/all_0.js
index a0247ad..bc57110 100644
--- a/Samples/AZX_Docs/html/search/all_0.js
+++ b/Samples/AZX_Docs/html/search/all_0.js
@@ -11,33 +11,31 @@ var searchData=
['azx_5flog_5fdeinit_8',['azx_log_deinit',['../azx__log_8h.html#a1cff830ca498f89db8a6ba0882441231',1,'azx_log.h']]],
['azx_5flog_5ferror_9',['AZX_LOG_ERROR',['../group__log_usage.html#ga81e4f03b2a752e5e9cfae1e037ce7256',1,'app_cfg.h']]],
['azx_5flog_5ferrors_5fe_10',['AZX_LOG_ERRORS_E',['../group__log_usage.html#gabe77e5a2f7b57b5029c6f7cdfa7e3dd0',1,'azx_log.h']]],
- ['azx_5flog_5fflush_5fto_5ffile_11',['azx_log_flush_to_file',['../azx__log_8h.html#a3e999a06dd697da3196e357039081124',1,'azx_log.h']]],
- ['azx_5flog_5fgetlevel_12',['azx_log_getLevel',['../azx__log_8h.html#ab2c4e9406084c9f69c1314a718cc90d8',1,'azx_log.h']]],
- ['azx_5flog_5fhandle_5fe_13',['AZX_LOG_HANDLE_E',['../group__log_conf.html#ga03b618927cb5d884386832ab76781760',1,'azx_log.h']]],
- ['azx_5flog_5finfo_14',['AZX_LOG_INFO',['../group__log_usage.html#ga847d9b9f62e31bf14b31882be7418675',1,'app_cfg.h']]],
- ['azx_5flog_5finit_15',['azx_log_init',['../group__log_conf.html#ga08e797515ecc2b71223a72c77c6dc6af',1,'azx_log_init(AZX_LOG_CFG_T *cfg): azx_log.h'],['../app__cfg_8h.html#a4af7b5c67a5df4ffbcafe9a91a4677bc',1,'AZX_LOG_INIT(): app_cfg.h']]],
- ['azx_5flog_5flevel_5fcritical_16',['AZX_LOG_LEVEL_CRITICAL',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a51671d346b1e7d44f8993fa9d2ca174c',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5fdebug_17',['AZX_LOG_LEVEL_DEBUG',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5aa77afa2490f92d58d965e30ce97c8048',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5fe_18',['AZX_LOG_LEVEL_E',['../group__log_conf.html#gae9fa7be40e4fcae6093707def57f82a5',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5ferror_19',['AZX_LOG_LEVEL_ERROR',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5acc52fcbd7aa2088fe583a11661b4abf2',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5finfo_20',['AZX_LOG_LEVEL_INFO',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a2bdb3bd46fb4a347265f0c966ded4f25',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5fnone_21',['AZX_LOG_LEVEL_NONE',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a8f609b972c7fd17cec42b2c216dc68b4',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5ftrace_22',['AZX_LOG_LEVEL_TRACE',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5adc5cc122c3a06700e09e4c6d1cc17497',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5fwarn_23',['AZX_LOG_LEVEL_WARN',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a0d4c7c18f82729850d7a1c3e35e2f0b8',1,'azx_log.h']]],
- ['azx_5flog_5fno_5fusb_5finstance_5favailable_24',['AZX_LOG_NO_USB_INSTANCE_AVAILABLE',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0ab7e169017c26c73457fe21f879b299f0',1,'azx_log.h']]],
- ['azx_5flog_5fnot_5finit_25',['AZX_LOG_NOT_INIT',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0a12ddd7346038a59740724ffcc8c20e12',1,'azx_log.h']]],
- ['azx_5flog_5fsend_5fto_5ffile_26',['azx_log_send_to_file',['../azx__log_8h.html#af64520b985c9e8b97fda9dd77279bdd3',1,'azx_log.h']]],
- ['azx_5flog_5fsetlevel_27',['azx_log_setLevel',['../azx__log_8h.html#a7b0daaed2d1a5700a26365e409593a4b',1,'azx_log.h']]],
- ['azx_5flog_5fto_5faux_5fuart_28',['AZX_LOG_TO_AUX_UART',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760a0af771a438449471f0f1fb0a6e5d65d4',1,'azx_log.h']]],
- ['azx_5flog_5fto_5fmain_5fuart_29',['AZX_LOG_TO_MAIN_UART',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760a371b4156625be29814df43770a9150a3',1,'azx_log.h']]],
- ['azx_5flog_5fto_5fusb0_30',['AZX_LOG_TO_USB0',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760a2b9fdc468ce514e4118797ad0e624841',1,'azx_log.h']]],
- ['azx_5flog_5fto_5fusb1_31',['AZX_LOG_TO_USB1',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760ab87a0049b27ce615b28ea77f51118286',1,'azx_log.h']]],
- ['azx_5flog_5ftrace_32',['AZX_LOG_TRACE',['../group__log_usage.html#gaa85ac7254570a307564019c5dfb98d83',1,'app_cfg.h']]],
- ['azx_5flog_5fusb_5fcable_5funplugged_33',['AZX_LOG_USB_CABLE_UNPLUGGED',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0ab2beedfe225418d618c1d2e12410b72b',1,'azx_log.h']]],
- ['azx_5flog_5fwarn_34',['AZX_LOG_WARN',['../group__log_usage.html#ga47bb701aa779a05aa34ed01fcfbbdd54',1,'app_cfg.h']]],
- ['azx_5freboot_5fnow_35',['azx_reboot_now',['../azx__utils_8h.html#a75795b5fabfb2be85fc105df383a82bf',1,'azx_utils.h']]],
- ['azx_5fshutdown_5fnow_36',['azx_shutdown_now',['../azx__utils_8h.html#aeaea36b3c4e80ad8a22f172aa36542df',1,'azx_utils.h']]],
- ['azx_5fsleep_5fms_37',['azx_sleep_ms',['../azx__utils_8h.html#adf8be666cb37d5c4d1c9c4b9694e2de5',1,'azx_utils.h']]],
- ['azx_5futils_2eh_38',['azx_utils.h',['../azx__utils_8h.html',1,'']]],
- ['azx_20sample_20modules_20documentation_39',['AZX sample modules documentation',['../index.html',1,'']]]
+ ['azx_5flog_5fgetlevel_11',['azx_log_getLevel',['../azx__log_8h.html#ab2c4e9406084c9f69c1314a718cc90d8',1,'azx_log.h']]],
+ ['azx_5flog_5fhandle_5fe_12',['AZX_LOG_HANDLE_E',['../group__log_conf.html#ga03b618927cb5d884386832ab76781760',1,'azx_log.h']]],
+ ['azx_5flog_5finfo_13',['AZX_LOG_INFO',['../group__log_usage.html#ga847d9b9f62e31bf14b31882be7418675',1,'app_cfg.h']]],
+ ['azx_5flog_5finit_14',['azx_log_init',['../group__log_conf.html#ga08e797515ecc2b71223a72c77c6dc6af',1,'azx_log_init(AZX_LOG_CFG_T *cfg): azx_log.h'],['../app__cfg_8h.html#a4af7b5c67a5df4ffbcafe9a91a4677bc',1,'AZX_LOG_INIT(): app_cfg.h']]],
+ ['azx_5flog_5flevel_5fcritical_15',['AZX_LOG_LEVEL_CRITICAL',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a51671d346b1e7d44f8993fa9d2ca174c',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5fdebug_16',['AZX_LOG_LEVEL_DEBUG',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5aa77afa2490f92d58d965e30ce97c8048',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5fe_17',['AZX_LOG_LEVEL_E',['../group__log_conf.html#gae9fa7be40e4fcae6093707def57f82a5',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5ferror_18',['AZX_LOG_LEVEL_ERROR',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5acc52fcbd7aa2088fe583a11661b4abf2',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5finfo_19',['AZX_LOG_LEVEL_INFO',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a2bdb3bd46fb4a347265f0c966ded4f25',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5fnone_20',['AZX_LOG_LEVEL_NONE',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a8f609b972c7fd17cec42b2c216dc68b4',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5ftrace_21',['AZX_LOG_LEVEL_TRACE',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5adc5cc122c3a06700e09e4c6d1cc17497',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5fwarn_22',['AZX_LOG_LEVEL_WARN',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a0d4c7c18f82729850d7a1c3e35e2f0b8',1,'azx_log.h']]],
+ ['azx_5flog_5fno_5fusb_5finstance_5favailable_23',['AZX_LOG_NO_USB_INSTANCE_AVAILABLE',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0ab7e169017c26c73457fe21f879b299f0',1,'azx_log.h']]],
+ ['azx_5flog_5fnot_5finit_24',['AZX_LOG_NOT_INIT',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0a12ddd7346038a59740724ffcc8c20e12',1,'azx_log.h']]],
+ ['azx_5flog_5fsetlevel_25',['azx_log_setLevel',['../azx__log_8h.html#a7b0daaed2d1a5700a26365e409593a4b',1,'azx_log.h']]],
+ ['azx_5flog_5fto_5faux_5fuart_26',['AZX_LOG_TO_AUX_UART',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760a0af771a438449471f0f1fb0a6e5d65d4',1,'azx_log.h']]],
+ ['azx_5flog_5fto_5fmain_5fuart_27',['AZX_LOG_TO_MAIN_UART',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760a371b4156625be29814df43770a9150a3',1,'azx_log.h']]],
+ ['azx_5flog_5fto_5fusb0_28',['AZX_LOG_TO_USB0',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760a2b9fdc468ce514e4118797ad0e624841',1,'azx_log.h']]],
+ ['azx_5flog_5fto_5fusb1_29',['AZX_LOG_TO_USB1',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760ab87a0049b27ce615b28ea77f51118286',1,'azx_log.h']]],
+ ['azx_5flog_5ftrace_30',['AZX_LOG_TRACE',['../group__log_usage.html#gaa85ac7254570a307564019c5dfb98d83',1,'app_cfg.h']]],
+ ['azx_5flog_5fusb_5fcable_5funplugged_31',['AZX_LOG_USB_CABLE_UNPLUGGED',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0ab2beedfe225418d618c1d2e12410b72b',1,'azx_log.h']]],
+ ['azx_5flog_5fwarn_32',['AZX_LOG_WARN',['../group__log_usage.html#ga47bb701aa779a05aa34ed01fcfbbdd54',1,'app_cfg.h']]],
+ ['azx_5freboot_5fnow_33',['azx_reboot_now',['../azx__utils_8h.html#a8fb8f6f485efbdbc31fc02942faf3a89',1,'azx_utils.h']]],
+ ['azx_5fshutdown_5fnow_34',['azx_shutdown_now',['../azx__utils_8h.html#ae6a6a38c2fdd6b84d9ef00b88690c97d',1,'azx_utils.h']]],
+ ['azx_5fsleep_5fms_35',['azx_sleep_ms',['../azx__utils_8h.html#adf8be666cb37d5c4d1c9c4b9694e2de5',1,'azx_utils.h']]],
+ ['azx_5futils_2eh_36',['azx_utils.h',['../azx__utils_8h.html',1,'']]],
+ ['azx_20sample_20modules_20documentation_37',['AZX sample modules documentation',['../index.html',1,'']]]
];
diff --git a/Samples/AZX_Docs/html/search/all_1.js b/Samples/AZX_Docs/html/search/all_1.js
index 6b18790..e255eeb 100644
--- a/Samples/AZX_Docs/html/search/all_1.js
+++ b/Samples/AZX_Docs/html/search/all_1.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['configuration_20of_20logging_20functionalities_40',['Configuration of logging functionalities',['../group__log_conf.html',1,'']]]
+ ['configuration_20of_20logging_20functionalities_38',['Configuration of logging functionalities',['../group__log_conf.html',1,'']]]
];
diff --git a/Samples/AZX_Docs/html/search/all_2.js b/Samples/AZX_Docs/html/search/all_2.js
index d12e2da..20f3995 100644
--- a/Samples/AZX_Docs/html/search/all_2.js
+++ b/Samples/AZX_Docs/html/search/all_2.js
@@ -1,7 +1,7 @@
var searchData=
[
- ['log_5fchannel_41',['log_channel',['../struct_a_z_x___l_o_g___c_f_g___t.html#a609c698186c3593727637d0d4afcad9a',1,'AZX_LOG_CFG_T']]],
- ['log_5fcolours_42',['log_colours',['../struct_a_z_x___l_o_g___c_f_g___t.html#aa034a943c56f918fe8dbbf6a06ade44c',1,'AZX_LOG_CFG_T']]],
- ['log_5flevel_43',['log_level',['../struct_a_z_x___l_o_g___c_f_g___t.html#afc9a3bd60f8958c7cccaf707612d2ae2',1,'AZX_LOG_CFG_T::log_level()'],['../app__cfg_8h.html#a0b87e0d3bf5853bcbb0b66a7c48fdc05',1,'LOG_LEVEL(): app_cfg.h']]],
- ['log_5fwith_5fcolour_44',['LOG_WITH_COLOUR',['../app__cfg_8h.html#a490faa4d74e7d551583e681f9b8c2dfe',1,'app_cfg.h']]]
+ ['log_5fchannel_39',['log_channel',['../struct_a_z_x___l_o_g___c_f_g___t.html#a609c698186c3593727637d0d4afcad9a',1,'AZX_LOG_CFG_T']]],
+ ['log_5fcolours_40',['log_colours',['../struct_a_z_x___l_o_g___c_f_g___t.html#aa034a943c56f918fe8dbbf6a06ade44c',1,'AZX_LOG_CFG_T']]],
+ ['log_5flevel_41',['log_level',['../struct_a_z_x___l_o_g___c_f_g___t.html#afc9a3bd60f8958c7cccaf707612d2ae2',1,'AZX_LOG_CFG_T::log_level()'],['../app__cfg_8h.html#a0b87e0d3bf5853bcbb0b66a7c48fdc05',1,'LOG_LEVEL(): app_cfg.h']]],
+ ['log_5fwith_5fcolour_42',['LOG_WITH_COLOUR',['../app__cfg_8h.html#a490faa4d74e7d551583e681f9b8c2dfe',1,'app_cfg.h']]]
];
diff --git a/Samples/AZX_Docs/html/search/all_3.js b/Samples/AZX_Docs/html/search/all_3.js
index 93bcc3c..ab1e377 100644
--- a/Samples/AZX_Docs/html/search/all_3.js
+++ b/Samples/AZX_Docs/html/search/all_3.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['usage_20of_20logging_20functionalities_45',['Usage of logging functionalities',['../group__log_usage.html',1,'']]]
+ ['usage_20of_20logging_20functionalities_43',['Usage of logging functionalities',['../group__log_usage.html',1,'']]]
];
diff --git a/Samples/AZX_Docs/html/search/all_4.js b/Samples/AZX_Docs/html/search/all_4.js
index 2bc1709..0e109fe 100644
--- a/Samples/AZX_Docs/html/search/all_4.js
+++ b/Samples/AZX_Docs/html/search/all_4.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['version_46',['VERSION',['../app__cfg_8h.html#a1c6d5de492ac61ad29aec7aa9a436bbf',1,'app_cfg.h']]]
+ ['version_44',['VERSION',['../app__cfg_8h.html#a1c6d5de492ac61ad29aec7aa9a436bbf',1,'app_cfg.h']]]
];
diff --git a/Samples/AZX_Docs/html/search/classes_0.js b/Samples/AZX_Docs/html/search/classes_0.js
index 8c9619a..7ebb134 100644
--- a/Samples/AZX_Docs/html/search/classes_0.js
+++ b/Samples/AZX_Docs/html/search/classes_0.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['azx_5flog_5fcfg_5ft_47',['AZX_LOG_CFG_T',['../struct_a_z_x___l_o_g___c_f_g___t.html',1,'']]]
+ ['azx_5flog_5fcfg_5ft_45',['AZX_LOG_CFG_T',['../struct_a_z_x___l_o_g___c_f_g___t.html',1,'']]]
];
diff --git a/Samples/AZX_Docs/html/search/defines_0.js b/Samples/AZX_Docs/html/search/defines_0.js
index cd8ba65..e83cd00 100644
--- a/Samples/AZX_Docs/html/search/defines_0.js
+++ b/Samples/AZX_Docs/html/search/defines_0.js
@@ -1,5 +1,5 @@
var searchData=
[
- ['azx_5flimit_82',['AZX_LIMIT',['../azx__utils_8h.html#ae63391c8b40ed84ad60e84ed2386d1f9',1,'azx_utils.h']]],
- ['azx_5flog_5finit_83',['AZX_LOG_INIT',['../app__cfg_8h.html#a4af7b5c67a5df4ffbcafe9a91a4677bc',1,'app_cfg.h']]]
+ ['azx_5flimit_78',['AZX_LIMIT',['../azx__utils_8h.html#ae63391c8b40ed84ad60e84ed2386d1f9',1,'azx_utils.h']]],
+ ['azx_5flog_5finit_79',['AZX_LOG_INIT',['../app__cfg_8h.html#a4af7b5c67a5df4ffbcafe9a91a4677bc',1,'app_cfg.h']]]
];
diff --git a/Samples/AZX_Docs/html/search/defines_1.js b/Samples/AZX_Docs/html/search/defines_1.js
index 4d8dc3a..8d00242 100644
--- a/Samples/AZX_Docs/html/search/defines_1.js
+++ b/Samples/AZX_Docs/html/search/defines_1.js
@@ -1,5 +1,5 @@
var searchData=
[
- ['log_5flevel_84',['LOG_LEVEL',['../app__cfg_8h.html#a0b87e0d3bf5853bcbb0b66a7c48fdc05',1,'app_cfg.h']]],
- ['log_5fwith_5fcolour_85',['LOG_WITH_COLOUR',['../app__cfg_8h.html#a490faa4d74e7d551583e681f9b8c2dfe',1,'app_cfg.h']]]
+ ['log_5flevel_80',['LOG_LEVEL',['../app__cfg_8h.html#a0b87e0d3bf5853bcbb0b66a7c48fdc05',1,'app_cfg.h']]],
+ ['log_5fwith_5fcolour_81',['LOG_WITH_COLOUR',['../app__cfg_8h.html#a490faa4d74e7d551583e681f9b8c2dfe',1,'app_cfg.h']]]
];
diff --git a/Samples/AZX_Docs/html/search/defines_2.js b/Samples/AZX_Docs/html/search/defines_2.js
index e35b0d7..0f018bf 100644
--- a/Samples/AZX_Docs/html/search/defines_2.js
+++ b/Samples/AZX_Docs/html/search/defines_2.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['version_86',['VERSION',['../app__cfg_8h.html#a1c6d5de492ac61ad29aec7aa9a436bbf',1,'app_cfg.h']]]
+ ['version_82',['VERSION',['../app__cfg_8h.html#a1c6d5de492ac61ad29aec7aa9a436bbf',1,'app_cfg.h']]]
];
diff --git a/Samples/AZX_Docs/html/search/enums_0.js b/Samples/AZX_Docs/html/search/enums_0.js
index 4b2957b..972b59f 100644
--- a/Samples/AZX_Docs/html/search/enums_0.js
+++ b/Samples/AZX_Docs/html/search/enums_0.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['azx_5flog_5ferrors_5fe_64',['AZX_LOG_ERRORS_E',['../group__log_usage.html#gabe77e5a2f7b57b5029c6f7cdfa7e3dd0',1,'azx_log.h']]],
- ['azx_5flog_5fhandle_5fe_65',['AZX_LOG_HANDLE_E',['../group__log_conf.html#ga03b618927cb5d884386832ab76781760',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5fe_66',['AZX_LOG_LEVEL_E',['../group__log_conf.html#gae9fa7be40e4fcae6093707def57f82a5',1,'azx_log.h']]]
+ ['azx_5flog_5ferrors_5fe_60',['AZX_LOG_ERRORS_E',['../group__log_usage.html#gabe77e5a2f7b57b5029c6f7cdfa7e3dd0',1,'azx_log.h']]],
+ ['azx_5flog_5fhandle_5fe_61',['AZX_LOG_HANDLE_E',['../group__log_conf.html#ga03b618927cb5d884386832ab76781760',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5fe_62',['AZX_LOG_LEVEL_E',['../group__log_conf.html#gae9fa7be40e4fcae6093707def57f82a5',1,'azx_log.h']]]
];
diff --git a/Samples/AZX_Docs/html/search/enumvalues_0.js b/Samples/AZX_Docs/html/search/enumvalues_0.js
index 12b5664..2187cf2 100644
--- a/Samples/AZX_Docs/html/search/enumvalues_0.js
+++ b/Samples/AZX_Docs/html/search/enumvalues_0.js
@@ -1,18 +1,18 @@
var searchData=
[
- ['azx_5flog_5fcannot_5fopen_5fusb_5fchannel_67',['AZX_LOG_CANNOT_OPEN_USB_CHANNEL',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0aadebfaa08c22d4ad0729e98b50ce880c',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5fcritical_68',['AZX_LOG_LEVEL_CRITICAL',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a51671d346b1e7d44f8993fa9d2ca174c',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5fdebug_69',['AZX_LOG_LEVEL_DEBUG',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5aa77afa2490f92d58d965e30ce97c8048',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5ferror_70',['AZX_LOG_LEVEL_ERROR',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5acc52fcbd7aa2088fe583a11661b4abf2',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5finfo_71',['AZX_LOG_LEVEL_INFO',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a2bdb3bd46fb4a347265f0c966ded4f25',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5fnone_72',['AZX_LOG_LEVEL_NONE',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a8f609b972c7fd17cec42b2c216dc68b4',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5ftrace_73',['AZX_LOG_LEVEL_TRACE',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5adc5cc122c3a06700e09e4c6d1cc17497',1,'azx_log.h']]],
- ['azx_5flog_5flevel_5fwarn_74',['AZX_LOG_LEVEL_WARN',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a0d4c7c18f82729850d7a1c3e35e2f0b8',1,'azx_log.h']]],
- ['azx_5flog_5fno_5fusb_5finstance_5favailable_75',['AZX_LOG_NO_USB_INSTANCE_AVAILABLE',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0ab7e169017c26c73457fe21f879b299f0',1,'azx_log.h']]],
- ['azx_5flog_5fnot_5finit_76',['AZX_LOG_NOT_INIT',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0a12ddd7346038a59740724ffcc8c20e12',1,'azx_log.h']]],
- ['azx_5flog_5fto_5faux_5fuart_77',['AZX_LOG_TO_AUX_UART',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760a0af771a438449471f0f1fb0a6e5d65d4',1,'azx_log.h']]],
- ['azx_5flog_5fto_5fmain_5fuart_78',['AZX_LOG_TO_MAIN_UART',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760a371b4156625be29814df43770a9150a3',1,'azx_log.h']]],
- ['azx_5flog_5fto_5fusb0_79',['AZX_LOG_TO_USB0',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760a2b9fdc468ce514e4118797ad0e624841',1,'azx_log.h']]],
- ['azx_5flog_5fto_5fusb1_80',['AZX_LOG_TO_USB1',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760ab87a0049b27ce615b28ea77f51118286',1,'azx_log.h']]],
- ['azx_5flog_5fusb_5fcable_5funplugged_81',['AZX_LOG_USB_CABLE_UNPLUGGED',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0ab2beedfe225418d618c1d2e12410b72b',1,'azx_log.h']]]
+ ['azx_5flog_5fcannot_5fopen_5fusb_5fchannel_63',['AZX_LOG_CANNOT_OPEN_USB_CHANNEL',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0aadebfaa08c22d4ad0729e98b50ce880c',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5fcritical_64',['AZX_LOG_LEVEL_CRITICAL',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a51671d346b1e7d44f8993fa9d2ca174c',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5fdebug_65',['AZX_LOG_LEVEL_DEBUG',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5aa77afa2490f92d58d965e30ce97c8048',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5ferror_66',['AZX_LOG_LEVEL_ERROR',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5acc52fcbd7aa2088fe583a11661b4abf2',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5finfo_67',['AZX_LOG_LEVEL_INFO',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a2bdb3bd46fb4a347265f0c966ded4f25',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5fnone_68',['AZX_LOG_LEVEL_NONE',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a8f609b972c7fd17cec42b2c216dc68b4',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5ftrace_69',['AZX_LOG_LEVEL_TRACE',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5adc5cc122c3a06700e09e4c6d1cc17497',1,'azx_log.h']]],
+ ['azx_5flog_5flevel_5fwarn_70',['AZX_LOG_LEVEL_WARN',['../group__log_conf.html#ggae9fa7be40e4fcae6093707def57f82a5a0d4c7c18f82729850d7a1c3e35e2f0b8',1,'azx_log.h']]],
+ ['azx_5flog_5fno_5fusb_5finstance_5favailable_71',['AZX_LOG_NO_USB_INSTANCE_AVAILABLE',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0ab7e169017c26c73457fe21f879b299f0',1,'azx_log.h']]],
+ ['azx_5flog_5fnot_5finit_72',['AZX_LOG_NOT_INIT',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0a12ddd7346038a59740724ffcc8c20e12',1,'azx_log.h']]],
+ ['azx_5flog_5fto_5faux_5fuart_73',['AZX_LOG_TO_AUX_UART',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760a0af771a438449471f0f1fb0a6e5d65d4',1,'azx_log.h']]],
+ ['azx_5flog_5fto_5fmain_5fuart_74',['AZX_LOG_TO_MAIN_UART',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760a371b4156625be29814df43770a9150a3',1,'azx_log.h']]],
+ ['azx_5flog_5fto_5fusb0_75',['AZX_LOG_TO_USB0',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760a2b9fdc468ce514e4118797ad0e624841',1,'azx_log.h']]],
+ ['azx_5flog_5fto_5fusb1_76',['AZX_LOG_TO_USB1',['../group__log_conf.html#gga03b618927cb5d884386832ab76781760ab87a0049b27ce615b28ea77f51118286',1,'azx_log.h']]],
+ ['azx_5flog_5fusb_5fcable_5funplugged_77',['AZX_LOG_USB_CABLE_UNPLUGGED',['../group__log_usage.html#ggabe77e5a2f7b57b5029c6f7cdfa7e3dd0ab2beedfe225418d618c1d2e12410b72b',1,'azx_log.h']]]
];
diff --git a/Samples/AZX_Docs/html/search/files_0.js b/Samples/AZX_Docs/html/search/files_0.js
index d7f50b1..ac55d4f 100644
--- a/Samples/AZX_Docs/html/search/files_0.js
+++ b/Samples/AZX_Docs/html/search/files_0.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['app_5fcfg_2eh_48',['app_cfg.h',['../app__cfg_8h.html',1,'']]],
- ['azx_5flog_2eh_49',['azx_log.h',['../azx__log_8h.html',1,'']]],
- ['azx_5futils_2eh_50',['azx_utils.h',['../azx__utils_8h.html',1,'']]]
+ ['app_5fcfg_2eh_46',['app_cfg.h',['../app__cfg_8h.html',1,'']]],
+ ['azx_5flog_2eh_47',['azx_log.h',['../azx__log_8h.html',1,'']]],
+ ['azx_5futils_2eh_48',['azx_utils.h',['../azx__utils_8h.html',1,'']]]
];
diff --git a/Samples/AZX_Docs/html/search/functions_0.js b/Samples/AZX_Docs/html/search/functions_0.js
index 59d48af..18af8dd 100644
--- a/Samples/AZX_Docs/html/search/functions_0.js
+++ b/Samples/AZX_Docs/html/search/functions_0.js
@@ -1,13 +1,11 @@
var searchData=
[
- ['azx_5fhex_5fdump_51',['azx_hex_dump',['../azx__utils_8h.html#a079fc61e9774e7c7b178ddcc67617a0f',1,'azx_utils.h']]],
- ['azx_5flog_5fdeinit_52',['azx_log_deinit',['../azx__log_8h.html#a1cff830ca498f89db8a6ba0882441231',1,'azx_log.h']]],
- ['azx_5flog_5fflush_5fto_5ffile_53',['azx_log_flush_to_file',['../azx__log_8h.html#a3e999a06dd697da3196e357039081124',1,'azx_log.h']]],
- ['azx_5flog_5fgetlevel_54',['azx_log_getLevel',['../azx__log_8h.html#ab2c4e9406084c9f69c1314a718cc90d8',1,'azx_log.h']]],
- ['azx_5flog_5finit_55',['azx_log_init',['../group__log_conf.html#ga08e797515ecc2b71223a72c77c6dc6af',1,'azx_log.h']]],
- ['azx_5flog_5fsend_5fto_5ffile_56',['azx_log_send_to_file',['../azx__log_8h.html#af64520b985c9e8b97fda9dd77279bdd3',1,'azx_log.h']]],
- ['azx_5flog_5fsetlevel_57',['azx_log_setLevel',['../azx__log_8h.html#a7b0daaed2d1a5700a26365e409593a4b',1,'azx_log.h']]],
- ['azx_5freboot_5fnow_58',['azx_reboot_now',['../azx__utils_8h.html#a75795b5fabfb2be85fc105df383a82bf',1,'azx_utils.h']]],
- ['azx_5fshutdown_5fnow_59',['azx_shutdown_now',['../azx__utils_8h.html#aeaea36b3c4e80ad8a22f172aa36542df',1,'azx_utils.h']]],
- ['azx_5fsleep_5fms_60',['azx_sleep_ms',['../azx__utils_8h.html#adf8be666cb37d5c4d1c9c4b9694e2de5',1,'azx_utils.h']]]
+ ['azx_5fhex_5fdump_49',['azx_hex_dump',['../azx__utils_8h.html#a079fc61e9774e7c7b178ddcc67617a0f',1,'azx_utils.h']]],
+ ['azx_5flog_5fdeinit_50',['azx_log_deinit',['../azx__log_8h.html#a1cff830ca498f89db8a6ba0882441231',1,'azx_log.h']]],
+ ['azx_5flog_5fgetlevel_51',['azx_log_getLevel',['../azx__log_8h.html#ab2c4e9406084c9f69c1314a718cc90d8',1,'azx_log.h']]],
+ ['azx_5flog_5finit_52',['azx_log_init',['../group__log_conf.html#ga08e797515ecc2b71223a72c77c6dc6af',1,'azx_log.h']]],
+ ['azx_5flog_5fsetlevel_53',['azx_log_setLevel',['../azx__log_8h.html#a7b0daaed2d1a5700a26365e409593a4b',1,'azx_log.h']]],
+ ['azx_5freboot_5fnow_54',['azx_reboot_now',['../azx__utils_8h.html#a8fb8f6f485efbdbc31fc02942faf3a89',1,'azx_utils.h']]],
+ ['azx_5fshutdown_5fnow_55',['azx_shutdown_now',['../azx__utils_8h.html#ae6a6a38c2fdd6b84d9ef00b88690c97d',1,'azx_utils.h']]],
+ ['azx_5fsleep_5fms_56',['azx_sleep_ms',['../azx__utils_8h.html#adf8be666cb37d5c4d1c9c4b9694e2de5',1,'azx_utils.h']]]
];
diff --git a/Samples/AZX_Docs/html/search/groups_0.js b/Samples/AZX_Docs/html/search/groups_0.js
index 5af8f69..1be15f2 100644
--- a/Samples/AZX_Docs/html/search/groups_0.js
+++ b/Samples/AZX_Docs/html/search/groups_0.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['configuration_20of_20logging_20functionalities_87',['Configuration of logging functionalities',['../group__log_conf.html',1,'']]]
+ ['configuration_20of_20logging_20functionalities_83',['Configuration of logging functionalities',['../group__log_conf.html',1,'']]]
];
diff --git a/Samples/AZX_Docs/html/search/groups_1.js b/Samples/AZX_Docs/html/search/groups_1.js
index 93509ba..4397a21 100644
--- a/Samples/AZX_Docs/html/search/groups_1.js
+++ b/Samples/AZX_Docs/html/search/groups_1.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['usage_20of_20logging_20functionalities_88',['Usage of logging functionalities',['../group__log_usage.html',1,'']]]
+ ['usage_20of_20logging_20functionalities_84',['Usage of logging functionalities',['../group__log_usage.html',1,'']]]
];
diff --git a/Samples/AZX_Docs/html/search/pages_0.js b/Samples/AZX_Docs/html/search/pages_0.js
index 5e5b5ce..8c98d94 100644
--- a/Samples/AZX_Docs/html/search/pages_0.js
+++ b/Samples/AZX_Docs/html/search/pages_0.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['azx_20sample_20modules_20documentation_89',['AZX sample modules documentation',['../index.html',1,'']]]
+ ['azx_20sample_20modules_20documentation_85',['AZX sample modules documentation',['../index.html',1,'']]]
];
diff --git a/Samples/AZX_Docs/html/search/variables_0.js b/Samples/AZX_Docs/html/search/variables_0.js
index 2a42215..bfc4614 100644
--- a/Samples/AZX_Docs/html/search/variables_0.js
+++ b/Samples/AZX_Docs/html/search/variables_0.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['log_5fchannel_61',['log_channel',['../struct_a_z_x___l_o_g___c_f_g___t.html#a609c698186c3593727637d0d4afcad9a',1,'AZX_LOG_CFG_T']]],
- ['log_5fcolours_62',['log_colours',['../struct_a_z_x___l_o_g___c_f_g___t.html#aa034a943c56f918fe8dbbf6a06ade44c',1,'AZX_LOG_CFG_T']]],
- ['log_5flevel_63',['log_level',['../struct_a_z_x___l_o_g___c_f_g___t.html#afc9a3bd60f8958c7cccaf707612d2ae2',1,'AZX_LOG_CFG_T']]]
+ ['log_5fchannel_57',['log_channel',['../struct_a_z_x___l_o_g___c_f_g___t.html#a609c698186c3593727637d0d4afcad9a',1,'AZX_LOG_CFG_T']]],
+ ['log_5fcolours_58',['log_colours',['../struct_a_z_x___l_o_g___c_f_g___t.html#aa034a943c56f918fe8dbbf6a06ade44c',1,'AZX_LOG_CFG_T']]],
+ ['log_5flevel_59',['log_level',['../struct_a_z_x___l_o_g___c_f_g___t.html#afc9a3bd60f8958c7cccaf707612d2ae2',1,'AZX_LOG_CFG_T']]]
];
diff --git a/Samples/AZX_Docs/html/struct_a_z_x___l_o_g___c_f_g___t.html b/Samples/AZX_Docs/html/struct_a_z_x___l_o_g___c_f_g___t.html
index 395633c..0a592f3 100644
--- a/Samples/AZX_Docs/html/struct_a_z_x___l_o_g___c_f_g___t.html
+++ b/Samples/AZX_Docs/html/struct_a_z_x___l_o_g___c_f_g___t.html
@@ -34,7 +34,7 @@
 |
AZX (AppZone eXtensions) documentation
- 1.0.3
+ 1.0.4
A set of companion utilities that make AZ development easier
|
diff --git a/Samples/BRAVO_Environment_BSEC_Demo/azx/hdr/azx_log.h b/Samples/BRAVO_Environment_BSEC_Demo/azx/hdr/azx_log.h
index 38912d3..04f29be 100644
--- a/Samples/BRAVO_Environment_BSEC_Demo/azx/hdr/azx_log.h
+++ b/Samples/BRAVO_Environment_BSEC_Demo/azx/hdr/azx_log.h
@@ -1,11 +1,10 @@
-/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
-/* See LICENSE file in the project root for full license information. */
-
+/* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
+/* See LICENSE file in the project root for full license information. */
#ifndef HDR_AZX_LOG_H_
#define HDR_AZX_LOG_H_
/**
* @file azx_log.h
- * @version 1.0.5
+ * @version 1.0.2
* @dependencies
* @author Fabio Pintus
* @author Ioannis Demetriou
@@ -40,13 +39,13 @@
*/
typedef enum
{
- AZX_LOG_LEVEL_TRACE = 1, /**< Prints every message, adds a "TRACE" at the beginning of the message*/
- AZX_LOG_LEVEL_DEBUG = 2, /**< Prints most of the messages, adds a "DEBUG" at the beginning of the message*/
- AZX_LOG_LEVEL_INFO = 3, /**< print the message only, without any additional info */
- AZX_LOG_LEVEL_WARN = 4, /**< like DEBUG, but adds a "WARNING" at the beginning of the message. */
- AZX_LOG_LEVEL_ERROR = 5, /**< like DEBUG, but adds an "ERROR" at the beginning of the message */
- AZX_LOG_LEVEL_CRITICAL = 6, /**< like DEBUG, but adds an "CRITICAL" at the beginning of the message */
- AZX_LOG_LEVEL_NONE = 0x7F, /**< Do not print anything */
+ AZX_LOG_LEVEL_NONE = 0, /**< Do not print anything */
+ AZX_LOG_LEVEL_TRACE = 1, /**< Prints every message, adds a "TRACE" at the beginning of the message*/
+ AZX_LOG_LEVEL_DEBUG = 2, /**< Prints most of the messages, adds a "DEBUG" at the beginning of the message*/
+ AZX_LOG_LEVEL_INFO = 3, /**< print the message only, without any additional info */
+ AZX_LOG_LEVEL_WARN = 4, /**< like DEBUG, but adds a "WARNING" at the beginning of the message. */
+ AZX_LOG_LEVEL_ERROR = 5, /**< like DEBUG, but adds an "ERROR" at the beginning of the message */
+ AZX_LOG_LEVEL_CRITICAL = 6, /**< like DEBUG, but adds an "CRITICAL" at the beginning of the message */
} AZX_LOG_LEVEL_E;
@@ -209,37 +208,4 @@ void azx_log_setLevel(AZX_LOG_LEVEL_E level);
*/
AZX_LOG_LEVEL_E azx_log_getLevel(void);
-/**
- * @brief 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.
- *
- * @param filename The name of the file to log to. If NULL, this function does nothing.
- * @param circular_chunks The number of chunks to store circularly (apart from the original one).
- * @param min_level The minimum level of the logs to be stored.
- * @param max_size_kb The 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.
- *
- * @return TRUE if the file can be created and opened, FALSE otherwise
- */
-BOOLEAN azx_log_send_to_file(const CHAR* filename, UINT32 circular_chunks,
- AZX_LOG_LEVEL_E min_level, UINT32 max_size_kb);
-
-/**
- * @brief 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.
- */
-void azx_log_flush_to_file(void);
-
#endif /* HDR_AZX_LOG_H_ */
diff --git a/Samples/BRAVO_Environment_BSEC_Demo/azx/hdr/azx_utils.h b/Samples/BRAVO_Environment_BSEC_Demo/azx/hdr/azx_utils.h
index d0ffd84..b4905da 100644
--- a/Samples/BRAVO_Environment_BSEC_Demo/azx/hdr/azx_utils.h
+++ b/Samples/BRAVO_Environment_BSEC_Demo/azx/hdr/azx_utils.h
@@ -1,11 +1,10 @@
-/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
-/* See LICENSE file in the project root for full license information. */
-
+/* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
+/* See LICENSE file in the project root for full license information. */
#ifndef HDR_M2M_UTILS_H_
#define HDR_M2M_UTILS_H_
/**
* @file azx_utils.h
- * @version 1.0.1
+ * @version 1.0.0
* @dependencies azx_log
* @author Ioannis Demetriou
* @author Sorin Basca
@@ -68,7 +67,7 @@ const CHAR* azx_hex_dump(const void* data, UINT32 len);
*/
/*-----------------------------------------------------------------------------------------------*/
-void azx_reboot_now(void);
+void azx_reboot_now();
/**
@brief Shuts the modem down straight away.
@@ -81,7 +80,7 @@ void azx_reboot_now(void);
*/
/*-----------------------------------------------------------------------------------------------*/
-void azx_shutdown_now(void);
+void azx_shutdown_now();
diff --git a/Samples/BRAVO_Environment_BSEC_Demo/azx/src/azx_log.c b/Samples/BRAVO_Environment_BSEC_Demo/azx/src/azx_log.c
index abade1f..eb6be31 100644
--- a/Samples/BRAVO_Environment_BSEC_Demo/azx/src/azx_log.c
+++ b/Samples/BRAVO_Environment_BSEC_Demo/azx/src/azx_log.c
@@ -1,5 +1,5 @@
-/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
-/* See LICENSE file in the project root for full license information. */
+/* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
+/* See LICENSE file in the project root for full license information. */
/* Include files =============================================================*/
@@ -12,17 +12,13 @@
#include "m2mb_usb.h"
#include "m2mb_uart.h"
-#include "m2mb_fs_posix.h"
-#include "m2mb_fs_stdio.h"
-#include "m2mb_rtc.h"
-
#include "app_cfg.h"
#include "azx_log.h"
/* Local defines =============================================================*/
#define USB_CH_MAX 3
#define LOG_BUFFER_SIZE 2048
-#define MAX_FILE_LOG_CACHE 10000
+
#define NO_COLOUR "\033[0m"
#define BOLD "\033[1m"
@@ -70,15 +66,6 @@
); \
break
-#define LOG_FILE_PREFIX(tag) \
- case AZX_LOG_LEVEL_##tag: \
- offset = snprintf(log_buffer, LOG_BUFFER_SIZE, \
- prefix_fmt_file, get_date_time(), \
- ((now / 10) % 100), #tag, \
- get_file_title(file), line \
- ); \
- break
-
/* Local typedefs ============================================================*/
/* Local statics =============================================================*/
static struct
@@ -89,49 +76,19 @@ static struct
INT32 ch_fd;
BOOLEAN colouredLogs;
M2MB_OS_SEM_HANDLE CSSemHandle;
-} log_cfg = {/*.isInit*/ FALSE, /*.level*/ AZX_LOG_LEVEL_NONE, /*.channel*/ AZX_LOG_TO_MAX, /*.ch_fd */ -1, /*.colouredLogs*/ FALSE, /*.CSSemHandle */ NULL};
+} log_cfg = {.isInit=FALSE, .level=AZX_LOG_LEVEL_NONE, .channel=AZX_LOG_TO_MAX, .ch_fd = -1, .colouredLogs=FALSE, .CSSemHandle = NULL};
static CHAR log_buffer[LOG_BUFFER_SIZE] = { 0 };
static CHAR task_name[64];
-static CHAR dateTime[32] = { 0 };
-static struct
-{
- M2MB_FILE_T* fd;
- CHAR name[32];
- CHAR current_name[40];
- UINT32 circular_chunks;
- UINT32 max_size_kb;
- AZX_LOG_LEVEL_E min_level;
- UINT32 cache_idx;
- CHAR cache[MAX_FILE_LOG_CACHE];
-} logFile = {
- /*.fd */
- 0,
- /*.name */
- { 0 },
- /*.current_name */
- { 0 },
- /*.circular_chunks */
- 0,
- /*.max_size_kb */
- 0,
- /*.min_level */
- AZX_LOG_LEVEL_CRITICAL,
- /*.cache_idx */
- 0,
- /*.cache */
- { 0 }
-};
static const CHAR* prefix_fmt_colour = "[%s%-5s%s] %3.2f " CYAN "%s" NO_COLOUR
":" BOLD CYAN "%d" NO_COLOUR
" - %s{" BOLD WHITE "%s" NO_COLOUR "}$ ";
static const CHAR* prefix_fmt_no_colour = "[%s%-5s%s] %3.2f %s:%d - %s{%s}$ ";
-static const CHAR* prefix_fmt_file = "%s.%.2u [%-5s] %s:%d ";
/* Local function prototypes =================================================*/
@@ -174,13 +131,6 @@ static INT32 log_print_to_USB (const CHAR *path, const CHAR *message );
static UINT32 get_uptime(void);
static const char* get_file_title(const CHAR* path);
static char* get_current_task_name(CHAR *name);
-static BOOLEAN check_file_size(const CHAR* filename, UINT32 max_size_kb);
-static void flush_log_to_file();
-static void file_log_or_cache(const CHAR* buffer);
-static const CHAR* get_next_log_filename(const CHAR* filename,
- UINT32 circular_chunks, UINT32 max_size_kb);
-static BOOLEAN rotate_log_files(const CHAR* filename, UINT32 circular_chunks);
-static const char* get_date_time();
/* Static functions ==========================================================*/
@@ -301,8 +251,6 @@ static UINT32 get_uptime(void)
}
-static CHAR fileTitle[12] = "";
-
/*-----------------------------------------------------------------------------------------------*/
/*!
\brief Removes the file path from the provided path, leaving only filename
@@ -315,27 +263,15 @@ static CHAR fileTitle[12] = "";
static const char* get_file_title(const CHAR* path)
{
const CHAR* p = path;
- const CHAR* start = path;
- const CHAR* end = path;
while (*p) {
if (*p == '/' || *p == '\\') {
- start = p + 1;
- }
-
- if(*p == '.') {
- end = p;
+ return p + 1;
}
p++;
}
-
- if(end <= start) {
- end = p;
- }
-
- snprintf(fileTitle, sizeof(fileTitle), "%.*s", (INT32)(end - start), start);
- return fileTitle;
+ return path;
}
@@ -365,29 +301,6 @@ static char* get_current_task_name(CHAR *name)
}
}
-static const char* get_date_time(void)
-{
- INT32 fd = m2mb_rtc_open( "/dev/rtc0", 0 );
- M2MB_RTC_TIME_T ts = { 0 };
- if(fd == -1)
- {
- dateTime[0] = '\0';
- return dateTime;
- }
-
- if(-1 == m2mb_rtc_ioctl( fd, M2MB_RTC_IOCTL_GET_SYSTEM_TIME, &ts ))
- {
- m2mb_rtc_close( fd );
- dateTime[0] = '\0';
- return dateTime;
- }
- m2mb_rtc_close( fd );
- snprintf(dateTime, sizeof(dateTime), "%02u-%02u %02u:%02u:%02u",
- ts.mon, ts.day,
- ts.hour, ts.min, ts.sec);
- return dateTime;
-}
-
/* Global functions ==========================================================*/
@@ -573,210 +486,8 @@ INT32 azx_log_formatted(AZX_LOG_LEVEL_E level,
/* Print the message on the selected output stream */
sent = log_base_function(log_buffer);
- if(logFile.fd && level >= logFile.min_level)
- {
- if(!check_file_size(logFile.current_name, logFile.max_size_kb))
- {
- /* Log limit reached, so we'll need to open the next file in the rotation. Log in the file
- * that this limit is reached and then get the next filename */
- m2mb_fs_fputs("=== Log file size limit reached\r\n", logFile.fd);
- m2mb_fs_fclose(logFile.fd);
- logFile.fd = 0;
-
- snprintf(logFile.current_name, sizeof(logFile.current_name), "%s",
- get_next_log_filename(logFile.name, logFile.circular_chunks,
- logFile.max_size_kb));
-
- if(logFile.current_name[0] == '\0')
- {
- goto end;
- }
-
- logFile.fd = m2mb_fs_fopen(logFile.current_name, "a");
-
- if(!logFile.fd)
- {
- goto end;
- }
- }
-
- switch(level)
- {
- LOG_FILE_PREFIX(TRACE);
- LOG_FILE_PREFIX(DEBUG);
- LOG_FILE_PREFIX(INFO);
- LOG_FILE_PREFIX(WARN);
- LOG_FILE_PREFIX(ERROR);
- LOG_FILE_PREFIX(CRITICAL);
- default:
- break;
- }
-
- va_start(arg, fmt);
- vsnprintf(log_buffer + offset, LOG_BUFFER_SIZE - offset, fmt, arg);
- va_end(arg);
- file_log_or_cache(log_buffer);
- }
-
-end:
m2mb_os_sem_put(log_cfg.CSSemHandle);
}
return sent;
}
-
-static BOOLEAN check_file_size(const CHAR* filename, UINT32 max_size_kb)
-{
- struct M2MB_STAT stat;
- if(-1 == m2mb_fs_stat(filename, &stat))
- {
- /* Most likely the file doesn't exist, so return true */
- return TRUE;
- }
- return ((stat.st_size >> 10) < max_size_kb);
-}
-
-static void flush_log_to_file(void)
-{
- logFile.cache[logFile.cache_idx] = '\0';
- m2mb_fs_fwrite(logFile.cache, logFile.cache_idx, 1, logFile.fd);
- logFile.cache_idx = 0;
-}
-
-static void file_log_or_cache(const CHAR* buffer)
-{
- const UINT32 size = strlen(buffer);
-
- if(MAX_FILE_LOG_CACHE - 1 - size < logFile.cache_idx)
- {
- flush_log_to_file();
- }
-
- memcpy(&logFile.cache[logFile.cache_idx], buffer, size);
- logFile.cache_idx += size;
-}
-
-static CHAR filenameInUse[40] = "";
-
-static BOOLEAN rotate_log_files(const CHAR* filename, UINT32 circular_chunks)
-{
- CHAR from[40] = "";
- CHAR to[40] = "";
- UINT32 i = 0;
-
- /* This will move log.1 to log.2, log.2 to log.3 and so on until the last one */
- snprintf(from, sizeof(from), "%s.%u", filename, circular_chunks);
-
- m2mb_fs_remove(from);
-
- for(i = circular_chunks - 1; i > 0; --i)
- {
- snprintf(from, sizeof(from), "%s.%u", filename, i);
- snprintf(to, sizeof(to), "%s.%u", filename, i+1);
- if(-1 == m2mb_fs_rename(from, to))
- {
- /* Only return FALSE when the final file cannot be renamed - the other renames could be
- * failing if there are no files there */
- if(i == 1)
- {
- return FALSE;
- }
- }
- }
- return TRUE;
-}
-
-static const CHAR* get_next_log_filename(const CHAR* filename,
- UINT32 circular_chunks, UINT32 max_size_kb)
-{
- filenameInUse[0] = '\0';
-
- if(!filename)
- {
- goto end;
- }
-
- /* First try the original file */
- snprintf(filenameInUse, sizeof(filenameInUse), "%s", filename);
-
- if(check_file_size(filenameInUse, max_size_kb))
- {
- goto end;
- }
-
- /* If there is no circular logging and the original file is full, just return empty string */
- if(circular_chunks == 0)
- {
- filenameInUse[0] = '\0';
- goto end;
- }
-
- /* We should log to filename.1, but if that's full we need to rotate logs and then still use
- * filename.1 (since the old one got moved to filename.2) */
- snprintf(filenameInUse, sizeof(filenameInUse), "%s.1", filename);
-
- if(check_file_size(filenameInUse, max_size_kb))
- {
- goto end;
- }
-
- if(!rotate_log_files(filename, circular_chunks))
- {
- /* Since we failed to rotate, just wipe filename.1 so it can be reused */
- m2mb_fs_remove(filenameInUse);
- goto end;
- }
-
-end:
- return filenameInUse;
-}
-
-BOOLEAN azx_log_send_to_file(const CHAR* filename, UINT32 circular_chunks,
- AZX_LOG_LEVEL_E min_level, UINT32 max_size_kb)
-
-{
- if(!filename)
- {
- return FALSE;
- }
-
- if(circular_chunks == 0 && !check_file_size(filename, max_size_kb))
- {
- return FALSE;
- }
-
- if(logFile.fd)
- {
- m2mb_fs_fclose(logFile.fd);
- logFile.fd = 0;
- }
-
- snprintf(logFile.current_name, sizeof(logFile.current_name), "%s",
- get_next_log_filename(filename, circular_chunks, max_size_kb));
-
- if(logFile.current_name[0] == '\0')
- {
- return FALSE;
- }
-
- logFile.fd = m2mb_fs_fopen(logFile.current_name, "a");
-
- if(!logFile.fd)
- {
- return FALSE;
- }
-
- snprintf(logFile.name, sizeof(logFile.name), "%s", filename);
- logFile.circular_chunks = circular_chunks;
- logFile.min_level = min_level;
- logFile.max_size_kb = max_size_kb;
- logFile.cache_idx = 0;
- return TRUE;
-}
-
-void azx_log_flush_to_file(void)
-{
- m2mb_os_sem_get(log_cfg.CSSemHandle, M2MB_OS_WAIT_FOREVER );
- flush_log_to_file();
- m2mb_os_sem_put(log_cfg.CSSemHandle);
-}
diff --git a/Samples/BRAVO_Environment_BSEC_Demo/azx/src/azx_utils.c b/Samples/BRAVO_Environment_BSEC_Demo/azx/src/azx_utils.c
index a15c5cf..af11062 100644
--- a/Samples/BRAVO_Environment_BSEC_Demo/azx/src/azx_utils.c
+++ b/Samples/BRAVO_Environment_BSEC_Demo/azx/src/azx_utils.c
@@ -1,5 +1,5 @@
-/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
-/* See LICENSE file in the project root for full license information. */
+/* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
+/* See LICENSE file in the project root for full license information. */
#include
#include
@@ -43,26 +43,24 @@ const CHAR* azx_hex_dump(const void* data, UINT32 len)
return buff;
}
-void azx_reboot_now(void)
+void azx_reboot_now()
{
M2MB_POWER_HANDLE h = NULL;
if(M2MB_RESULT_SUCCESS == m2mb_power_init(&h, NULL, NULL))
{
- AZX_LOG_DEBUG("It's dead, Jim!\r\n");
- AZX_LOG_INFO("Rebooting device\r\n");
+ AZX_LOG_ERROR("It's dead, Jim!\r\n");
m2mb_power_reboot(h);
}
}
-void azx_shutdown_now(void)
+void azx_shutdown_now()
{
M2MB_POWER_HANDLE h = NULL;
if(M2MB_RESULT_SUCCESS == m2mb_power_init(&h, NULL, NULL))
{
- AZX_LOG_DEBUG("It's dead, Jim!\r\n");
- AZX_LOG_INFO("Shutting down device\r\n");
+ AZX_LOG_ERROR("It's dead, Jim!\r\n");
m2mb_power_shutdown(h);
}
}
diff --git a/Samples/BRAVO_Environment_BSEC_Demo/hdr/app_cfg.h b/Samples/BRAVO_Environment_BSEC_Demo/hdr/app_cfg.h
index 7f96af8..711dd51 100644
--- a/Samples/BRAVO_Environment_BSEC_Demo/hdr/app_cfg.h
+++ b/Samples/BRAVO_Environment_BSEC_Demo/hdr/app_cfg.h
@@ -23,7 +23,7 @@
/**
* @brief The current version of the Samples
*/
-#define VERSION "1.0.3"
+#define VERSION "1.0.4"
/**
* @name Log Settings
diff --git a/Samples/BRAVO_Environment_BSEC_Demo/src/demo_utils/lwm2m.c b/Samples/BRAVO_Environment_BSEC_Demo/src/demo_utils/lwm2m.c
index 0a3eeb1..364da7f 100644
--- a/Samples/BRAVO_Environment_BSEC_Demo/src/demo_utils/lwm2m.c
+++ b/Samples/BRAVO_Environment_BSEC_Demo/src/demo_utils/lwm2m.c
@@ -15,7 +15,7 @@
@author FabioPi
@date
- 2020-02-15
+ 2021-01-20
*/
/* Include files ================================================================================*/
#include
@@ -47,7 +47,7 @@
/* Local statics ================================================================================*/
/* ONEEDGE */
-static M2MB_LWM2M_HANDLE _h;
+static M2MB_LWM2M_HANDLE lwm2mHandle;
static M2MB_LWM2M_OBJ_URI_T _obj_telit_service_uri = {.uriLen = 4, .obj = 33211, .objInst = 0, .resource = 0, .resourceInst = 1};
@@ -92,6 +92,7 @@ void lwm2mIndCB( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size
if(resp->result == M2MB_LWM2M_RES_SUCCESS)
{
AZX_LOG_DEBUG( "LWM2M enable result OK\r\n");
+ m2mb_os_ev_set(lwm2m_evHandle, EV_LWM2M_ENABLE_RES_BIT, M2MB_OS_EV_SET);
}
else
{
@@ -106,6 +107,7 @@ void lwm2mIndCB( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size
if(resp->result == M2MB_LWM2M_RES_SUCCESS)
{
AZX_LOG_DEBUG( "LWM2M set result OK\r\n");
+ m2mb_os_ev_set(lwm2m_evHandle, EV_LWM2M_SET_RES_BIT, M2MB_OS_EV_SET);
}
else
{
@@ -120,6 +122,7 @@ void lwm2mIndCB( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size
if(resp->result == M2MB_LWM2M_RES_SUCCESS)
{
AZX_LOG_TRACE( "LWM2M write result OK\r\n");
+ m2mb_os_ev_set(lwm2m_evHandle, EV_LWM2M_WRITE_RES_BIT, M2MB_OS_EV_SET);
}
else
{
@@ -173,7 +176,7 @@ void lwm2mIndCB( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size
break;
case M2MB_LWM2M_CL_STATE_REGISTERED:
AZX_LOG_DEBUG( "resp->info == M2MB_LWM2M_CL_STATE_REGISTERED\r\n" );
- m2mb_os_ev_set(lwm2m_evHandle, EV_SRV_REG_BIT, M2MB_OS_EV_SET);
+ m2mb_os_ev_set(lwm2m_evHandle, EV_LWM2M_SRV_REG_BIT, M2MB_OS_EV_SET);
break;
case M2MB_LWM2M_CL_STATE_DEREGISTERING:
AZX_LOG_DEBUG( "resp->info == M2MB_LWM2M_CL_STATE_DEREGISTERING\r\n" );
@@ -242,7 +245,7 @@ uint8_t oneedge_init( INT32 obj_id )
{
m2mb_os_ev_setAttrItem( &evAttrHandle, M2MB_OS_EV_SEL_CMD_DEL_ATTR, NULL );
AZX_LOG_CRITICAL("m2mb_os_ev_init failed!\r\n");
- return 0;
+ return -1;
}
else
{
@@ -250,43 +253,64 @@ uint8_t oneedge_init( INT32 obj_id )
}
- //get the handle of the lwm2m client on _h
- retVal = m2mb_lwm2m_init( &_h, lwm2mIndCB, ( void * )NULL );
+ //get the handle of the lwm2m client on lwm2mHandle
+ retVal = m2mb_lwm2m_init( &lwm2mHandle, lwm2mIndCB, ( void * )NULL );
if( retVal != M2MB_RESULT_SUCCESS )
{
AZX_LOG_ERROR( "m2mb_lwm2m_init returned error %d\r\n", retVal );
+ m2mb_os_ev_deinit( lwm2m_evHandle );
return -1;
}
- retVal = m2mb_lwm2m_write( _h, &_obj_telit_service_uri, &service_enable, sizeof( INT32 ) );
+ retVal = m2mb_lwm2m_write( lwm2mHandle, &_obj_telit_service_uri, &service_enable, sizeof( INT32 ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
AZX_LOG_ERROR( "m2mb_lwm2m_write returned error %d\r\n", retVal );
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+
+ m2mb_lwm2m_deinit( lwm2mHandle );
return -1;
}
//AT#LWM2MENA=1
memset( &pars, 0, sizeof( M2MB_LWM2M_ENABLE_REQ_T ) );
- pars.apnclass = 0;
- pars.guardRequestEventSecs = 0;
- pars.guardReleaseEventSecs = 0;
+ pars.apnclass = 1; /*CID*/
+ pars.guardRequestEventSecs = 5;
+ pars.guardReleaseEventSecs = 5;
pars.commandType = M2MB_LWM2MENA_CMD_TYPE_SET;
pars.mode = M2MB_LWM2M_MODE_NO_ACK;
- retVal = m2mb_lwm2m_enable( _h, &pars );
-
-
-
+ retVal = m2mb_lwm2m_enable( lwm2mHandle, &pars );
if( retVal != M2MB_RESULT_SUCCESS )
{
AZX_LOG_ERROR( "m2mb_lwm2m_enable returned error %d\r\n", retVal );
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+ m2mb_lwm2m_deinit( lwm2mHandle );
return -1;
}
+ if(M2MB_OS_SUCCESS != m2mb_os_ev_get(
+ lwm2m_evHandle,
+ EV_LWM2M_ENABLE_RES_BIT,
+ M2MB_OS_EV_GET_ANY_AND_CLEAR,
+ &curEvBits,
+ M2MB_OS_MS2TICKS(10000) /*wait 10 seconds for the event to occur*/
+ )
+ )
+ {
+ AZX_LOG_ERROR("m2mb_lwm2m_enable timeout!\r\n");
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+ azx_sleep_ms(2000);
+ m2mb_lwm2m_deinit(lwm2mHandle);
+ return -1;
+ }
+
+ azx_sleep_ms(1000);
+
/*new object instance information*/
uri.obj = obj_id;
uri.objInst = 0;
@@ -294,20 +318,27 @@ uint8_t oneedge_init( INT32 obj_id )
new_inst_params.agent = 0; /*Telit Agent*/
/*If OK the instance was not present, and so it was created. If an error
is received, it is likely because the instance already exists.*/
- retVal = m2mb_lwm2m_newinst( _h, &uri, &new_inst_params );
+ retVal = m2mb_lwm2m_newinst( lwm2mHandle, &uri, &new_inst_params );
if( retVal != M2MB_RESULT_SUCCESS )
{
AZX_LOG_ERROR( "m2mb_lwm2m_newinst returned error %d\r\n", retVal );
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+ m2mb_lwm2m_deinit( lwm2mHandle );
return -1;
}
- AZX_LOG_DEBUG("Waiting LWM2M Registering (60 seconds)...\r\n");
- osRes = m2mb_os_ev_get(lwm2m_evHandle, EV_SRV_REG_BIT, M2MB_OS_EV_GET_ANY_AND_CLEAR, &curEvBits, M2MB_OS_MS2TICKS(60000));
+ AZX_LOG_DEBUG("Waiting LWM2M Registering (120 seconds timeout)...\r\n");
+ osRes = m2mb_os_ev_get(lwm2m_evHandle, EV_LWM2M_SRV_REG_BIT, M2MB_OS_EV_GET_ANY_AND_CLEAR, &curEvBits, M2MB_OS_MS2TICKS(120000));
if(osRes != M2MB_OS_SUCCESS)
{
AZX_LOG_ERROR("LWM2M Register timeout!\r\n");
- return 1;
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+
+ m2mb_lwm2m_disable(lwm2mHandle);
+ azx_sleep_ms(2000);
+ m2mb_lwm2m_deinit(lwm2mHandle);
+ return -1;
}
return 0;
@@ -317,7 +348,7 @@ uint8_t oneedge_init( INT32 obj_id )
/*-----------------------------------------------------------------------------------------------*/
void update_tamper_LWM2MObject( int value )
{
- M2MB_RESULT_E retVal = m2mb_lwm2m_write( _h, &_obj_tamper_uri, &value, sizeof( int ) );
+ M2MB_RESULT_E retVal = m2mb_lwm2m_write( lwm2mHandle, &_obj_tamper_uri, &value, sizeof( int ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
@@ -330,13 +361,13 @@ void update_tamper_LWM2MObject( int value )
/*-----------------------------------------------------------------------------------------------*/
void update_environment_LWM2MObject( float _t, float _p, float _rh, INT16 _iaq )
{
- M2MB_RESULT_E retVal = m2mb_lwm2m_set( _h, &_obj_environment_uri_t, &_t, sizeof( float ) );
+ M2MB_RESULT_E retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_environment_uri_t, &_t, sizeof( float ) );
azx_sleep_ms( 10 );
- retVal = m2mb_lwm2m_set( _h, &_obj_environment_uri_p, &_p, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_environment_uri_p, &_p, sizeof( float ) );
azx_sleep_ms( 10 );
- retVal = m2mb_lwm2m_set( _h, &_obj_environment_uri_h, &_rh, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_environment_uri_h, &_rh, sizeof( float ) );
azx_sleep_ms( 10 );
- retVal = m2mb_lwm2m_set( _h, &_obj_environment_uri_iaq, &_iaq, sizeof( INT16 ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_environment_uri_iaq, &_iaq, sizeof( INT16 ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
@@ -350,15 +381,15 @@ void update_environment_LWM2MObject( float _t, float _p, float _rh, INT16 _iaq )
void update_rotation_LWM2MObject( float _w, float _x, float _y, float _z, INT16 _acc )
{
M2MB_RESULT_E retVal;
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_w, &_w, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_w, &_w, sizeof( float ) );
//azx_sleep_ms(100);
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_x, &_x, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_x, &_x, sizeof( float ) );
//azx_sleep_ms(100);
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_y, &_y, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_y, &_y, sizeof( float ) );
//azx_sleep_ms(100);
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_z, &_z, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_z, &_z, sizeof( float ) );
//azx_sleep_ms(100);
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_a, &_acc, sizeof( INT16 ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_a, &_acc, sizeof( INT16 ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
@@ -371,7 +402,7 @@ void update_rotation_LWM2MObject( float _w, float _x, float _y, float _z, INT16
/*-----------------------------------------------------------------------------------------------*/
void update_smartlock_LWM2MObject( int value )
{
- M2MB_RESULT_E retVal = m2mb_lwm2m_write( _h, &_obj_smartlock_uri, &value, sizeof( int ) );
+ M2MB_RESULT_E retVal = m2mb_lwm2m_write( lwm2mHandle, &_obj_smartlock_uri, &value, sizeof( int ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
diff --git a/Samples/BRAVO_Environment_BSEC_Demo/src/demo_utils/lwm2m.h b/Samples/BRAVO_Environment_BSEC_Demo/src/demo_utils/lwm2m.h
index 52a7ac0..266a936 100644
--- a/Samples/BRAVO_Environment_BSEC_Demo/src/demo_utils/lwm2m.h
+++ b/Samples/BRAVO_Environment_BSEC_Demo/src/demo_utils/lwm2m.h
@@ -33,7 +33,14 @@
#define SMARTLOCK_OBJ_ID 26247
-#define EV_SRV_REG_BIT (UINT32)0x1 /*0x0000000000000001*/
+#define EV_LWM2M_ENABLE_RES_BIT (UINT32)0x00000001
+#define EV_LWM2M_SET_RES_BIT (UINT32)0x00000002
+#define EV_LWM2M_GET_RES_BIT (UINT32)0x00000004
+#define EV_LWM2M_MON_RES_BIT (UINT32)0x00000008
+#define EV_LWM2M_WRITE_RES_BIT (UINT32)0x00000010
+#define EV_LWM2M_READ_RES_BIT (UINT32)0x00000020
+#define EV_LWM2M_SRV_REG_BIT (UINT32)0x00000040
+#define EV_LWM2M_GET_STAT_RES_BIT (UINT32)0x00000080
/**
diff --git a/Samples/BRAVO_Rotation_Demo/azx/hdr/azx_log.h b/Samples/BRAVO_Rotation_Demo/azx/hdr/azx_log.h
index 38912d3..04f29be 100644
--- a/Samples/BRAVO_Rotation_Demo/azx/hdr/azx_log.h
+++ b/Samples/BRAVO_Rotation_Demo/azx/hdr/azx_log.h
@@ -1,11 +1,10 @@
-/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
-/* See LICENSE file in the project root for full license information. */
-
+/* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
+/* See LICENSE file in the project root for full license information. */
#ifndef HDR_AZX_LOG_H_
#define HDR_AZX_LOG_H_
/**
* @file azx_log.h
- * @version 1.0.5
+ * @version 1.0.2
* @dependencies
* @author Fabio Pintus
* @author Ioannis Demetriou
@@ -40,13 +39,13 @@
*/
typedef enum
{
- AZX_LOG_LEVEL_TRACE = 1, /**< Prints every message, adds a "TRACE" at the beginning of the message*/
- AZX_LOG_LEVEL_DEBUG = 2, /**< Prints most of the messages, adds a "DEBUG" at the beginning of the message*/
- AZX_LOG_LEVEL_INFO = 3, /**< print the message only, without any additional info */
- AZX_LOG_LEVEL_WARN = 4, /**< like DEBUG, but adds a "WARNING" at the beginning of the message. */
- AZX_LOG_LEVEL_ERROR = 5, /**< like DEBUG, but adds an "ERROR" at the beginning of the message */
- AZX_LOG_LEVEL_CRITICAL = 6, /**< like DEBUG, but adds an "CRITICAL" at the beginning of the message */
- AZX_LOG_LEVEL_NONE = 0x7F, /**< Do not print anything */
+ AZX_LOG_LEVEL_NONE = 0, /**< Do not print anything */
+ AZX_LOG_LEVEL_TRACE = 1, /**< Prints every message, adds a "TRACE" at the beginning of the message*/
+ AZX_LOG_LEVEL_DEBUG = 2, /**< Prints most of the messages, adds a "DEBUG" at the beginning of the message*/
+ AZX_LOG_LEVEL_INFO = 3, /**< print the message only, without any additional info */
+ AZX_LOG_LEVEL_WARN = 4, /**< like DEBUG, but adds a "WARNING" at the beginning of the message. */
+ AZX_LOG_LEVEL_ERROR = 5, /**< like DEBUG, but adds an "ERROR" at the beginning of the message */
+ AZX_LOG_LEVEL_CRITICAL = 6, /**< like DEBUG, but adds an "CRITICAL" at the beginning of the message */
} AZX_LOG_LEVEL_E;
@@ -209,37 +208,4 @@ void azx_log_setLevel(AZX_LOG_LEVEL_E level);
*/
AZX_LOG_LEVEL_E azx_log_getLevel(void);
-/**
- * @brief 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.
- *
- * @param filename The name of the file to log to. If NULL, this function does nothing.
- * @param circular_chunks The number of chunks to store circularly (apart from the original one).
- * @param min_level The minimum level of the logs to be stored.
- * @param max_size_kb The 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.
- *
- * @return TRUE if the file can be created and opened, FALSE otherwise
- */
-BOOLEAN azx_log_send_to_file(const CHAR* filename, UINT32 circular_chunks,
- AZX_LOG_LEVEL_E min_level, UINT32 max_size_kb);
-
-/**
- * @brief 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.
- */
-void azx_log_flush_to_file(void);
-
#endif /* HDR_AZX_LOG_H_ */
diff --git a/Samples/BRAVO_Rotation_Demo/azx/hdr/azx_utils.h b/Samples/BRAVO_Rotation_Demo/azx/hdr/azx_utils.h
index d0ffd84..b4905da 100644
--- a/Samples/BRAVO_Rotation_Demo/azx/hdr/azx_utils.h
+++ b/Samples/BRAVO_Rotation_Demo/azx/hdr/azx_utils.h
@@ -1,11 +1,10 @@
-/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
-/* See LICENSE file in the project root for full license information. */
-
+/* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
+/* See LICENSE file in the project root for full license information. */
#ifndef HDR_M2M_UTILS_H_
#define HDR_M2M_UTILS_H_
/**
* @file azx_utils.h
- * @version 1.0.1
+ * @version 1.0.0
* @dependencies azx_log
* @author Ioannis Demetriou
* @author Sorin Basca
@@ -68,7 +67,7 @@ const CHAR* azx_hex_dump(const void* data, UINT32 len);
*/
/*-----------------------------------------------------------------------------------------------*/
-void azx_reboot_now(void);
+void azx_reboot_now();
/**
@brief Shuts the modem down straight away.
@@ -81,7 +80,7 @@ void azx_reboot_now(void);
*/
/*-----------------------------------------------------------------------------------------------*/
-void azx_shutdown_now(void);
+void azx_shutdown_now();
diff --git a/Samples/BRAVO_Rotation_Demo/azx/src/azx_log.c b/Samples/BRAVO_Rotation_Demo/azx/src/azx_log.c
index abade1f..eb6be31 100644
--- a/Samples/BRAVO_Rotation_Demo/azx/src/azx_log.c
+++ b/Samples/BRAVO_Rotation_Demo/azx/src/azx_log.c
@@ -1,5 +1,5 @@
-/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
-/* See LICENSE file in the project root for full license information. */
+/* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
+/* See LICENSE file in the project root for full license information. */
/* Include files =============================================================*/
@@ -12,17 +12,13 @@
#include "m2mb_usb.h"
#include "m2mb_uart.h"
-#include "m2mb_fs_posix.h"
-#include "m2mb_fs_stdio.h"
-#include "m2mb_rtc.h"
-
#include "app_cfg.h"
#include "azx_log.h"
/* Local defines =============================================================*/
#define USB_CH_MAX 3
#define LOG_BUFFER_SIZE 2048
-#define MAX_FILE_LOG_CACHE 10000
+
#define NO_COLOUR "\033[0m"
#define BOLD "\033[1m"
@@ -70,15 +66,6 @@
); \
break
-#define LOG_FILE_PREFIX(tag) \
- case AZX_LOG_LEVEL_##tag: \
- offset = snprintf(log_buffer, LOG_BUFFER_SIZE, \
- prefix_fmt_file, get_date_time(), \
- ((now / 10) % 100), #tag, \
- get_file_title(file), line \
- ); \
- break
-
/* Local typedefs ============================================================*/
/* Local statics =============================================================*/
static struct
@@ -89,49 +76,19 @@ static struct
INT32 ch_fd;
BOOLEAN colouredLogs;
M2MB_OS_SEM_HANDLE CSSemHandle;
-} log_cfg = {/*.isInit*/ FALSE, /*.level*/ AZX_LOG_LEVEL_NONE, /*.channel*/ AZX_LOG_TO_MAX, /*.ch_fd */ -1, /*.colouredLogs*/ FALSE, /*.CSSemHandle */ NULL};
+} log_cfg = {.isInit=FALSE, .level=AZX_LOG_LEVEL_NONE, .channel=AZX_LOG_TO_MAX, .ch_fd = -1, .colouredLogs=FALSE, .CSSemHandle = NULL};
static CHAR log_buffer[LOG_BUFFER_SIZE] = { 0 };
static CHAR task_name[64];
-static CHAR dateTime[32] = { 0 };
-static struct
-{
- M2MB_FILE_T* fd;
- CHAR name[32];
- CHAR current_name[40];
- UINT32 circular_chunks;
- UINT32 max_size_kb;
- AZX_LOG_LEVEL_E min_level;
- UINT32 cache_idx;
- CHAR cache[MAX_FILE_LOG_CACHE];
-} logFile = {
- /*.fd */
- 0,
- /*.name */
- { 0 },
- /*.current_name */
- { 0 },
- /*.circular_chunks */
- 0,
- /*.max_size_kb */
- 0,
- /*.min_level */
- AZX_LOG_LEVEL_CRITICAL,
- /*.cache_idx */
- 0,
- /*.cache */
- { 0 }
-};
static const CHAR* prefix_fmt_colour = "[%s%-5s%s] %3.2f " CYAN "%s" NO_COLOUR
":" BOLD CYAN "%d" NO_COLOUR
" - %s{" BOLD WHITE "%s" NO_COLOUR "}$ ";
static const CHAR* prefix_fmt_no_colour = "[%s%-5s%s] %3.2f %s:%d - %s{%s}$ ";
-static const CHAR* prefix_fmt_file = "%s.%.2u [%-5s] %s:%d ";
/* Local function prototypes =================================================*/
@@ -174,13 +131,6 @@ static INT32 log_print_to_USB (const CHAR *path, const CHAR *message );
static UINT32 get_uptime(void);
static const char* get_file_title(const CHAR* path);
static char* get_current_task_name(CHAR *name);
-static BOOLEAN check_file_size(const CHAR* filename, UINT32 max_size_kb);
-static void flush_log_to_file();
-static void file_log_or_cache(const CHAR* buffer);
-static const CHAR* get_next_log_filename(const CHAR* filename,
- UINT32 circular_chunks, UINT32 max_size_kb);
-static BOOLEAN rotate_log_files(const CHAR* filename, UINT32 circular_chunks);
-static const char* get_date_time();
/* Static functions ==========================================================*/
@@ -301,8 +251,6 @@ static UINT32 get_uptime(void)
}
-static CHAR fileTitle[12] = "";
-
/*-----------------------------------------------------------------------------------------------*/
/*!
\brief Removes the file path from the provided path, leaving only filename
@@ -315,27 +263,15 @@ static CHAR fileTitle[12] = "";
static const char* get_file_title(const CHAR* path)
{
const CHAR* p = path;
- const CHAR* start = path;
- const CHAR* end = path;
while (*p) {
if (*p == '/' || *p == '\\') {
- start = p + 1;
- }
-
- if(*p == '.') {
- end = p;
+ return p + 1;
}
p++;
}
-
- if(end <= start) {
- end = p;
- }
-
- snprintf(fileTitle, sizeof(fileTitle), "%.*s", (INT32)(end - start), start);
- return fileTitle;
+ return path;
}
@@ -365,29 +301,6 @@ static char* get_current_task_name(CHAR *name)
}
}
-static const char* get_date_time(void)
-{
- INT32 fd = m2mb_rtc_open( "/dev/rtc0", 0 );
- M2MB_RTC_TIME_T ts = { 0 };
- if(fd == -1)
- {
- dateTime[0] = '\0';
- return dateTime;
- }
-
- if(-1 == m2mb_rtc_ioctl( fd, M2MB_RTC_IOCTL_GET_SYSTEM_TIME, &ts ))
- {
- m2mb_rtc_close( fd );
- dateTime[0] = '\0';
- return dateTime;
- }
- m2mb_rtc_close( fd );
- snprintf(dateTime, sizeof(dateTime), "%02u-%02u %02u:%02u:%02u",
- ts.mon, ts.day,
- ts.hour, ts.min, ts.sec);
- return dateTime;
-}
-
/* Global functions ==========================================================*/
@@ -573,210 +486,8 @@ INT32 azx_log_formatted(AZX_LOG_LEVEL_E level,
/* Print the message on the selected output stream */
sent = log_base_function(log_buffer);
- if(logFile.fd && level >= logFile.min_level)
- {
- if(!check_file_size(logFile.current_name, logFile.max_size_kb))
- {
- /* Log limit reached, so we'll need to open the next file in the rotation. Log in the file
- * that this limit is reached and then get the next filename */
- m2mb_fs_fputs("=== Log file size limit reached\r\n", logFile.fd);
- m2mb_fs_fclose(logFile.fd);
- logFile.fd = 0;
-
- snprintf(logFile.current_name, sizeof(logFile.current_name), "%s",
- get_next_log_filename(logFile.name, logFile.circular_chunks,
- logFile.max_size_kb));
-
- if(logFile.current_name[0] == '\0')
- {
- goto end;
- }
-
- logFile.fd = m2mb_fs_fopen(logFile.current_name, "a");
-
- if(!logFile.fd)
- {
- goto end;
- }
- }
-
- switch(level)
- {
- LOG_FILE_PREFIX(TRACE);
- LOG_FILE_PREFIX(DEBUG);
- LOG_FILE_PREFIX(INFO);
- LOG_FILE_PREFIX(WARN);
- LOG_FILE_PREFIX(ERROR);
- LOG_FILE_PREFIX(CRITICAL);
- default:
- break;
- }
-
- va_start(arg, fmt);
- vsnprintf(log_buffer + offset, LOG_BUFFER_SIZE - offset, fmt, arg);
- va_end(arg);
- file_log_or_cache(log_buffer);
- }
-
-end:
m2mb_os_sem_put(log_cfg.CSSemHandle);
}
return sent;
}
-
-static BOOLEAN check_file_size(const CHAR* filename, UINT32 max_size_kb)
-{
- struct M2MB_STAT stat;
- if(-1 == m2mb_fs_stat(filename, &stat))
- {
- /* Most likely the file doesn't exist, so return true */
- return TRUE;
- }
- return ((stat.st_size >> 10) < max_size_kb);
-}
-
-static void flush_log_to_file(void)
-{
- logFile.cache[logFile.cache_idx] = '\0';
- m2mb_fs_fwrite(logFile.cache, logFile.cache_idx, 1, logFile.fd);
- logFile.cache_idx = 0;
-}
-
-static void file_log_or_cache(const CHAR* buffer)
-{
- const UINT32 size = strlen(buffer);
-
- if(MAX_FILE_LOG_CACHE - 1 - size < logFile.cache_idx)
- {
- flush_log_to_file();
- }
-
- memcpy(&logFile.cache[logFile.cache_idx], buffer, size);
- logFile.cache_idx += size;
-}
-
-static CHAR filenameInUse[40] = "";
-
-static BOOLEAN rotate_log_files(const CHAR* filename, UINT32 circular_chunks)
-{
- CHAR from[40] = "";
- CHAR to[40] = "";
- UINT32 i = 0;
-
- /* This will move log.1 to log.2, log.2 to log.3 and so on until the last one */
- snprintf(from, sizeof(from), "%s.%u", filename, circular_chunks);
-
- m2mb_fs_remove(from);
-
- for(i = circular_chunks - 1; i > 0; --i)
- {
- snprintf(from, sizeof(from), "%s.%u", filename, i);
- snprintf(to, sizeof(to), "%s.%u", filename, i+1);
- if(-1 == m2mb_fs_rename(from, to))
- {
- /* Only return FALSE when the final file cannot be renamed - the other renames could be
- * failing if there are no files there */
- if(i == 1)
- {
- return FALSE;
- }
- }
- }
- return TRUE;
-}
-
-static const CHAR* get_next_log_filename(const CHAR* filename,
- UINT32 circular_chunks, UINT32 max_size_kb)
-{
- filenameInUse[0] = '\0';
-
- if(!filename)
- {
- goto end;
- }
-
- /* First try the original file */
- snprintf(filenameInUse, sizeof(filenameInUse), "%s", filename);
-
- if(check_file_size(filenameInUse, max_size_kb))
- {
- goto end;
- }
-
- /* If there is no circular logging and the original file is full, just return empty string */
- if(circular_chunks == 0)
- {
- filenameInUse[0] = '\0';
- goto end;
- }
-
- /* We should log to filename.1, but if that's full we need to rotate logs and then still use
- * filename.1 (since the old one got moved to filename.2) */
- snprintf(filenameInUse, sizeof(filenameInUse), "%s.1", filename);
-
- if(check_file_size(filenameInUse, max_size_kb))
- {
- goto end;
- }
-
- if(!rotate_log_files(filename, circular_chunks))
- {
- /* Since we failed to rotate, just wipe filename.1 so it can be reused */
- m2mb_fs_remove(filenameInUse);
- goto end;
- }
-
-end:
- return filenameInUse;
-}
-
-BOOLEAN azx_log_send_to_file(const CHAR* filename, UINT32 circular_chunks,
- AZX_LOG_LEVEL_E min_level, UINT32 max_size_kb)
-
-{
- if(!filename)
- {
- return FALSE;
- }
-
- if(circular_chunks == 0 && !check_file_size(filename, max_size_kb))
- {
- return FALSE;
- }
-
- if(logFile.fd)
- {
- m2mb_fs_fclose(logFile.fd);
- logFile.fd = 0;
- }
-
- snprintf(logFile.current_name, sizeof(logFile.current_name), "%s",
- get_next_log_filename(filename, circular_chunks, max_size_kb));
-
- if(logFile.current_name[0] == '\0')
- {
- return FALSE;
- }
-
- logFile.fd = m2mb_fs_fopen(logFile.current_name, "a");
-
- if(!logFile.fd)
- {
- return FALSE;
- }
-
- snprintf(logFile.name, sizeof(logFile.name), "%s", filename);
- logFile.circular_chunks = circular_chunks;
- logFile.min_level = min_level;
- logFile.max_size_kb = max_size_kb;
- logFile.cache_idx = 0;
- return TRUE;
-}
-
-void azx_log_flush_to_file(void)
-{
- m2mb_os_sem_get(log_cfg.CSSemHandle, M2MB_OS_WAIT_FOREVER );
- flush_log_to_file();
- m2mb_os_sem_put(log_cfg.CSSemHandle);
-}
diff --git a/Samples/BRAVO_Rotation_Demo/azx/src/azx_utils.c b/Samples/BRAVO_Rotation_Demo/azx/src/azx_utils.c
index a15c5cf..af11062 100644
--- a/Samples/BRAVO_Rotation_Demo/azx/src/azx_utils.c
+++ b/Samples/BRAVO_Rotation_Demo/azx/src/azx_utils.c
@@ -1,5 +1,5 @@
-/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
-/* See LICENSE file in the project root for full license information. */
+/* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
+/* See LICENSE file in the project root for full license information. */
#include
#include
@@ -43,26 +43,24 @@ const CHAR* azx_hex_dump(const void* data, UINT32 len)
return buff;
}
-void azx_reboot_now(void)
+void azx_reboot_now()
{
M2MB_POWER_HANDLE h = NULL;
if(M2MB_RESULT_SUCCESS == m2mb_power_init(&h, NULL, NULL))
{
- AZX_LOG_DEBUG("It's dead, Jim!\r\n");
- AZX_LOG_INFO("Rebooting device\r\n");
+ AZX_LOG_ERROR("It's dead, Jim!\r\n");
m2mb_power_reboot(h);
}
}
-void azx_shutdown_now(void)
+void azx_shutdown_now()
{
M2MB_POWER_HANDLE h = NULL;
if(M2MB_RESULT_SUCCESS == m2mb_power_init(&h, NULL, NULL))
{
- AZX_LOG_DEBUG("It's dead, Jim!\r\n");
- AZX_LOG_INFO("Shutting down device\r\n");
+ AZX_LOG_ERROR("It's dead, Jim!\r\n");
m2mb_power_shutdown(h);
}
}
diff --git a/Samples/BRAVO_Rotation_Demo/hdr/app_cfg.h b/Samples/BRAVO_Rotation_Demo/hdr/app_cfg.h
index 7f96af8..711dd51 100644
--- a/Samples/BRAVO_Rotation_Demo/hdr/app_cfg.h
+++ b/Samples/BRAVO_Rotation_Demo/hdr/app_cfg.h
@@ -23,7 +23,7 @@
/**
* @brief The current version of the Samples
*/
-#define VERSION "1.0.3"
+#define VERSION "1.0.4"
/**
* @name Log Settings
diff --git a/Samples/BRAVO_Rotation_Demo/src/demo_utils/lwm2m.c b/Samples/BRAVO_Rotation_Demo/src/demo_utils/lwm2m.c
index 0a3eeb1..364da7f 100644
--- a/Samples/BRAVO_Rotation_Demo/src/demo_utils/lwm2m.c
+++ b/Samples/BRAVO_Rotation_Demo/src/demo_utils/lwm2m.c
@@ -15,7 +15,7 @@
@author FabioPi
@date
- 2020-02-15
+ 2021-01-20
*/
/* Include files ================================================================================*/
#include
@@ -47,7 +47,7 @@
/* Local statics ================================================================================*/
/* ONEEDGE */
-static M2MB_LWM2M_HANDLE _h;
+static M2MB_LWM2M_HANDLE lwm2mHandle;
static M2MB_LWM2M_OBJ_URI_T _obj_telit_service_uri = {.uriLen = 4, .obj = 33211, .objInst = 0, .resource = 0, .resourceInst = 1};
@@ -92,6 +92,7 @@ void lwm2mIndCB( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size
if(resp->result == M2MB_LWM2M_RES_SUCCESS)
{
AZX_LOG_DEBUG( "LWM2M enable result OK\r\n");
+ m2mb_os_ev_set(lwm2m_evHandle, EV_LWM2M_ENABLE_RES_BIT, M2MB_OS_EV_SET);
}
else
{
@@ -106,6 +107,7 @@ void lwm2mIndCB( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size
if(resp->result == M2MB_LWM2M_RES_SUCCESS)
{
AZX_LOG_DEBUG( "LWM2M set result OK\r\n");
+ m2mb_os_ev_set(lwm2m_evHandle, EV_LWM2M_SET_RES_BIT, M2MB_OS_EV_SET);
}
else
{
@@ -120,6 +122,7 @@ void lwm2mIndCB( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size
if(resp->result == M2MB_LWM2M_RES_SUCCESS)
{
AZX_LOG_TRACE( "LWM2M write result OK\r\n");
+ m2mb_os_ev_set(lwm2m_evHandle, EV_LWM2M_WRITE_RES_BIT, M2MB_OS_EV_SET);
}
else
{
@@ -173,7 +176,7 @@ void lwm2mIndCB( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size
break;
case M2MB_LWM2M_CL_STATE_REGISTERED:
AZX_LOG_DEBUG( "resp->info == M2MB_LWM2M_CL_STATE_REGISTERED\r\n" );
- m2mb_os_ev_set(lwm2m_evHandle, EV_SRV_REG_BIT, M2MB_OS_EV_SET);
+ m2mb_os_ev_set(lwm2m_evHandle, EV_LWM2M_SRV_REG_BIT, M2MB_OS_EV_SET);
break;
case M2MB_LWM2M_CL_STATE_DEREGISTERING:
AZX_LOG_DEBUG( "resp->info == M2MB_LWM2M_CL_STATE_DEREGISTERING\r\n" );
@@ -242,7 +245,7 @@ uint8_t oneedge_init( INT32 obj_id )
{
m2mb_os_ev_setAttrItem( &evAttrHandle, M2MB_OS_EV_SEL_CMD_DEL_ATTR, NULL );
AZX_LOG_CRITICAL("m2mb_os_ev_init failed!\r\n");
- return 0;
+ return -1;
}
else
{
@@ -250,43 +253,64 @@ uint8_t oneedge_init( INT32 obj_id )
}
- //get the handle of the lwm2m client on _h
- retVal = m2mb_lwm2m_init( &_h, lwm2mIndCB, ( void * )NULL );
+ //get the handle of the lwm2m client on lwm2mHandle
+ retVal = m2mb_lwm2m_init( &lwm2mHandle, lwm2mIndCB, ( void * )NULL );
if( retVal != M2MB_RESULT_SUCCESS )
{
AZX_LOG_ERROR( "m2mb_lwm2m_init returned error %d\r\n", retVal );
+ m2mb_os_ev_deinit( lwm2m_evHandle );
return -1;
}
- retVal = m2mb_lwm2m_write( _h, &_obj_telit_service_uri, &service_enable, sizeof( INT32 ) );
+ retVal = m2mb_lwm2m_write( lwm2mHandle, &_obj_telit_service_uri, &service_enable, sizeof( INT32 ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
AZX_LOG_ERROR( "m2mb_lwm2m_write returned error %d\r\n", retVal );
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+
+ m2mb_lwm2m_deinit( lwm2mHandle );
return -1;
}
//AT#LWM2MENA=1
memset( &pars, 0, sizeof( M2MB_LWM2M_ENABLE_REQ_T ) );
- pars.apnclass = 0;
- pars.guardRequestEventSecs = 0;
- pars.guardReleaseEventSecs = 0;
+ pars.apnclass = 1; /*CID*/
+ pars.guardRequestEventSecs = 5;
+ pars.guardReleaseEventSecs = 5;
pars.commandType = M2MB_LWM2MENA_CMD_TYPE_SET;
pars.mode = M2MB_LWM2M_MODE_NO_ACK;
- retVal = m2mb_lwm2m_enable( _h, &pars );
-
-
-
+ retVal = m2mb_lwm2m_enable( lwm2mHandle, &pars );
if( retVal != M2MB_RESULT_SUCCESS )
{
AZX_LOG_ERROR( "m2mb_lwm2m_enable returned error %d\r\n", retVal );
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+ m2mb_lwm2m_deinit( lwm2mHandle );
return -1;
}
+ if(M2MB_OS_SUCCESS != m2mb_os_ev_get(
+ lwm2m_evHandle,
+ EV_LWM2M_ENABLE_RES_BIT,
+ M2MB_OS_EV_GET_ANY_AND_CLEAR,
+ &curEvBits,
+ M2MB_OS_MS2TICKS(10000) /*wait 10 seconds for the event to occur*/
+ )
+ )
+ {
+ AZX_LOG_ERROR("m2mb_lwm2m_enable timeout!\r\n");
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+ azx_sleep_ms(2000);
+ m2mb_lwm2m_deinit(lwm2mHandle);
+ return -1;
+ }
+
+ azx_sleep_ms(1000);
+
/*new object instance information*/
uri.obj = obj_id;
uri.objInst = 0;
@@ -294,20 +318,27 @@ uint8_t oneedge_init( INT32 obj_id )
new_inst_params.agent = 0; /*Telit Agent*/
/*If OK the instance was not present, and so it was created. If an error
is received, it is likely because the instance already exists.*/
- retVal = m2mb_lwm2m_newinst( _h, &uri, &new_inst_params );
+ retVal = m2mb_lwm2m_newinst( lwm2mHandle, &uri, &new_inst_params );
if( retVal != M2MB_RESULT_SUCCESS )
{
AZX_LOG_ERROR( "m2mb_lwm2m_newinst returned error %d\r\n", retVal );
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+ m2mb_lwm2m_deinit( lwm2mHandle );
return -1;
}
- AZX_LOG_DEBUG("Waiting LWM2M Registering (60 seconds)...\r\n");
- osRes = m2mb_os_ev_get(lwm2m_evHandle, EV_SRV_REG_BIT, M2MB_OS_EV_GET_ANY_AND_CLEAR, &curEvBits, M2MB_OS_MS2TICKS(60000));
+ AZX_LOG_DEBUG("Waiting LWM2M Registering (120 seconds timeout)...\r\n");
+ osRes = m2mb_os_ev_get(lwm2m_evHandle, EV_LWM2M_SRV_REG_BIT, M2MB_OS_EV_GET_ANY_AND_CLEAR, &curEvBits, M2MB_OS_MS2TICKS(120000));
if(osRes != M2MB_OS_SUCCESS)
{
AZX_LOG_ERROR("LWM2M Register timeout!\r\n");
- return 1;
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+
+ m2mb_lwm2m_disable(lwm2mHandle);
+ azx_sleep_ms(2000);
+ m2mb_lwm2m_deinit(lwm2mHandle);
+ return -1;
}
return 0;
@@ -317,7 +348,7 @@ uint8_t oneedge_init( INT32 obj_id )
/*-----------------------------------------------------------------------------------------------*/
void update_tamper_LWM2MObject( int value )
{
- M2MB_RESULT_E retVal = m2mb_lwm2m_write( _h, &_obj_tamper_uri, &value, sizeof( int ) );
+ M2MB_RESULT_E retVal = m2mb_lwm2m_write( lwm2mHandle, &_obj_tamper_uri, &value, sizeof( int ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
@@ -330,13 +361,13 @@ void update_tamper_LWM2MObject( int value )
/*-----------------------------------------------------------------------------------------------*/
void update_environment_LWM2MObject( float _t, float _p, float _rh, INT16 _iaq )
{
- M2MB_RESULT_E retVal = m2mb_lwm2m_set( _h, &_obj_environment_uri_t, &_t, sizeof( float ) );
+ M2MB_RESULT_E retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_environment_uri_t, &_t, sizeof( float ) );
azx_sleep_ms( 10 );
- retVal = m2mb_lwm2m_set( _h, &_obj_environment_uri_p, &_p, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_environment_uri_p, &_p, sizeof( float ) );
azx_sleep_ms( 10 );
- retVal = m2mb_lwm2m_set( _h, &_obj_environment_uri_h, &_rh, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_environment_uri_h, &_rh, sizeof( float ) );
azx_sleep_ms( 10 );
- retVal = m2mb_lwm2m_set( _h, &_obj_environment_uri_iaq, &_iaq, sizeof( INT16 ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_environment_uri_iaq, &_iaq, sizeof( INT16 ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
@@ -350,15 +381,15 @@ void update_environment_LWM2MObject( float _t, float _p, float _rh, INT16 _iaq )
void update_rotation_LWM2MObject( float _w, float _x, float _y, float _z, INT16 _acc )
{
M2MB_RESULT_E retVal;
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_w, &_w, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_w, &_w, sizeof( float ) );
//azx_sleep_ms(100);
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_x, &_x, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_x, &_x, sizeof( float ) );
//azx_sleep_ms(100);
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_y, &_y, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_y, &_y, sizeof( float ) );
//azx_sleep_ms(100);
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_z, &_z, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_z, &_z, sizeof( float ) );
//azx_sleep_ms(100);
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_a, &_acc, sizeof( INT16 ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_a, &_acc, sizeof( INT16 ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
@@ -371,7 +402,7 @@ void update_rotation_LWM2MObject( float _w, float _x, float _y, float _z, INT16
/*-----------------------------------------------------------------------------------------------*/
void update_smartlock_LWM2MObject( int value )
{
- M2MB_RESULT_E retVal = m2mb_lwm2m_write( _h, &_obj_smartlock_uri, &value, sizeof( int ) );
+ M2MB_RESULT_E retVal = m2mb_lwm2m_write( lwm2mHandle, &_obj_smartlock_uri, &value, sizeof( int ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
diff --git a/Samples/BRAVO_Rotation_Demo/src/demo_utils/lwm2m.h b/Samples/BRAVO_Rotation_Demo/src/demo_utils/lwm2m.h
index 52a7ac0..266a936 100644
--- a/Samples/BRAVO_Rotation_Demo/src/demo_utils/lwm2m.h
+++ b/Samples/BRAVO_Rotation_Demo/src/demo_utils/lwm2m.h
@@ -33,7 +33,14 @@
#define SMARTLOCK_OBJ_ID 26247
-#define EV_SRV_REG_BIT (UINT32)0x1 /*0x0000000000000001*/
+#define EV_LWM2M_ENABLE_RES_BIT (UINT32)0x00000001
+#define EV_LWM2M_SET_RES_BIT (UINT32)0x00000002
+#define EV_LWM2M_GET_RES_BIT (UINT32)0x00000004
+#define EV_LWM2M_MON_RES_BIT (UINT32)0x00000008
+#define EV_LWM2M_WRITE_RES_BIT (UINT32)0x00000010
+#define EV_LWM2M_READ_RES_BIT (UINT32)0x00000020
+#define EV_LWM2M_SRV_REG_BIT (UINT32)0x00000040
+#define EV_LWM2M_GET_STAT_RES_BIT (UINT32)0x00000080
/**
diff --git a/Samples/BRAVO_Tampering_Demo/azx/hdr/azx_log.h b/Samples/BRAVO_Tampering_Demo/azx/hdr/azx_log.h
index 38912d3..04f29be 100644
--- a/Samples/BRAVO_Tampering_Demo/azx/hdr/azx_log.h
+++ b/Samples/BRAVO_Tampering_Demo/azx/hdr/azx_log.h
@@ -1,11 +1,10 @@
-/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
-/* See LICENSE file in the project root for full license information. */
-
+/* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
+/* See LICENSE file in the project root for full license information. */
#ifndef HDR_AZX_LOG_H_
#define HDR_AZX_LOG_H_
/**
* @file azx_log.h
- * @version 1.0.5
+ * @version 1.0.2
* @dependencies
* @author Fabio Pintus
* @author Ioannis Demetriou
@@ -40,13 +39,13 @@
*/
typedef enum
{
- AZX_LOG_LEVEL_TRACE = 1, /**< Prints every message, adds a "TRACE" at the beginning of the message*/
- AZX_LOG_LEVEL_DEBUG = 2, /**< Prints most of the messages, adds a "DEBUG" at the beginning of the message*/
- AZX_LOG_LEVEL_INFO = 3, /**< print the message only, without any additional info */
- AZX_LOG_LEVEL_WARN = 4, /**< like DEBUG, but adds a "WARNING" at the beginning of the message. */
- AZX_LOG_LEVEL_ERROR = 5, /**< like DEBUG, but adds an "ERROR" at the beginning of the message */
- AZX_LOG_LEVEL_CRITICAL = 6, /**< like DEBUG, but adds an "CRITICAL" at the beginning of the message */
- AZX_LOG_LEVEL_NONE = 0x7F, /**< Do not print anything */
+ AZX_LOG_LEVEL_NONE = 0, /**< Do not print anything */
+ AZX_LOG_LEVEL_TRACE = 1, /**< Prints every message, adds a "TRACE" at the beginning of the message*/
+ AZX_LOG_LEVEL_DEBUG = 2, /**< Prints most of the messages, adds a "DEBUG" at the beginning of the message*/
+ AZX_LOG_LEVEL_INFO = 3, /**< print the message only, without any additional info */
+ AZX_LOG_LEVEL_WARN = 4, /**< like DEBUG, but adds a "WARNING" at the beginning of the message. */
+ AZX_LOG_LEVEL_ERROR = 5, /**< like DEBUG, but adds an "ERROR" at the beginning of the message */
+ AZX_LOG_LEVEL_CRITICAL = 6, /**< like DEBUG, but adds an "CRITICAL" at the beginning of the message */
} AZX_LOG_LEVEL_E;
@@ -209,37 +208,4 @@ void azx_log_setLevel(AZX_LOG_LEVEL_E level);
*/
AZX_LOG_LEVEL_E azx_log_getLevel(void);
-/**
- * @brief 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.
- *
- * @param filename The name of the file to log to. If NULL, this function does nothing.
- * @param circular_chunks The number of chunks to store circularly (apart from the original one).
- * @param min_level The minimum level of the logs to be stored.
- * @param max_size_kb The 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.
- *
- * @return TRUE if the file can be created and opened, FALSE otherwise
- */
-BOOLEAN azx_log_send_to_file(const CHAR* filename, UINT32 circular_chunks,
- AZX_LOG_LEVEL_E min_level, UINT32 max_size_kb);
-
-/**
- * @brief 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.
- */
-void azx_log_flush_to_file(void);
-
#endif /* HDR_AZX_LOG_H_ */
diff --git a/Samples/BRAVO_Tampering_Demo/azx/hdr/azx_utils.h b/Samples/BRAVO_Tampering_Demo/azx/hdr/azx_utils.h
index d0ffd84..b4905da 100644
--- a/Samples/BRAVO_Tampering_Demo/azx/hdr/azx_utils.h
+++ b/Samples/BRAVO_Tampering_Demo/azx/hdr/azx_utils.h
@@ -1,11 +1,10 @@
-/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
-/* See LICENSE file in the project root for full license information. */
-
+/* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
+/* See LICENSE file in the project root for full license information. */
#ifndef HDR_M2M_UTILS_H_
#define HDR_M2M_UTILS_H_
/**
* @file azx_utils.h
- * @version 1.0.1
+ * @version 1.0.0
* @dependencies azx_log
* @author Ioannis Demetriou
* @author Sorin Basca
@@ -68,7 +67,7 @@ const CHAR* azx_hex_dump(const void* data, UINT32 len);
*/
/*-----------------------------------------------------------------------------------------------*/
-void azx_reboot_now(void);
+void azx_reboot_now();
/**
@brief Shuts the modem down straight away.
@@ -81,7 +80,7 @@ void azx_reboot_now(void);
*/
/*-----------------------------------------------------------------------------------------------*/
-void azx_shutdown_now(void);
+void azx_shutdown_now();
diff --git a/Samples/BRAVO_Tampering_Demo/azx/src/azx_log.c b/Samples/BRAVO_Tampering_Demo/azx/src/azx_log.c
index abade1f..eb6be31 100644
--- a/Samples/BRAVO_Tampering_Demo/azx/src/azx_log.c
+++ b/Samples/BRAVO_Tampering_Demo/azx/src/azx_log.c
@@ -1,5 +1,5 @@
-/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
-/* See LICENSE file in the project root for full license information. */
+/* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
+/* See LICENSE file in the project root for full license information. */
/* Include files =============================================================*/
@@ -12,17 +12,13 @@
#include "m2mb_usb.h"
#include "m2mb_uart.h"
-#include "m2mb_fs_posix.h"
-#include "m2mb_fs_stdio.h"
-#include "m2mb_rtc.h"
-
#include "app_cfg.h"
#include "azx_log.h"
/* Local defines =============================================================*/
#define USB_CH_MAX 3
#define LOG_BUFFER_SIZE 2048
-#define MAX_FILE_LOG_CACHE 10000
+
#define NO_COLOUR "\033[0m"
#define BOLD "\033[1m"
@@ -70,15 +66,6 @@
); \
break
-#define LOG_FILE_PREFIX(tag) \
- case AZX_LOG_LEVEL_##tag: \
- offset = snprintf(log_buffer, LOG_BUFFER_SIZE, \
- prefix_fmt_file, get_date_time(), \
- ((now / 10) % 100), #tag, \
- get_file_title(file), line \
- ); \
- break
-
/* Local typedefs ============================================================*/
/* Local statics =============================================================*/
static struct
@@ -89,49 +76,19 @@ static struct
INT32 ch_fd;
BOOLEAN colouredLogs;
M2MB_OS_SEM_HANDLE CSSemHandle;
-} log_cfg = {/*.isInit*/ FALSE, /*.level*/ AZX_LOG_LEVEL_NONE, /*.channel*/ AZX_LOG_TO_MAX, /*.ch_fd */ -1, /*.colouredLogs*/ FALSE, /*.CSSemHandle */ NULL};
+} log_cfg = {.isInit=FALSE, .level=AZX_LOG_LEVEL_NONE, .channel=AZX_LOG_TO_MAX, .ch_fd = -1, .colouredLogs=FALSE, .CSSemHandle = NULL};
static CHAR log_buffer[LOG_BUFFER_SIZE] = { 0 };
static CHAR task_name[64];
-static CHAR dateTime[32] = { 0 };
-static struct
-{
- M2MB_FILE_T* fd;
- CHAR name[32];
- CHAR current_name[40];
- UINT32 circular_chunks;
- UINT32 max_size_kb;
- AZX_LOG_LEVEL_E min_level;
- UINT32 cache_idx;
- CHAR cache[MAX_FILE_LOG_CACHE];
-} logFile = {
- /*.fd */
- 0,
- /*.name */
- { 0 },
- /*.current_name */
- { 0 },
- /*.circular_chunks */
- 0,
- /*.max_size_kb */
- 0,
- /*.min_level */
- AZX_LOG_LEVEL_CRITICAL,
- /*.cache_idx */
- 0,
- /*.cache */
- { 0 }
-};
static const CHAR* prefix_fmt_colour = "[%s%-5s%s] %3.2f " CYAN "%s" NO_COLOUR
":" BOLD CYAN "%d" NO_COLOUR
" - %s{" BOLD WHITE "%s" NO_COLOUR "}$ ";
static const CHAR* prefix_fmt_no_colour = "[%s%-5s%s] %3.2f %s:%d - %s{%s}$ ";
-static const CHAR* prefix_fmt_file = "%s.%.2u [%-5s] %s:%d ";
/* Local function prototypes =================================================*/
@@ -174,13 +131,6 @@ static INT32 log_print_to_USB (const CHAR *path, const CHAR *message );
static UINT32 get_uptime(void);
static const char* get_file_title(const CHAR* path);
static char* get_current_task_name(CHAR *name);
-static BOOLEAN check_file_size(const CHAR* filename, UINT32 max_size_kb);
-static void flush_log_to_file();
-static void file_log_or_cache(const CHAR* buffer);
-static const CHAR* get_next_log_filename(const CHAR* filename,
- UINT32 circular_chunks, UINT32 max_size_kb);
-static BOOLEAN rotate_log_files(const CHAR* filename, UINT32 circular_chunks);
-static const char* get_date_time();
/* Static functions ==========================================================*/
@@ -301,8 +251,6 @@ static UINT32 get_uptime(void)
}
-static CHAR fileTitle[12] = "";
-
/*-----------------------------------------------------------------------------------------------*/
/*!
\brief Removes the file path from the provided path, leaving only filename
@@ -315,27 +263,15 @@ static CHAR fileTitle[12] = "";
static const char* get_file_title(const CHAR* path)
{
const CHAR* p = path;
- const CHAR* start = path;
- const CHAR* end = path;
while (*p) {
if (*p == '/' || *p == '\\') {
- start = p + 1;
- }
-
- if(*p == '.') {
- end = p;
+ return p + 1;
}
p++;
}
-
- if(end <= start) {
- end = p;
- }
-
- snprintf(fileTitle, sizeof(fileTitle), "%.*s", (INT32)(end - start), start);
- return fileTitle;
+ return path;
}
@@ -365,29 +301,6 @@ static char* get_current_task_name(CHAR *name)
}
}
-static const char* get_date_time(void)
-{
- INT32 fd = m2mb_rtc_open( "/dev/rtc0", 0 );
- M2MB_RTC_TIME_T ts = { 0 };
- if(fd == -1)
- {
- dateTime[0] = '\0';
- return dateTime;
- }
-
- if(-1 == m2mb_rtc_ioctl( fd, M2MB_RTC_IOCTL_GET_SYSTEM_TIME, &ts ))
- {
- m2mb_rtc_close( fd );
- dateTime[0] = '\0';
- return dateTime;
- }
- m2mb_rtc_close( fd );
- snprintf(dateTime, sizeof(dateTime), "%02u-%02u %02u:%02u:%02u",
- ts.mon, ts.day,
- ts.hour, ts.min, ts.sec);
- return dateTime;
-}
-
/* Global functions ==========================================================*/
@@ -573,210 +486,8 @@ INT32 azx_log_formatted(AZX_LOG_LEVEL_E level,
/* Print the message on the selected output stream */
sent = log_base_function(log_buffer);
- if(logFile.fd && level >= logFile.min_level)
- {
- if(!check_file_size(logFile.current_name, logFile.max_size_kb))
- {
- /* Log limit reached, so we'll need to open the next file in the rotation. Log in the file
- * that this limit is reached and then get the next filename */
- m2mb_fs_fputs("=== Log file size limit reached\r\n", logFile.fd);
- m2mb_fs_fclose(logFile.fd);
- logFile.fd = 0;
-
- snprintf(logFile.current_name, sizeof(logFile.current_name), "%s",
- get_next_log_filename(logFile.name, logFile.circular_chunks,
- logFile.max_size_kb));
-
- if(logFile.current_name[0] == '\0')
- {
- goto end;
- }
-
- logFile.fd = m2mb_fs_fopen(logFile.current_name, "a");
-
- if(!logFile.fd)
- {
- goto end;
- }
- }
-
- switch(level)
- {
- LOG_FILE_PREFIX(TRACE);
- LOG_FILE_PREFIX(DEBUG);
- LOG_FILE_PREFIX(INFO);
- LOG_FILE_PREFIX(WARN);
- LOG_FILE_PREFIX(ERROR);
- LOG_FILE_PREFIX(CRITICAL);
- default:
- break;
- }
-
- va_start(arg, fmt);
- vsnprintf(log_buffer + offset, LOG_BUFFER_SIZE - offset, fmt, arg);
- va_end(arg);
- file_log_or_cache(log_buffer);
- }
-
-end:
m2mb_os_sem_put(log_cfg.CSSemHandle);
}
return sent;
}
-
-static BOOLEAN check_file_size(const CHAR* filename, UINT32 max_size_kb)
-{
- struct M2MB_STAT stat;
- if(-1 == m2mb_fs_stat(filename, &stat))
- {
- /* Most likely the file doesn't exist, so return true */
- return TRUE;
- }
- return ((stat.st_size >> 10) < max_size_kb);
-}
-
-static void flush_log_to_file(void)
-{
- logFile.cache[logFile.cache_idx] = '\0';
- m2mb_fs_fwrite(logFile.cache, logFile.cache_idx, 1, logFile.fd);
- logFile.cache_idx = 0;
-}
-
-static void file_log_or_cache(const CHAR* buffer)
-{
- const UINT32 size = strlen(buffer);
-
- if(MAX_FILE_LOG_CACHE - 1 - size < logFile.cache_idx)
- {
- flush_log_to_file();
- }
-
- memcpy(&logFile.cache[logFile.cache_idx], buffer, size);
- logFile.cache_idx += size;
-}
-
-static CHAR filenameInUse[40] = "";
-
-static BOOLEAN rotate_log_files(const CHAR* filename, UINT32 circular_chunks)
-{
- CHAR from[40] = "";
- CHAR to[40] = "";
- UINT32 i = 0;
-
- /* This will move log.1 to log.2, log.2 to log.3 and so on until the last one */
- snprintf(from, sizeof(from), "%s.%u", filename, circular_chunks);
-
- m2mb_fs_remove(from);
-
- for(i = circular_chunks - 1; i > 0; --i)
- {
- snprintf(from, sizeof(from), "%s.%u", filename, i);
- snprintf(to, sizeof(to), "%s.%u", filename, i+1);
- if(-1 == m2mb_fs_rename(from, to))
- {
- /* Only return FALSE when the final file cannot be renamed - the other renames could be
- * failing if there are no files there */
- if(i == 1)
- {
- return FALSE;
- }
- }
- }
- return TRUE;
-}
-
-static const CHAR* get_next_log_filename(const CHAR* filename,
- UINT32 circular_chunks, UINT32 max_size_kb)
-{
- filenameInUse[0] = '\0';
-
- if(!filename)
- {
- goto end;
- }
-
- /* First try the original file */
- snprintf(filenameInUse, sizeof(filenameInUse), "%s", filename);
-
- if(check_file_size(filenameInUse, max_size_kb))
- {
- goto end;
- }
-
- /* If there is no circular logging and the original file is full, just return empty string */
- if(circular_chunks == 0)
- {
- filenameInUse[0] = '\0';
- goto end;
- }
-
- /* We should log to filename.1, but if that's full we need to rotate logs and then still use
- * filename.1 (since the old one got moved to filename.2) */
- snprintf(filenameInUse, sizeof(filenameInUse), "%s.1", filename);
-
- if(check_file_size(filenameInUse, max_size_kb))
- {
- goto end;
- }
-
- if(!rotate_log_files(filename, circular_chunks))
- {
- /* Since we failed to rotate, just wipe filename.1 so it can be reused */
- m2mb_fs_remove(filenameInUse);
- goto end;
- }
-
-end:
- return filenameInUse;
-}
-
-BOOLEAN azx_log_send_to_file(const CHAR* filename, UINT32 circular_chunks,
- AZX_LOG_LEVEL_E min_level, UINT32 max_size_kb)
-
-{
- if(!filename)
- {
- return FALSE;
- }
-
- if(circular_chunks == 0 && !check_file_size(filename, max_size_kb))
- {
- return FALSE;
- }
-
- if(logFile.fd)
- {
- m2mb_fs_fclose(logFile.fd);
- logFile.fd = 0;
- }
-
- snprintf(logFile.current_name, sizeof(logFile.current_name), "%s",
- get_next_log_filename(filename, circular_chunks, max_size_kb));
-
- if(logFile.current_name[0] == '\0')
- {
- return FALSE;
- }
-
- logFile.fd = m2mb_fs_fopen(logFile.current_name, "a");
-
- if(!logFile.fd)
- {
- return FALSE;
- }
-
- snprintf(logFile.name, sizeof(logFile.name), "%s", filename);
- logFile.circular_chunks = circular_chunks;
- logFile.min_level = min_level;
- logFile.max_size_kb = max_size_kb;
- logFile.cache_idx = 0;
- return TRUE;
-}
-
-void azx_log_flush_to_file(void)
-{
- m2mb_os_sem_get(log_cfg.CSSemHandle, M2MB_OS_WAIT_FOREVER );
- flush_log_to_file();
- m2mb_os_sem_put(log_cfg.CSSemHandle);
-}
diff --git a/Samples/BRAVO_Tampering_Demo/azx/src/azx_utils.c b/Samples/BRAVO_Tampering_Demo/azx/src/azx_utils.c
index a15c5cf..af11062 100644
--- a/Samples/BRAVO_Tampering_Demo/azx/src/azx_utils.c
+++ b/Samples/BRAVO_Tampering_Demo/azx/src/azx_utils.c
@@ -1,5 +1,5 @@
-/*Copyright (C) 2020 Telit Communications S.p.A. Italy - All Rights Reserved.*/
-/* See LICENSE file in the project root for full license information. */
+/* Copyright (C) Telit Communications S.p.A. Italy All Rights Reserved. */
+/* See LICENSE file in the project root for full license information. */
#include
#include
@@ -43,26 +43,24 @@ const CHAR* azx_hex_dump(const void* data, UINT32 len)
return buff;
}
-void azx_reboot_now(void)
+void azx_reboot_now()
{
M2MB_POWER_HANDLE h = NULL;
if(M2MB_RESULT_SUCCESS == m2mb_power_init(&h, NULL, NULL))
{
- AZX_LOG_DEBUG("It's dead, Jim!\r\n");
- AZX_LOG_INFO("Rebooting device\r\n");
+ AZX_LOG_ERROR("It's dead, Jim!\r\n");
m2mb_power_reboot(h);
}
}
-void azx_shutdown_now(void)
+void azx_shutdown_now()
{
M2MB_POWER_HANDLE h = NULL;
if(M2MB_RESULT_SUCCESS == m2mb_power_init(&h, NULL, NULL))
{
- AZX_LOG_DEBUG("It's dead, Jim!\r\n");
- AZX_LOG_INFO("Shutting down device\r\n");
+ AZX_LOG_ERROR("It's dead, Jim!\r\n");
m2mb_power_shutdown(h);
}
}
diff --git a/Samples/BRAVO_Tampering_Demo/hdr/app_cfg.h b/Samples/BRAVO_Tampering_Demo/hdr/app_cfg.h
index 7f96af8..711dd51 100644
--- a/Samples/BRAVO_Tampering_Demo/hdr/app_cfg.h
+++ b/Samples/BRAVO_Tampering_Demo/hdr/app_cfg.h
@@ -23,7 +23,7 @@
/**
* @brief The current version of the Samples
*/
-#define VERSION "1.0.3"
+#define VERSION "1.0.4"
/**
* @name Log Settings
diff --git a/Samples/BRAVO_Tampering_Demo/src/demo_utils/lwm2m.c b/Samples/BRAVO_Tampering_Demo/src/demo_utils/lwm2m.c
index 0a3eeb1..364da7f 100644
--- a/Samples/BRAVO_Tampering_Demo/src/demo_utils/lwm2m.c
+++ b/Samples/BRAVO_Tampering_Demo/src/demo_utils/lwm2m.c
@@ -15,7 +15,7 @@
@author FabioPi
@date
- 2020-02-15
+ 2021-01-20
*/
/* Include files ================================================================================*/
#include
@@ -47,7 +47,7 @@
/* Local statics ================================================================================*/
/* ONEEDGE */
-static M2MB_LWM2M_HANDLE _h;
+static M2MB_LWM2M_HANDLE lwm2mHandle;
static M2MB_LWM2M_OBJ_URI_T _obj_telit_service_uri = {.uriLen = 4, .obj = 33211, .objInst = 0, .resource = 0, .resourceInst = 1};
@@ -92,6 +92,7 @@ void lwm2mIndCB( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size
if(resp->result == M2MB_LWM2M_RES_SUCCESS)
{
AZX_LOG_DEBUG( "LWM2M enable result OK\r\n");
+ m2mb_os_ev_set(lwm2m_evHandle, EV_LWM2M_ENABLE_RES_BIT, M2MB_OS_EV_SET);
}
else
{
@@ -106,6 +107,7 @@ void lwm2mIndCB( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size
if(resp->result == M2MB_LWM2M_RES_SUCCESS)
{
AZX_LOG_DEBUG( "LWM2M set result OK\r\n");
+ m2mb_os_ev_set(lwm2m_evHandle, EV_LWM2M_SET_RES_BIT, M2MB_OS_EV_SET);
}
else
{
@@ -120,6 +122,7 @@ void lwm2mIndCB( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size
if(resp->result == M2MB_LWM2M_RES_SUCCESS)
{
AZX_LOG_TRACE( "LWM2M write result OK\r\n");
+ m2mb_os_ev_set(lwm2m_evHandle, EV_LWM2M_WRITE_RES_BIT, M2MB_OS_EV_SET);
}
else
{
@@ -173,7 +176,7 @@ void lwm2mIndCB( M2MB_LWM2M_HANDLE h, M2MB_LWM2M_EVENT_E event, UINT16 resp_size
break;
case M2MB_LWM2M_CL_STATE_REGISTERED:
AZX_LOG_DEBUG( "resp->info == M2MB_LWM2M_CL_STATE_REGISTERED\r\n" );
- m2mb_os_ev_set(lwm2m_evHandle, EV_SRV_REG_BIT, M2MB_OS_EV_SET);
+ m2mb_os_ev_set(lwm2m_evHandle, EV_LWM2M_SRV_REG_BIT, M2MB_OS_EV_SET);
break;
case M2MB_LWM2M_CL_STATE_DEREGISTERING:
AZX_LOG_DEBUG( "resp->info == M2MB_LWM2M_CL_STATE_DEREGISTERING\r\n" );
@@ -242,7 +245,7 @@ uint8_t oneedge_init( INT32 obj_id )
{
m2mb_os_ev_setAttrItem( &evAttrHandle, M2MB_OS_EV_SEL_CMD_DEL_ATTR, NULL );
AZX_LOG_CRITICAL("m2mb_os_ev_init failed!\r\n");
- return 0;
+ return -1;
}
else
{
@@ -250,43 +253,64 @@ uint8_t oneedge_init( INT32 obj_id )
}
- //get the handle of the lwm2m client on _h
- retVal = m2mb_lwm2m_init( &_h, lwm2mIndCB, ( void * )NULL );
+ //get the handle of the lwm2m client on lwm2mHandle
+ retVal = m2mb_lwm2m_init( &lwm2mHandle, lwm2mIndCB, ( void * )NULL );
if( retVal != M2MB_RESULT_SUCCESS )
{
AZX_LOG_ERROR( "m2mb_lwm2m_init returned error %d\r\n", retVal );
+ m2mb_os_ev_deinit( lwm2m_evHandle );
return -1;
}
- retVal = m2mb_lwm2m_write( _h, &_obj_telit_service_uri, &service_enable, sizeof( INT32 ) );
+ retVal = m2mb_lwm2m_write( lwm2mHandle, &_obj_telit_service_uri, &service_enable, sizeof( INT32 ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
AZX_LOG_ERROR( "m2mb_lwm2m_write returned error %d\r\n", retVal );
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+
+ m2mb_lwm2m_deinit( lwm2mHandle );
return -1;
}
//AT#LWM2MENA=1
memset( &pars, 0, sizeof( M2MB_LWM2M_ENABLE_REQ_T ) );
- pars.apnclass = 0;
- pars.guardRequestEventSecs = 0;
- pars.guardReleaseEventSecs = 0;
+ pars.apnclass = 1; /*CID*/
+ pars.guardRequestEventSecs = 5;
+ pars.guardReleaseEventSecs = 5;
pars.commandType = M2MB_LWM2MENA_CMD_TYPE_SET;
pars.mode = M2MB_LWM2M_MODE_NO_ACK;
- retVal = m2mb_lwm2m_enable( _h, &pars );
-
-
-
+ retVal = m2mb_lwm2m_enable( lwm2mHandle, &pars );
if( retVal != M2MB_RESULT_SUCCESS )
{
AZX_LOG_ERROR( "m2mb_lwm2m_enable returned error %d\r\n", retVal );
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+ m2mb_lwm2m_deinit( lwm2mHandle );
return -1;
}
+ if(M2MB_OS_SUCCESS != m2mb_os_ev_get(
+ lwm2m_evHandle,
+ EV_LWM2M_ENABLE_RES_BIT,
+ M2MB_OS_EV_GET_ANY_AND_CLEAR,
+ &curEvBits,
+ M2MB_OS_MS2TICKS(10000) /*wait 10 seconds for the event to occur*/
+ )
+ )
+ {
+ AZX_LOG_ERROR("m2mb_lwm2m_enable timeout!\r\n");
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+ azx_sleep_ms(2000);
+ m2mb_lwm2m_deinit(lwm2mHandle);
+ return -1;
+ }
+
+ azx_sleep_ms(1000);
+
/*new object instance information*/
uri.obj = obj_id;
uri.objInst = 0;
@@ -294,20 +318,27 @@ uint8_t oneedge_init( INT32 obj_id )
new_inst_params.agent = 0; /*Telit Agent*/
/*If OK the instance was not present, and so it was created. If an error
is received, it is likely because the instance already exists.*/
- retVal = m2mb_lwm2m_newinst( _h, &uri, &new_inst_params );
+ retVal = m2mb_lwm2m_newinst( lwm2mHandle, &uri, &new_inst_params );
if( retVal != M2MB_RESULT_SUCCESS )
{
AZX_LOG_ERROR( "m2mb_lwm2m_newinst returned error %d\r\n", retVal );
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+ m2mb_lwm2m_deinit( lwm2mHandle );
return -1;
}
- AZX_LOG_DEBUG("Waiting LWM2M Registering (60 seconds)...\r\n");
- osRes = m2mb_os_ev_get(lwm2m_evHandle, EV_SRV_REG_BIT, M2MB_OS_EV_GET_ANY_AND_CLEAR, &curEvBits, M2MB_OS_MS2TICKS(60000));
+ AZX_LOG_DEBUG("Waiting LWM2M Registering (120 seconds timeout)...\r\n");
+ osRes = m2mb_os_ev_get(lwm2m_evHandle, EV_LWM2M_SRV_REG_BIT, M2MB_OS_EV_GET_ANY_AND_CLEAR, &curEvBits, M2MB_OS_MS2TICKS(120000));
if(osRes != M2MB_OS_SUCCESS)
{
AZX_LOG_ERROR("LWM2M Register timeout!\r\n");
- return 1;
+ m2mb_os_ev_deinit( lwm2m_evHandle );
+
+ m2mb_lwm2m_disable(lwm2mHandle);
+ azx_sleep_ms(2000);
+ m2mb_lwm2m_deinit(lwm2mHandle);
+ return -1;
}
return 0;
@@ -317,7 +348,7 @@ uint8_t oneedge_init( INT32 obj_id )
/*-----------------------------------------------------------------------------------------------*/
void update_tamper_LWM2MObject( int value )
{
- M2MB_RESULT_E retVal = m2mb_lwm2m_write( _h, &_obj_tamper_uri, &value, sizeof( int ) );
+ M2MB_RESULT_E retVal = m2mb_lwm2m_write( lwm2mHandle, &_obj_tamper_uri, &value, sizeof( int ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
@@ -330,13 +361,13 @@ void update_tamper_LWM2MObject( int value )
/*-----------------------------------------------------------------------------------------------*/
void update_environment_LWM2MObject( float _t, float _p, float _rh, INT16 _iaq )
{
- M2MB_RESULT_E retVal = m2mb_lwm2m_set( _h, &_obj_environment_uri_t, &_t, sizeof( float ) );
+ M2MB_RESULT_E retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_environment_uri_t, &_t, sizeof( float ) );
azx_sleep_ms( 10 );
- retVal = m2mb_lwm2m_set( _h, &_obj_environment_uri_p, &_p, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_environment_uri_p, &_p, sizeof( float ) );
azx_sleep_ms( 10 );
- retVal = m2mb_lwm2m_set( _h, &_obj_environment_uri_h, &_rh, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_environment_uri_h, &_rh, sizeof( float ) );
azx_sleep_ms( 10 );
- retVal = m2mb_lwm2m_set( _h, &_obj_environment_uri_iaq, &_iaq, sizeof( INT16 ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_environment_uri_iaq, &_iaq, sizeof( INT16 ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
@@ -350,15 +381,15 @@ void update_environment_LWM2MObject( float _t, float _p, float _rh, INT16 _iaq )
void update_rotation_LWM2MObject( float _w, float _x, float _y, float _z, INT16 _acc )
{
M2MB_RESULT_E retVal;
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_w, &_w, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_w, &_w, sizeof( float ) );
//azx_sleep_ms(100);
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_x, &_x, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_x, &_x, sizeof( float ) );
//azx_sleep_ms(100);
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_y, &_y, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_y, &_y, sizeof( float ) );
//azx_sleep_ms(100);
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_z, &_z, sizeof( float ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_z, &_z, sizeof( float ) );
//azx_sleep_ms(100);
- retVal = m2mb_lwm2m_set( _h, &_obj_rotation_uri_a, &_acc, sizeof( INT16 ) );
+ retVal = m2mb_lwm2m_set( lwm2mHandle, &_obj_rotation_uri_a, &_acc, sizeof( INT16 ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
@@ -371,7 +402,7 @@ void update_rotation_LWM2MObject( float _w, float _x, float _y, float _z, INT16
/*-----------------------------------------------------------------------------------------------*/
void update_smartlock_LWM2MObject( int value )
{
- M2MB_RESULT_E retVal = m2mb_lwm2m_write( _h, &_obj_smartlock_uri, &value, sizeof( int ) );
+ M2MB_RESULT_E retVal = m2mb_lwm2m_write( lwm2mHandle, &_obj_smartlock_uri, &value, sizeof( int ) );
if( retVal != M2MB_RESULT_SUCCESS )
{
diff --git a/Samples/BRAVO_Tampering_Demo/src/demo_utils/lwm2m.h b/Samples/BRAVO_Tampering_Demo/src/demo_utils/lwm2m.h
index 52a7ac0..266a936 100644
--- a/Samples/BRAVO_Tampering_Demo/src/demo_utils/lwm2m.h
+++ b/Samples/BRAVO_Tampering_Demo/src/demo_utils/lwm2m.h
@@ -33,7 +33,14 @@
#define SMARTLOCK_OBJ_ID 26247
-#define EV_SRV_REG_BIT (UINT32)0x1 /*0x0000000000000001*/
+#define EV_LWM2M_ENABLE_RES_BIT (UINT32)0x00000001
+#define EV_LWM2M_SET_RES_BIT (UINT32)0x00000002
+#define EV_LWM2M_GET_RES_BIT (UINT32)0x00000004
+#define EV_LWM2M_MON_RES_BIT (UINT32)0x00000008
+#define EV_LWM2M_WRITE_RES_BIT (UINT32)0x00000010
+#define EV_LWM2M_READ_RES_BIT (UINT32)0x00000020
+#define EV_LWM2M_SRV_REG_BIT (UINT32)0x00000040
+#define EV_LWM2M_GET_STAT_RES_BIT (UINT32)0x00000080
/**
diff --git a/Samples/README.md b/Samples/README.md
index 544a431..3cef994 100644
--- a/Samples/README.md
+++ b/Samples/README.md
@@ -4,7 +4,7 @@
-Package Version: **1.0.3**
+Package Version: **1.0.4**
Firmware Version: **30.00.XX8**
@@ -77,7 +77,7 @@ The applications code follow the structure below:
##Applications
-### Bravo Tampering demo
+### Bravo Environment demo
@@ -86,41 +86,47 @@ The applications code follow the structure below:
---
- Connect to LWM2M Portal
-- Retrieve movement information from BMI160 sensor
-- Update portal about current status (IDLE, TAMPER, WALKING... )
+- Retrieve environment information with BSEC library sensor
---
-#### Prerequisites
+#### Prerequisites on the module
-This application requires the file **object_26242.xml** (provided) to be stored into module's `/mod/` folder, along with the application binary itself.
+This application requires the file **object_26251.xml** (provided) to be stored into module's `/mod/` folder, along with the application binary itself.
To load it, use
-`AT#M2MWRITE=/mod/object_26242.xml,1358`
+`AT#M2MWRITE=/mod/object_26251.xml,1971`
And at prompt, send the file content in raw mode.
#### Prerequisites on the OneEdge Portal
-This application requires the **object_26242.xml** content to be stored in your OneEdge organization object registry. The latter can be accessed from the link https:///lwm2m/object_registry
+This application requires the **object_26251.xml** content to be stored in your OneEdge organization object registry. The latter can be accessed from the link https:///lwm2m/object_registry
where could be for example `portal-dev.telit.com`. open the xml file in a notepad tool, select all the content and copy it. Then, in the object registry webpage, press "New Object" button on the right and paste the content of the xml file, then press Add button.
-Now from Developer webpage, go in **Thing Definitions** page from the list on the left and press `Import` button on the right. Press `Attach File` and provide `json/bravo_TamperDemo_thing_def.json` from the project root, then press `Import`.
+Now from Developer webpage, go in **Thing Definitions** page from the list on the left and press `Import` button on the right. Press `Attach File` and provide `json/bravo_EnvironmentalDemo_thing_def.json` from the project root, then press `Import`.
-Again from the Developer webpage, select **Device Profiles**, `Import` button, `Attach File` and provide `json/bravo_TamperDemo_device_profile.json`, then press `Import`.
+Again from the Developer webpage, select **Device Profiles**, `Import` button, `Attach File` and provide `json/bravo_EnvironmentalDemo_device_profile.json`, then press `Import`.
+
+
+** External Libraries **
+
+To build the application it is required to put `libalgobsec.ar` file into the project's BOSCH/BSEC folder. The library can be retrieved at the link
+https://www.bosch-sensortec.com/software-tools/software/bsec/ . Download BSEC 1.4.7.4 version archive, then extract the library `libalgobsec.a` from the ZIP file and rename as `libalgobsec.ar`. It can be found in the directory
+/BSEC_1.4.7.4_Generic_Release/algo/normal_version/bin/gcc/Cortex_A7/
-Lastly, from the Developer webpage, select **Triggers**, `Actions` menu on the right, `Import` , `Attach File` and provide `json/bravo_TamperDemo_triggers.json`, then press `Import`. Now open the trigger **bravo_TamperDemo_state_trigger** by pressing the View button (the eye icon on the left) and be sure to press the `play` button, and that the trigger status is 'started'.
---
-Tampering Demo application. Debug prints on **MAIN UART**
+Environment Demo application. Debug prints on **MAIN UART**
-### Bravo Environment demo
+
+### Bravo Rotation demo
@@ -129,47 +135,40 @@ Tampering Demo application. Debug prints on **MAIN UART**
---
- Connect to LWM2M Portal
-- Retrieve environment information with BSEC library sensor
+- Retrieve rotation information from BMI160 sensor
+- Update portal about current status (X,Y,Z,W and accuracy values)
---
-#### Prerequisites on the module
+#### Prerequisites
-This application requires the file **object_26251.xml** (provided) to be stored into module's `/mod/` folder, along with the application binary itself.
+This application requires the file **object_26250.xml** (provided) to be stored into module's `/mod/` folder, along with the application binary itself.
To load it, use
-`AT#M2MWRITE=/mod/object_26251.xml,1971`
+`AT#M2MWRITE=/mod/object_26250.xml,2249`
And at prompt, send the file content in raw mode.
#### Prerequisites on the OneEdge Portal
-This application requires the **object_26251.xml** content to be stored in your OneEdge organization object registry. The latter can be accessed from the link https:///lwm2m/object_registry
+This application requires the **object_26250.xml** content to be stored in your OneEdge organization object registry. The latter can be accessed from the link https:///lwm2m/object_registry
where could be for example `portal-dev.telit.com`. open the xml file in a notepad tool, select all the content and copy it. Then, in the object registry webpage, press "New Object" button on the right and paste the content of the xml file, then press Add button.
-Now from Developer webpage, go in **Thing Definitions** page from the list on the left and press `Import` button on the right. Press `Attach File` and provide `json/bravo_EnvironmentalDemo_thing_def.json` from the project root, then press `Import`.
-
-Again from the Developer webpage, select **Device Profiles**, `Import` button, `Attach File` and provide `json/bravo_EnvironmentalDemo_device_profile.json`, then press `Import`.
-
-
-** External Libraries **
+Now from Developer webpage, go in **Thing Definitions** page from the list on the left and press `Import` button on the right. Press `Attach File` and provide `json/bravo_3D-RotationDemo_thing_def.json` from the project root, then press `Import`.
-To build the application it is required to put `libalgobsec.ar` file into the project's BOSCH/BSEC folder. The library can be retrieved at the link
-https://www.bosch-sensortec.com/software-tools/software/bsec/ . Download BSEC 1.4.7.4 version archive, then extract the library `libalgobsec.a` from the ZIP file and rename as `libalgobsec.ar`. It can be found in the directory
-/BSEC_1.4.7.4_Generic_Release/algo/normal_version/bin/gcc/Cortex_A7/
+Again from the Developer webpage, select **Device Profiles**, `Import` button, `Attach File` and provide `json/bravo_3D-RotationDemo_device_profile.json`, then press `Import`.
---
-
-Environment Demo application. Debug prints on **MAIN UART**
+Rotation Demo application. Debug prints on **MAIN UART**
-### Bravo Rotation demo
+### Bravo Tampering demo
@@ -178,34 +177,35 @@ Environment Demo application. Debug prints on **MAIN UART**
---
- Connect to LWM2M Portal
-- Retrieve rotation information from BMI160 sensor
-- Update portal about current status (X,Y,Z,W and accuracy values)
+- Retrieve movement information from BMI160 sensor
+- Update portal about current status (IDLE, TAMPER, WALKING... )
---
#### Prerequisites
-This application requires the file **object_26250.xml** (provided) to be stored into module's `/mod/` folder, along with the application binary itself.
+This application requires the file **object_26242.xml** (provided) to be stored into module's `/mod/` folder, along with the application binary itself.
To load it, use
-`AT#M2MWRITE=/mod/object_26250.xml,2249`
+`AT#M2MWRITE=/mod/object_26242.xml,1358`
And at prompt, send the file content in raw mode.
#### Prerequisites on the OneEdge Portal
-This application requires the **object_26250.xml** content to be stored in your OneEdge organization object registry. The latter can be accessed from the link https:///lwm2m/object_registry
+This application requires the **object_26242.xml** content to be stored in your OneEdge organization object registry. The latter can be accessed from the link https:///lwm2m/object_registry
where could be for example `portal-dev.telit.com`. open the xml file in a notepad tool, select all the content and copy it. Then, in the object registry webpage, press "New Object" button on the right and paste the content of the xml file, then press Add button.
-Now from Developer webpage, go in **Thing Definitions** page from the list on the left and press `Import` button on the right. Press `Attach File` and provide `json/bravo_3D-RotationDemo_thing_def.json` from the project root, then press `Import`.
+Now from Developer webpage, go in **Thing Definitions** page from the list on the left and press `Import` button on the right. Press `Attach File` and provide `json/bravo_TamperDemo_thing_def.json` from the project root, then press `Import`.
-Again from the Developer webpage, select **Device Profiles**, `Import` button, `Attach File` and provide `json/bravo_3D-RotationDemo_device_profile.json`, then press `Import`.
+Again from the Developer webpage, select **Device Profiles**, `Import` button, `Attach File` and provide `json/bravo_TamperDemo_device_profile.json`, then press `Import`.
+Lastly, from the Developer webpage, select **Triggers**, `Actions` menu on the right, `Import` , `Attach File` and provide `json/bravo_TamperDemo_triggers.json`, then press `Import`. Now open the trigger **bravo_TamperDemo_state_trigger** by pressing the View button (the eye icon on the left) and be sure to press the `play` button, and that the trigger status is 'started'.
---
-Rotation Demo application. Debug prints on **MAIN UART**
+Tampering Demo application. Debug prints on **MAIN UART**