GithubHelp home page GithubHelp logo

test-mass-forker-org-1 / ota-for-aws-iot-embedded-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws/ota-for-aws-iot-embedded-sdk

0.0 0.0 0.0 4.28 MB

License: MIT License

Python 0.12% C 87.43% Makefile 10.45% CMake 2.00%

ota-for-aws-iot-embedded-sdk's Introduction

AWS IoT Over-the-air Update Library

The OTA library enables you to manage the notification of a newly available update, download the update, and perform cryptographic verification of the firmware update. Using the library, you can logically separate firmware updates from the application running on your devices. The OTA library can share a network connection with the application, saving memory in resource-constrained devices. In addition, the OTA library lets you define application-specific logic for testing, committing, or rolling back a firmware update. The library supports different application protocols like Message Queuing Telemetry Transport (MQTT) and Hypertext Transfer Protocol (HTTP), and provides various configuration options you can fine tune depending on network type and conditions. 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. This library has also undergone static code analysis from Coverity static analysis.

See memory requirements for this library here.

AWS IoT Over-the-air Update Library v3.3.0 source code is part of the FreeRTOS 202012.01 LTS release.

AWS IoT Over-the-air Updates Config File

The AWS IoT Over-the-air Updates library exposes configuration macros that are required for building the library. A list of all the configurations and their default values are defined in ota_config_defaults.h. To provide custom values for the configuration macros, a custom config file named ota_config.h can be provided by the user application to the library.

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

Building the Library

The otaFilePaths.cmake file contains the information of all source files and the header include paths required to build the AWS IoT Over-the-air Updates library.

As mentioned in the previous section, either a custom config file (i.e. ota_config.h) OR the OTA_DO_NOT_USE_CUSTOM_CONFIG macro needs to be provided to build the AWS IoT Over-the-air Updates library.

For a CMake example of building the AWS IoT Over-the-air Updates library with the otaFilePaths.cmake file, refer to the coverity_analysis library target in the test/CMakeLists.txt file.

Building Unit Tests

Checkout CMock Submodule

By default, the submodules in this repository are configured with update=none in .gitmodules to avoid increasing clone time and disk space usage of other repositories (like AWS IoT Device SDK for Embedded C that submodules this repository).

To build unit tests, the submodule dependency of CMock is required. Use the following command to clone the submodule:

git submodule update --checkout --init --recursive test/unit-test/CMock

Platform Prerequisites

  • For building the library, CMake 3.13.0 or later and a C90 compiler.
  • For running unit tests, Ruby 2.0.0 or later is additionally required for the CMock test framework (that we use).
  • 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. (Make sure that the CMock submodule is cloned as described above.)

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

  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.

Migration Guide

How to migrate from v2.0.0 (Release Candidate) to v3.3.0

The following table lists equivalent API function signatures in v2.0.0 (Release Candidate) and v3.3.0 declared in ota.h

v2.0.0 (Release Candidate) v3.3.0 Notes
OtaState_t OTA_Shutdown( uint32_t ticksToWait ); OtaState_t OTA_Shutdown( uint32_t ticksToWait, uint8_t unsubscribeFlag ); unsubscribeFlag indicates if unsubscribe operations should be performed from the job topics when shutdown is called. Set this as 1 to unsubscribe, 0 otherwise.

How to migrate from version 1.0.0 to version 3.3.0 for OTA applications

Refer to OTA Migration document for the summary of updates to the API. Migration document for OTA PAL also provides a summary of updates required for upgrading the OTA-PAL to work with v3.3.0 of the library.

Porting

In order to support AWS IoT Over-the-air Updates on your device, it is necessary to provide the following components:

  1. Port for the OTA Portable Abstraction Layer (PAL).

  2. OS Interface

  3. MQTT Interface

For enabling data transfer over HTTP dataplane the following component should also be provided:

  1. HTTP Interface

NOTE When using OTA over HTTP dataplane, MQTT is required for control plane operations and should also be provided.

Reference examples

Please refer to the demos of the AWS IoT Over-the-air Updates library in the following location for reference examples on POSIX and FreeRTOS:

Platform Location
POSIX AWS IoT Device SDK for Embedded C
FreeRTOS FreeRTOS/FreeRTOS
FreeRTOS FreeRTOS AWS Reference Integrations

Documentation

Existing Documentation

For pre-generated documentation, please see the documentation linked in the locations below:

Location
AWS IoT Device SDK for Embedded C
FreeRTOS.org

Note that the latest included version of coreMQTT may differ across repositories.

Generating documentation

The Doxygen references were created using Doxygen version 1.9.2. 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.

ota-for-aws-iot-embedded-sdk's People

Contributors

bujain avatar yanjos-dev avatar pvyawaha avatar divekarshubham avatar actoryou avatar archigup avatar aggarw13 avatar markrtuttle avatar aggarg avatar b1ackviking avatar leegeth avatar yiting16 avatar yourslab avatar dachalco avatar amazon-auto avatar aniruddhakanhere avatar gkwicker avatar kelephant avatar muneebahmed10 avatar sarenameas avatar ser90368141 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.