@@ -33,8 +33,8 @@ _registered(false) {
33
33
}
34
34
35
35
void ArduinoCloudDevice::begin () {
36
- _attachAttempt.begin (AIOT_CONFIG_DEVICE_TOPIC_SUBSCRIBE_RETRY_DELAY_ms ,
37
- AIOT_CONFIG_MAX_DEVICE_TOPIC_SUBSCRIBE_RETRY_DELAY_ms );
36
+ _attachAttempt.begin (AIOT_CONFIG_THING_ID_REQUEST_RETRY_DELAY_ms ,
37
+ AIOT_CONFIG_MAX_THING_ID_REQUEST_RETRY_DELAY_ms );
38
38
}
39
39
40
40
void ArduinoCloudDevice::update () {
@@ -95,8 +95,8 @@ void ArduinoCloudDevice::handleMessage(Message *m) {
95
95
96
96
ArduinoCloudDevice::State ArduinoCloudDevice::handleInit () {
97
97
/* Reset attempt struct for the nex retry after disconnection */
98
- _attachAttempt.begin (AIOT_CONFIG_DEVICE_TOPIC_SUBSCRIBE_RETRY_DELAY_ms ,
99
- AIOT_CONFIG_MAX_DEVICE_TOPIC_SUBSCRIBE_RETRY_DELAY_ms );
98
+ _attachAttempt.begin (AIOT_CONFIG_THING_ID_REQUEST_RETRY_DELAY_ms ,
99
+ AIOT_CONFIG_MAX_THING_ID_REQUEST_RETRY_DELAY_ms );
100
100
101
101
_attached = false ;
102
102
_registered = false ;
@@ -122,7 +122,7 @@ ArduinoCloudDevice::State ArduinoCloudDevice::handleSendCapabilities() {
122
122
123
123
ArduinoCloudDevice::State ArduinoCloudDevice::handleConnected () {
124
124
/* Max retry than disconnect */
125
- if (_attachAttempt.getRetryCount () > AIOT_CONFIG_DEVICE_TOPIC_MAX_RETRY_CNT ) {
125
+ if (_attachAttempt.getRetryCount () > AIOT_CONFIG_THING_ID_REQUEST_MAX_RETRY_CNT ) {
126
126
return State::Disconnected;
127
127
}
128
128
@@ -132,8 +132,10 @@ ArduinoCloudDevice::State ArduinoCloudDevice::handleConnected() {
132
132
* counter, but recompute delay.
133
133
* Wait: 4s -> 80s -> 160s -> 320s -> 640s -> 1280s -> 1280s ...
134
134
*/
135
- _attachAttempt.reconfigure (AIOT_CONFIG_DEVICE_TOPIC_ATTACH_RETRY_DELAY_ms,
136
- AIOT_CONFIG_MAX_DEVICE_TOPIC_ATTACH_RETRY_DELAY_ms);
135
+ _attachAttempt.reconfigure (AIOT_CONFIG_THING_ID_REQUEST_RETRY_DELAY_ms *
136
+ AIOT_CONFIG_DEVICE_REGISTERED_RETRY_DELAY_k,
137
+ AIOT_CONFIG_MAX_THING_ID_REQUEST_RETRY_DELAY_ms *
138
+ AIOT_CONFIG_MAX_DEVICE_REGISTERED_RETRY_DELAY_k);
137
139
}
138
140
return State::SendCapabilities;
139
141
}
0 commit comments