uint16_t backOffBase,
uint16_t maxBackOff,
uint32_t maxAttempts );
void BackoffAlgorithm_InitializeParams(BackoffAlgorithmContext_t *pContext, uint16_t backOffBase, uint16_t maxBackOff, uint32_t maxAttempts)
Initializes the context for using backoff algorithm. The parameters are required for calculating the ...
Definition: backoff_algorithm.c:86
Represents parameters required for calculating the back-off delay for the next retry attempt.
Definition: backoff_algorithm.h:69
Initializes the context for using backoff algorithm. The parameters are required for calculating the next retry backoff delay. This function must be called by the application before the first new retry attempt.
- Parameters
-
[out] | pContext | The context to initialize with parameters required for the next backoff delay calculation function. |
[in] | maxBackOff | The maximum backoff delay (in milliseconds) between consecutive retry attempts. |
[in] | backOffBase | The base value (in milliseconds) of backoff delay to use in the exponential backoff and jitter model. |
[in] | maxAttempts | The maximum number of retry attempts. Set the value to BACKOFF_ALGORITHM_RETRY_FOREVER to retry for ever. |
From the Code Example for backoffAlgorithm API, following is the part relevant to the BackoffAlgorithm_InitializeParams API.
char serverAddress[] = "amazon.com";
uint16_t nextRetryBackoff = 0;
RETRY_BACKOFF_BASE_MS,
RETRY_MAX_BACKOFF_DELAY_MS,
RETRY_MAX_ATTEMPTS );
BackoffAlgorithmStatus_t
Status for BackoffAlgorithm_GetNextBackoff.
Definition: backoff_algorithm.h:58
@ BackoffAlgorithmSuccess
The function successfully calculated the next back-off value.
Definition: backoff_algorithm.h:59