@@ -118,15 +118,15 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
118118#endif /* OTA_ENABLED */
119119
120120 #ifdef BOARD_HAS_OFFLOADED_ECCX08
121- if (!ECCX08.begin ()) { DBG_ERROR (F (" Cryptography processor failure. Make sure you have a compatible board." )); return 0 ; }
122- if (!CryptoUtil::readDeviceId (ECCX08, getDeviceId (), ECCX08Slot::DeviceId)) { DBG_ERROR (F (" Cryptography processor read failure." )); return 0 ; }
121+ if (!ECCX08.begin ()) { DEBUG_ERROR (F (" Cryptography processor failure. Make sure you have a compatible board." )); return 0 ; }
122+ if (!CryptoUtil::readDeviceId (ECCX08, getDeviceId (), ECCX08Slot::DeviceId)) { DEBUG_ERROR (F (" Cryptography processor read failure." )); return 0 ; }
123123 ECCX08.end ();
124124 #endif
125125
126126 #ifdef BOARD_HAS_ECCX08
127- if (!ECCX08.begin ()) { DBG_ERROR (F (" Cryptography processor failure. Make sure you have a compatible board." )); return 0 ; }
128- if (!CryptoUtil::readDeviceId (ECCX08, getDeviceId (), ECCX08Slot::DeviceId)) { DBG_ERROR (F (" Cryptography processor read failure." )); return 0 ; }
129- if (!CryptoUtil::reconstructCertificate (_eccx08_cert, getDeviceId (), ECCX08Slot::Key, ECCX08Slot::CompressedCertificate, ECCX08Slot::SerialNumberAndAuthorityKeyIdentifier)) { DBG_ERROR (F (" Cryptography certificate reconstruction failure." )); return 0 ; }
127+ if (!ECCX08.begin ()) { DEBUG_ERROR (F (" Cryptography processor failure. Make sure you have a compatible board." )); return 0 ; }
128+ if (!CryptoUtil::readDeviceId (ECCX08, getDeviceId (), ECCX08Slot::DeviceId)) { DEBUG_ERROR (F (" Cryptography processor read failure." )); return 0 ; }
129+ if (!CryptoUtil::reconstructCertificate (_eccx08_cert, getDeviceId (), ECCX08Slot::Key, ECCX08Slot::CompressedCertificate, ECCX08Slot::SerialNumberAndAuthorityKeyIdentifier)) { DEBUG_ERROR (F (" Cryptography certificate reconstruction failure." )); return 0 ; }
130130 _sslClient.setClient (_connection->getClient ());
131131 _sslClient.setEccSlot (static_cast <int >(ECCX08Slot::Key), _eccx08_cert.bytes (), _eccx08_cert.length ());
132132 #elif defined(BOARD_ESP)
@@ -159,7 +159,7 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
159159 String const nina_fw_version = WiFi.firmwareVersion ();
160160 if (nina_fw_version < " 1.4.1" ) {
161161 _ota_cap = false ;
162- DBG_WARNING (F (" ArduinoIoTCloudTCP::%s In order to be ready for cloud OTA, NINA firmware needs to be >= 1.4.1, current %s" ), __FUNCTION__, nina_fw_version.c_str ());
162+ DEBUG_WARNING (F (" ArduinoIoTCloudTCP::%s In order to be ready for cloud OTA, NINA firmware needs to be >= 1.4.1, current %s" ), __FUNCTION__, nina_fw_version.c_str ());
163163 }
164164 else {
165165 _ota_cap = true ;
@@ -196,10 +196,10 @@ int ArduinoIoTCloudTCP::connected()
196196
197197void ArduinoIoTCloudTCP::printDebugInfo ()
198198{
199- DBG_INFO (F (" ***** Arduino IoT Cloud - configuration info *****" ));
200- DBG_INFO (F (" Device ID: %s" ), getDeviceId ().c_str ());
201- DBG_INFO (F (" Thing ID: %s" ), getThingId ().c_str ());
202- DBG_INFO (F (" MQTT Broker: %s:%d" ), _brokerAddress.c_str (), _brokerPort);
199+ DEBUG_INFO (F (" ***** Arduino IoT Cloud - configuration info *****" ));
200+ DEBUG_INFO (F (" Device ID: %s" ), getDeviceId ().c_str ());
201+ DEBUG_INFO (F (" Thing ID: %s" ), getThingId ().c_str ());
202+ DEBUG_INFO (F (" MQTT Broker: %s:%d" ), _brokerAddress.c_str (), _brokerPort);
203203}
204204
205205/* *****************************************************************************
@@ -217,7 +217,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectPhy()
217217ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SyncTime ()
218218{
219219 unsigned long const internal_posix_time = _time_service.getTime ();
220- DBG_VERBOSE (F (" ArduinoIoTCloudTCP::%s internal clock configured to posix timestamp %d" ), __FUNCTION__, internal_posix_time);
220+ DEBUG_VERBOSE (F (" ArduinoIoTCloudTCP::%s internal clock configured to posix timestamp %d" ), __FUNCTION__, internal_posix_time);
221221 return State::ConnectMqttBroker;
222222}
223223
@@ -226,28 +226,28 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
226226 if (_mqttClient.connect (_brokerAddress.c_str (), _brokerPort))
227227 return State::SubscribeMqttTopics;
228228
229- DBG_ERROR (F (" ArduinoIoTCloudTCP::%s could not connect to %s:%d" ), __FUNCTION__, _brokerAddress.c_str (), _brokerPort);
229+ DEBUG_ERROR (F (" ArduinoIoTCloudTCP::%s could not connect to %s:%d" ), __FUNCTION__, _brokerAddress.c_str (), _brokerPort);
230230 return State::ConnectPhy;
231231}
232232
233233ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SubscribeMqttTopics ()
234234{
235235 if (!_mqttClient.subscribe (_dataTopicIn))
236236 {
237- DBG_ERROR (F (" ArduinoIoTCloudTCP::%s could not subscribe to %s" ), __FUNCTION__, _dataTopicIn.c_str ());
237+ DEBUG_ERROR (F (" ArduinoIoTCloudTCP::%s could not subscribe to %s" ), __FUNCTION__, _dataTopicIn.c_str ());
238238 return State::SubscribeMqttTopics;
239239 }
240240
241241 if (_shadowTopicIn != " " )
242242 {
243243 if (!_mqttClient.subscribe (_shadowTopicIn))
244244 {
245- DBG_ERROR (F (" ArduinoIoTCloudTCP::%s could not subscribe to %s" ), __FUNCTION__, _shadowTopicIn.c_str ());
245+ DEBUG_ERROR (F (" ArduinoIoTCloudTCP::%s could not subscribe to %s" ), __FUNCTION__, _shadowTopicIn.c_str ());
246246 return State::SubscribeMqttTopics;
247247 }
248248 }
249249
250- DBG_INFO (F (" Connected to Arduino IoT Cloud" ));
250+ DEBUG_INFO (F (" Connected to Arduino IoT Cloud" ));
251251 execCloudEventCallback (ArduinoIoTCloudEvent::CONNECT);
252252
253253 if (_shadowTopicIn != " " )
@@ -262,7 +262,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_RequestLastValues()
262262 unsigned long const now = millis ();
263263 if ((now - _lastSyncRequestTickTime) > TIMEOUT_FOR_LASTVALUES_SYNC)
264264 {
265- DBG_VERBOSE (F (" ArduinoIoTCloudTCP::%s [%d] last values requested" ), __FUNCTION__, now);
265+ DEBUG_VERBOSE (F (" ArduinoIoTCloudTCP::%s [%d] last values requested" ), __FUNCTION__, now);
266266 requestLastValue ();
267267 _lastSyncRequestTickTime = now;
268268 }
@@ -274,7 +274,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Connected()
274274{
275275 if (!_mqttClient.connected ())
276276 {
277- DBG_ERROR (F (" ArduinoIoTCloudTCP::%s MQTT client connection lost" ), __FUNCTION__);
277+ DEBUG_ERROR (F (" ArduinoIoTCloudTCP::%s MQTT client connection lost" ), __FUNCTION__);
278278
279279 /* Forcefully disconnect MQTT client and trigger a reconnection. */
280280 _mqttClient.stop ();
@@ -354,7 +354,7 @@ void ArduinoIoTCloudTCP::handleMessage(int length)
354354
355355 if ((_shadowTopicIn == topic) && (_state == State::RequestLastValues))
356356 {
357- DBG_VERBOSE (F (" ArduinoIoTCloudTCP::%s [%d] last values received" ), __FUNCTION__, millis ());
357+ DEBUG_VERBOSE (F (" ArduinoIoTCloudTCP::%s [%d] last values received" ), __FUNCTION__, millis ());
358358 CBORDecoder::decode (_property_container, (uint8_t *)bytes, length, true );
359359 sendPropertiesToCloud ();
360360 execCloudEventCallback (ArduinoIoTCloudEvent::SYNC);
@@ -404,7 +404,7 @@ int ArduinoIoTCloudTCP::write(String const topic, byte const data[], int const l
404404#if OTA_ENABLED
405405void ArduinoIoTCloudTCP::onOTARequest ()
406406{
407- DBG_VERBOSE (F (" ArduinoIoTCloudTCP::%s _ota_url = %s" ), __FUNCTION__, _ota_url.c_str ());
407+ DEBUG_VERBOSE (F (" ArduinoIoTCloudTCP::%s _ota_url = %s" ), __FUNCTION__, _ota_url.c_str ());
408408
409409 /* Status flag to prevent the reset from being executed
410410 * when HTTPS download is not supported.
@@ -420,7 +420,7 @@ void ArduinoIoTCloudTCP::onOTARequest()
420420 uint8_t nina_ota_err_code = 0 ;
421421 if (!WiFiStorage.downloadOTA (_ota_url.c_str (), &nina_ota_err_code))
422422 {
423- DBG_ERROR (F (" ArduinoIoTCloudTCP::%s error download to nina: %d" ), __FUNCTION__, nina_ota_err_code);
423+ DEBUG_ERROR (F (" ArduinoIoTCloudTCP::%s error download to nina: %d" ), __FUNCTION__, nina_ota_err_code);
424424 _ota_error = static_cast <int >(OTAError::DownloadFailed);
425425 return ;
426426 }
0 commit comments