Skip to content

Commit

Permalink
ArduinoCloudTCP: print BearSSL error code
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Oct 4, 2024
1 parent 7d4e9e0 commit 46b9129
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,11 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
/* Can't connect to the broker. Wait: 2s -> 4s -> 8s -> 16s -> 32s -> 32s ... */
_connection_attempt.retry();

#if defined (BOARD_STM32H7) && defined(BOARD_HAS_ECCX08)
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not connect to %s:%d Mqtt error: %d TLS error: %d", __FUNCTION__, _brokerAddress.c_str(), _brokerPort, _mqttClient.connectError(), _brokerClient.errorCode());
#else
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not connect to %s:%d Error: %d", __FUNCTION__, _brokerAddress.c_str(), _brokerPort, _mqttClient.connectError());
#endif
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s %d next connection attempt in %d ms", __FUNCTION__, _connection_attempt.getRetryCount(), _connection_attempt.getWaitTime());
/* Go back to ConnectPhy and retry to get time from network (invalid time for SSL handshake?)*/
return State::ConnectPhy;
Expand Down

0 comments on commit 46b9129

Please sign in to comment.