Skip to content

Commit 5576a60

Browse files
committed
Declare last_checked_property_index as protected variable of ArduinoIoTCloud
1 parent e285273 commit 5576a60

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/ArduinoIoTCloud.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
ArduinoIoTCloudClass::ArduinoIoTCloudClass()
2929
: _connection{nullptr}
30+
, _last_checked_property_index{0}
3031
, _time_service(ArduinoIoTCloudTimeService())
3132
, _tz_offset{0}
3233
, _tz_dst_until{0}

src/ArduinoIoTCloud.h

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ class ArduinoIoTCloudClass
148148

149149
ConnectionHandler * _connection;
150150
PropertyContainer _property_container;
151+
unsigned int _last_checked_property_index;
151152
TimeService & _time_service;
152153
int _tz_offset;
153154
unsigned int _tz_dst_until;

src/ArduinoIoTCloudLPWAN.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,8 @@ void ArduinoIoTCloudLPWAN::sendPropertiesToCloud()
149149
{
150150
int bytes_encoded = 0;
151151
uint8_t data[CBOR_LORA_MSG_MAX_SIZE];
152-
static unsigned int last_checked_property_index = 0;
153152

154-
if (CBOREncoder::encode(_property_container, data, sizeof(data), bytes_encoded, last_checked_property_index, true) == CborNoError)
153+
if (CBOREncoder::encode(_property_container, data, sizeof(data), bytes_encoded, _last_checked_property_index, true) == CborNoError)
155154
if (bytes_encoded > 0)
156155
writeProperties(data, bytes_encoded);
157156
}

src/ArduinoIoTCloudTCP.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,7 @@ void ArduinoIoTCloudTCP::sendPropertyContainerToCloud(PropertyContainer & proper
596596

597597
void ArduinoIoTCloudTCP::sendPropertiesToCloud()
598598
{
599-
static unsigned int last_checked_property_index = 0;
600-
sendPropertyContainerToCloud(_property_container, last_checked_property_index);
599+
sendPropertyContainerToCloud(_property_container, _last_checked_property_index);
601600
}
602601

603602
#if OTA_ENABLED

0 commit comments

Comments
 (0)