diff --git a/api.html b/api.html
index d9ae6be..d2ca659 100644
--- a/api.html
+++ b/api.html
@@ -16,12 +16,17 @@ title: API Documentation
boolean connect (clientID, willTopic, willQoS, willRetain, willMessage)
boolean connect (clientID, username, password)
boolean connect (clientID, username, password, willTopic, willQoS, willRetain, willMessage)
+ boolean connect (clientID, username, password, willTopic, willQoS, willRetain, willMessage, cleanSession)
void disconnect ()
int publish (topic, payload)
int publish (topic, payload, retained)
int publish (topic, payload, length)
int publish (topic, payload, length, retained)
int publish_P (topic, payload, length, retained)
+ boolean beginPublish (topic, payloadLength, retained)
+ size_t write (uint8_t)
+ size_t write (payload, length)
+ boolean beginPublish ()
boolean subscribe (topic, [qos])
boolean unsubscribe (topic)
boolean loop ()
@@ -153,6 +158,29 @@ void setup() {
+
+ boolean connect (clientID, username, password, willTopic, willQoS, willRetain, willMessage, cleanSession)
+ Connects the client with a Will message, username, password and clean-session flag specified.
+ Note : even if the cleanSession
is set to false
/0
the client
+ will not retry failed qos 1 publishes. This flag is only of use to maintain subscriptions on the broker.
+ Parameters
+
+ - clientID : the client ID to use when connecting to the server.
+ - username : the username to use. If NULL, no username or password is used (const char[])
+ - password : the password to use. If NULL, no password is used (const char[])
+ - willTopic : the topic to be used by the will message (const char[])
+ - willQoS : the quality of service to be used by the will message (int : 0,1 or 2)
+ - willRetain : whether the will should be published with the retain flag (int : 0 or 1)
+ - willMessage : the payload of the will message (const char[])
+ - cleanSession : whether to connect clean-session or not (boolean)
+
+ Returns
+
+ - false - connection failed.
+ - true - connection succeeded.
+
+
+
void disconnect ()
Disconnects the client.
@@ -254,6 +282,66 @@ void setup() {
+
+ boolean beginPublish (topic, payloadLength, retained)
+ Begins sending a publish message. The payload of the message is provided by one or more calls to write
followed by a call to endPublish
.
+ Parameters
+
+ - topic - the topic to publish to (const char[])
+ - payloadLength - the length of the message to publish
+ - retained - whether the message should be retained (boolean)
+
+ - false - not retained
+ - true - retained
+
+
+
+ Returns
+
+ - false - publish failed
+ - true - publish succeeded
+
+
+
+
+ size_t write (uint8_t)
+ Writes a byte as a component of a publish started with a call to beginPublish
.
+ Parameters
+
+ - uint8_t - the byte to write
+
+ Returns
+
+ - false - publish failed
+ - true - publish succeeded
+
+
+
+
+ size_t write (payload, length)
+ Writes an array of bytes as a component of a publish started with a call to beginPublish
.
+ Parameters
+
+ - payload - the bytes to write (byte[])
+ - length - the length of the byte array (byte)
+
+ Returns
+
+ - false - publish failed
+ - true - publish succeeded
+
+
+
+
+ boolean beginPublish ()
+ Finishing sending a message that was started with a call to beginPublish
.
+ Returns
+
+ - false - publish failed
+ - true - publish succeeded
+
+
+
boolean subscribe (topic, [qos])
Subscribes to messages published to the specified topic.
diff --git a/index.html b/index.html
index eee85ad..1d4e601 100644
--- a/index.html
+++ b/index.html
@@ -31,6 +31,7 @@ title: Arduino Client for MQTT
Sparkfun WiFly Shield – when used with this library
Intel Galileo/Edison
ESP8266
+ ESP32
The library cannot currently be used with hardware based on the ENC28J60 chip –
@@ -51,91 +52,16 @@ title: Arduino Client for MQTT
Change History
The complete change history is available on GitHub.
- - 2.0
- -
-
- - Add (and default to) MQTT 3.1.1 support
- - Fix PROGMEM handling for Intel Galileo/ESP8266
- - Add overloaded constructors for convenience
- - Add chainable setters for server/callback/client/stream
- - Add state function to return connack return code
-
-
- - 1.9
- -
-
- - Do not split MQTT packets over multiple calls to
_client->write()
- - API change: All constructors now require an instance of Client to be passed in.
- - Fixed example to match 1.8 api changes - dpslwk
- - Added username/password support - WilHall
- - Added
publish_P
- publishes messages from PROGMEM
- jobytaffey
-
-
- - 1.8
- -
-
- - KeepAlive interval is configurable in
PubSubClient.h
- - Maximum packet size is configurable in
PubSubClient.h
- - API change: Return
boolean
rather than int
from various functions
- - API change: Length parameter in message callback changed from
int
to unsigned int
- - Various internal tidy-ups around types
- - Able to specify server address by DNS name
-
-
- - 1.7
- -
-
- - Improved keepalive handling
- - Updated to the Arduino-1.0 API
-
-
- - 1.6
- -
-
- - Added ability to publish retained messages
-
-
- - 1.5
- -
-
- - Added default constructor
- - Fixed compile error when used with arduino-0021 or later
-
-
- - 1.4
- -
-
- - Fixed connection lost handling
-
-
- - 1.3
- -
-
- - Fixed packet reading bug
-
-
- - 1.2
- -
-
- - Fixed compile error when used with arduino-0016 or later
-
-
- - 1.1
- -
-
- - Reduced size of library
- - Added support for Will messages
Clarified licensing – see LICENSE.txt
-
-
- - 1.0
- -
-
- - Only Quality of Service (QOS) 0 messaging is supported
- - The maximum message size, including header, is 128 bytes
- - The keepalive interval is set to 30 seconds
- - No support for Will messages
-
-
+ - 2.7
+ -
+
+ - Fix remaining-length handling to prevent buffer overrun
+ - Add large-payload API - beginPublish/write/publish/endPublish
+ - Add yield call to improve reliability on ESP
+ - Add Clean Session flag to connect options
+ - Add ESP32 support for functional callback signature
+ - Various other fixes
+
+
-
+