Skip to content

Commit 3addcf4

Browse files
per1234ilcato
andcommitted
Apply suggestions from code review
Co-Authored-By: ilcato <ilcato@yahoo.com>
1 parent e9297c3 commit 3addcf4

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/ArduinoIoTCloud.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,16 @@ void ArduinoIoTCloudClass::update(int const reconnectionMaxRetries, int const re
240240
(*callback)();
241241
syncStatus = SYNC_STATUS_SYNCHRONIZED;
242242
break;
243-
}
243+
}
244244
}
245245

246-
void ArduinoIoTCloudClass::sendPropertiesToCloud() {
247-
uint8_t data[MQTT_TRANSMIT_BUFFER_SIZE];
248-
int const length = Thing.encode(data, sizeof(data));
249-
if (length > 0) {
250-
writeProperties(data, length);
251-
}
246+
void ArduinoIoTCloudClass::sendPropertiesToCloud()
247+
{
248+
uint8_t data[MQTT_TRANSMIT_BUFFER_SIZE];
249+
int const length = Thing.encode(data, sizeof(data));
250+
if (length > 0) {
251+
writeProperties(data, length);
252+
}
252253
}
253254

254255
int ArduinoIoTCloudClass::reconnect(Client& /* net */)
@@ -348,10 +349,10 @@ void ArduinoIoTCloudClass::handleMessage(int length)
348349

349350
void ArduinoIoTCloudClass::requestLastValue()
350351
{
351-
// Send the getLastValues CBOR message to the cloud
352-
// [{0: "r:m", 3: "getLastValues"}] = 81 A2 00 63 72 3A 6D 03 6D 67 65 74 4C 61 73 74 56 61 6C 75 65 73
353-
const uint8_t data[] = { 0x81, 0xA2, 0x00, 0x63, 0x72, 0x3A, 0x6D, 0x03, 0x6D, 0x67, 0x65, 0x74, 0x4C, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6C, 0x75, 0x65, 0x73 };
354-
writeShadowOut(data, sizeof data);
352+
// Send the getLastValues CBOR message to the cloud
353+
// [{0: "r:m", 3: "getLastValues"}] = 81 A2 00 63 72 3A 6D 03 6D 67 65 74 4C 61 73 74 56 61 6C 75 65 73
354+
const uint8_t data[] = { 0x81, 0xA2, 0x00, 0x63, 0x72, 0x3A, 0x6D, 0x03, 0x6D, 0x67, 0x65, 0x74, 0x4C, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6C, 0x75, 0x65, 0x73 };
355+
writeShadowOut(data, sizeof data);
355356
}
356357

357358
void ArduinoIoTCloudClass::connectionCheck()

src/ArduinoIoTCloud.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ class ArduinoIoTCloudClass {
153153
ArduinoCloudThing Thing;
154154
BearSSLClient* _bearSslClient;
155155
MqttClient* _mqttClient;
156-
int _lastSyncRequestTickTime;
157-
bool _callGetLastValueCallback;
156+
int _lastSyncRequestTickTime;
157+
bool _callGetLastValueCallback;
158158

159159

160160
// Class attribute to define MTTQ topics 2 for stdIn/out and 2 for data, in order to avoid getting previous pupblished payload

0 commit comments

Comments
 (0)