Skip to content

Commit

Permalink
Fix incorrect spellings, add needed words to the word list, update ma…
Browse files Browse the repository at this point in the history
…nifest.yml
  • Loading branch information
Skptak committed Aug 25, 2023
1 parent 540d584 commit 2da14e2
Show file tree
Hide file tree
Showing 142 changed files with 278 additions and 1,294 deletions.
39 changes: 39 additions & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,47 @@
ABCDEFGHIJKLMNOPQRSTUVWXY
CBMC
CBOR
CMOCK
CMock
Cmock
Coverity
DCMOCK
DNDEBUG
DUNITY
FOOB
FOOBA
FOOBDA
MISRA
MQTT
Misra
OPTIMISED
Wunused
cbmc
cbor
cborvalue
cmock
coverity
ctest
deinitializing
isystem
lcov
lpthread
misra
mqdes
mqttstatus
mqueue
osstatus
otahttppage
otahttpsectionoverview
otamqttpage
otamqttsectionoverview
otaosfipage
otaosfisectionoverview
otapalpage
otapalsectionoverview
pbuffer
pclienttoken
sinclude
stringz
tinycbor
utest
2 changes: 2 additions & 0 deletions .github/.exclude-urls.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://dummy-url.com/ota.bin

1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ jobs:
uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@v2
with:
path: ./
allowlist-file: .github/.exclude-urls.txt

verify-manifest:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions MISRA.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ _Ref 8.13.1_
- MISRA C-2012 Rule 8.13 There are multiple functions that all use the same function header so that
they can be assigned to function pointers in a seamless manner. There are a few that modify the
OtaAgentContext_t that gets passed in. In order to allow convienent assignment of these function pointers
we supress this rule on this function that can't have const added.
we suppress this rule on this function that can't have const added.

#### Rule 10.1
_Ref 10.1.1_
Expand All @@ -44,7 +44,7 @@ _Ref 10.8.1_
_Ref 11.8.1_

- Misra C-2012 Rule 11.8 will raise an error if certain variables are not marked as const, even if the variables do get
modified in that function. As such there are two occurences where to get around that error, we supress these.
modified in that function. As such there are two occurrences where to get around that error, we suppress these.

#### Rule 19.2
_Ref 19.2.1_
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Please refer to the demos of the AWS IoT Over-the-air Updates library in the fol
| Platform | Location |
| :-: | :-: |
| POSIX | [AWS IoT Device SDK for Embedded C](https://github.com/aws/aws-iot-device-sdk-embedded-C/tree/main/demos/ota) |
| FreeRTOS | [FreeRTOS/FreeRTOS](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/AWS/Ota_Windows_Simulator) |
| FreeRTOS | [FreeRTOS/FreeRTOS](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/AWS/Ota_Windows_Simulator) |
| FreeRTOS | [FreeRTOS AWS Reference Integrations](https://github.com/aws/amazon-freertos/tree/main/demos/ota) |

## Documentation
Expand Down
30 changes: 26 additions & 4 deletions manifest.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
name : "ota-for-aws-iot-embedded-sdk"
name: "ota-for-aws-iot-embedded-sdk"
version: "v3.4.0"
description: "Client library for using the AWS Over-the-air Update service on embedded devices."
description:
"Client library for using the AWS Over-the-air Update service on embedded
devices."
license: "MIT"

dependencies:
- name : "coreJSON"
- name: "coreJSON"
version: "v3.2.0"
license: "MIT"
repository:
type: "git"
url: "https://github.com/FreeRTOS/coreJSON.git"
- name : "tinycbor"
path: source/dependency/coreJSON

- name: "tinycbor"
version: "v0.5.4"
license: "MIT"
repository:
type: "git"
url: "https://github.com/intel/tinycbor.git"
path: source/dependency/3rdparty/tinycbor

- name: "CMock"
version: "v2.5.2"
license: "MIT"
repository:
type: "git"
url: "https://github.com/ThrowTheSwitch/CMock.git"
path: test/unit-test/CMock

- name: "FreeRTOS-Kernel"
version: "V10.4.5"
license: "MIT"
repository:
type: "git"
path: test/cbmc/FreeRTOS-Kernel
url: "https://github.com/FreeRTOS/FreeRTOS-Kernel.git"
File renamed without changes.
2 changes: 1 addition & 1 deletion source/include/ota.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ typedef struct OtaJobDocument
* OtaJobEventActivate|OtaJobDocument_t|status and reason
* OtaJobEventFail|OtaJobDocument_t|status, reason and subReason
* OtaJobEventStartTest|NULL|nothing
* OtaJobEventProcessed|OtaEventData_t|data buffer inputed from user by OTA_SignalEvent
* OtaJobEventProcessed|OtaEventData_t|data buffer inputted from user by OTA_SignalEvent
* OtaJobEventSelfTestFailed|NULL|nothing
* OtaJobEventParseCustomJob|OtaJobDocument_t|pJobId, jobIdLength, pJobDocJson, and jobDocLength
* OtaJobEventReceivedJob|OtaJobDocument_t|pJobId, jobIdLength, pJobDocJson, jobDocLength, and fileTypeId
Expand Down
36 changes: 18 additions & 18 deletions source/include/ota_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,24 +190,24 @@ typedef enum
*/
typedef enum
{
DocParseErrUnknown = -1, /*!< The error code has not yet been set by a logic path. */
DocParseErrNone = 0, /*!< No error in parsing the document. */
DocParseErrOutOfMemory, /*!< We failed to allocate enough dynamic memory for a field. */
DocParseErrUserBufferInsuffcient, /*!< The supplied user buffer is insufficient for a field. */
DocParseErrFieldTypeMismatch, /*!< The field type parsed does not match the document model. */
DocParseErrBase64Decode, /*!< There was an error decoding the base64 data. */
DocParseErrInvalidNumChar, /*!< There was an invalid character in a numeric value field. */
DocParseErrDuplicatesNotAllowed, /*!< A duplicate parameter was found in the job document. */
DocParseErrMalformedDoc, /*!< The document didn't fulfill the model requirements. */
DocParseErr_InvalidJSONBuffer, /*!< When the JSON is malformed and not parsed correctly. */
DocParseErrNullModelPointer, /*!< The pointer to the document model was NULL. */
DocParseErrNullBodyPointer, /*!< The document model's internal body pointer was NULL. */
DocParseErrNullDocPointer, /*!< The pointer to the JSON document was NULL. */
DocParseErrTooManyParams, /*!< The document model has more parameters than we can handle. */
DocParseErrParamKeyNotInModel, /*!< The document model does not include the specified parameter key. */
DocParseErrInvalidModelParamType, /*!< The document model specified an invalid parameter type. */
DocParseErrInvalidToken, /*!< The Jasmine token was invalid, producing a NULL pointer. */
DocParseErrEmptyJobDoc /*!< The document is valid but does not contain all necessary fields. */
DocParseErrUnknown = -1, /*!< The error code has not yet been set by a logic path. */
DocParseErrNone = 0, /*!< No error in parsing the document. */
DocParseErrOutOfMemory, /*!< We failed to allocate enough dynamic memory for a field. */
DocParseErrUserBufferInsufficient, /*!< The supplied user buffer is insufficient for a field. */
DocParseErrFieldTypeMismatch, /*!< The field type parsed does not match the document model. */
DocParseErrBase64Decode, /*!< There was an error decoding the base64 data. */
DocParseErrInvalidNumChar, /*!< There was an invalid character in a numeric value field. */
DocParseErrDuplicatesNotAllowed, /*!< A duplicate parameter was found in the job document. */
DocParseErrMalformedDoc, /*!< The document didn't fulfill the model requirements. */
DocParseErr_InvalidJSONBuffer, /*!< When the JSON is malformed and not parsed correctly. */
DocParseErrNullModelPointer, /*!< The pointer to the document model was NULL. */
DocParseErrNullBodyPointer, /*!< The document model's internal body pointer was NULL. */
DocParseErrNullDocPointer, /*!< The pointer to the JSON document was NULL. */
DocParseErrTooManyParams, /*!< The document model has more parameters than we can handle. */
DocParseErrParamKeyNotInModel, /*!< The document model does not include the specified parameter key. */
DocParseErrInvalidModelParamType, /*!< The document model specified an invalid parameter type. */
DocParseErrInvalidToken, /*!< The Jasmine token was invalid, producing a NULL pointer. */
DocParseErrEmptyJobDoc /*!< The document is valid but does not contain all necessary fields. */
} DocParseErr_t;

/**
Expand Down
78 changes: 39 additions & 39 deletions source/ota.c
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,7 @@ static DocParseErr_t extractAndStoreArray( const char * pKey,
{
if( *pParamSizeAdd < ( valueLength + 1U ) )
{
err = DocParseErrUserBufferInsuffcient;
err = DocParseErrUserBufferInsufficient;

LogError( ( "Insufficient user memory: "
"[key: valueLength]=[%s: %lu]",
Expand Down Expand Up @@ -2175,62 +2175,62 @@ static void handleSelfTestJobDoc( const OtaFileContext_t * pFileContext )
LogInfo( ( "In self test mode." ) );

#if ( otaconfigAllowDowngrade == 1U )
{
LogWarn( ( "OTA Config Allow Downgrade has been set to 1, bypassing version check: Begin testing file: File ID=%d",
( int ) otaAgent.serverFileID ) );

/* Downgrade is allowed so this means we're ready to start self test phase.
* Set image state accordingly and update job status with self test identifier.
*/
otaErr = setImageStateWithReason( OtaImageStateTesting, ( uint32_t ) errVersionCheck );

if( otaErr != OtaErrNone )
{
LogError( ( "Failed to set image state to testing: OtaErr_t=%s", OTA_Err_strerror( otaErr ) ) );
}
}
#else /* if ( otaconfigAllowDowngrade == 1U ) */
{
/* Validate version of the update received.*/
errVersionCheck = validateUpdateVersion( pFileContext );

if( errVersionCheck == OtaErrNone )
{
LogWarn( ( "OTA Config Allow Downgrade has been set to 1, bypassing version check: Begin testing file: File ID=%d",
LogInfo( ( "Image version is valid: Begin testing file: File ID=%d",
( int ) otaAgent.serverFileID ) );

/* Downgrade is allowed so this means we're ready to start self test phase.
/* The running firmware version is newer than the firmware that performed
* the update so this means we're ready to start the self test phase.
* Set image state accordingly and update job status with self test identifier.
*/

otaErr = setImageStateWithReason( OtaImageStateTesting, ( uint32_t ) errVersionCheck );

if( otaErr != OtaErrNone )
{
LogError( ( "Failed to set image state to testing: OtaErr_t=%s", OTA_Err_strerror( otaErr ) ) );
}
}
#else /* if ( otaconfigAllowDowngrade == 1U ) */
else
{
/* Validate version of the update received.*/
errVersionCheck = validateUpdateVersion( pFileContext );

if( errVersionCheck == OtaErrNone )
{
LogInfo( ( "Image version is valid: Begin testing file: File ID=%d",
( int ) otaAgent.serverFileID ) );
LogWarn( ( "New image is being rejected: Application version of the new image is invalid: "
"OtaErr_t=%s", OTA_Err_strerror( errVersionCheck ) ) );

/* The running firmware version is newer than the firmware that performed
* the update so this means we're ready to start the self test phase.
* Set image state accordingly and update job status with self test identifier.
*/
otaErr = setImageStateWithReason( OtaImageStateRejected, ( uint32_t ) errVersionCheck );

otaErr = setImageStateWithReason( OtaImageStateTesting, ( uint32_t ) errVersionCheck );

if( otaErr != OtaErrNone )
{
LogError( ( "Failed to set image state to testing: OtaErr_t=%s", OTA_Err_strerror( otaErr ) ) );
}
}
else
if( otaErr != OtaErrNone )
{
LogWarn( ( "New image is being rejected: Application version of the new image is invalid: "
"OtaErr_t=%s", OTA_Err_strerror( errVersionCheck ) ) );

otaErr = setImageStateWithReason( OtaImageStateRejected, ( uint32_t ) errVersionCheck );

if( otaErr != OtaErrNone )
{
LogError( ( "Failed to set image state to rejected: OtaErr_t=%s", OTA_Err_strerror( otaErr ) ) );
}
LogError( ( "Failed to set image state to rejected: OtaErr_t=%s", OTA_Err_strerror( otaErr ) ) );
}

/* Application callback for self-test failure.*/
callOtaCallback( OtaJobEventSelfTestFailed, NULL );
/* Application callback for self-test failure.*/
callOtaCallback( OtaJobEventSelfTestFailed, NULL );

/* Handle self-test failure in the platform specific implementation,
* example, reset the device in case of firmware upgrade. */
( void ) otaAgent.pOtaInterface->pal.reset( &( otaAgent.fileContext ) );
}
/* Handle self-test failure in the platform specific implementation,
* example, reset the device in case of firmware upgrade. */
( void ) otaAgent.pOtaInterface->pal.reset( &( otaAgent.fileContext ) );
}
}
#endif /* if ( otaconfigAllowDowngrade == 1U ) */
}

Expand Down Expand Up @@ -2998,7 +2998,7 @@ static void executeHandler( uint32_t index,
}
else if( err == OtaErrEmptyJobDocument )
{
LogInfo( ( "Empty job docuemnt found for event=[%s]", pOtaEventStrings[ pEventMsg->eventId ] ) );
LogInfo( ( "Empty job document found for event=[%s]", pOtaEventStrings[ pEventMsg->eventId ] ) );
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions source/ota_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ OtaErr_t initFileTransfer_Http( const OtaAgentContext_t * pAgentCtx )

if( httpStatus != OtaHttpSuccess )
{
LogError( ( "Error occured while initializing http:"
LogError( ( "Error occurred while initializing http:"
"OtaHttpStatus_t=%s"
, OTA_HTTP_strerror( httpStatus ) ) );
}
Expand Down Expand Up @@ -112,7 +112,7 @@ OtaErr_t requestDataBlock_Http( OtaAgentContext_t * pAgentCtx )

if( httpStatus != OtaHttpSuccess )
{
LogError( ( "Error occured while requesting data block:"
LogError( ( "Error occurred while requesting data block:"
"OtaHttpStatus_t=%s"
, OTA_HTTP_strerror( httpStatus ) ) );
}
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )

# Include filepaths for source and include.
include( ${MODULE_ROOT_DIR}/otaFilePaths.cmake )
include( ${MODULE_ROOT_DIR}/otaDependenyFilePaths.cmake )
include( ${MODULE_ROOT_DIR}/otaDependencyFilePaths.cmake )

# Target for Coverity analysis that builds the library.
add_library( coverity_analysis
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/include/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ extern void vLoggingPrint( const char * pcMessage );

/* The address of an echo server that will be used by the two demo echo client
* tasks:
* http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Echo_Clients.html,
* http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Echo_Clients.html
* http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/UDP_Echo_Clients.html. */
#define configECHO_SERVER_ADDR0 192
#define configECHO_SERVER_ADDR1 168
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/proofs/Free_FreeRTOS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To run the proof.
* Run `make`.
* Open html/index.html in a web browser.

To use [`arpa`](https://github.com/awslabs/aws-proof-build-assistant) to simplify writing Makefiles.
To use [`arpa`](https://awslabs.github.io/aws-proof-build-assistant) to simplify writing Makefiles.
-------------

* Run `make arpa` to generate a Makefile.arpa that contains relevant build information for the proof.
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/proofs/Malloc_FreeRTOS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To run the proof.
* Run `make`.
* Open html/index.html in a web browser.

To use [`arpa`](https://github.com/awslabs/aws-proof-build-assistant) to simplify writing Makefiles.
To use [`arpa`](https://awslabs.github.io/aws-proof-build-assistant) to simplify writing Makefiles.
-------------

* Run `make arpa` to generate a Makefile.arpa that contains relevant build information for the proof.
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/proofs/OTA_ActivateNewImage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To run the proof.
* Run `make`.
* Open html/index.html in a web browser.

To use [`arpa`](https://github.com/awslabs/aws-proof-build-assistant) to simplify writing Makefiles.
To use [`arpa`](https://awslabs.github.io/aws-proof-build-assistant) to simplify writing Makefiles.
-------------

* Run `make arpa` to generate a Makefile.arpa that contains relevant build information for the proof.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To run the proof.
* Run `make`.
* Open html/index.html in a web browser.

To use [`arpa`](https://github.com/awslabs/aws-proof-build-assistant) to simplify writing Makefiles.
To use [`arpa`](https://awslabs.github.io/aws-proof-build-assistant) to simplify writing Makefiles.
-------------

* Run `make arpa` to generate a Makefile.arpa that contains relevant build information for the proof.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To run the proof.
* Run `make`.
* Open html/index.html in a web browser.

To use [`arpa`](https://github.com/awslabs/aws-proof-build-assistant) to simplify writing Makefiles.
To use [`arpa`](https://awslabs.github.io/aws-proof-build-assistant) to simplify writing Makefiles.
-------------

* Run `make arpa` to generate a Makefile.arpa that contains relevant build information for the proof.
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/proofs/OTA_CheckForUpdate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To run the proof.
* Run `make`.
* Open html/index.html in a web browser.

To use [`arpa`](https://github.com/awslabs/aws-proof-build-assistant) to simplify writing Makefiles.
To use [`arpa`](https://awslabs.github.io/aws-proof-build-assistant) to simplify writing Makefiles.
-------------

* Run `make arpa` to generate a Makefile.arpa that contains relevant build information for the proof.
Expand Down
2 changes: 1 addition & 1 deletion test/cbmc/proofs/OTA_Err_strerror/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To run the proof.
* Run `make`.
* Open html/index.html in a web browser.

To use [`arpa`](https://github.com/awslabs/aws-proof-build-assistant) to simplify writing Makefiles.
To use [`arpa`](https://awslabs.github.io/aws-proof-build-assistant) to simplify writing Makefiles.
-------------

* Run `make arpa` to generate a Makefile.arpa that contains relevant build information for the proof.
Expand Down
Loading

0 comments on commit 2da14e2

Please sign in to comment.