@@ -33,7 +33,9 @@ ArduinoIoTCloudClass::ArduinoIoTCloudClass()
33
33
, _tz_dst_until{0 }
34
34
, _thing_id{" " }
35
35
, _device_id{" " }
36
+ , _lib_version{AIOT_CONFIG_LIB_VERSION}
36
37
, _cloud_event_callback{nullptr }
38
+ , _thing_id_outdated{false }
37
39
{
38
40
39
41
}
@@ -44,12 +46,12 @@ ArduinoIoTCloudClass::ArduinoIoTCloudClass()
44
46
45
47
void ArduinoIoTCloudClass::push ()
46
48
{
47
- requestUpdateForAllProperties (_property_container );
49
+ requestUpdateForAllProperties (_thing_property_container );
48
50
}
49
51
50
52
bool ArduinoIoTCloudClass::setTimestamp (String const & prop_name, unsigned long const timestamp)
51
53
{
52
- Property * p = getProperty (_property_container , prop_name);
54
+ Property * p = getProperty (_thing_property_container , prop_name);
53
55
54
56
if (p == nullptr )
55
57
return false ;
@@ -81,20 +83,30 @@ void ArduinoIoTCloudClass::addPropertyReal(Property& property, String name, int
81
83
}
82
84
83
85
if (seconds == ON_CHANGE) {
84
- addPropertyToContainer (_property_container , property, name, permission, tag).publishOnChange (minDelta, Property::DEFAULT_MIN_TIME_BETWEEN_UPDATES_MILLIS).onUpdate (fn).onSync (synFn);
86
+ addPropertyToContainer (_thing_property_container , property, name, permission, tag).publishOnChange (minDelta, Property::DEFAULT_MIN_TIME_BETWEEN_UPDATES_MILLIS).onUpdate (fn).onSync (synFn);
85
87
} else {
86
- addPropertyToContainer (_property_container , property, name, permission, tag).publishEvery (seconds).onUpdate (fn).onSync (synFn);
88
+ addPropertyToContainer (_thing_property_container , property, name, permission, tag).publishEvery (seconds).onUpdate (fn).onSync (synFn);
87
89
}
88
90
}
89
91
90
92
Property& ArduinoIoTCloudClass::addPropertyReal (Property& property, String name, Permission const permission)
91
93
{
92
- return addPropertyToContainer (_property_container , property, name, permission);
94
+ return addPropertyToContainer (_thing_property_container , property, name, permission);
93
95
}
94
96
95
97
Property& ArduinoIoTCloudClass::addPropertyReal (Property& property, String name, int tag, Permission const permission)
96
98
{
97
- return addPropertyToContainer (_property_container, property, name, permission, tag);
99
+ return addPropertyToContainer (_thing_property_container, property, name, permission, tag);
100
+ }
101
+
102
+ Property& ArduinoIoTCloudClass::addPropertyReal (Property& property, PropertyContainer &prop_cont, String name, Permission const permission)
103
+ {
104
+ return addPropertyToContainer (prop_cont, property, name, permission, -1 );
105
+ }
106
+
107
+ Property& ArduinoIoTCloudClass::addPropertyReal (Property& property, PropertyContainer &prop_cont, String name, int tag, Permission const permission)
108
+ {
109
+ return addPropertyToContainer (prop_cont, property, name, permission, tag);
98
110
}
99
111
100
112
void ArduinoIoTCloudClass::addPropertyReal (bool & property, String name, permissionType permission_type, long seconds, void (*fn)(void ), float minDelta, void(*synFn)(Property & property))
@@ -110,13 +122,23 @@ void ArduinoIoTCloudClass::addPropertyReal(bool& property, String name, int tag,
110
122
111
123
Property& ArduinoIoTCloudClass::addPropertyReal (bool & property, String name, Permission const permission)
112
124
{
113
- return addPropertyReal (property, name, -1 , permission);
125
+ return addPropertyReal (property, _thing_property_container, name, -1 , permission);
114
126
}
115
127
116
128
Property& ArduinoIoTCloudClass::addPropertyReal (bool & property, String name, int tag, Permission const permission)
129
+ {
130
+ return addPropertyReal (property, _thing_property_container, name, tag, permission);
131
+ }
132
+
133
+ Property& ArduinoIoTCloudClass::addPropertyReal (bool & property, PropertyContainer &prop_cont, String name, Permission const permission)
134
+ {
135
+ return addPropertyReal (property, prop_cont, name, -1 , permission);
136
+ }
137
+
138
+ Property& ArduinoIoTCloudClass::addPropertyReal (bool & property, PropertyContainer &prop_cont, String name, int tag, Permission const permission)
117
139
{
118
140
Property* p = new CloudWrapperBool (property);
119
- return addPropertyToContainer (_property_container , *p, name, permission, tag);
141
+ return addPropertyToContainer (prop_cont , *p, name, permission, tag);
120
142
}
121
143
122
144
void ArduinoIoTCloudClass::addPropertyReal (float & property, String name, permissionType permission_type, long seconds, void (*fn)(void ), float minDelta, void(*synFn)(Property & property))
@@ -132,13 +154,23 @@ void ArduinoIoTCloudClass::addPropertyReal(float& property, String name, int tag
132
154
133
155
Property& ArduinoIoTCloudClass::addPropertyReal (float & property, String name, Permission const permission)
134
156
{
135
- return addPropertyReal (property, name, -1 , permission);
157
+ return addPropertyReal (property, _thing_property_container, name, -1 , permission);
136
158
}
137
159
138
160
Property& ArduinoIoTCloudClass::addPropertyReal (float & property, String name, int tag, Permission const permission)
161
+ {
162
+ return addPropertyReal (property, _thing_property_container, name, tag, permission);
163
+ }
164
+
165
+ Property& ArduinoIoTCloudClass::addPropertyReal (float & property, PropertyContainer &prop_cont, String name, Permission const permission)
166
+ {
167
+ return addPropertyReal (property, prop_cont, name, -1 , permission);
168
+ }
169
+
170
+ Property& ArduinoIoTCloudClass::addPropertyReal (float & property, PropertyContainer &prop_cont, String name, int tag, Permission const permission)
139
171
{
140
172
Property* p = new CloudWrapperFloat (property);
141
- return addPropertyToContainer (_property_container , *p, name, permission, tag);
173
+ return addPropertyToContainer (prop_cont , *p, name, permission, tag);
142
174
}
143
175
144
176
void ArduinoIoTCloudClass::addPropertyReal (int & property, String name, permissionType permission_type, long seconds, void (*fn)(void ), float minDelta, void(*synFn)(Property & property))
@@ -154,13 +186,23 @@ void ArduinoIoTCloudClass::addPropertyReal(int& property, String name, int tag,
154
186
155
187
Property& ArduinoIoTCloudClass::addPropertyReal (int & property, String name, Permission const permission)
156
188
{
157
- return addPropertyReal (property, name, -1 , permission);
189
+ return addPropertyReal (property, _thing_property_container, name, -1 , permission);
158
190
}
159
191
160
192
Property& ArduinoIoTCloudClass::addPropertyReal (int & property, String name, int tag, Permission const permission)
193
+ {
194
+ return addPropertyReal (property, _thing_property_container, name, tag, permission);
195
+ }
196
+
197
+ Property& ArduinoIoTCloudClass::addPropertyReal (int & property, PropertyContainer &prop_cont, String name, Permission const permission)
198
+ {
199
+ return addPropertyReal (property, prop_cont, name, -1 , permission);
200
+ }
201
+
202
+ Property& ArduinoIoTCloudClass::addPropertyReal (int & property, PropertyContainer &prop_cont, String name, int tag, Permission const permission)
161
203
{
162
204
Property* p = new CloudWrapperInt (property);
163
- return addPropertyToContainer (_property_container , *p, name, permission, tag);
205
+ return addPropertyToContainer (prop_cont , *p, name, permission, tag);
164
206
}
165
207
166
208
void ArduinoIoTCloudClass::addPropertyReal (unsigned int & property, String name, permissionType permission_type, long seconds, void (*fn)(void ), float minDelta, void(*synFn)(Property & property))
@@ -176,13 +218,23 @@ void ArduinoIoTCloudClass::addPropertyReal(unsigned int& property, String name,
176
218
177
219
Property& ArduinoIoTCloudClass::addPropertyReal (unsigned int & property, String name, Permission const permission)
178
220
{
179
- return addPropertyReal (property, name, -1 , permission);
221
+ return addPropertyReal (property, _thing_property_container, name, -1 , permission);
180
222
}
181
223
182
224
Property& ArduinoIoTCloudClass::addPropertyReal (unsigned int & property, String name, int tag, Permission const permission)
225
+ {
226
+ return addPropertyReal (property, _thing_property_container, name, tag, permission);
227
+ }
228
+
229
+ Property& ArduinoIoTCloudClass::addPropertyReal (unsigned int & property, PropertyContainer &prop_cont, String name, Permission const permission)
230
+ {
231
+ return addPropertyReal (property, prop_cont, name, -1 , permission);
232
+ }
233
+
234
+ Property& ArduinoIoTCloudClass::addPropertyReal (unsigned int & property, PropertyContainer &prop_cont, String name, int tag, Permission const permission)
183
235
{
184
236
Property* p = new CloudWrapperUnsignedInt (property);
185
- return addPropertyToContainer (_property_container , *p, name, permission, tag);
237
+ return addPropertyToContainer (prop_cont , *p, name, permission, tag);
186
238
}
187
239
188
240
void ArduinoIoTCloudClass::addPropertyReal (String& property, String name, permissionType permission_type, long seconds, void (*fn)(void ), float minDelta, void(*synFn)(Property & property))
@@ -198,13 +250,23 @@ void ArduinoIoTCloudClass::addPropertyReal(String& property, String name, int ta
198
250
199
251
Property& ArduinoIoTCloudClass::addPropertyReal (String& property, String name, Permission const permission)
200
252
{
201
- return addPropertyReal (property, name, -1 , permission);
253
+ return addPropertyReal (property, _thing_property_container, name, -1 , permission);
202
254
}
203
255
204
256
Property& ArduinoIoTCloudClass::addPropertyReal (String& property, String name, int tag, Permission const permission)
257
+ {
258
+ return addPropertyReal (property, _thing_property_container, name, tag, permission);
259
+ }
260
+
261
+ Property& ArduinoIoTCloudClass::addPropertyReal (String& property, PropertyContainer &prop_cont, String name, Permission const permission)
262
+ {
263
+ return addPropertyReal (property, prop_cont, name, -1 , permission);
264
+ }
265
+
266
+ Property& ArduinoIoTCloudClass::addPropertyReal (String& property, PropertyContainer &prop_cont, String name, int tag, Permission const permission)
205
267
{
206
268
Property* p = new CloudWrapperString (property);
207
- return addPropertyToContainer (_property_container , *p, name, permission, tag);
269
+ return addPropertyToContainer (prop_cont , *p, name, permission, tag);
208
270
}
209
271
210
272
/* *****************************************************************************
0 commit comments