Skip to content

Commit 88aedae

Browse files
committed
Rename _writeOnConnect into _writeCertOnConnect
1 parent ea3cd84 commit 88aedae

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/ArduinoIoTCloudTCP.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ArduinoIoTCloudTCP::ArduinoIoTCloudTCP()
6060
, _password("")
6161
#endif
6262
#if defined(BOARD_HAS_SECURE_ELEMENT)
63-
, _writeOnConnect(false)
63+
, _writeCertOnConnect(false)
6464
#endif
6565
, _mqttClient{nullptr}
6666
, _messageTopicOut("")
@@ -114,7 +114,7 @@ int ArduinoIoTCloudTCP::begin(ConnectionHandler & connection, bool const enable_
114114
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not read device id.", __FUNCTION__);
115115
return 0;
116116
}
117-
if (!_writeOnConnect) {
117+
if (!_writeCertOnConnect) {
118118
/* No update pending read certificate stored in secure element */
119119
if (!SElementArduinoCloudCertificate::read(_selement, _cert, SElementArduinoCloudSlot::CompressedCertificate))
120120
{
@@ -289,12 +289,12 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
289289

290290
#if defined(BOARD_HAS_SECURE_ELEMENT)
291291
/* A device certificate update was pending */
292-
if (_writeOnConnect)
292+
if (_writeCertOnConnect)
293293
{
294294
if (SElementArduinoCloudCertificate::write(_selement, _cert, SElementArduinoCloudSlot::CompressedCertificate))
295295
{
296296
DEBUG_INFO("ArduinoIoTCloudTCP::%s device certificate update done.", __FUNCTION__);
297-
_writeOnConnect = false;
297+
_writeCertOnConnect = false;
298298
}
299299
}
300300
#endif
@@ -623,7 +623,7 @@ int ArduinoIoTCloudTCP::updateCertificate(String authorityKeyIdentifier, String
623623
DEBUG_INFO("ArduinoIoTCloudTCP::%s update done.", __FUNCTION__);
624624
}
625625
#else
626-
_writeOnConnect = true;
626+
_writeCertOnConnect = true;
627627
#endif
628628
return 1;
629629
}

src/ArduinoIoTCloudTCP.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
150150
#if defined(BOARD_HAS_SECURE_ELEMENT)
151151
SecureElement _selement;
152152
ECP256Certificate _cert;
153-
bool _writeOnConnect;
153+
/* Flag used to store updated device certificate after broker connection has succeeded */
154+
bool _writeCertOnConnect;
154155
#endif
155156

156157
TLSClientMqtt _brokerClient;

0 commit comments

Comments
 (0)