[MQTT] Added Arduino String overload
This commit is contained in:
parent
7d00dde817
commit
5c48ed73b6
2 changed files with 5 additions and 0 deletions
|
@ -145,6 +145,10 @@ int16_t MQTTClient::disconnect() {
|
|||
return(_tl->closeTransportConnection());
|
||||
}
|
||||
|
||||
int16_t MQTTClient::publish(String& topic, String& message) {
|
||||
return(MQTTClient::publish(topic.c_str(), message.c_str()));
|
||||
}
|
||||
|
||||
int16_t MQTTClient::publish(const char* topic, const char* message) {
|
||||
// encode packet length
|
||||
size_t topicLen = strlen(topic);
|
||||
|
|
|
@ -35,6 +35,7 @@ class MQTTClient {
|
|||
// basic methods
|
||||
int16_t connect(const char* host, const char* clientId, const char* userName = "", const char* password = "", uint16_t keepAlive = 60, bool cleanSession = true, const char* willTopic = "", const char* willMessage = "");
|
||||
int16_t disconnect();
|
||||
int16_t publish(String& topic, String& message);
|
||||
int16_t publish(const char* topic, const char* message);
|
||||
int16_t subscribe(const char* topicFilter);
|
||||
int16_t unsubscribe(const char* topicFilter);
|
||||
|
|
Loading…
Add table
Reference in a new issue