Skip to content

Conversation

@johnrhen
Copy link
Contributor

@johnrhen johnrhen commented Jan 6, 2022

Other AWS demos in FreeRTOS share an mqtt_demo_helpers file, which has functions that perform MQTT operations using credentials stored in macros. This PR adds an mqtt_pkcs11_demo_helpers equivalent which uses PKCS11 for credential management. For now, only the Fleet Provisioning demo uses the mqtt_pkcs11_demo_helpers, but this allows potential future PKCS11+MQTT AWS demos to share the helper files.

This PR also modifies the Fleet Provisioning demo to use the new mqtt_pkcs11_demo_helpers files. This also eliminates the need for mqtt_operations in the Fleet Provisioning demo, as the functionality is now covered in mqtt_pkcs11_demo_helpers.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@johnrhen johnrhen requested a review from a team as a code owner January 6, 2022 01:23
archigup
archigup previously approved these changes Jan 6, 2022
cobusve
cobusve previously approved these changes Jan 6, 2022
@johnrhen johnrhen dismissed stale reviews from cobusve and archigup via 27ac38b January 6, 2022 21:04
@johnrhen johnrhen merged commit 348ebbc into FreeRTOS:main Jan 11, 2022
johnrhen added a commit to johnrhen/FreeRTOS that referenced this pull request Jan 24, 2022
* Create mqtt_pkcs11_demo_helpers by modifying mqtt_demo_helpers

* Update formatting and variable naming

* Fix multi-line parameter formatting

* Update file headers to match latest release version
johnrhen added a commit that referenced this pull request Jul 20, 2022
* Create CloudFormation template for demo setup

* Add CF_ prefix to CloudFormation-created resources to avoid collisions

* Update lexicon.txt

* Create initial python setup script

* Create separate demo_cleanup.py file

* Move setup items to DemoSetup folder

* Add demo_config.h setup to the demo_setup.py script

* Modify error logging on demo_setup.py

* Add file cleanup to demo_cleanup.py

* Rename convert_pem_to_der.py to convert_credentials_to_der.py

* Adjust comment wording on demo_cleanup.py

* added configUSE_TICKLESS_IDLE (#764)

* Fix tests needed for FreeRTOS/FreeRTOS-Kernel#435 (#766)

* Fix tests needed for FreeRTOS/FreeRTOS-Kernel#435

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Add tests to cover FreeRTOS/FreeRTOS-Kernel#435 (#768)

Add tests to cover FreeRTOS/FreeRTOS-Kernel#435

This ensures that the coverage does not go down with the PR
FreeRTOS/FreeRTOS-Kernel#435.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Add tests to increase queue code coverage (#770)

These tests cover the following portion in the queue code:

static void prvUnlockQueue( Queue_t * const pxQueue )
{
    ...

    if( prvNotifyQueueSetContainer( pxQueue ) != pdFALSE )
    {
        /* The queue is a member of a queue set, and posting to
            * the queue set caused a higher priority task to unblock.
            * A context switch is required. */
        vTaskMissedYield();
    }
    else
    {
        mtCOVERAGE_TEST_MARKER();
    }

    ...
}

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Update FreeRTOS-Kernel submodule pointer (#771)

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Add new names to spell check dictionary (#772)

* Return error if invalid input detected in transport layer (Send/Recv) (#773)

* return error if invalid input detected in transport layer

* Create mqtt_pkcs11_demo_helpers for AWS demos (#769)

* Create mqtt_pkcs11_demo_helpers by modifying mqtt_demo_helpers

* Update formatting and variable naming

* Fix multi-line parameter formatting

* Update file headers to match latest release version

* GCC/Rx100 Demo project files update to e2 Studio v8 (#776)

* Upgrade GCC project files for e2 studio v7.8.0 in Demo/RX100-RSK_GCC_e2studio folder

* Update Demo project file to e2 Studio v8 and remove the .bat file.

* Update the choice of toolchain version.

* Update the link in file header.

Co-authored-by: NoMaY (a user of Japan.RenesasRulz.com) <NoMaY-jp@outlook.com>

* Update FreeRTOS-Cellular-Interface submodule pointer (#775)

* Update cellular sub-module pointer
* Add more log in cellular_setup.c to indicate error
* Adjust cellular transport timeout value for demo application
* Add default cellular module specific config in cellular_config.h

* Create separate demo_cleanup.py file

* Move setup items to DemoSetup folder

* Add demo_config.h setup to the demo_setup.py script

* Modify error logging on demo_setup.py

* Add file cleanup to demo_cleanup.py

* Rename convert_pem_to_der.py to convert_credentials_to_der.py

* Adjust comment wording on demo_cleanup.py

* Adjust comment wording on demo_config.h

* Format files and reduce code redundancy

* Update lexicon.txt

* Remove preconfigured fields from demo_config,h

* Update convert_credentials_to_der.py

Co-authored-by: Archit Gupta <71798289+archigup@users.noreply.github.com>

* Make python files executable

Co-authored-by: Joseph Julicher <jjulicher@mac.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Co-authored-by: Ravishankar Bhagavandas <bhagavar@amazon.com>
Co-authored-by: ActoryOu <jay2002824@gmail.com>
Co-authored-by: Ming Yue <mingyue86010@gmail.com>
Co-authored-by: NoMaY (a user of Japan.RenesasRulz.com) <NoMaY-jp@outlook.com>
Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
Co-authored-by: Archit Gupta <71798289+archigup@users.noreply.github.com>
every-breaking-wave pushed a commit to every-breaking-wave/FreeRTOS that referenced this pull request Nov 15, 2024
* Add taskYIELD_TASK_CORE_IF_USING_PREEMPTION and taskYIELD_ANY_CORE_IF_USING_PREEMPTION to align task yield behavior for single core and SMP.
---------

Co-authored-by: Soren Ptak <ptaksoren@gmail.com>
Zangetsu112 pushed a commit to Zangetsu112/FreeRTOS-evpp that referenced this pull request Aug 18, 2025
* Create mqtt_pkcs11_demo_helpers by modifying mqtt_demo_helpers

* Update formatting and variable naming

* Fix multi-line parameter formatting

* Update file headers to match latest release version
Zangetsu112 pushed a commit to Zangetsu112/FreeRTOS-evpp that referenced this pull request Aug 18, 2025
* Create CloudFormation template for demo setup

* Add CF_ prefix to CloudFormation-created resources to avoid collisions

* Update lexicon.txt

* Create initial python setup script

* Create separate demo_cleanup.py file

* Move setup items to DemoSetup folder

* Add demo_config.h setup to the demo_setup.py script

* Modify error logging on demo_setup.py

* Add file cleanup to demo_cleanup.py

* Rename convert_pem_to_der.py to convert_credentials_to_der.py

* Adjust comment wording on demo_cleanup.py

* added configUSE_TICKLESS_IDLE (FreeRTOS#764)

* Fix tests needed for FreeRTOS/FreeRTOS-Kernel#435 (FreeRTOS#766)

* Fix tests needed for FreeRTOS/FreeRTOS-Kernel#435

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Add tests to cover FreeRTOS/FreeRTOS-Kernel#435 (FreeRTOS#768)

Add tests to cover FreeRTOS/FreeRTOS-Kernel#435

This ensures that the coverage does not go down with the PR
FreeRTOS/FreeRTOS-Kernel#435.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Add tests to increase queue code coverage (FreeRTOS#770)

These tests cover the following portion in the queue code:

static void prvUnlockQueue( Queue_t * const pxQueue )
{
    ...

    if( prvNotifyQueueSetContainer( pxQueue ) != pdFALSE )
    {
        /* The queue is a member of a queue set, and posting to
            * the queue set caused a higher priority task to unblock.
            * A context switch is required. */
        vTaskMissedYield();
    }
    else
    {
        mtCOVERAGE_TEST_MARKER();
    }

    ...
}

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Update FreeRTOS-Kernel submodule pointer (FreeRTOS#771)

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Add new names to spell check dictionary (FreeRTOS#772)

* Return error if invalid input detected in transport layer (Send/Recv) (FreeRTOS#773)

* return error if invalid input detected in transport layer

* Create mqtt_pkcs11_demo_helpers for AWS demos (FreeRTOS#769)

* Create mqtt_pkcs11_demo_helpers by modifying mqtt_demo_helpers

* Update formatting and variable naming

* Fix multi-line parameter formatting

* Update file headers to match latest release version

* GCC/Rx100 Demo project files update to e2 Studio v8 (FreeRTOS#776)

* Upgrade GCC project files for e2 studio v7.8.0 in Demo/RX100-RSK_GCC_e2studio folder

* Update Demo project file to e2 Studio v8 and remove the .bat file.

* Update the choice of toolchain version.

* Update the link in file header.

Co-authored-by: NoMaY (a user of Japan.RenesasRulz.com) <NoMaY-jp@outlook.com>

* Update FreeRTOS-Cellular-Interface submodule pointer (FreeRTOS#775)

* Update cellular sub-module pointer
* Add more log in cellular_setup.c to indicate error
* Adjust cellular transport timeout value for demo application
* Add default cellular module specific config in cellular_config.h

* Create separate demo_cleanup.py file

* Move setup items to DemoSetup folder

* Add demo_config.h setup to the demo_setup.py script

* Modify error logging on demo_setup.py

* Add file cleanup to demo_cleanup.py

* Rename convert_pem_to_der.py to convert_credentials_to_der.py

* Adjust comment wording on demo_cleanup.py

* Adjust comment wording on demo_config.h

* Format files and reduce code redundancy

* Update lexicon.txt

* Remove preconfigured fields from demo_config,h

* Update convert_credentials_to_der.py

Co-authored-by: Archit Gupta <71798289+archigup@users.noreply.github.com>

* Make python files executable

Co-authored-by: Joseph Julicher <jjulicher@mac.com>
Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Co-authored-by: Ravishankar Bhagavandas <bhagavar@amazon.com>
Co-authored-by: ActoryOu <jay2002824@gmail.com>
Co-authored-by: Ming Yue <mingyue86010@gmail.com>
Co-authored-by: NoMaY (a user of Japan.RenesasRulz.com) <NoMaY-jp@outlook.com>
Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
Co-authored-by: Archit Gupta <71798289+archigup@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants