@@ -170,7 +170,7 @@ void Property::execCallbackOnSync() {
170
170
CborError Property::append (CborEncoder *encoder, bool lightPayload) {
171
171
_lightPayload = lightPayload;
172
172
_attributeIdentifier = 0 ;
173
- CHECK_CBOR (appendAttributesToCloudReal (encoder));
173
+ CHECK_CBOR (appendAttributesToCloud (encoder));
174
174
fromLocalToCloud ();
175
175
_has_been_updated_once = true ;
176
176
_has_been_modified_in_callback = false ;
@@ -181,7 +181,7 @@ CborError Property::append(CborEncoder *encoder, bool lightPayload) {
181
181
return CborNoError;
182
182
}
183
183
184
- CborError Property::appendAttributeReal (bool value, String attributeName, CborEncoder *encoder) {
184
+ CborError Property::appendAttribute (bool value, String attributeName, CborEncoder *encoder) {
185
185
return appendAttributeName (attributeName, [value](CborEncoder & mapEncoder)
186
186
{
187
187
CHECK_CBOR (cbor_encode_int (&mapEncoder, static_cast <int >(CborIntegerMapKey::BooleanValue)));
@@ -190,7 +190,7 @@ CborError Property::appendAttributeReal(bool value, String attributeName, CborEn
190
190
}, encoder);
191
191
}
192
192
193
- CborError Property::appendAttributeReal (int value, String attributeName, CborEncoder *encoder) {
193
+ CborError Property::appendAttribute (int value, String attributeName, CborEncoder *encoder) {
194
194
return appendAttributeName (attributeName, [value](CborEncoder & mapEncoder)
195
195
{
196
196
CHECK_CBOR (cbor_encode_int (&mapEncoder, static_cast <int >(CborIntegerMapKey::Value)));
@@ -199,7 +199,7 @@ CborError Property::appendAttributeReal(int value, String attributeName, CborEnc
199
199
}, encoder);
200
200
}
201
201
202
- CborError Property::appendAttributeReal (unsigned int value, String attributeName, CborEncoder *encoder) {
202
+ CborError Property::appendAttribute (unsigned int value, String attributeName, CborEncoder *encoder) {
203
203
return appendAttributeName (attributeName, [value](CborEncoder & mapEncoder)
204
204
{
205
205
CHECK_CBOR (cbor_encode_int (&mapEncoder, static_cast <int >(CborIntegerMapKey::Value)));
@@ -208,7 +208,7 @@ CborError Property::appendAttributeReal(unsigned int value, String attributeName
208
208
}, encoder);
209
209
}
210
210
211
- CborError Property::appendAttributeReal (float value, String attributeName, CborEncoder *encoder) {
211
+ CborError Property::appendAttribute (float value, String attributeName, CborEncoder *encoder) {
212
212
return appendAttributeName (attributeName, [value](CborEncoder & mapEncoder)
213
213
{
214
214
CHECK_CBOR (cbor_encode_int (&mapEncoder, static_cast <int >(CborIntegerMapKey::Value)));
@@ -217,7 +217,7 @@ CborError Property::appendAttributeReal(float value, String attributeName, CborE
217
217
}, encoder);
218
218
}
219
219
220
- CborError Property::appendAttributeReal (String value, String attributeName, CborEncoder *encoder) {
220
+ CborError Property::appendAttribute (String value, String attributeName, CborEncoder *encoder) {
221
221
return appendAttributeName (attributeName, [value](CborEncoder & mapEncoder)
222
222
{
223
223
CHECK_CBOR (cbor_encode_int (&mapEncoder, static_cast <int >(CborIntegerMapKey::StringValue)));
@@ -278,8 +278,8 @@ void Property::setAttributesFromCloud(std::list<CborMapData> * map_data_list) {
278
278
setAttributesFromCloud ();
279
279
}
280
280
281
- void Property::setAttributeReal (bool & value, String attributeName) {
282
- setAttributeReal (attributeName, [&value](CborMapData & md) {
281
+ void Property::setAttribute (bool & value, String attributeName) {
282
+ setAttribute (attributeName, [&value](CborMapData & md) {
283
283
// Manage the case to have boolean values received as integers 0/1
284
284
if (md.bool_val .isSet ()) {
285
285
value = md.bool_val .get ();
@@ -295,34 +295,34 @@ void Property::setAttributeReal(bool& value, String attributeName) {
295
295
});
296
296
}
297
297
298
- void Property::setAttributeReal (int & value, String attributeName) {
299
- setAttributeReal (attributeName, [&value](CborMapData & md) {
298
+ void Property::setAttribute (int & value, String attributeName) {
299
+ setAttribute (attributeName, [&value](CborMapData & md) {
300
300
value = md.val .get ();
301
301
});
302
302
}
303
303
304
- void Property::setAttributeReal (unsigned int & value, String attributeName) {
305
- setAttributeReal (attributeName, [&value](CborMapData & md) {
304
+ void Property::setAttribute (unsigned int & value, String attributeName) {
305
+ setAttribute (attributeName, [&value](CborMapData & md) {
306
306
value = md.val .get ();
307
307
});
308
308
}
309
309
310
- void Property::setAttributeReal (float & value, String attributeName) {
311
- setAttributeReal (attributeName, [&value](CborMapData & md) {
310
+ void Property::setAttribute (float & value, String attributeName) {
311
+ setAttribute (attributeName, [&value](CborMapData & md) {
312
312
value = md.val .get ();
313
313
});
314
314
}
315
315
316
- void Property::setAttributeReal (String& value, String attributeName) {
317
- setAttributeReal (attributeName, [&value](CborMapData & md) {
316
+ void Property::setAttribute (String& value, String attributeName) {
317
+ setAttribute (attributeName, [&value](CborMapData & md) {
318
318
value = md.str_val .get ();
319
319
});
320
320
}
321
321
322
322
#ifdef __AVR__
323
- void Property::setAttributeReal (String attributeName, nonstd::function<void (CborMapData & md)>setValue)
323
+ void Property::setAttribute (String attributeName, nonstd::function<void (CborMapData & md)>setValue)
324
324
#else
325
- void Property::setAttributeReal (String attributeName, std::function<void (CborMapData & md)>setValue)
325
+ void Property::setAttribute (String attributeName, std::function<void (CborMapData & md)>setValue)
326
326
#endif
327
327
{
328
328
if (attributeName != " " ) {
@@ -354,13 +354,6 @@ void Property::setAttributeReal(String attributeName, std::function<void (CborMa
354
354
});
355
355
}
356
356
357
- String Property::getAttributeName (String propertyName, char separator) {
358
- int colonPos;
359
- String attributeName = " " ;
360
- (colonPos = propertyName.indexOf (separator)) != -1 ? attributeName = propertyName.substring (colonPos + 1 ) : " " ;
361
- return attributeName;
362
- }
363
-
364
357
void Property::updateLocalTimestamp () {
365
358
if (isReadableByCloud ()) {
366
359
if (_get_time_func) {
0 commit comments