Skip to content

Client library for using AWS IoT Fleet Provisioning service on embedded devices

License

Notifications You must be signed in to change notification settings

aws/Fleet-Provisioning-for-AWS-IoT-embedded-sdk

Repository files navigation

AWS IoT Fleet Provisioning Library

API Documentation Pages for current and previous releases of this library can be found here

The Fleet Provisioning library enables you to provision IoT devices without device certificates using the Fleet Provisioning feature of AWS IoT Core. For an overview of provisioning options available, see Device provisioning. This library has no dependencies on any additional libraries other than the standard C library, and therefore, can be used with any MQTT library. This library is distributed under the MIT Open Source License.

This library has gone through code quality checks including verification that no function has a GNU Complexity score over 8, and checks against deviations from mandatory rules in the MISRA coding standard. Deviations from the MISRA C:2012 guidelines are documented under MISRA Deviations. This library has also undergone static code analysis using Coverity static analysis, and validation of memory safety through the CBMC automated reasoning tool.

See memory requirements for this library here.

AWS IoT Fleet Provisioning Library v1.2.1 source code is part of the FreeRTOS 202406.00 LTS release.

AWS IoT Fleet Provisioning Library Config File

The AWS IoT Fleet Provisioning Library exposes build configuration macros that are required for building the library. A list of all the configurations and their default values are defined in fleet_provisioning_config_defaults.h. To provide custom values for the configuration macros, a config file named fleet_provisioning_config.h can be provided by the application to the library.

By default, a fleet_provisioning_config.h config file is required to build the library. To disable this requirement and build the library with default configuration values, provide FLEET_PROVISIONING_DO_NOT_USE_CUSTOM_CONFIG as a compile time preprocessor macro.

Thus, the Fleet Provisioning library can be built by either:

  • Defining a fleet_provisioning_config.h file in the application, and adding it to the include directories list of the library.

OR

  • Defining the FLEET_PROVISIONING_DO_NOT_USE_CUSTOM_CONFIG preprocessor macro for the library build.

Building the Library

The fleetprovisioningFilePaths.cmake file contains the information of all source files and the header include paths required to build the Fleet Provisioning library.

As mentioned in the previous section, either a custom config file (i.e. fleet_provisioning_config.h) or FLEET_PROVISIONING_DO_NOT_USE_CUSTOM_CONFIG macro needs to be provided to build the Fleet Provisioning library.

For a CMake example of building the Fleet Provisioning library with the fleetprovisioningFilePaths.cmake file, refer to the coverity_analysis library target in test/CMakeLists.txt file.

Building Unit Tests

Platform Prerequisites

  • For running unit tests:
    • C90 compiler like gcc.
    • CMake 3.13.0 or later.
  • For running the coverage target, gcov and lcov are additionally required.

Steps to build Unit Tests

  1. Go to the root directory of this repository.

  2. Run the cmake command: cmake -S test -B build -DBUILD_CLONE_SUBMODULES=ON.

  3. Run this command to build the library and unit tests: make -C build all.

  4. The generated test executables will be present in build/bin/tests folder.

  5. Run cd build && ctest to execute all tests and view the test run summary.

CBMC

To learn more about CBMC and proofs specifically, review the training material here.

The test/cbmc/proofs directory contains CBMC proofs.

In order to run these proofs you will need to install CBMC and other tools by following the instructions here.

Reference examples

The AWS IoT Embedded C-SDK repository contains a demo showing the use of the AWS IoT Fleet Provisioning Library on a POSIX platform here.

Generating documentation

The Doxygen references were created using Doxygen version 1.9.6. To generate the Doxygen pages, please run the following command from the root of this repository:

doxygen docs/doxygen/config.doxyfile

Contributing

See CONTRIBUTING.md for information on contributing.