|
1 | 1 | // matth-x/MicroOcpp |
2 | | -// Copyright Matthias Akstaller 2019 - 2023 |
| 2 | +// Copyright Matthias Akstaller 2019 - 2024 |
3 | 3 | // MIT License |
4 | 4 |
|
5 | 5 | #include <MicroOcpp/Model/Diagnostics/DiagnosticsService.h> |
@@ -101,30 +101,37 @@ std::string DiagnosticsService::requestDiagnosticsUpload(const char *location, u |
101 | 101 | } |
102 | 102 |
|
103 | 103 | #if MO_DBG_LEVEL >= MO_DL_INFO |
104 | | - char dbuf [JSONDATE_LENGTH + 1] = {'\0'}; |
105 | | - char dbuf2 [JSONDATE_LENGTH + 1] = {'\0'}; |
106 | | - this->startTime.toJsonString(dbuf, JSONDATE_LENGTH + 1); |
107 | | - this->stopTime.toJsonString(dbuf2, JSONDATE_LENGTH + 1); |
108 | | - |
109 | | - MO_DBG_INFO("Scheduled Diagnostics upload!\n" \ |
110 | | - " location = %s\n" \ |
111 | | - " retries = %i" \ |
112 | | - ", retryInterval = %u" \ |
113 | | - " startTime = %s\n" \ |
114 | | - " stopTime = %s", |
115 | | - this->location.c_str(), |
116 | | - this->retries, |
117 | | - this->retryInterval, |
118 | | - dbuf, |
119 | | - dbuf2); |
| 104 | + { |
| 105 | + char dbuf [JSONDATE_LENGTH + 1] = {'\0'}; |
| 106 | + char dbuf2 [JSONDATE_LENGTH + 1] = {'\0'}; |
| 107 | + this->startTime.toJsonString(dbuf, JSONDATE_LENGTH + 1); |
| 108 | + this->stopTime.toJsonString(dbuf2, JSONDATE_LENGTH + 1); |
| 109 | + |
| 110 | + MO_DBG_INFO("Scheduled Diagnostics upload!\n" \ |
| 111 | + " location = %s\n" \ |
| 112 | + " retries = %i" \ |
| 113 | + ", retryInterval = %u" \ |
| 114 | + " startTime = %s\n" \ |
| 115 | + " stopTime = %s", |
| 116 | + this->location.c_str(), |
| 117 | + this->retries, |
| 118 | + this->retryInterval, |
| 119 | + dbuf, |
| 120 | + dbuf2); |
| 121 | + } |
120 | 122 | #endif |
121 | 123 |
|
122 | 124 | nextTry = context.getModel().getClock().now(); |
123 | 125 | nextTry += 5; //wait for 5s before upload |
124 | 126 | uploadIssued = false; |
125 | 127 |
|
126 | | - nextTry.toJsonString(dbuf, JSONDATE_LENGTH + 1); |
127 | | - MO_DBG_DEBUG("Initial try at %s", dbuf); |
| 128 | +#if MO_DBG_LEVEL >= MO_DL_DEBUG |
| 129 | + { |
| 130 | + char dbuf [JSONDATE_LENGTH + 1] = {'\0'}; |
| 131 | + nextTry.toJsonString(dbuf, JSONDATE_LENGTH + 1); |
| 132 | + MO_DBG_DEBUG("Initial try at %s", dbuf); |
| 133 | + } |
| 134 | +#endif |
128 | 135 |
|
129 | 136 | std::string fileName; |
130 | 137 | if (refreshFilename) { |
|
0 commit comments