From 459738a4369ff80a0e01df291d9271c005ab0491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Korina=20=C5=A0imi=C4=8Devi=C4=87?= Date: Fri, 1 Dec 2023 12:22:45 +0100 Subject: [PATCH] Update README example Summary: related to T12804 Reviewers: ivica Reviewed By: ivica Subscribers: miljen, iljazovic Differential Revision: https://repo.mireo.local/D26798 --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0409ae9..f01eb95 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,8 @@ Usage and API --------- Detailed documentation is available [here](https://spacetime.mireo.com/async-mqtt5/). -The following example illustrates a simple scenario of configuring a Client and publishing an Application Message. +The following example illustrates a simple scenario of configuring a Client and publishing a +"Hello World!" Application Message with `QoS` 0. ```cpp #include @@ -65,16 +66,16 @@ int main() { using client_type = async_mqtt5::mqtt_client; client_type c(ioc, ""); - c.credentials("clientid", "username", "password") - .brokers("mqtt.broker", 1883) + c.credentials("", "", "") + .brokers("", 1883) .run(); c.async_publish( - "test/mqtt-test", "hello world!", + "", "Hello world!", async_mqtt5::retain_e::no, async_mqtt5::publish_props {}, [&c](async_mqtt5::error_code ec) { std::cout << ec.message() << std::endl; - c.async_disconnect(asio::detached); // disconnect and close the client + c.async_disconnect(boost::asio::detached); // disconnect and close the client } );