{"id":19775030,"url":"https://github.com/freertos/coresntp","last_synced_at":"2026-01-28T03:29:30.709Z","repository":{"id":45305665,"uuid":"351600546","full_name":"FreeRTOS/coreSNTP","owner":"FreeRTOS","description":"SNTPv4 client designed for embedded devices.","archived":false,"fork":false,"pushed_at":"2025-04-15T09:11:39.000Z","size":1203,"stargazers_count":21,"open_issues_count":0,"forks_count":25,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-04-15T10:25:07.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FreeRTOS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-25T23:09:20.000Z","updated_at":"2025-04-15T09:11:07.000Z","dependencies_parsed_at":"2023-11-27T17:27:15.645Z","dependency_job_id":"50dbdd69-5f87-4c6f-9520-0768e73d7bf2","html_url":"https://github.com/FreeRTOS/coreSNTP","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreeRTOS%2FcoreSNTP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreeRTOS%2FcoreSNTP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreeRTOS%2FcoreSNTP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FreeRTOS%2FcoreSNTP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FreeRTOS","download_url":"https://codeload.github.com/FreeRTOS/coreSNTP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251769157,"owners_count":21640847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T05:14:36.119Z","updated_at":"2026-01-28T03:29:30.658Z","avatar_url":"https://github.com/FreeRTOS.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## coreSNTP Library\n\n**[API Documentation Pages for current and previous releases of this library can be found here](https://freertos.github.io/coreSNTP/)**\n\nThis repository contains the coreSNTP library, a client library to use Simple\nNetwork Time Protocol (SNTP) to synchronize device clocks with internet time.\nThis library implements the SNTPv4 specification defined in\n[RFC 4330](https://tools.ietf.org/html/rfc4330).\n\nAn SNTP client can request time from both NTP and SNTP servers. According to the\nSNTPv4 specification, \"_To an NTP or SNTP server, NTP and SNTP clients are\nindistinguishable; to an NTP or SNTP client, NTP and SNTP servers are\nindistinguishable._\", thereby, allowing SNTP clients to request time from NTP\nservers.\n\nThis library has gone through code quality checks including verification that no\nfunction has a\n[GNU Complexity](https://www.gnu.org/software/complexity/manual/complexity.html)\nscore over 10, and checks against deviations from mandatory rules in the\n[MISRA coding standard](https://www.misra.org.uk). Deviations from the MISRA\nC:2012 guidelines are documented under [MISRA Deviations](MISRA.md). This\nlibrary has also undergone both static code analysis from\n[Coverity static analysis](https://scan.coverity.com/), and validation of memory\nsafety through the\n[CBMC automated reasoning tool](https://www.cprover.org/cbmc/).\n\nSee memory requirements for this library\n[here](./docs/doxygen/include/size_table.md).\n\n**coreSNTP v1.3.1\n[source code](https://github.com/FreeRTOS/coreSNTP/tree/v1.3.1/source) is part\nof the\n[FreeRTOS 202406.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202406.00-LTS)\nrelease.**\n\n### Documentation\n\nThe API reference documentation for the coreSNTP library version released in\n[FreeRTOS/FreeRTOS](https://github.com/FreeRTOS/FreeRTOS) can be viewed from the\n[freertos.org website](https://freertos.org/coresntp/index.html).\n\n## Cloning this repository\n\nThis repo uses\n[Git Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to bring\nin dependent components.\n\nTo clone using HTTPS:\n\n```sh\ngit clone https://github.com/FreeRTOS/coreSNTP.git --recurse-submodules\n```\n\nUsing SSH:\n\n```sh\ngit clone git@github.com:FreeRTOS/coreSNTP.git --recurse-submodules\n```\n\nIf you have downloaded the repo without using the `--recurse-submodules`\nargument, you need to run:\n\n```sh\ngit submodule update --init --recursive\n```\n\n## Building the library\n\nYou can build the coreSNTP source files that are in the [source](source/)\ndirectory, and add [source/include](source/include) to your compiler's include\npath.\n\nIf using CMake, the [coreSntpFilePaths.cmake](coreSntpFilePaths.cmake) file\ncontains the above information of the source files and the header include path\nfrom this repository.\n\n## Reference Example\n\nA reference example of using the coreSNTP library can be viewed in the\n`FreeRTOS/FreeRTOS` repository\n[here](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/coreSNTP_Windows_Simulator).\nThe demo application showcases use of the library in order to create an SNTP\nclient for periodic time synchronization of the system clock.\n\n## Building Unit Tests\n\nThe unit tests for the library use CMock/Unity unit testing framework.\n\n### Checkout CMock Submodule\n\nTo build unit tests, the submodule dependency of CMock is required. Use the\nfollowing command to clone the submodule:\n\n```\ngit submodule update --checkout --init --recursive test/unit-test/CMock\n```\n\n### Unit Test Platform Prerequisites\n\n- For running unit tests\n  - **C90 compiler** like gcc\n  - **CMake 3.13.0 or later**\n  - **Ruby 2.0.0 or later** is additionally required for the CMock test\n    framework (that we use).\n- For running the coverage target, **gcov** and **lcov** are additionally\n  required.\n\n### Steps to build **Unit Tests**\n\n1. Go to the root directory of this repository. (Make sure that the **CMock**\n   submodule is cloned as described [above](#checkout-cmock-submodule))\n\n1. Run the _cmake_ command: `cmake -S test -B build -DUNITTEST=ON`\n\n1. Run this command to build the library and unit tests: `make -C build all`\n\n1. The generated test executables will be present in `build/bin/tests` folder.\n\n1. Run `cd build \u0026\u0026 ctest` to execute all tests and view the test run summary.\n\n## CBMC proofs\n\nTo learn more about CBMC and proofs specifically, review the training material\n[here](https://model-checking.github.io/cbmc-training).\n\nThe `test/cbmc/proofs` directory contains CBMC proofs.\n\nIn order to run these proofs you will need to install CBMC and other tools by\nfollowing the instructions\n[here](https://model-checking.github.io/cbmc-training/installation.html).\n\n## Generating documentation\n\nThe Doxygen references were created using Doxygen version 1.9.6. To generate the\nDoxygen pages, please run the following command from the root of this\nrepository:\n\n```sh\ndoxygen docs/doxygen/config.doxyfile\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](./.github/CONTRIBUTING.md) for information on\ncontributing.\n\n## License\n\nThis library is licensed under the MIT License. See the [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreertos%2Fcoresntp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreertos%2Fcoresntp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreertos%2Fcoresntp/lists"}