Declaration of the exponential backoff retry logic utility functions and constants. More...
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | RetryUtilsParams_t |
Represents parameters required for retry logic. More... | |
Macros | |
#define | MAX_RETRY_ATTEMPTS 4U |
Max number of retry attempts. Set this value to 0 if the client must retry forever. | |
#define | INITIAL_RETRY_BACKOFF_SECONDS 1U |
Initial fixed backoff value in seconds between two successive retries. A random jitter value is added to every backoff value. | |
#define | MAX_RETRY_BACKOFF_SECONDS 128U |
Max backoff value in seconds. | |
#define | MAX_JITTER_VALUE_SECONDS 5U |
Max jitter value in seconds. | |
Enumerations | |
enum | RetryUtilsStatus_t { RetryUtilsSuccess = 0, RetryUtilsRetriesExhausted } |
Status for RetryUtils_BackoffAndSleep. More... | |
Functions | |
void | RetryUtils_ParamsReset (RetryUtilsParams_t *pRetryParams) |
Resets the retry timeout value and number of attempts. This function must be called by the application before a new retry attempt. More... | |
RetryUtilsStatus_t | RetryUtils_BackoffAndSleep (RetryUtilsParams_t *pRetryParams) |
Simple platform specific exponential backoff function. The application must use this function between retry failures to add exponential delay. This function will block the calling task for the current timeout value. More... | |
Declaration of the exponential backoff retry logic utility functions and constants.
enum RetryUtilsStatus_t |
Status for RetryUtils_BackoffAndSleep.
Enumerator | |
---|---|
RetryUtilsSuccess | The function returned successfully after sleeping. |
RetryUtilsRetriesExhausted | The function exhausted all retry attempts. |
void RetryUtils_ParamsReset | ( | RetryUtilsParams_t * | pRetryParams | ) |
Resets the retry timeout value and number of attempts. This function must be called by the application before a new retry attempt.
[in,out] | pRetryParams | Structure containing attempts done and timeout value. |
RetryUtilsStatus_t RetryUtils_BackoffAndSleep | ( | RetryUtilsParams_t * | pRetryParams | ) |
Simple platform specific exponential backoff function. The application must use this function between retry failures to add exponential delay. This function will block the calling task for the current timeout value.
[in,out] | pRetryParams | Structure containing retry parameters. |