Restructure platform directory (#382)

This updates the platform and logging directory and moves it to the following places:
FreeRTOS\FreeRTOS-Plus\Source\Utilities
FreeRTOS\FreeRTOS-Plus\Source\Application-Protocols\network_transport\freertos_plus_tcp

Project files are updated to follow suite. All updated demos are tested to work as expected.
This commit is contained in:
Oscar Michael Abrina 2020-11-05 16:47:43 -08:00 committed by GitHub
parent 330b8c002f
commit 01e59a036c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 224 additions and 218 deletions

View file

@ -20,7 +20,7 @@
*/
/**
* @file freertos_plus_tcp_sockets_wrapper.c
* @file sockets_wrapper.c
* @brief FreeRTOS Sockets connect and disconnect wrapper implementation.
*/
@ -30,7 +30,7 @@
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "freertos_plus_tcp_sockets_wrapper.h"
#include "sockets_wrapper.h"
/*-----------------------------------------------------------*/

View file

@ -20,12 +20,12 @@
*/
/**
* @file freertos_plus_tcp_sockets_wrapper.h
* @file sockets_wrapper.h
* @brief FreeRTOS Sockets connect and disconnect function wrapper.
*/
#ifndef FREERTOS_SOCKETS_WRAPPER_H_
#define FREERTOS_SOCKETS_WRAPPER_H_
#ifndef SOCKETS_WRAPPER_H
#define SOCKETS_WRAPPER_H
/* FreeRTOS+TCP includes. */
#include "FreeRTOS_IP.h"
@ -83,4 +83,4 @@ BaseType_t Sockets_Connect( Socket_t * pTcpSocket,
*/
void Sockets_Disconnect( Socket_t tcpSocket );
#endif /* ifndef FREERTOS_SOCKETS_WRAPPER_H_ */
#endif /* ifndef SOCKETS_WRAPPER_H */

View file

@ -36,10 +36,10 @@
#include "FreeRTOS_Sockets.h"
/* TLS transport header. */
#include "freertos_plus_tcp_mbedtls.h"
#include "using_mbedtls.h"
/* FreeRTOS Socket wrapper include. */
#include "freertos_plus_tcp_sockets_wrapper.h"
#include "sockets_wrapper.h"
/* mbedTLS util includes. */
#include "mbedtls_error.h"

View file

@ -24,8 +24,8 @@
* @brief TLS transport interface header.
*/
#ifndef TLS_FREERTOS_H_
#define TLS_FREERTOS_H_
#ifndef USING_MBEDTLS
#define USING_MBEDTLS
/**************************************************/
/******* DO NOT CHANGE the following order ********/
@ -196,4 +196,4 @@ int32_t TLS_FreeRTOS_send( NetworkContext_t * pNetworkContext,
const void * pBuffer,
size_t bytesToSend );
#endif /* ifndef TLS_FREERTOS_H_ */
#endif /* ifndef USING_MBEDTLS */

View file

@ -39,10 +39,10 @@
#include "FreeRTOS_Sockets.h"
/* TLS transport header. */
#include "freertos_plus_tcp_mbedtls_pkcs11.h"
#include "using_mbedtls_pkcs11.h"
/* FreeRTOS Socket wrapper include. */
#include "freertos_plus_tcp_sockets_wrapper.h"
#include "sockets_wrapper.h"
/* mbedTLS util includes. */
#include "mbedtls_error.h"

View file

@ -27,8 +27,8 @@
* PKCS #11 when using TLS.
*/
#ifndef TLS_FREERTOS_H_
#define TLS_FREERTOS_H_
#ifndef USING_MBEDTLS_PKCS11
#define USING_MBEDTLS_PKCS11
/**************************************************/
/******* DO NOT CHANGE the following order ********/
@ -209,4 +209,4 @@ int32_t TLS_FreeRTOS_send( NetworkContext_t * pNetworkContext,
const void * pBuffer,
size_t bytesToSend );
#endif /* ifndef TLS_FREERTOS_H_ */
#endif /* ifndef USING_MBEDTLS_PKCS11 */

View file

@ -30,10 +30,10 @@
#include "FreeRTOS_Sockets.h"
/* FreeRTOS Socket wrapper include. */
#include "freertos_plus_tcp_sockets_wrapper.h"
#include "sockets_wrapper.h"
/* Transport interface include. */
#include "freertos_plus_tcp_plaintext.h"
#include "using_plaintext.h"
PlaintextTransportStatus_t Plaintext_FreeRTOS_Connect( NetworkContext_t * pNetworkContext,
const char * pHostName,

View file

@ -19,8 +19,8 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef TRANSPORT_INTERFACE_FREERTOS_H_
#define TRANSPORT_INTERFACE_FREERTOS_H_
#ifndef USING_PLAINTEXT_H
#define USING_PLAINTEXT_H
/**************************************************/
/******* DO NOT CHANGE the following order ********/
@ -127,4 +127,4 @@ int32_t Plaintext_FreeRTOS_send( NetworkContext_t * pNetworkContext,
const void * pBuffer,
size_t bytesToSend );
#endif /* ifndef TRANSPORT_INTERFACE_FREERTOS_H_ */
#endif /* ifndef USING_PLAINTEXT_H */

View file

@ -0,0 +1,6 @@
Building a network transport implementation:
1. Go into the sub directory for the TCP/IP stack you are using (e.g. freertos_plus_tcp).
2. Build the wrapper file located in the directory (i.e. sockets_wrapper.c).
3. Select an additional folder based on the TLS stack you are using (e.g. using_mbedtls), or the using_plaintext folder if not using TLS.
4. Build and include all files from the selected folder.

View file

@ -20,7 +20,7 @@
*/
/**
* @file retry_utils.c
* @file exponential_backoff.c
* @brief Utility implementation of backoff logic, used for attempting retries of failed processes.
*/
@ -31,7 +31,7 @@
#include "FreeRTOS.h"
#include "task.h"
#include "retry_utils.h"
#include "exponential_backoff.h"
#define MILLISECONDS_PER_SECOND ( 1000U ) /**< @brief Milliseconds per second. */

View file

@ -20,13 +20,13 @@
*/
/**
* @file retry_utils.h
* @file exponential_backoff.h
* @brief Declaration of the exponential backoff retry logic utility functions
* and constants.
*/
#ifndef RETRY_UTILS_H_
#define RETRY_UTILS_H_
#ifndef EXPONENTIAL_BACKOFF_H
#define EXPONENTIAL_BACKOFF_H
/* Standard include. */
#include <stdint.h>
@ -66,11 +66,11 @@
* The functions are used as shown in the diagram below. This is the exponential
* backoff with jitter loop:
*
* @image html retry_utils_flow.png width=25%
* @image html exponential_backoff_flow.png width=25%
*
* The following steps give guidance on implementing the Retry Utils. An example
* implementation of the Retry Utils for a POSIX platform can be found in file
* @ref retry_utils_posix.c.
* implementation of the Retry Utils for the FreeRTOS platform can be found in file
* @ref exponential_backoff.c.
*
* -# Implementing @ref RetryUtils_ParamsReset
* @snippet this define_retryutils_paramsreset
@ -242,4 +242,4 @@ void RetryUtils_ParamsReset( RetryUtilsParams_t * pRetryParams );
*/
RetryUtilsStatus_t RetryUtils_BackoffAndSleep( RetryUtilsParams_t * pRetryParams );
#endif /* ifndef RETRY_UTILS_H_ */
#endif /* ifndef EXPONENTIAL_BACKOFF_H */