Skip to content

Commit a5a91e3

Browse files
committed
Extract reconnection specific constants and move them to AIOTConfig.h
1 parent f218bce commit a5a91e3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/AIoTC_Config.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,11 @@
134134
#define HAS_TCP
135135
#endif
136136

137+
/******************************************************************************
138+
* CONSTANTS
139+
******************************************************************************/
140+
141+
#define RECONNECTION_RETRY_DELAY_ms (1000UL)
142+
#define MAX_RECONNECTION_RETRY_DELAY_ms (32000UL)
143+
137144
#endif /* ARDUINO_AIOTC_CONFIG_H_ */

src/ArduinoIoTCloudTCP.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,6 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
363363
return State::SubscribeMqttTopics;
364364
}
365365

366-
static unsigned long const RECONNECTION_RETRY_DELAY_ms = 1000;
367-
static unsigned long const MAX_RECONNECTION_RETRY_DELAY_ms = 32000;
368366
_last_connection_attempt_cnt++;
369367
unsigned long const reconnection_retry_delay = min(MAX_RECONNECTION_RETRY_DELAY_ms, pow(2, _last_connection_attempt_cnt) * RECONNECTION_RETRY_DELAY_ms);
370368
_next_connection_attempt_tick = millis() + reconnection_retry_delay;

0 commit comments

Comments
 (0)