AWS IoT Device SDK C  202009.00
SDK for connecting to AWS IoT from a device using embedded C.
retry_utils_posix.c File Reference

Utility implementation of backoff logic, used for attempting retries of failed processes. More...

#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#include "retry_utils.h"

Functions

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...
 
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...
 

Detailed Description

Utility implementation of backoff logic, used for attempting retries of failed processes.

Function Documentation

◆ RetryUtils_BackoffAndSleep()

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.

Parameters
[in,out]pRetryParamsStructure containing retry parameters.
Returns
RetryUtilsSuccess after a successful sleep, RetryUtilsRetriesExhausted when all attempts are exhausted.

◆ RetryUtils_ParamsReset()

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.

Parameters
[in,out]pRetryParamsStructure containing attempts done and timeout value.