From 4924aab540e52d76feb29fb25ac201a22eb082b6 Mon Sep 17 00:00:00 2001 From: Archit Aggarwal Date: Fri, 30 Apr 2021 22:25:10 +0000 Subject: [PATCH 1/3] Update REAMDE --- README.md | 61 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index e7970a5..0fa0b9c 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,67 @@ ## coreSNTP Library -This repository contains the coreSNTP library, a client library to use the Simple Network Time Protocol (SNTP), that is specified in [RFC 4330](https://tools.ietf.org/html/rfc4330), to synchronize client devices with network time. -According to the SNTPv4 specification, "_To an NTP or SNTP server, NTP and SNTP clients are indistinguishable; to an NTP or SNTP client, NTP and SNTP servers are indistinguishable._", thereby, allowing SNTP clients to request time from NTP servers. +**Note:** This library is under development. -## Reference example +This repository contains the coreSNTP library, a client library to use Simple Network Time Protocol (SNTP) to synchronize device clocks with internet time. This library implements the SNTPv4 specification defined in [RFC 4330](https://tools.ietf.org/html/rfc4330#section-3). +An SNTP client can request time from both NTP and SNTP servers. According to the SNTPv4 specification, "_To an NTP or SNTP server, NTP and SNTP clients are indistinguishable; to an NTP or SNTP client, NTP and SNTP servers are indistinguishable._", thereby, allowing SNTP clients to request time from NTP servers. + +## Cloning this repository +This repo uses [Git Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to bring in dependent components. + +To clone using HTTPS: +``` +git clone https://github.com/FreeRTOS/coreSNTP.git --recurse-submodules +``` +Using SSH: +``` +git clone git@github.com:FreeRTOS/coreSNTP.git --recurse-submodules +``` + +If you have downloaded the repo without using the `--recurse-submodules` argument, you need to run: +``` +git submodule update --init --recursive +``` ## Building the library -## Building unit tests +You can build the coreSNTP source files that are in the [source](source/) directory, and add [source/include](source/include) to your compiler's include path. + +If using CMake, the [coreSntpFilePaths.cmake](coreSntpFilePaths.cmake) file contains the above information of the source files and the header include path from this repository. + +## Building Unit Tests -### Checkout Unity Submodule -By default, the submodules in this repository are configured with `update=none` in [.gitmodules](.gitmodules), to avoid increasing clone time and disk space usage of other repositories (like [amazon-freertos](https://github.com/aws/amazon-freertos) that submodules this repository). +### Checkout CMock Submodule -To build unit tests, the submodule dependency of Unity is required. Use the following command to clone the submodule: +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/Unity +git submodule update --checkout --init --recursive test/unit-test/CMock ``` -### Platform Prerequisites +### Unit Test Platform Prerequisites - For running unit tests - - C89 or later compiler like gcc - - CMake 3.13.0 or later -- For running the coverage target, gcov is additionally required. + - **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 +### Steps to build **Unit Tests** -1. Go to the root directory of this repository. (Make sure that the **Unity** submodule is cloned as described [above](#checkout-unity-submodule).) +1. Go to the root directory of this repository. (Make sure that the **CMock** submodule is cloned as described [above](#checkout-cmock-submodule)) -1. Create build directory: `mkdir build && cd build` +1. Run the *cmake* command: `cmake -S test -B build` -1. Run *cmake* while inside build directory: `cmake -S ../test` - -1. Run this command to build the library and unit tests: `make all` +1. Run this command to build the library and unit tests: `make -C build all` 1. The generated test executables will be present in `build/bin/tests` folder. -1. Run `ctest` to execute all tests and view the test run summary. +1. Run `cd build && ctest` to execute all tests and view the test run summary. ## Contributing See [CONTRIBUTING.md](./.github/CONTRIBUTING.md) for information on contributing. + +## License + +This library is licensed under the MIT License. See the [LICENSE](LICENSE) file. From cc6c9a698f561558952b38d06813a1e729b1037a Mon Sep 17 00:00:00 2001 From: Archit Aggarwal Date: Fri, 30 Apr 2021 22:32:37 +0000 Subject: [PATCH 2/3] Add link verifier check to CI workflow --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ba6396..be464e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,3 +76,18 @@ jobs: run: | git-secrets --register-aws git-secrets --scan + link-verifier: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Setup Python for link verifier action + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Check Links + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: FreeRTOS/CI-CD-GitHub-Actions/link-verifier@main + with: + path: ./ + include-file-types: .c,.h,.dox From 028660f6d9ca511a796f140acf190b0a3fbc6ce6 Mon Sep 17 00:00:00 2001 From: Archit Aggarwal Date: Fri, 30 Apr 2021 22:37:35 +0000 Subject: [PATCH 3/3] Fix hyperlink --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fa0b9c..d6c42a3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **Note:** This library is under development. -This repository contains the coreSNTP library, a client library to use Simple Network Time Protocol (SNTP) to synchronize device clocks with internet time. This library implements the SNTPv4 specification defined in [RFC 4330](https://tools.ietf.org/html/rfc4330#section-3). +This repository contains the coreSNTP library, a client library to use Simple Network Time Protocol (SNTP) to synchronize device clocks with internet time. This library implements the SNTPv4 specification defined in [RFC 4330](https://tools.ietf.org/html/rfc4330). An SNTP client can request time from both NTP and SNTP servers. According to the SNTPv4 specification, "_To an NTP or SNTP server, NTP and SNTP clients are indistinguishable; to an NTP or SNTP client, NTP and SNTP servers are indistinguishable._", thereby, allowing SNTP clients to request time from NTP servers.