Skip to content

Commit 80ace16

Browse files
committed
Reducing available update functions
1 parent e58b825 commit 80ace16

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/ArduinoIoTCloud.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ bool ArduinoIoTCloudClass::disconnect() {
211211
return true;
212212
}
213213

214-
void ArduinoIoTCloudClass::update(int const /* reconnectionMaxRetries */, int const /* reconnectionTimeoutMs */, CallbackFunc onSyncCompleteCallback) {
214+
void ArduinoIoTCloudClass::update(CallbackFunc onSyncCompleteCallback) {
215215
// Check if a primitive property wrapper is locally changed
216216
Thing.updateTimestampOnLocallyChangedProperties();
217217

src/ArduinoIoTCloud.h

+3-9
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ class ArduinoIoTCloudClass {
7979
int begin(Client& net, String brokerAddress = DEFAULT_BROKER_ADDRESS, uint16_t brokerPort = DEFAULT_BROKER_PORT);
8080
// Class constant declaration
8181
static const int MQTT_TRANSMIT_BUFFER_SIZE = 256;
82-
static const int MAX_RETRIES = 5;
83-
static const int RECONNECTION_TIMEOUT = 2000;
8482
static const int TIMEOUT_FOR_LASTVALUES_SYNC = 10000;
8583

8684
void onGetTime(unsigned long(*callback)(void));
@@ -91,14 +89,10 @@ class ArduinoIoTCloudClass {
9189
inline void update() {
9290
update(NULL);
9391
}
94-
inline void update(CallbackFunc onSyncCompleteCallback) __attribute__((deprecated)) { /* Attention: Function is deprecated - use 'addCallback(ArduinoIoTCloudConnectionEvent::SYNC, &onSync)' for adding a onSyncCallback instead */
95-
update(MAX_RETRIES, RECONNECTION_TIMEOUT, onSyncCompleteCallback);
96-
}
97-
// defined for users who want to specify max reconnections reties and timeout between them
98-
inline void update(int const reconnectionMaxRetries, int const reconnectionTimeoutMs) {
99-
update(reconnectionMaxRetries, reconnectionTimeoutMs, NULL);
92+
inline void update(int const reconnectionMaxRetries, int const reconnectionTimeoutMs) __attribute__((deprecated)) {
93+
update(NULL);
10094
}
101-
void update(int const reconnectionMaxRetries, int const reconnectionTimeoutMs, CallbackFunc onSyncCompleteCallback) __attribute__((deprecated)); /* Attention: Function is deprecated - use 'addCallback(ArduinoIoTCloudConnectionEvent::SYNC, &onSync)' for adding a onSyncCallback instead */
95+
void update(CallbackFunc onSyncCompleteCallback) __attribute__((deprecated)); /* Attention: Function is deprecated - use 'addCallback(ArduinoIoTCloudConnectionEvent::SYNC, &onSync)' for adding a onSyncCallback instead */
10296

10397
int connected();
10498
// Clean up existing Mqtt connection, create a new one and initialize it

0 commit comments

Comments
 (0)