1818#ifndef CONNECTION_MANAGER_H_
1919#define CONNECTION_MANAGER_H_
2020
21- #define ARDUINO_CLOUD_DEBUG_LEVEL 2
21+ /* *****************************************************************************
22+ * INCLUDES
23+ ******************************************************************************/
2224
2325#include < Client.h>
2426#include < Udp.h>
27+
2528#include " utility/NTPUtils.h"
29+ #include " utility/DebugUtils.h"
30+
31+ /* *****************************************************************************
32+ * TYPEDEFS
33+ ******************************************************************************/
2634
2735enum NetworkConnectionState {
2836 CONNECTION_STATE_INIT,
@@ -34,6 +42,10 @@ enum NetworkConnectionState {
3442 CONNECTION_STATE_ERROR
3543};
3644
45+ /* *****************************************************************************
46+ * CLASS DECLARATION
47+ ******************************************************************************/
48+
3749class ConnectionManager {
3850public:
3951 virtual void init () = 0;
@@ -50,7 +62,6 @@ class ConnectionManager {
5062
5163};
5264
53-
5465#ifdef ARDUINO_SAMD_MKR1000
5566#include < WiFi101.h>
5667#define BOARD_HAS_WIFI
@@ -77,27 +88,4 @@ class ConnectionManager {
7788#define NETWORK_CONNECTED GSM3_NetworkStatus_t::GPRS_READY
7889#endif
7990
80- static int debugMessageLevel = ARDUINO_CLOUD_DEBUG_LEVEL;
81- inline void debugMessage (char *_msg, int _debugLevel, bool _timestamp = true , bool _newline = true ) {
82- if (_debugLevel < 0 ){
83- return ;
84- }
85- if (_debugLevel <= debugMessageLevel) {
86- char prepend[20 ];
87- sprintf (prepend, " \n [ %d ] " , millis ());
88- if (_timestamp){
89- Serial.print (prepend);
90- }
91- if (_newline){
92- Serial.println (_msg);
93- }else {
94- Serial.print (_msg);
95- }
96- }
97- }
98-
99- inline void setDebugMessageLevel (int _debugLevel){
100- debugMessageLevel = _debugLevel;
101- }
102-
10391#endif /* CONNECTION_MANAGER_H_ */
0 commit comments