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

Add setStream from PubSubClient #132

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions src/EspMQTTClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,11 @@ void EspMQTTClient::executeDelayed(const unsigned long delay, DelayedExecutionCa
_delayedExecutionList.push_back(delayedExecutionRecord);
}

void EspMQTTClient::setStream(Stream& stream)
{
_mqttClient.setStream(stream);
}


// ================== Private functions ====================-

Expand Down
3 changes: 2 additions & 1 deletion src/EspMQTTClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ class EspMQTTClient
bool publish(const String &topic, const String &payload, bool retain = false);
bool subscribe(const String &topic, MessageReceivedCallback messageReceivedCallback, uint8_t qos = 0);
bool subscribe(const String &topic, MessageReceivedCallbackWithTopic messageReceivedCallback, uint8_t qos = 0);
bool unsubscribe(const String &topic); //Unsubscribes from the topic, if it exists, and removes it from the CallbackList.
bool unsubscribe(const String &topic); // Unsubscribes from the topic, if it exists, and removes it from the CallbackList.
void setStream(Stream& stream);
void setKeepAlive(uint16_t keepAliveSeconds); // Change the keepalive interval (15 seconds by default)
inline void setMqttClientName(const char* name) { _mqttClientName = name; }; // Allow to set client name manually (must be done in setup(), else it will not work.)
inline void setMqttServer(const char* server, const char* username = "", const char* password = "", const uint16_t port = 1883) { // Allow setting the MQTT info manually (must be done in setup())
Expand Down