Skip to content

Commit 70219c5

Browse files
aentingermattiabertorello
authored andcommitted
Renaming function 'poll()' to 'update()' and 'poll(args)' to 'update(args)' and marking 'poll' as deprecated since the user of the function should be aware that there is going on more than simple polling
1 parent facda86 commit 70219c5

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/ArduinoIoTCloud.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,13 @@ bool ArduinoIoTCloudClass::disconnect()
103103

104104
void ArduinoIoTCloudClass::poll()
105105
{
106-
// If user call poll() without parameters use the default ones
107-
poll(MAX_RETRIES, RECONNECTION_TIMEOUT);
106+
update();
107+
}
108+
109+
void ArduinoIoTCloudClass::update()
110+
{
111+
// If user call update() without parameters use the default ones
112+
update(MAX_RETRIES, RECONNECTION_TIMEOUT);
108113
}
109114

110115
bool ArduinoIoTCloudClass::mqttReconnect(int maxRetries, int timeout)
@@ -131,7 +136,7 @@ bool ArduinoIoTCloudClass::mqttReconnect(int maxRetries, int timeout)
131136
return true;
132137
}
133138

134-
void ArduinoIoTCloudClass::poll(int reconnectionMaxRetries, int reconnectionTimeoutMs)
139+
void ArduinoIoTCloudClass::update(int reconnectionMaxRetries, int reconnectionTimeoutMs)
135140
{
136141
// Method's argument controls
137142
int maxRetries = (reconnectionMaxRetries > 0) ? reconnectionMaxRetries : MAX_RETRIES;

src/ArduinoIoTCloud.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ class ArduinoIoTCloudClass {
3030

3131
int connect();
3232
bool disconnect();
33-
void poll();
33+
34+
void poll(); /* Attention: Function is deprecated - use 'update' instead */
35+
void update();
3436

3537
// defined for users who want to specify max reconnections reties and timeout between them
36-
void poll(int reconnectionMaxRetries, int reconnectionTimeoutMs);
38+
void update(int reconnectionMaxRetries, int reconnectionTimeoutMs);
3739
// It must be a user defined function, in order to avoid ArduinoCloud include specific WiFi file
3840
// in this case this library is independent from the WiFi one
3941
void onGetTime(unsigned long(*)(void));

0 commit comments

Comments
 (0)