From d18f961e4bfcbe1533b8f1efa41bf74afa978e22 Mon Sep 17 00:00:00 2001 From: Patrick Balsiger Date: Thu, 15 Nov 2018 13:14:04 +0100 Subject: [PATCH] documentation --- src/examples/basic/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/examples/basic/main.cpp b/src/examples/basic/main.cpp index 50f0088..9b5fb3d 100644 --- a/src/examples/basic/main.cpp +++ b/src/examples/basic/main.cpp @@ -11,11 +11,16 @@ Task publishHeap; void setup() { publishHeap.set(TASK_SECOND * 5, TASK_FOREVER, [](){ + // publish locally to local/topic + // and remotely to wirelos/mqttSprocket-out/local/topic sprocket->publish("local/topic", "heap=" + String(ESP.getFreeHeap())); }); sprocket = new Sprocket( {STARTUP_DELAY, SERIAL_BAUD_RATE}); + + // subscribe locally to local/topic + // and remotely to wirelos/mqttSprocket-in/local/topic sprocket->subscribe("local/topic", [](String msg){ PRINT_MSG(Serial, "LOCAL", msg.c_str()); });