openthread) GEMINI.mdOpenThread is an open-source implementation of the Thread networking protocol, released by Google. It is designed to be OS and platform-agnostic, with a small memory footprint, making it highly portable. It supports both system-on-chip (SoC) and network co-processor (NCP) designs and is a Thread Certified Component.
The project is primarily written in C and C++, with Python used for scripting and tooling. It uses a variety of build systems, including CMake and GN, and is actively maintained with a strong emphasis on code quality and style, enforced through continuous integration.
The project uses both CMake and GN as build systems. A collection of scripts in the script/ directory simplifies the build and test process.
gcc and clangmake, ninja-buildpython3, yapf (v0.43.0), clang-format (v19), pylint, shellcheck, iwyuA bootstrap script is provided to install the required tools:
./script/bootstrap
The project provides CMake presets for easier configuration.
Configure:
cmake --preset simulation
Build:
cmake --build --preset simulation
The script/ directory contains several scripts for building the project for different configurations:
script/check-simulation-build
script/check-posix-build
script/check-arm-build
script/check-gn-build
The project uses CTest for testing.
To run the tests after building with the simulation preset:
ctest --preset simulation
Nexus is a test framework that allows simulating multiple OpenThread nodes within a single process, enabling faster and more scalable network simulations.
Build Nexus tests:
top_builddir=nexus_test ./tests/nexus/build.sh
Run all Nexus tests:
top_builddir=nexus_test ./tests/nexus/run_nexus_tests.sh
Run a specific Nexus test:
top_builddir=nexus_test ./tests/nexus/run_nexus_tests.sh <test_name>
For more details, see tests/nexus/README.md.
The project has a strict coding style, which is enforced by the script/make-pretty script. Before submitting a pull request, ensure your code is formatted correctly.
Check code style:
script/make-pretty check
Format code:
script/make-pretty
Key style points:
UpperCamelCase for types (classes, structs, enums), methods, functions.lowerCamelCase for variables.g prefix for globals, s for statics, m for members, a for arguments.For more details, see the STYLE_GUIDE.md.
The project follows the “Fork-and-Pull” model. All contributions must be accompanied by a Contributor License Agreement (CLA). Pull requests are tested using GitHub Actions, and all checks must pass before merging.
For more details, see the CONTRIBUTING.md.