diff --git a/Adafruit_MQTT.h b/Adafruit_MQTT.h index fc65b0a..382dd87 100644 --- a/Adafruit_MQTT.h +++ b/Adafruit_MQTT.h @@ -100,7 +100,7 @@ class Adafruit_MQTT_Subscribe; // forward decl class Adafruit_MQTT { public: Adafruit_MQTT(const char *server = "io.adafruit.com", - uint16_t port = 1883, + uint16_t port = 1883, const char *user = "", const char *pass = "", const char *cid = ""); diff --git a/examples/mqtt_cc3k/mqtt_cc3k.ino b/examples/mqtt_cc3k/mqtt_cc3k.ino index bce77ed..4fa3a26 100644 --- a/examples/mqtt_cc3k/mqtt_cc3k.ino +++ b/examples/mqtt_cc3k/mqtt_cc3k.ino @@ -45,18 +45,14 @@ // Setup the main CC3000 class, just like a normal CC3000 sketch. Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT); -// Store the MQTT server, client ID, username, and password in flash memory. +// Store the MQTT server, username, and password in flash memory. // This is required for using the Adafruit MQTT library. const char MQTT_SERVER[] PROGMEM = AIO_SERVER; -// Set a unique MQTT client ID using the AIO key + the date and time the sketch -// was compiled (so this should be unique across multiple devices for a user, -// alternatively you can manually set this to a GUID or other random value). -const char MQTT_CLIENTID[] PROGMEM = __TIME__ AIO_USERNAME; const char MQTT_USERNAME[] PROGMEM = AIO_USERNAME; const char MQTT_PASSWORD[] PROGMEM = AIO_KEY; // Setup the CC3000 MQTT class by passing in the CC3000 class and MQTT server and login details. -Adafruit_MQTT_CC3000 mqtt(&cc3000, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD); +Adafruit_MQTT_CC3000 mqtt(&cc3000, MQTT_SERVER, AIO_SERVERPORT, MQTT_USERNAME, MQTT_PASSWORD); // You don't need to change anything below this line! #define halt(s) { Serial.println(F( s )); while(1); } diff --git a/examples/mqtt_esp8266/mqtt_esp8266.ino b/examples/mqtt_esp8266/mqtt_esp8266.ino index ca72c59..75830c3 100644 --- a/examples/mqtt_esp8266/mqtt_esp8266.ino +++ b/examples/mqtt_esp8266/mqtt_esp8266.ino @@ -35,14 +35,14 @@ // Create an ESP8266 WiFiClient class to connect to the MQTT server. WiFiClient client; -// Store the MQTT server, client ID, username, and password in flash memory. +// Store the MQTT server, username, and password in flash memory. // This is required for using the Adafruit MQTT library. const char MQTT_SERVER[] PROGMEM = AIO_SERVER; const char MQTT_USERNAME[] PROGMEM = AIO_USERNAME; const char MQTT_PASSWORD[] PROGMEM = AIO_KEY; // Setup the MQTT client class by passing in the WiFi client and MQTT server and login details. -Adafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, "", MQTT_USERNAME, MQTT_PASSWORD); +Adafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, MQTT_USERNAME, MQTT_PASSWORD); /****************************** Feeds ***************************************/ diff --git a/examples/mqtt_fona/mqtt_fona.ino b/examples/mqtt_fona/mqtt_fona.ino index 4af766a..45c41cb 100644 --- a/examples/mqtt_fona/mqtt_fona.ino +++ b/examples/mqtt_fona/mqtt_fona.ino @@ -52,18 +52,14 @@ Adafruit_FONA fona = Adafruit_FONA(FONA_RST); /************ Global State (you don't need to change this!) ******************/ -// Store the MQTT server, client ID, username, and password in flash memory. +// Store the MQTT server, username, and password in flash memory. // This is required for using the Adafruit MQTT library. const char MQTT_SERVER[] PROGMEM = AIO_SERVER; -// Set a unique MQTT client ID using the AIO key + the date and time the sketch -// was compiled (so this should be unique across multiple devices for a user, -// alternatively you can manually set this to a GUID or other random value). -const char MQTT_CLIENTID[] PROGMEM = __TIME__ AIO_USERNAME; const char MQTT_USERNAME[] PROGMEM = AIO_USERNAME; const char MQTT_PASSWORD[] PROGMEM = AIO_KEY; // Setup the FONA MQTT class by passing in the FONA class and MQTT server and login details. -Adafruit_MQTT_FONA mqtt(&fona, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD); +Adafruit_MQTT_FONA mqtt(&fona, MQTT_SERVER, AIO_SERVERPORT, MQTT_USERNAME, MQTT_PASSWORD); // You don't need to change anything below this line! #define halt(s) { Serial.println(F( s )); while(1); } diff --git a/examples/mqtt_yun/mqtt_yun.ino b/examples/mqtt_yun/mqtt_yun.ino index cea49d6..33fa550 100644 --- a/examples/mqtt_yun/mqtt_yun.ino +++ b/examples/mqtt_yun/mqtt_yun.ino @@ -35,18 +35,14 @@ // Create a YunClient instance to communicate using the Yun's brighe & Linux OS. YunClient client; -// Store the MQTT server, client ID, username, and password in flash memory. +// Store the MQTT server, username, and password in flash memory. // This is required for using the Adafruit MQTT library. const char MQTT_SERVER[] PROGMEM = AIO_SERVER; -// Set a unique MQTT client ID using the AIO key + the date and time the sketch -// was compiled (so this should be unique across multiple devices for a user, -// alternatively you can manually set this to a GUID or other random value). -const char MQTT_CLIENTID[] PROGMEM = __TIME__ AIO_USERNAME; const char MQTT_USERNAME[] PROGMEM = AIO_USERNAME; const char MQTT_PASSWORD[] PROGMEM = AIO_KEY; // Setup the MQTT client class by passing in the WiFi client and MQTT server and login details. -Adafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, MQTT_CLIENTID, MQTT_USERNAME, MQTT_PASSWORD); +Adafruit_MQTT_Client mqtt(&client, MQTT_SERVER, AIO_SERVERPORT, MQTT_USERNAME, MQTT_PASSWORD); /****************************** Feeds ***************************************/