Skip to content

Commit 79c3c03

Browse files
committed
Config: usa a multiplier to handle thing id request retries for detached by user devices
1 parent fa89e5b commit 79c3c03

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/AIoTC_Config.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@
153153
#define AIOT_CONFIG_MAX_THING_ID_REQUEST_RETRY_DELAY_ms (32000UL)
154154
#define AIOT_CONFIG_THING_ID_REQUEST_MAX_RETRY_CNT (10UL)
155155

156-
#define AIOT_CONFIG_DEVICE_TOPIC_ATTACH_RETRY_DELAY_ms (20000UL)
157-
#define AIOT_CONFIG_MAX_DEVICE_TOPIC_ATTACH_RETRY_DELAY_ms (1280000UL)
156+
#define AIOT_CONFIG_DEVICE_REGISTERED_RETRY_DELAY_k (10UL)
157+
#define AIOT_CONFIG_MAX_DEVICE_REGISTERED_RETRY_DELAY_k (4UL)
158+
158159
#define AIOT_CONFIG_TIMEOUT_FOR_LASTVALUES_SYNC_ms (30000UL)
159160
#define AIOT_CONFIG_LASTVALUES_SYNC_MAX_RETRY_CNT (10UL)
160161

src/ArduinoIoTCloudDevice.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ ArduinoCloudDevice::State ArduinoCloudDevice::handleConnected() {
130130
* counter, but recompute delay.
131131
* Wait: 4s -> 80s -> 160s -> 320s -> 640s -> 1280s -> 1280s ...
132132
*/
133-
_attachAttempt.reconfigure(AIOT_CONFIG_DEVICE_TOPIC_ATTACH_RETRY_DELAY_ms,
134-
AIOT_CONFIG_MAX_DEVICE_TOPIC_ATTACH_RETRY_DELAY_ms);
133+
_attachAttempt.reconfigure(AIOT_CONFIG_THING_ID_REQUEST_RETRY_DELAY_ms *
134+
AIOT_CONFIG_DEVICE_REGISTERED_RETRY_DELAY_k,
135+
AIOT_CONFIG_MAX_THING_ID_REQUEST_RETRY_DELAY_ms *
136+
AIOT_CONFIG_MAX_DEVICE_REGISTERED_RETRY_DELAY_k);
135137
}
136138
return State::SendCapabilities;
137139
}

0 commit comments

Comments
 (0)