From 44481cf5a20d8ffdf4920700e1b62c5911e908cb Mon Sep 17 00:00:00 2001 From: Peter M. Groen Date: Thu, 30 May 2024 17:20:04 +0200 Subject: [PATCH] Updated the documentation --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4c3ff93..06d03a0 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,15 @@ Just check your package manager for the correct package-name. $ cmake ../ $ gmake ( or make, depending on your platform ) ``` -And you're all set. In build/bin there are two examples, test_mqtt_pu and test_mqtt_sub. Have a broker running, -like mosquitto or flashmq capable of accepting anonymous connections. Start the "sub" part and couple of moments -later the "pub" part. If all went well, you should see two screens in sync running. + +## Building the examples and tests +### Tests +Normally only the library is being build. By adding `-DENABLE_TESTING` to the cmake step, the unittests are being build also. Make sure a broker is running on localhost and type `test/mqtt_test` to run the tests. + +### Examples +By adding the flag `-DENABLE_EXAMPLES` to the cmake step, the examples are being build together with the library. + +In build/bin there are two examples, test_mqtt_pu and test_mqtt_sub. Have a broker running, like mosquitto or flashmq capable of accepting anonymous connections. Start the "sub" part and couple of moments later the "pub" part. If all went well, you should see two screens in sync running. ``` Open terminal 1 @@ -41,6 +47,7 @@ later the "pub" part. If all went well, you should see two screens in sync runni Open terminal 2 $ bin/test_mqtt_pub ``` + Screen 2 is sending, Screen 1 is receiving. # Using the library. -- libgit2 0.21.4