Giter Site home page Giter Site logo

yourslab / device-defender-for-aws-iot-embedded-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws/device-defender-for-aws-iot-embedded-sdk

0.0 1.0 0.0 395 KB

Client library for using AWS IoT Defender service on embedded devices

License: MIT License

CMake 12.39% C 75.49% Makefile 5.01% Python 7.11%

device-defender-for-aws-iot-embedded-sdk's Introduction

Device Defender Client Library

This repository contains the Device Defender client library for interacting with the AWS IoT Device Defender Service. This library has no dependencies on any additional libraries other than the standard C library, and therefore, can be used with any MQTT client 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.

Device Defender Config File

The Device Defender client 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 defender_config_defaults.h. To provide custom values for the configuration macros, a config file named defender_config.h can be provided by the application to the library.

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

Thus, the Device Defender client library can be built by either:

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

OR

  • Defining the DEFENDER_DO_NOT_USE_CUSTOM_CONFIG preprocessor macro for the library build.

Building the Library

The defenderFilePaths.cmake file contains the information of all source files and the header include paths required to build the Device Defender client library.

As mentioned in the previous section, either a custom config file (i.e. defender_config.h) or DEFENDER_DO_NOT_USE_CUSTOM_CONFIG macro needs to be provided to build the Device Defender client library.

For a CMake example of building the Device Defender client library with the defenderFilePaths.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.
    • 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.

  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.

device-defender-for-aws-iot-embedded-sdk's People

Contributors

aggarg avatar amazon-auto avatar gkwicker avatar markrtuttle avatar nrdg42 avatar

Watchers

 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.