@@ -112,7 +112,7 @@ void ArduinoIoTCloudClass::update()
112
112
update (MAX_RETRIES, RECONNECTION_TIMEOUT);
113
113
}
114
114
115
- bool ArduinoIoTCloudClass::mqttReconnect (int maxRetries, int timeout)
115
+ bool ArduinoIoTCloudClass::mqttReconnect (int const maxRetries, int const timeout)
116
116
{
117
117
// Counter for reconnection retries
118
118
int retries = 0 ;
@@ -136,11 +136,11 @@ bool ArduinoIoTCloudClass::mqttReconnect(int maxRetries, int timeout)
136
136
return true ;
137
137
}
138
138
139
- void ArduinoIoTCloudClass::update (int reconnectionMaxRetries, int reconnectionTimeoutMs)
139
+ void ArduinoIoTCloudClass::update (int const reconnectionMaxRetries, int const reconnectionTimeoutMs)
140
140
{
141
141
// Method's argument controls
142
- int maxRetries = (reconnectionMaxRetries > 0 ) ? reconnectionMaxRetries : MAX_RETRIES;
143
- int timeout = (reconnectionTimeoutMs > 0 ) ? reconnectionTimeoutMs : RECONNECTION_TIMEOUT;
142
+ int const maxRetries = (reconnectionMaxRetries > 0 ) ? reconnectionMaxRetries : MAX_RETRIES;
143
+ int const timeout = (reconnectionTimeoutMs > 0 ) ? reconnectionTimeoutMs : RECONNECTION_TIMEOUT;
144
144
145
145
// If the reconnect() culd not establish the connection, return the control to the user sketch
146
146
if (!mqttReconnect (maxRetries, timeout))
@@ -150,7 +150,7 @@ void ArduinoIoTCloudClass::update(int reconnectionMaxRetries, int reconnectionTi
150
150
_mqttClient.loop ();
151
151
152
152
uint8_t data[MQTT_BUFFER_SIZE];
153
- int length = Thing.poll (data, sizeof (data));
153
+ int const length = Thing.poll (data, sizeof (data));
154
154
if (length > 0 ) {
155
155
writeProperties (data, length);
156
156
}
@@ -186,22 +186,22 @@ int ArduinoIoTCloudClass::connected()
186
186
return _mqttClient.connected ();
187
187
}
188
188
189
- int ArduinoIoTCloudClass::writeProperties (const byte data[], int length)
189
+ int ArduinoIoTCloudClass::writeProperties (const byte data[], int const length)
190
190
{
191
191
return _mqttClient.publish (_dataTopicOut.c_str (), (const char *)data, length);
192
192
}
193
193
194
- int ArduinoIoTCloudClass::writeStdout (const byte data[], int length)
194
+ int ArduinoIoTCloudClass::writeStdout (const byte data[], int const length)
195
195
{
196
196
return _mqttClient.publish (_stdoutTopic.c_str (), (const char *)data, length);
197
197
}
198
198
199
- void ArduinoIoTCloudClass::onMessage (MQTTClient* /* client*/ , char topic[], char bytes[], int length)
199
+ void ArduinoIoTCloudClass::onMessage (MQTTClient* /* client*/ , char topic[], char bytes[], int const length)
200
200
{
201
201
ArduinoCloud.handleMessage (topic, bytes, length);
202
202
}
203
203
204
- void ArduinoIoTCloudClass::handleMessage (char topic[], char bytes[], int length)
204
+ void ArduinoIoTCloudClass::handleMessage (char topic[], char bytes[], int const length)
205
205
{
206
206
if (_stdinTopic == topic) {
207
207
CloudSerial.appendStdin ((uint8_t *)bytes, length);
0 commit comments