@@ -118,15 +118,15 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
118
118
#endif /* OTA_ENABLED */
119
119
120
120
#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 ; }
123
123
ECCX08.end ();
124
124
#endif
125
125
126
126
#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 ; }
130
130
_sslClient.setClient (_connection->getClient ());
131
131
_sslClient.setEccSlot (static_cast <int >(ECCX08Slot::Key), _eccx08_cert.bytes (), _eccx08_cert.length ());
132
132
#elif defined(BOARD_ESP)
@@ -159,7 +159,7 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
159
159
String const nina_fw_version = WiFi.firmwareVersion ();
160
160
if (nina_fw_version < " 1.4.1" ) {
161
161
_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 ());
163
163
}
164
164
else {
165
165
_ota_cap = true ;
@@ -196,10 +196,10 @@ int ArduinoIoTCloudTCP::connected()
196
196
197
197
void ArduinoIoTCloudTCP::printDebugInfo ()
198
198
{
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);
203
203
}
204
204
205
205
/* *****************************************************************************
@@ -217,7 +217,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectPhy()
217
217
ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SyncTime ()
218
218
{
219
219
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);
221
221
return State::ConnectMqttBroker;
222
222
}
223
223
@@ -226,28 +226,28 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
226
226
if (_mqttClient.connect (_brokerAddress.c_str (), _brokerPort))
227
227
return State::SubscribeMqttTopics;
228
228
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);
230
230
return State::ConnectPhy;
231
231
}
232
232
233
233
ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SubscribeMqttTopics ()
234
234
{
235
235
if (!_mqttClient.subscribe (_dataTopicIn))
236
236
{
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 ());
238
238
return State::SubscribeMqttTopics;
239
239
}
240
240
241
241
if (_shadowTopicIn != " " )
242
242
{
243
243
if (!_mqttClient.subscribe (_shadowTopicIn))
244
244
{
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 ());
246
246
return State::SubscribeMqttTopics;
247
247
}
248
248
}
249
249
250
- DBG_INFO (F (" Connected to Arduino IoT Cloud" ));
250
+ DEBUG_INFO (F (" Connected to Arduino IoT Cloud" ));
251
251
execCloudEventCallback (ArduinoIoTCloudEvent::CONNECT);
252
252
253
253
if (_shadowTopicIn != " " )
@@ -262,7 +262,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_RequestLastValues()
262
262
unsigned long const now = millis ();
263
263
if ((now - _lastSyncRequestTickTime) > TIMEOUT_FOR_LASTVALUES_SYNC)
264
264
{
265
- DBG_VERBOSE (F (" ArduinoIoTCloudTCP::%s [%d] last values requested" ), __FUNCTION__, now);
265
+ DEBUG_VERBOSE (F (" ArduinoIoTCloudTCP::%s [%d] last values requested" ), __FUNCTION__, now);
266
266
requestLastValue ();
267
267
_lastSyncRequestTickTime = now;
268
268
}
@@ -274,7 +274,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Connected()
274
274
{
275
275
if (!_mqttClient.connected ())
276
276
{
277
- DBG_ERROR (F (" ArduinoIoTCloudTCP::%s MQTT client connection lost" ), __FUNCTION__);
277
+ DEBUG_ERROR (F (" ArduinoIoTCloudTCP::%s MQTT client connection lost" ), __FUNCTION__);
278
278
279
279
/* Forcefully disconnect MQTT client and trigger a reconnection. */
280
280
_mqttClient.stop ();
@@ -354,7 +354,7 @@ void ArduinoIoTCloudTCP::handleMessage(int length)
354
354
355
355
if ((_shadowTopicIn == topic) && (_state == State::RequestLastValues))
356
356
{
357
- DBG_VERBOSE (F (" ArduinoIoTCloudTCP::%s [%d] last values received" ), __FUNCTION__, millis ());
357
+ DEBUG_VERBOSE (F (" ArduinoIoTCloudTCP::%s [%d] last values received" ), __FUNCTION__, millis ());
358
358
CBORDecoder::decode (_property_container, (uint8_t *)bytes, length, true );
359
359
sendPropertiesToCloud ();
360
360
execCloudEventCallback (ArduinoIoTCloudEvent::SYNC);
@@ -404,7 +404,7 @@ int ArduinoIoTCloudTCP::write(String const topic, byte const data[], int const l
404
404
#if OTA_ENABLED
405
405
void ArduinoIoTCloudTCP::onOTARequest ()
406
406
{
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 ());
408
408
409
409
/* Status flag to prevent the reset from being executed
410
410
* when HTTPS download is not supported.
@@ -420,7 +420,7 @@ void ArduinoIoTCloudTCP::onOTARequest()
420
420
uint8_t nina_ota_err_code = 0 ;
421
421
if (!WiFiStorage.downloadOTA (_ota_url.c_str (), &nina_ota_err_code))
422
422
{
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);
424
424
_ota_error = static_cast <int >(OTAError::DownloadFailed);
425
425
return ;
426
426
}
0 commit comments