You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+77-10
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,10 @@
1
-
## MQTT Agent - Using coreMQTT
1
+
## coreMQTT Agent Library
2
2
3
-
Note: The MQTT agent and associated example project are functional but not yet complete. Be aware the agent does not yet comply with our code quality standards and is not yet fully tested. There is a chance its APIs will change before its official first release. Feedback, suggestions and comments are welcome on the [FreeRTOS support forum](https://forums.freertos.org).
3
+
The coreMQTT Agent library is a high level API that adds thread safety to the [coreMQTT](https://github.com/FreeRTOS/coreMQTT) library. The library provides thread safe equivalents to the coreMQTT's APIs, greatly simplifying its use in multi-threaded environments. The coreMQTT Agent library manages the MQTT connection by serializing the access to the coreMQTT library and reducing implementation overhead (e.g., removing the need for the application to repeatedly call to `MQTT_ProcessLoop`). This allows your multi-threaded applications to share the same MQTT connection, and enables you to design an embedded application without having to worry about coreMQTT thread safety.
4
4
5
-
[coreMQTT](https://github.com/FreeRTOS/coreMQTT) is an MIT licensed open source C MQTT client library for microcontrollers and small microprocessor based IoT devices. It’s design is intentionally simple to ensure it has no dependency on any other library or operating system, and to better enable static analysis including [memory safety proofs](https://www.freertos.org/2020/02/ensuring-the-memory-safety-of-freertos-part-1.html). That simplicity and lack of operating system dependency (coreMQTT does not require multithreading at all) means coreMQTT does not build thread safety directly into its implementation. Instead thread safety must be provided by higher level software. This labs project implements a coreMQTT extension that provides that higher level functionality in the form of an MQTT agent (or MQTT daemon). While the implementation demonstrated here is currently specific to FreeRTOS, there are not many dependencies on FreeRTOS, meaning the implementation can easily be adapted for use with other operating systems.
5
+
This library has gone through code quality checks including verification that no function has a [GNU Complexity](https://www.gnu.org/software/complexity/manual/complexity.html) score over 8, and checks against deviations from mandatory rules in the [MISRA coding standard](https://www.misra.org.uk/MISRAHome/MISRAC2012/tabid/196/Default.aspx). Deviations from the MISRA C:2012 guidelines are documented under [MISRA Deviations](MISRA.md). This library has also undergone both static code analysis from [Coverity static analysis](https://scan.coverity.com/), and validation of memory safety through the [CBMC automated reasoning tool](https://www.cprover.org/cbmc/).
6
6
7
-
## Getting started
8
-
The [documentation page](https://freertos.org/mqtt/mqtt-agent-demo.html) for this repository contains information on the MQTT agent and the contained demo project.
7
+
See memory requirements for this library [here](https://freertos.org/Documentation/api-ref/coreMQTT-Agent/docs/doxygen/output/html/index.html#core_mqtt_agent_memory_requirements).
9
8
10
9
## Cloning this repository
11
10
This repo uses [Git Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to bring in dependent components.
@@ -24,14 +23,82 @@ If you have downloaded the repo without using the `--recurse-submodules` argumen
24
23
git submodule update --init --recursive
25
24
```
26
25
26
+
## coreMQTT Agent Library Configurations
27
+
28
+
The MQTT Agent library uses the same `core_mqtt_config.h` configuration file as coreMQTT, with the addition of configuration constants listed at the top of [core_mqtt_agent.h](source/include/core_mqtt_agent.h) and [core_mqtt_agent_command_functions.h](source/include/core_mqtt_agent_command_functions.h). Documentation for these configurations can be found [here](https://freertos.org/Documentation/api-ref/coreMQTT-Agent/docs/doxygen/output/html/core_mqtt_agent_config.html).
29
+
30
+
To provide values for these configuration values, they must be either:
31
+
* Defined in `core_mqtt_config.h` used by coreMQTT
32
+
**OR**
33
+
* Passed as compile time preprocessor macros
34
+
35
+
## Building the Library
36
+
37
+
You can build the MQTT Agent source files that are in the [source](source/) directory, and add [source/include](source/include) to your compiler's include path. Additionally, the MQTT Agent library requires the coreMQTT library, whose files follow the same `source/` and `source/include` pattern as the agent library; its build instructions can be found [here](https://github.com/FreeRTOS/coreMQTT#building-the-library).
38
+
39
+
If using CMake, the [mqttAgentFilePaths.cmake](mqttAgentFilePaths.cmake) file contains the above information of the source files and the header include path from this repository. The same information is found for coreMQTT from `mqttFilePaths.cmake` in the [coreMQTT submodule](source/dependency/).
40
+
41
+
For a CMake example of building the MQTT Agent library with the `mqttAgentFilePaths.cmake` file, refer to the `coverity_analysis` library target in [test/CMakeLists.txt](test/CMakeLists.txt) file.
42
+
43
+
## Building Unit Tests
44
+
45
+
### Checkout CMock Submodule
46
+
47
+
To build unit tests, the submodule dependency of CMock is required. Use the following command to clone the submodule:
The MQTT Agent API documentation can be found [here](https://freertos.org/Documentation/api-ref/coreMQTT-Agent/docs/doxygen/output/html/index.html).
85
+
86
+
## Generating documentation
87
+
88
+
The Doxygen references were created using Doxygen version 1.8.20. To generate the
89
+
Doxygen pages yourself, please run the following command from the root of this repository:
90
+
91
+
```shell
92
+
doxygen docs/doxygen/config.doxyfile
93
+
```
94
+
27
95
## Getting help
28
-
You can use your Github login to get support from both the FreeRTOS community and directly from the primary FreeRTOS developers on our [active support forum](https://forums.freertos.org). The [FAQ](https://www.freertos.org/FAQ.html)provides another support resource.
96
+
You can use your Github login to get support from both the FreeRTOS community and directly from the primary FreeRTOS developers on our [active support forum](https://forums.freertos.org). You can find a list of [frequently asked questions](https://www.freertos.org/FAQ.html)here.
29
97
30
-
## Security
98
+
## Contributing
31
99
32
-
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
100
+
See [CONTRIBUTING.md](./.github/CONTRIBUTING.md) for information on contributing.
33
101
34
102
## License
35
103
36
-
This library is licensed under the MIT License. See the [LICENSE](LICENSE.md) file.
37
-
104
+
This library is licensed under the MIT License. See the [LICENSE](LICENSE) file.
0 commit comments