Skip to content

Commit aa12854

Browse files
aentingerilcato
andauthored
Apply suggestions from @lxrobotics code review
Co-Authored-By: ilcato <[email protected]>
1 parent 8b5ac80 commit aa12854

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ArduinoIoTCloud.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static unsigned long getTimestamp() {
4040
#ifdef ARDUINO_ARCH_SAMD
4141
return rtc.getEpoch();
4242
#else
43-
#warning "No RTC available on this architecture - ArduinoIoTCloud will not keep track of local changes timestamps ."
43+
#warning "No RTC available on this architecture - ArduinoIoTCloud will not keep track of local change timestamps ."
4444
return 0;
4545
#endif
4646
}
@@ -210,7 +210,7 @@ void ArduinoIoTCloudClass::update(int const reconnectionMaxRetries, int const re
210210
{
211211
unsigned long const timestamp = getTimestamp();
212212
//check if a property is changed
213-
if(timestamp) Thing.updateTimestampOnChangedProperties(timestamp);
213+
if(timestamp != 0) Thing.updateTimestampOnChangedProperties(timestamp);
214214

215215
connectionCheck();
216216
if(iotStatus != IOT_STATUS_CLOUD_CONNECTED){
@@ -347,7 +347,7 @@ void ArduinoIoTCloudClass::requestLastValue()
347347
// Send the getLastValues CBOR message to the cloud
348348
// [{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
349349
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 };
350-
writeShadowOut(data, sizeof data);
350+
writeShadowOut(data, sizeof(data));
351351
}
352352

353353
void ArduinoIoTCloudClass::connectionCheck()
@@ -405,7 +405,7 @@ void ArduinoIoTCloudClass::connectionCheck()
405405
CloudSerial.println("Hello from Cloud Serial!");
406406
}
407407
#ifdef ARDUINO_ARCH_SAMD
408-
unsigned long epoch = getTime();
408+
unsigned long const epoch = getTime();
409409
if (epoch!=0)
410410
rtc.setEpoch(epoch);
411411
#endif

0 commit comments

Comments
 (0)