Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added setTimeGetter function to support time handling when millis() a… #984

Open
wants to merge 206 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
5c69907
Move everything under PubSubClient into the root so it can server dir…
Imroy Apr 23, 2015
4f1e53c
Add .gitignore file with some (X)Emacs patterns
Imroy Apr 23, 2015
ed8a9ff
Start cleaning up code - this-> is unnecessary, use typedef for callb…
Imroy Apr 23, 2015
9fb9e07
Port to ESP8266WiFi library, some more renaming
Imroy Apr 23, 2015
8af8d64
Simplify constructors - use setters for optional callback and stream …
Imroy Apr 23, 2015
ca1e5be
Update README
Imroy Apr 23, 2015
3f46451
Clean up argument types for connect()
Imroy Apr 23, 2015
68c68e4
Use memcpy instead of loops
Imroy Apr 23, 2015
7398198
Clean up some odd bits of logic and inefficient maths
Imroy Apr 23, 2015
6462d59
Use OR when combining two bytes, instead of addition
Imroy Apr 23, 2015
64c7cbc
Use Arduino String class instead of char*, cut down on overloaded met…
Imroy Apr 24, 2015
0396dd5
Use standard 'bool' type instead of Arduino's 'boolean' type
Imroy May 1, 2015
a65ed4e
Always initialise the serial console to 115.2 kbaud in examples
Imroy May 7, 2015
43d0d3d
Make layout more compliant with the Arduino 1.5+ specs
Imroy May 7, 2015
3954ed1
Add classes implementing all of the MQTT message types, use them in P…
Imroy May 7, 2015
94708bc
Update example sketches with change to the callback signature
Imroy May 7, 2015
717ee6a
Update the authentication example using an MQTT::Connect object directly
Imroy May 7, 2015
047b7e8
Oops, the PublishRec/Rel/Comp messages do have a variable header
Imroy May 7, 2015
51ed30b
Oops, some confusion as to where the qos value is stored
Imroy May 7, 2015
38384bc
Add getter to PubSubClient for its next packet id
Imroy May 7, 2015
84736d2
Add an example showing how to set the QoS value of a message to publish
Imroy May 7, 2015
3c16701
Have Subscribe and Unsubscribe contstruct a buffer as they go
Imroy May 7, 2015
f4a77b5
Don't increment nextMsgId in the methods that take an MQTT object
Imroy May 7, 2015
cd2a4bb
Change callback signature to simply take an MQTT::Publish object
Imroy May 7, 2015
47b17a7
Can't use the String array operator to set arbitrary characters after…
Imroy May 7, 2015
d9edf64
Add simple subscriber example
Imroy May 7, 2015
70c41f7
Fix signature of callback function in subscriber example
Imroy May 8, 2015
ca78dfd
Have PubSubClient keep the keepalive value from a connection, use it …
Imroy May 8, 2015
854bc4a
Standardise on checking connected() at the start of a method and retu…
Imroy May 8, 2015
9e63964
Use next_packet_id() instead of manipulating nextMsgId directly
Imroy May 8, 2015
9753dd8
Standardise on using the publish/subscribe/unsubscribe methods that t…
Imroy May 8, 2015
3c9b5f1
Update lastOutActivity timestamp every time we send a packet out
Imroy May 8, 2015
11c00c9
The message flags is an uint8_t type, so the constructor should take …
Imroy May 8, 2015
6f3fb58
Move packet id into the base Message class since most types have it
Imroy May 8, 2015
df4c007
Remove 'with_payload' class that didn't end up achieving anything
Imroy May 8, 2015
4ecc2d0
Perform reliable sending of connection, publish, subscribe and unsubs…
Imroy May 8, 2015
7b36b6e
Correct some comments
Imroy May 8, 2015
dbc509f
Add a response_type() to each MQTT message type class
Imroy May 8, 2015
55a0150
Add private send_reliably() method to PubSubClient which handles time…
Imroy May 8, 2015
5ed838a
Oops, have subscriber demo start a new line after every message printed
Imroy May 8, 2015
16f898d
Remove remaining references to stream functionality
Imroy May 9, 2015
eec1824
Update mqtt_stream example to do the stream writing in the callback
Imroy May 9, 2015
27b1664
Allow the maximum number of retransmissions of a message to be set
Imroy May 9, 2015
50d067a
Move short PubSubClient setter methods into the header file
Imroy May 9, 2015
5bd647a
Move Connect setter methods into header
Imroy May 9, 2015
fb4f191
Move Publish setter methods into header
Imroy May 9, 2015
a998375
Add constrctors for Subscribe and Unsubscribe that start with only a …
Imroy May 9, 2015
fca2f33
Fix memory leak by using delete operator instead of free() on objects…
Imroy May 11, 2015
badb1f4
Merge branch 'OOP-monster'
Imroy May 12, 2015
a209619
write_fixed_header() doesn't need to be virtual
Imroy May 12, 2015
e29ee4e
Move write_packet_length() in header
Imroy May 12, 2015
1974b33
Rename 'len' to 'bufpos' in functions that write data to a buffer
Imroy May 12, 2015
e106b47
Add some more comments describing methods and constructors
Imroy May 12, 2015
696e1a5
Allow passing of payloads in "PROGMEM" storage, fix issue #1
Imroy May 14, 2015
d06ca4d
Be more precise with pointer type passed to WiFiClient.write() now th…
Imroy May 14, 2015
2a7050d
Use WiFiClient.h instead of ESP8266WiFi.h in a small effort to be mor…
Imroy May 14, 2015
5a0ca10
Fix up publishing data held in PROGMEM
Imroy May 15, 2015
969898c
Update README with two paragraphs on the changes I've made
Imroy May 15, 2015
d500d09
Add an empty constructor and set_server() methods to allow the server…
Imroy May 16, 2015
c549318
Add comments to other PubSubClient methods
Imroy May 16, 2015
47cfda7
Avoid malloc'ing 0 bytes, possibly fixing #3
Imroy Jun 3, 2015
ae3dd0c
Use static_cast<>() instead of C-style casting
Imroy Jun 6, 2015
9ac8ef9
Replace malloc/free with new/delete operators
Imroy Jun 6, 2015
45d8801
Add some examples of using the MQTT classes and their chainable sette…
Imroy Jun 6, 2015
2c83327
Use std::function to define the callback type
Imroy Jun 8, 2015
e2a72ad
Remove extra semicolons that are picked up by the -pedantic compiler …
Imroy Jun 14, 2015
56ea511
initialize pending pings variable in connect, so that reconnections c…
TheDistractor Jun 15, 2015
ec565e5
Merge pull request #10 from TheDistractor/master
Imroy Jun 15, 2015
278199a
Update library.properties
Testato Jun 18, 2015
8c8a94b
Merge pull request #11 from Testato/patch-1
Imroy Jun 18, 2015
0cf1704
Convert README to mediawiki format
Imroy Jun 19, 2015
9b9b5ef
Add notice about MQTT 3.1.1 broker
Imroy Jun 19, 2015
64705b5
Upgrade all lengths and positions from 8 bits to 32 bits
Imroy Jun 20, 2015
43c3268
Make write_* methods return void
Imroy Jun 20, 2015
ba97747
Mark write_* methods as being const
Imroy Jun 20, 2015
6333b0b
Make write_variable_header() empty in the base class so that child cl…
Imroy Jun 20, 2015
88d33e0
Make packet size dynamic, allowing the max allowed by MQTT and the pl…
Imroy Jun 20, 2015
54b7c5d
Also make payload length (plength) 32-bit in the PubSubClient class
Imroy Jun 22, 2015
8baacb7
Convert existing comments to Doxygen documentation, add Doxygen confi…
Imroy Jun 22, 2015
b9e68d6
Convert the comments in MQTT.h to Doxygen documentation
Imroy Jun 22, 2015
d1db20a
Link to the new Doxygen-generated docs from README
Imroy Jun 22, 2015
d60b095
Replace delayMicroseconds(100) in loops with yield()
Imroy Jun 22, 2015
de795e0
Only include "functional" and "pgmspace.h" on ESP8266
Imroy Jun 22, 2015
ae47dba
Fix building for non-ESP8266 devices
Imroy Jun 22, 2015
d47f2ba
Oops, redeclare 'sent' variable
Imroy Jun 23, 2015
d2912a4
Simplify _process_message - the optional args are only used in one place
Imroy Jun 24, 2015
f889040
More documentation of the internal functions of PubSubClient
Imroy Jun 24, 2015
ea84fd1
Move the MQTT message types into an enum type in the MQTT namespace
Imroy Jun 24, 2015
d12c2ff
Oops, get session_present flag
Imroy Jun 24, 2015
a639cf3
update lastInActivity the other place we read a packet
Imroy Jun 24, 2015
985bcef
Fill out keywords with all of our types and functions/methods
Imroy Jun 25, 2015
a0edcf0
Mark library as being for all architectures, add period to end of sen…
Imroy Jun 25, 2015
04109b6
Remove unnecessary _client == NULL check
Imroy Jun 25, 2015
a4c36c5
Check make sure we're connected before trying to disconnect
Imroy Jun 25, 2015
66cb5d3
Unnecessary connected() checks
Imroy Jun 25, 2015
b44b2d7
Add underscores to start of wait_for() and send_reliably() to signify…
Imroy Jun 25, 2015
792c0f5
Bump version to 1.99.0
Imroy Jun 25, 2015
cf15dcc
Don't set the packet id on MQTT::* objects, have PubSubClient do that…
Imroy Jul 6, 2015
151ea69
Oops, when did deferred_payload sneak in?
Imroy Jul 17, 2015
da7c5ae
Replace readByte with a template function
Imroy Jul 17, 2015
cd6260b
Allow large Publish and SubscribeAck message payloads to be received …
Imroy Jul 17, 2015
b79e356
Add example sketch for receiving OTA updates in MQTT messages
Imroy Jul 17, 2015
45761fb
Disconnect from the broker before rebooting
Imroy Jul 17, 2015
4b72308
Set the retain flag when pushing an OTA update
Imroy Jul 17, 2015
6fa5e86
Print out the timestamp on boot so we can see when the new version ha…
Imroy Jul 17, 2015
15260f7
Use writeStream() method instead of write()
Imroy Jul 17, 2015
d7d045a
Use ESP.updateSketch() to read the update from the stream
Imroy Jul 17, 2015
8513745
Close the stream once the update is finished
Imroy Jul 17, 2015
19a1449
Update examples to show how to stream the payload in callback functions
Imroy Jul 17, 2015
a76fff5
Make internal _recv_message() method to simplify getting messages
Imroy Jul 17, 2015
3c81596
Rename _send_reliably to _send_message and use it for sending all mes…
Imroy Jul 17, 2015
4bebebc
A bunch of places where we can directly return the result from _send_…
Imroy Jul 17, 2015
4addf79
More testing the return from _send_message()
Imroy Jul 17, 2015
bd6522a
Just use one simple constructor for MQTT::Message
Imroy Jul 18, 2015
e8a9814
Make network constructors private
Imroy Jul 18, 2015
ff826b2
Reword documentation for constructors, explain Publish's parameters
Imroy Jul 18, 2015
a788fdd
Oops, really need to do the initialisation of lastInActivity before _…
Imroy Jul 18, 2015
0223efa
Add a 'need_reply' argument to _send_message() to restore the old _se…
Imroy Jul 18, 2015
3406427
Update all of the examples with reliable connecting in loop()
Imroy Jul 18, 2015
dd1b435
Add a callback mechanism for publishing large messages
Imroy Jul 18, 2015
9ac342f
Return true or false from the payload callback in the publish_large e…
Imroy Jul 18, 2015
636ed87
Create 'options' subheading under 'new features'
Imroy Jul 19, 2015
1e52931
Rename payload callback and its parameter
Imroy Jul 19, 2015
fa24049
Describe how to send or receive large Publish messages
Imroy Jul 19, 2015
0b3ba71
Fix markup
Imroy Jul 19, 2015
9fa8fd7
Add links to example sketches
Imroy Jul 19, 2015
f8fcdfc
Add links to MQTT namespace and PubSubClient class docs
Imroy Jul 19, 2015
99f7ece
Add information about Mosquitto versions
Imroy Jul 20, 2015
9de3db4
Join paragraphs of text into single lines
Imroy Jul 20, 2015
d7a4a2a
Fixed comparison of message packet ids
mactro Jul 23, 2015
b1ad9b7
Merge pull request #24 from mactro/master
Imroy Jul 23, 2015
b375302
Bump to 1.99.1
Testato Jul 23, 2015
f6ad4b6
Merge pull request #26 from Testato/patch-2
Imroy Jul 24, 2015
e1d3cd8
Client never connected...
Protoneer Aug 1, 2015
f3e8287
Merge pull request #28 from Protoneer/patch-1
Imroy Aug 6, 2015
ae94d0b
Oops, create Unsubscribe objects with the wrong message type
Imroy Nov 9, 2015
e18a5a1
Make MQTT::Message::packet_id() method public
Imroy Mar 16, 2016
1d277ec
Fix reading multi-packet messages in MQTT::readPacket()
Imroy Mar 22, 2016
8ded71f
Put "remaining length" decoder in block to limit variable scope
Imroy Mar 22, 2016
2529552
Remove unused variable
Imroy Mar 22, 2016
11fd8d0
Have connect(String) make its own object
Imroy Mar 22, 2016
18dc076
Change the private sections of Connect and Publish to protected
Imroy Dec 5, 2016
faa0634
Add header file for publishing ArduinoJson objects and arrays
Imroy Dec 5, 2016
1ca3076
Rename one of the overloaded write() functions to write_bare_payload …
Imroy Dec 5, 2016
d17035a
Allow the "will" message to be any binary payload, not just a String
Imroy Dec 5, 2016
b14ac47
Add example sketch for testing out "will" messages
Imroy Dec 5, 2016
c1c7bef
Add ConnectJSON class for having JSON "will" messages
Imroy Dec 5, 2016
3e58b42
Add some comments describing the write() functions
Imroy Dec 5, 2016
4b99d26
Be sure to check the buffer pointer before using it to write the payload
Imroy Dec 5, 2016
7fe1fc2
Fix not initialized field
Toshik Dec 16, 2016
ed4ff81
Merge pull request #69 from Toshik/patch-1
Imroy Dec 17, 2016
7b186bc
Use template constructors (!) to be able to print any child of JsonPr…
Imroy Dec 7, 2016
a1fe3f6
Fixing the PublishComp object to send PUBCOMP packet instead of a PUB…
vmarseguerra Dec 31, 2016
7f8d92d
Fix: Library remains blocked if there are incoming PUBLISH messages w…
vmarseguerra Dec 31, 2016
5a3adec
Update library.properties
Testato Jan 14, 2017
1a8fd63
Merge pull request #70 from Vincent-Ma/master
Imroy Jan 24, 2017
090014d
Merge pull request #73 from Testato/patch-4
Imroy Jan 24, 2017
3d13e7a
Fixed PublishAck to send variable header
THKDev Mar 13, 2017
6cff905
use strncpy_P for flash memory access; add enum for QOS
THKDev Mar 17, 2017
1ae36b4
this commit fixes #64
THKDev Mar 17, 2017
727b91b
Merge in a few fixes from THKDev, including fixing PublishAck when QO…
Imroy Mar 19, 2017
4e99533
Also check for ESP32 for automatically including <functional>
Imroy Apr 27, 2017
0ef8589
Use C++11's nullptr instead of C's NULL
Imroy May 12, 2017
c94d36b
Client::read() returns an int and -1 indicates an error
Imroy May 12, 2017
945125a
Since we use realloc(), use malloc() and free() on _buffer
Imroy May 12, 2017
1ceea39
Use a reference to the Client object instead of a pointer
Imroy May 13, 2017
d94ccef
Use a define to specify how big is too big and requires 'streaming'
Imroy May 13, 2017
627481f
Tests: Clean up the C++ code in tests/src/lib
Imroy May 15, 2017
1a842e2
Tests: Fix paths to the main library in the tests Makefile
Imroy May 15, 2017
2f98597
Tests: Make simple IPAddress class that operates more like Arduino's …
Imroy May 15, 2017
5244b18
Tests: Have the Makefile pull in all *.cpp files from the main library
Imroy May 15, 2017
baa19a0
Tests: Pull in dummy defines from the ESP8266 port for AVR's pgmspace…
Imroy May 15, 2017
5932923
Tests: fix use of PubSubClient constructor
Imroy May 15, 2017
0bbf93a
Tests: fix callbacks
Imroy May 15, 2017
6053531
Tests: fix use of the connect() method
Imroy May 15, 2017
558c2d0
Tests: Add unistd.h to keepalive_spec for sleep()
Imroy May 15, 2017
a75b164
Tests: Need Stream.h in receive_spec
Imroy May 15, 2017
ea3fca5
Tests: define 'String' in Arduino.h and include that in MQTT.cpp to a…
Imroy May 15, 2017
b05e3e7
Tests: topic is now a String type so use the equals operator instead …
Imroy May 15, 2017
889a29d
Tests: include stddef.h in Client.h to get basic typedefs
Imroy May 15, 2017
a7a281b
Tests: define our own MQTT_MAX_PACKET_SIZE since my version of the li…
Imroy May 15, 2017
8530574
Tests: Pull in more pgmspace.h definitions from the ESP8266 for Ardui…
Imroy May 15, 2017
ea84e8c
Tests: Use size_t instead of uint16_t for sizes and related variables
Imroy May 16, 2017
b16cf1f
Tests: Don't write past the end of bigPublish in receive_spec
Imroy May 16, 2017
be57b07
Tests: Write large packets in receive_spec with multi-byte length field
Imroy May 16, 2017
d14937c
Tests: Add deconstructors to ShimClient and Stream to deallocate dyna…
Imroy May 16, 2017
e4912c3
Tests: use proper protocol name and level for MQTT 3.1.1 in connect_spec
Imroy May 16, 2017
e84fc73
Tests: return the number of bytes available in Buffer.available() ins…
Imroy May 16, 2017
2349453
Tests: Update Makefile to compile into separate object files first
Imroy May 16, 2017
d599174
Add tests binaries to gitignore file
Imroy May 16, 2017
4c04908
Tests: Use std::string in the Buffer class instead of a fixed size bu…
Imroy May 16, 2017
e0c0e86
Make readPacket() state based so it can handle not having the complet…
Imroy May 12, 2017
a2fae93
Move packet parser into a class
Imroy May 13, 2017
9d391d6
Use an enum class for parser state variable
Imroy May 15, 2017
525df0c
Split reading the 'header' into the type/flags byte and then remainin…
Imroy May 16, 2017
f37122d
Return a message pointer from _wait_for so we can examine the respons…
Imroy May 16, 2017
747c441
Split _send_message() into one that just sends and a second that wait…
Imroy May 16, 2017
beb81e3
Test the return code of the CONNACK response to a connection attempt
Imroy May 16, 2017
9303c1f
Update ConnectJSON and PublishJSON for v6 of ArduinoJson
Imroy Oct 17, 2020
45888da
Add available() method to PubSubClient for checking if a packet is av…
Imroy Oct 17, 2020
79c1dc4
Correct documentation on loop() method
Imroy Oct 18, 2020
0a9a277
Use new/delete instead of malloc/free
Imroy Oct 25, 2020
d911d76
Correctly size and allocated the buffer for JSON messages
Imroy Oct 25, 2020
b44a900
added setTimeGetter function to support time handling when millis() a…
egzumer Dec 23, 2022
30e4114
set TimeGetter return time according to millis
egzumer Dec 29, 2022
198cd48
fix response_type missing return
egzumer Dec 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use standard 'bool' type instead of Arduino's 'boolean' type
  • Loading branch information
Imroy committed May 9, 2015
commit 0396dd51b9660a84234730aec77381e768d47924
22 changes: 11 additions & 11 deletions PubSubClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ PubSubClient& PubSubClient::unset_stream(void) {
return *this;
}

boolean PubSubClient::connect(String id) {
bool PubSubClient::connect(String id) {
return connect(id, "", 0, false, "");
}

boolean PubSubClient::connect(String id, String willTopic, uint8_t willQos, boolean willRetain, String willMessage) {
bool PubSubClient::connect(String id, String willTopic, uint8_t willQos, bool willRetain, String willMessage) {
if (!connected()) {
int result = 0;

Expand Down Expand Up @@ -182,7 +182,7 @@ uint16_t PubSubClient::readPacket(uint8_t* lengthLength) {
return len;
}

boolean PubSubClient::loop() {
bool PubSubClient::loop() {
if (connected()) {
unsigned long t = millis();
if ((t - lastInActivity > MQTT_KEEPALIVE*1000UL) || (t - lastOutActivity > MQTT_KEEPALIVE*1000UL)) {
Expand Down Expand Up @@ -244,11 +244,11 @@ boolean PubSubClient::loop() {
return false;
}

boolean PubSubClient::publish(String topic, String payload) {
bool PubSubClient::publish(String topic, String payload) {
return publish(topic, (const uint8_t*)payload.c_str(), payload.length(), false);
}

boolean PubSubClient::publish(String topic, const uint8_t* payload, unsigned int plength, boolean retained) {
bool PubSubClient::publish(String topic, const uint8_t* payload, unsigned int plength, bool retained) {
if (connected()) {
// Leave room in the buffer for header and variable length field
uint16_t length = 5;
Expand All @@ -266,7 +266,7 @@ boolean PubSubClient::publish(String topic, const uint8_t* payload, unsigned int
return false;
}

boolean PubSubClient::publish_P(String topic, const uint8_t* PROGMEM payload, unsigned int plength, boolean retained) {
bool PubSubClient::publish_P(String topic, const uint8_t* PROGMEM payload, unsigned int plength, bool retained) {
uint8_t llen = 0;
uint8_t digit;
unsigned int rc = 0;
Expand Down Expand Up @@ -310,7 +310,7 @@ boolean PubSubClient::publish_P(String topic, const uint8_t* PROGMEM payload, un
return rc == tlen + 4 + plength;
}

boolean PubSubClient::write(uint8_t header, uint8_t* buf, uint16_t length) {
bool PubSubClient::write(uint8_t header, uint8_t* buf, uint16_t length) {
uint8_t lenBuf[4];
uint8_t llen = 0;
uint8_t digit;
Expand All @@ -334,7 +334,7 @@ boolean PubSubClient::write(uint8_t header, uint8_t* buf, uint16_t length) {
return (rc == 1+llen+length);
}

boolean PubSubClient::subscribe(String topic, uint8_t qos) {
bool PubSubClient::subscribe(String topic, uint8_t qos) {
if (qos < 0 || qos > 1)
return false;

Expand All @@ -354,7 +354,7 @@ boolean PubSubClient::subscribe(String topic, uint8_t qos) {
return false;
}

boolean PubSubClient::unsubscribe(String topic) {
bool PubSubClient::unsubscribe(String topic) {
if (connected()) {
uint16_t length = 5;
nextMsgId++;
Expand Down Expand Up @@ -391,8 +391,8 @@ uint16_t PubSubClient::writeString(String string, uint8_t* buf, uint16_t pos) {
}


boolean PubSubClient::connected() {
boolean rc = (int)_client.connected();
bool PubSubClient::connected() {
bool rc = _client.connected();
if (!rc)
_client.stop();

Expand Down
22 changes: 11 additions & 11 deletions PubSubClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class PubSubClient {

uint16_t readPacket(uint8_t*);
uint8_t readByte();
boolean write(uint8_t header, uint8_t* buf, uint16_t length);
bool write(uint8_t header, uint8_t* buf, uint16_t length);
uint16_t writeString(String string, uint8_t* buf, uint16_t pos);


Expand All @@ -78,17 +78,17 @@ class PubSubClient {
PubSubClient& set_stream(Stream &s);
PubSubClient& unset_stream(void);

boolean connect(String id);
boolean connect(String id, String willTopic, uint8_t willQos, boolean willRetain, String willMessage);
bool connect(String id);
bool connect(String id, String willTopic, uint8_t willQos, bool willRetain, String willMessage);
void disconnect(void);
boolean publish(String topic, String payload);
boolean publish(String topic, const uint8_t *payload, unsigned int plength, boolean retained = false);
boolean publish_P(String topic, const uint8_t PROGMEM *payload, unsigned int, boolean retained = false);
boolean subscribe(String topic, uint8_t qos = 0);
boolean unsubscribe(String topic);

boolean loop();
boolean connected();
bool publish(String topic, String payload);
bool publish(String topic, const uint8_t *payload, unsigned int plength, bool retained = false);
bool publish_P(String topic, const uint8_t PROGMEM *payload, unsigned int, bool retained = false);
bool subscribe(String topic, uint8_t qos = 0);
bool unsubscribe(String topic);

bool loop();
bool connected();
};


Expand Down