mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2025-12-16 18:08:11 +08:00
Use CI-CD-Github-Actions for spelling and formatting, add in the bot formatting action, update the CI-CD workflow files. Fix incorrect spelling and formatting on files. (#1083)
* Use new version of CI-CD Actions, checkout@v3 instead of checkout@v2 on all jobs * Use cSpell spell check, and use ubuntu-20.04 for formatting check * Add in bot formatting action * Update freertos_demo.yml and freertos_plus_demo.yml files to increase github log readability * Add in a Qemu demo onto the workflows.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -538,7 +538,7 @@ static BaseType_t prvCellularSocketRegisterCallback( CellularSocketHandle_t cell
|
||||
|
||||
if( socketStatus != CELLULAR_SUCCESS )
|
||||
{
|
||||
LogError( ( "Failed to SocketRegisterSocketOpenCallbac. Socket status %d.", socketStatus ) );
|
||||
LogError( ( "Failed to SocketRegisterSocketOpenCallback. Socket status %d.", socketStatus ) );
|
||||
retRegCallback = TCP_SOCKETS_ERRNO_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -93,15 +93,17 @@ BaseType_t Sockets_Connect( Socket_t * pTcpSocket,
|
||||
serverAddress.sin_port = FreeRTOS_htons( port );
|
||||
serverAddress.sin_len = ( uint8_t ) sizeof( serverAddress );
|
||||
|
||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||
serverAddress.sin_address.ulIP_IPv4 = ( uint32_t ) FreeRTOS_gethostbyname( pHostName );
|
||||
/* Check for errors from DNS lookup. */
|
||||
if( serverAddress.sin_address.ulIP_IPv4 == 0U )
|
||||
#else
|
||||
serverAddress.sin_addr = ( uint32_t ) FreeRTOS_gethostbyname( pHostName );
|
||||
/* Check for errors from DNS lookup. */
|
||||
if( serverAddress.sin_addr == 0U )
|
||||
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||
serverAddress.sin_address.ulIP_IPv4 = ( uint32_t ) FreeRTOS_gethostbyname( pHostName );
|
||||
|
||||
/* Check for errors from DNS lookup. */
|
||||
if( serverAddress.sin_address.ulIP_IPv4 == 0U )
|
||||
#else
|
||||
serverAddress.sin_addr = ( uint32_t ) FreeRTOS_gethostbyname( pHostName );
|
||||
|
||||
/* Check for errors from DNS lookup. */
|
||||
if( serverAddress.sin_addr == 0U )
|
||||
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
||||
|
||||
{
|
||||
LogError( ( "Failed to connect to server: DNS resolution failed: Hostname=%s.",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "FreeRTOS_Sockets.h"
|
||||
#include "FreeRTOS_DNS.h"
|
||||
|
||||
#define SOCKETS_INVALID_SOCKET ( ( Socket_t ) ~0U )
|
||||
#define SOCKETS_INVALID_SOCKET ( ( Socket_t ) ~0U )
|
||||
|
||||
/**
|
||||
* @brief Establish a connection to server.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -117,15 +117,17 @@ BaseType_t TCP_Sockets_Connect( Socket_t * pTcpSocket,
|
||||
serverAddress.sin_port = FreeRTOS_htons( port );
|
||||
serverAddress.sin_len = ( uint8_t ) sizeof( serverAddress );
|
||||
|
||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||
serverAddress.sin_address.ulIP_IPv4 = ( uint32_t ) FreeRTOS_gethostbyname( pHostName );
|
||||
/* Check for errors from DNS lookup. */
|
||||
if( serverAddress.sin_address.ulIP_IPv4 == 0U )
|
||||
#else
|
||||
serverAddress.sin_addr = ( uint32_t ) FreeRTOS_gethostbyname( pHostName );
|
||||
/* Check for errors from DNS lookup. */
|
||||
if( serverAddress.sin_addr == 0U )
|
||||
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
||||
#if defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 )
|
||||
serverAddress.sin_address.ulIP_IPv4 = ( uint32_t ) FreeRTOS_gethostbyname( pHostName );
|
||||
|
||||
/* Check for errors from DNS lookup. */
|
||||
if( serverAddress.sin_address.ulIP_IPv4 == 0U )
|
||||
#else
|
||||
serverAddress.sin_addr = ( uint32_t ) FreeRTOS_gethostbyname( pHostName );
|
||||
|
||||
/* Check for errors from DNS lookup. */
|
||||
if( serverAddress.sin_addr == 0U )
|
||||
#endif /* defined( ipconfigIPv4_BACKWARD_COMPATIBLE ) && ( ipconfigIPv4_BACKWARD_COMPATIBLE == 0 ) */
|
||||
|
||||
{
|
||||
LogError( ( "Failed to connect to server: DNS resolution failed: Hostname=%s.",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -210,12 +210,12 @@ static TlsTransportStatus_t tlsHandshake( NetworkContext_t * pNetworkContext,
|
||||
* @brief Initialize mbedTLS.
|
||||
*
|
||||
* @param[out] entropyContext mbed TLS entropy context for generation of random numbers.
|
||||
* @param[out] ctrDrgbContext mbed TLS CTR DRBG context for generation of random numbers.
|
||||
* @param[out] ctrDrbgContext mbed TLS CTR DRBG context for generation of random numbers.
|
||||
*
|
||||
* @return #TLS_TRANSPORT_SUCCESS, or #TLS_TRANSPORT_INTERNAL_ERROR.
|
||||
*/
|
||||
static TlsTransportStatus_t initMbedtls( mbedtls_entropy_context * pEntropyContext,
|
||||
mbedtls_ctr_drbg_context * pCtrDrgbContext );
|
||||
mbedtls_ctr_drbg_context * pCtrDrbgContext );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
@@ -240,7 +240,7 @@ static void sslContextFree( SSLContext_t * pSslContext )
|
||||
mbedtls_x509_crt_free( &( pSslContext->clientCert ) );
|
||||
mbedtls_pk_free( &( pSslContext->privKey ) );
|
||||
mbedtls_entropy_free( &( pSslContext->entropyContext ) );
|
||||
mbedtls_ctr_drbg_free( &( pSslContext->ctrDrgbContext ) );
|
||||
mbedtls_ctr_drbg_free( &( pSslContext->ctrDrbgContext ) );
|
||||
mbedtls_ssl_config_free( &( pSslContext->config ) );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
@@ -321,7 +321,7 @@ static int32_t setPrivateKey( SSLContext_t * pSslContext,
|
||||
privateKeySize,
|
||||
NULL, 0,
|
||||
mbedtls_ctr_drbg_random,
|
||||
&( pSslContext->ctrDrgbContext ) );
|
||||
&( pSslContext->ctrDrbgContext ) );
|
||||
#endif /* if MBEDTLS_VERSION_NUMBER < 0x03000000 */
|
||||
|
||||
if( mbedtlsError != 0 )
|
||||
@@ -351,7 +351,7 @@ static int32_t setCredentials( SSLContext_t * pSslContext,
|
||||
MBEDTLS_SSL_VERIFY_REQUIRED );
|
||||
mbedtls_ssl_conf_rng( &( pSslContext->config ),
|
||||
mbedtls_ctr_drbg_random,
|
||||
&( pSslContext->ctrDrgbContext ) );
|
||||
&( pSslContext->ctrDrbgContext ) );
|
||||
mbedtls_ssl_conf_cert_profile( &( pSslContext->config ),
|
||||
&( pSslContext->certProfile ) );
|
||||
|
||||
@@ -429,6 +429,7 @@ static void setOptionalConfigurations( SSLContext_t * pSslContext,
|
||||
|
||||
/* Set Maximum Fragment Length if enabled. */
|
||||
#ifdef MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
|
||||
|
||||
/* Enable the max fragment extension. 4096 bytes is currently the largest fragment size permitted.
|
||||
* See RFC 8449 https://tools.ietf.org/html/rfc8449 for more information.
|
||||
*
|
||||
@@ -574,7 +575,7 @@ static TlsTransportStatus_t tlsHandshake( NetworkContext_t * pNetworkContext,
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static TlsTransportStatus_t initMbedtls( mbedtls_entropy_context * pEntropyContext,
|
||||
mbedtls_ctr_drbg_context * pCtrDrgbContext )
|
||||
mbedtls_ctr_drbg_context * pCtrDrbgContext )
|
||||
{
|
||||
TlsTransportStatus_t returnStatus = TLS_TRANSPORT_SUCCESS;
|
||||
int32_t mbedtlsError = 0;
|
||||
@@ -586,7 +587,7 @@ static TlsTransportStatus_t initMbedtls( mbedtls_entropy_context * pEntropyConte
|
||||
|
||||
/* Initialize contexts for random number generation. */
|
||||
mbedtls_entropy_init( pEntropyContext );
|
||||
mbedtls_ctr_drbg_init( pCtrDrgbContext );
|
||||
mbedtls_ctr_drbg_init( pCtrDrbgContext );
|
||||
|
||||
if( mbedtlsError != 0 )
|
||||
{
|
||||
@@ -599,7 +600,7 @@ static TlsTransportStatus_t initMbedtls( mbedtls_entropy_context * pEntropyConte
|
||||
if( returnStatus == TLS_TRANSPORT_SUCCESS )
|
||||
{
|
||||
/* Seed the random number generator. */
|
||||
mbedtlsError = mbedtls_ctr_drbg_seed( pCtrDrgbContext,
|
||||
mbedtlsError = mbedtls_ctr_drbg_seed( pCtrDrbgContext,
|
||||
mbedtls_entropy_func,
|
||||
pEntropyContext,
|
||||
NULL,
|
||||
@@ -686,7 +687,7 @@ TlsTransportStatus_t TLS_FreeRTOS_Connect( NetworkContext_t * pNetworkContext,
|
||||
isSocketConnected = pdTRUE;
|
||||
|
||||
returnStatus = initMbedtls( &( pTlsTransportParams->sslContext.entropyContext ),
|
||||
&( pTlsTransportParams->sslContext.ctrDrgbContext ) );
|
||||
&( pTlsTransportParams->sslContext.ctrDrbgContext ) );
|
||||
}
|
||||
|
||||
/* Initialize TLS contexts and set credentials. */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -97,7 +97,7 @@ typedef struct SSLContext
|
||||
mbedtls_x509_crt clientCert; /**< @brief Client certificate context. */
|
||||
mbedtls_pk_context privKey; /**< @brief Client private key context. */
|
||||
mbedtls_entropy_context entropyContext; /**< @brief Entropy context for random number generation. */
|
||||
mbedtls_ctr_drbg_context ctrDrgbContext; /**< @brief CTR DRBG context for random number generation. */
|
||||
mbedtls_ctr_drbg_context ctrDrbgContext; /**< @brief CTR DRBG context for random number generation. */
|
||||
} SSLContext_t;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -118,7 +118,7 @@ PlaintextTransportStatus_t Plaintext_FreeRTOS_Disconnect( const NetworkContext_t
|
||||
|
||||
/**
|
||||
* @brief Receives data from an established TCP connection.
|
||||
*
|
||||
*
|
||||
* @note When the number of bytes requested is 1, the TCP socket's Rx stream
|
||||
* is checked for available bytes to read. If there are none, this function
|
||||
* immediately returns 0 without blocking.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* FreeRTOS V202212.00
|
||||
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* 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
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
@@ -71,8 +71,8 @@
|
||||
*/
|
||||
typedef struct SSLContext
|
||||
{
|
||||
WOLFSSL_CTX* ctx; /**< @brief wolfSSL context */
|
||||
WOLFSSL* ssl; /**< @brief wolfSSL ssl session context */
|
||||
WOLFSSL_CTX * ctx; /**< @brief wolfSSL context */
|
||||
WOLFSSL * ssl; /**< @brief wolfSSL ssl session context */
|
||||
} SSLContext_t;
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,10 +6,10 @@ the same transport interface definition.
|
||||
|
||||
Directories:
|
||||
|
||||
+ coreMQTT contains the implementation of the coreMQTT library.
|
||||
+ coreMQTT contains the implementation of the coreMQTT library.
|
||||
+ coreMQTT-Agent contains the implementation of the coreMQTT Agent library.
|
||||
+ coreHTTP contains the implementation of the coreHTTP library.
|
||||
+ coreSNTP contains the implementation of the coreSNTP library.
|
||||
+ network_transport contains multiple implementations for the transport interface.
|
||||
+ network_transport contains multiple implementations for the transport interface.
|
||||
|
||||
For more details on the above libraries, see: https://www.freertos.org/application-protocols.html.
|
||||
|
||||
Reference in New Issue
Block a user