Skip to content

Commit 52e179d

Browse files
committed
Fix reference as value in addProperty signature
1 parent 659608d commit 52e179d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ArduinoCloud.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ void ArduinoCloudClass::poll()
9797
_mqttClient.loop();
9898
uint8_t data[1024];
9999
int length = Thing.poll(data);
100-
if (length) {
101-
writeProperties(data, length);
100+
if (length > 0) {
101+
writeProperties(data, length);
102102
}
103103
}
104104

src/ArduinoCloudV2.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ArduinoCloudClass {
2626

2727
#define addProperty( v, ...) addPropertyReal(v, #v, __VA_ARGS__)
2828

29-
template<typename T> void addPropertyReal(T property, String name, permissionType _permission = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL) {
29+
template<typename T> void addPropertyReal(T& property, String name, permissionType _permission = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL) {
3030
Thing.addPropertyReal(property, name).publishEvery(seconds).setPermission(_permission).onUpdate(fn);
3131
}
3232

0 commit comments

Comments
 (0)