Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version for release #29

Merged
merged 9 commits into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ jobs:
uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main
with:
config: .github/memory_statistics_config.json
check_against: docs/doxygen/include/size_table.html
check_against: docs/doxygen/include/size_table.md
2 changes: 1 addition & 1 deletion .github/workflows/memory_statistics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: size_table
path: size_table.html
path: size_table.md
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Changelog for backoffAlgorithm Library

## Changes after v1.0.1
- [#27](https://github.com/FreeRTOS/backoffAlgorithm/pull/26) Fix incorrect comment about use of BACKOFF_ALGORITHM_RETRY_FOREVER constant in BackoffAlgorithm_GetNextBackoff API.
## v1.1.0 (July 2021)

## v1.0.1 (February 2020)
### Changes

- [#29](https://github.com/FreeRTOS/backoffAlgorithm/pull/29) Set BACKOFF_ALGORITHM_RETRY_FOREVER to be nonzero and add header guards for C++ linkage.
- [#27](https://github.com/FreeRTOS/backoffAlgorithm/pull/27) Fix incorrect comment about use of BACKOFF_ALGORITHM_RETRY_FOREVER constant in BackoffAlgorithm_GetNextBackoff API.

## v1.0.1 (February 2021)

### Changes

Expand All @@ -16,4 +20,4 @@ This is the first release of the backoffAlgorithm library in this repository.

The backoffAlgorithm library is a utility library to calculate backoff period using an exponential backoff with jitter algorithm for retrying network operations (like failed network connection with server).
This library uses the "Full Jitter" strategy for the exponential backoff with jitter algorithm.
More information about the algorithm can be seen in the [Exponential Backoff and Jitter](https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/) AWS blog.
More information about the algorithm can be seen in the [Exponential Backoff and Jitter](https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/) AWS blog.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Besides, in an environment with poor connectivity, a client can get disconnected
A backoff strategy helps the client to conserve battery by not repeatedly attempting reconnections when they are
unlikely to succeed.

See memory requirements for this library [here](https://docs.aws.amazon.com/embedded-csdk/202103.00/lib-ref/libraries/standard/backoffAlgorithm/docs/doxygen/output/html/index.html#backoff_algorithm_memory_requirements).
See memory requirements for this library [here](./docs/doxygen/include/size_table.md).

**backoffAlgorithm v1.0.0 [source code](https://github.com/FreeRTOS/backoffAlgorithm/tree/v1.0.0/source) is part of the [FreeRTOS 202012.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202012.00-LTS) release.**

Expand Down Expand Up @@ -129,7 +129,7 @@ By default, the submodules in this repository are configured with `update=none`

To build unit tests, the submodule dependency of Unity is required. Use the following command to clone the submodule:
```
git submodule update --checkout --init --recursive --test/unit-test/Unity
git submodule update --checkout --init --recursive test/unit-test/Unity
```

### Platform Prerequisites
Expand Down
2 changes: 1 addition & 1 deletion docs/doxygen/config.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "backoffAlgorithm"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "v1.0.1"
PROJECT_NUMBER = "v1.1.0"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion docs/doxygen/pages.dox
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ For a reference example of using the library, refer to the related README sectio
@section backoff_algorithm_memory_requirements Memory Requirements
@brief Memory requirements of the backoffAlgorithm library.

@include{doc} size_table.html
@include{doc} size_table.md

@section backoff_algorithm_design Design
@brief backoffAlgorithm Library Design
Expand Down
3 changes: 2 additions & 1 deletion lexicon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mainpage
maxattempts
maxbackoff
maxretryattempts
md
min
misra
mockrng
Expand All @@ -56,4 +57,4 @@ td
toolchain
tr
trng
utils
utils
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name : "backoffAlgorithm"
version: "v1.0.1"
version: "v1.1.0"
description: |
"Algorithm for calculating exponential backoff with jitter for network retry attempts.\n"
license: "MIT"
8 changes: 4 additions & 4 deletions source/backoff_algorithm.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* backoffAlgorithm v1.0.1
* backoffAlgorithm v1.1.0
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down Expand Up @@ -44,9 +44,9 @@ BackoffAlgorithmStatus_t BackoffAlgorithm_GetNextBackoff( BackoffAlgorithmContex
assert( pRetryContext != NULL );
assert( pNextBackOff != NULL );

/* If maxRetryAttempts state of the context is set to 0, retry forever. */
if( ( pRetryContext->attemptsDone < pRetryContext->maxRetryAttempts ) ||
( pRetryContext->maxRetryAttempts == BACKOFF_ALGORITHM_RETRY_FOREVER ) )
/* If maxRetryAttempts state of the context is set to the maximum, retry forever. */
if( ( pRetryContext->maxRetryAttempts == BACKOFF_ALGORITHM_RETRY_FOREVER ) ||
( pRetryContext->attemptsDone < pRetryContext->maxRetryAttempts ) )
{
/* The next backoff value is a random value between 0 and the maximum jitter value
* for the retry attempt. */
Expand Down
16 changes: 14 additions & 2 deletions source/include/backoff_algorithm.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* backoffAlgorithm v1.0.1
* backoffAlgorithm v1.1.0
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down Expand Up @@ -36,11 +36,17 @@
/* Standard include. */
#include <stdint.h>

/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */

/**
* @ingroup backoff_algorithm_constants
* @brief Constant to represent unlimited number of retry attempts.
*/
#define BACKOFF_ALGORITHM_RETRY_FOREVER ( 0U )
#define BACKOFF_ALGORITHM_RETRY_FOREVER ( UINT32_MAX )

/**
* @ingroup backoff_algorithm_enum_types
Expand Down Expand Up @@ -130,4 +136,10 @@ BackoffAlgorithmStatus_t BackoffAlgorithm_GetNextBackoff( BackoffAlgorithmContex
uint16_t * pNextBackOff );
/* @[define_backoffalgorithm_getnextbackoff] */

/* *INDENT-OFF* */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */

#endif /* ifndef BACKOFF_ALGORITHM_H_ */
2 changes: 1 addition & 1 deletion test/unit-test/backoff_algorithm_utest.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* backoffAlgorithm v1.0.1
* backoffAlgorithm v1.1.0
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/catch_assert.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* backoffAlgorithm v1.0.1
* backoffAlgorithm v1.1.0
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down