Skip to content

Commit 2329e43

Browse files
aentingermattiabertorello
authored andcommitted
Providing a new function addProperty which suports the new interface of ArduinoCloudProperty
1 parent 90cd1b9 commit 2329e43

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ArduinoIoTCloud.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class ArduinoIoTCloudClass {
5050
// Clean up existing Mqtt connection, create a new one and initialize it
5151
int reconnect(Client& net);
5252

53-
template<typename T, typename N=T> void addProperty(T & property, String name, permissionType permission_type = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL, N minDelta = N(0)) {
53+
template<typename T, typename N=T>
54+
void addProperty(T & property, String name, permissionType permission_type = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL, N minDelta = N(0)) {
5455
Permission permission = Permission::ReadWrite;
5556
if (permission_type == READ ) permission = Permission::Read;
5657
else if(permission_type == WRITE) permission = Permission::Write;
@@ -64,6 +65,11 @@ class ArduinoIoTCloudClass {
6465
}
6566
}
6667

68+
template <typename T>
69+
ArduinoCloudProperty<T> addProperty(T & property, String const & name, Permission const permission) {
70+
return Thing.addProperty(property, name, permission);
71+
}
72+
6773
protected:
6874
friend class CloudSerialClass;
6975
int writeStdout(const byte data[], int const length);

0 commit comments

Comments
 (0)