Skip to content

Commit

Permalink
[examples] Little modification for RETAIN
Browse files Browse the repository at this point in the history
  • Loading branch information
hsaturn committed Mar 22, 2023
1 parent 294657f commit 245e746
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions examples/simple-broker/simple-broker.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "TinyMqtt.h" // https://github.com/hsaturn/TinyMqtt

#define PORT 1883
MqttBroker broker(PORT);
const uint16_t PORT 1883;
const uint8_t RETAIN = 10; // Max retained messages

MqttBroker broker(PORT, RETAIN);

/** Basic Mqtt Broker
*
Expand All @@ -16,6 +18,8 @@ MqttBroker broker(PORT);
* Your ESP will become a MqttBroker.
* You can test it with any client such as mqtt-spy for example
*
* Messages are retained *only* if retain > 0
*
*/

const char* ssid = "";
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-client/simple-client.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "TinyMqtt.h" // https://github.com/hsaturn/TinyMqtt
#include "TinyStreaming.h" // https://github.com/hsaturn/TinyConsole

/** Simple Client (The simplest configuration)
/** Simple Client (The simplest configuration, client only sends topics)
*
*
* +--------+
Expand Down

0 comments on commit 245e746

Please sign in to comment.