Skip to content

Commit 892861a

Browse files
committed
Updated int shadow_property assignment, modified test (all passed), because CBOR map has to be declared of infinite length
1 parent 5080d9d commit 892861a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ArduinoCloudThing.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ int ArduinoCloudThing::poll(uint8_t* data, size_t size) {
6060

6161
cbor_encoder_init(&encoder, data, size, 0);
6262
// create a cbor array containing the property that should be updated.
63-
err = cbor_encoder_create_array(&encoder, &arrayEncoder, CborIndefiniteLength);
63+
err = cbor_encoder_create_array(&encoder, &arrayEncoder, diff);
6464
if (err) {
65-
Serial.println(cbor_error_string(err));
65+
//Serial.println(cbor_error_string(err));
6666
return -1;
6767
}
6868

@@ -136,7 +136,7 @@ ArduinoCloudPropertyGeneric& ArduinoCloudThing::addPropertyReal(int& property, S
136136
// If a property with ythis name does not exist, create it into thing
137137
ArduinoCloudProperty<int> *propertyObj = new ArduinoCloudProperty<int>(property, name);
138138
// Initialize property data members, this is a friend class of ArduinoCloudProperty
139-
propertyObj->shadow_property = -1;
139+
propertyObj->shadow_property = property + 1;
140140
propertyObj->minDelta = minDelta;
141141
propertyObj->permission = _permission;
142142
propertyObj->updatePolicy = seconds;

0 commit comments

Comments
 (0)