adafruit / Adafruit_MQTT_Library

Arduino library for MQTT support
MIT License
573 stars 291 forks source link

Changing ServerName #89

Open MolsonB opened 7 years ago

MolsonB commented 7 years ago

I don't know how to do the pull request, but here is a function to change the servername (ipaddress) once defined. I have a system where it tries the main IP address, and if it doesn't connect to go to the backup IP address.

.h void setServer(const char *server, uint16_t port);

.cpp void Adafruit_MQTT::setServer(const char *server, uint16_t port) { servername = server; portnum = port; }