void BackoffAlgorithm_InitializeParams()

in source/backoff_algorithm.c [84:99]


void BackoffAlgorithm_InitializeParams( BackoffAlgorithmContext_t * pContext,
                                        uint16_t backOffBase,
                                        uint16_t maxBackOff,
                                        uint32_t maxAttempts )
{
    assert( pContext != NULL );

    /* Initialize the context with parameters used in calculating the backoff
     * value for the next retry attempt. */
    pContext->nextJitterMax = backOffBase;
    pContext->maxBackoffDelay = maxBackOff;
    pContext->maxRetryAttempts = maxAttempts;

    /* The total number of retry attempts is zero at initialization. */
    pContext->attemptsDone = 0;
}