You've already forked Adafruit_MQTT_Library
							
							
				mirror of
				https://github.com/adafruit/Adafruit_MQTT_Library.git
				synced 2025-11-03 11:53:11 +03:00 
			
		
		
		
	Merge pull request #222 from adafruit/fix-esp-bsp-2-0-8
Fix connectErrorString return type for ESP-32 BSP 2.0.8
This commit is contained in:
		@@ -327,7 +327,11 @@ uint16_t Adafruit_MQTT::readFullPacket(uint8_t *buffer, uint16_t maxsize,
 | 
				
			|||||||
  return ((pbuff - buffer) + rlen);
 | 
					  return ((pbuff - buffer) + rlen);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef ARDUINO_ARCH_ESP32
 | 
				
			||||||
 | 
					const char *Adafruit_MQTT::connectErrorString(int8_t code) {
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
const __FlashStringHelper *Adafruit_MQTT::connectErrorString(int8_t code) {
 | 
					const __FlashStringHelper *Adafruit_MQTT::connectErrorString(int8_t code) {
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
  switch (code) {
 | 
					  switch (code) {
 | 
				
			||||||
  case 1:
 | 
					  case 1:
 | 
				
			||||||
    return F(
 | 
					    return F(
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -166,11 +166,19 @@ public:
 | 
				
			|||||||
  int8_t connect();
 | 
					  int8_t connect();
 | 
				
			||||||
  int8_t connect(const char *user, const char *pass);
 | 
					  int8_t connect(const char *user, const char *pass);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Return a printable string version of the error code returned by
 | 
					#ifdef ARDUINO_ARCH_ESP32
 | 
				
			||||||
 | 
					  // Returns a printable string version of the error code returned by
 | 
				
			||||||
 | 
					  // connect(). Preprocessor due to breaking change within
 | 
				
			||||||
 | 
					  // Arduino ESP32 BSP v2.0.8
 | 
				
			||||||
 | 
					  // see: https://github.com/espressif/arduino-esp32/pull/7941
 | 
				
			||||||
 | 
					  const char *connectErrorString(int8_t code);
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					  // Returns a printable string version of the error code returned by
 | 
				
			||||||
  // connect(). This returns a __FlashStringHelper*, which points to a
 | 
					  // connect(). This returns a __FlashStringHelper*, which points to a
 | 
				
			||||||
  // string stored in flash, but can be directly passed to e.g.
 | 
					  // string stored in flash, but can be directly passed to e.g.
 | 
				
			||||||
  // Serial.println without any further processing.
 | 
					  // Serial.println without any further processing.
 | 
				
			||||||
  const __FlashStringHelper *connectErrorString(int8_t code);
 | 
					  const __FlashStringHelper *connectErrorString(int8_t code);
 | 
				
			||||||
 | 
					#endif;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Sends MQTT disconnect packet and calls disconnectServer()
 | 
					  // Sends MQTT disconnect packet and calls disconnectServer()
 | 
				
			||||||
  bool disconnect();
 | 
					  bool disconnect();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
name=Adafruit MQTT Library
 | 
					name=Adafruit MQTT Library
 | 
				
			||||||
version=2.5.2
 | 
					version=2.5.3
 | 
				
			||||||
author=Adafruit
 | 
					author=Adafruit
 | 
				
			||||||
maintainer=Adafruit <info@adafruit.com>
 | 
					maintainer=Adafruit <info@adafruit.com>
 | 
				
			||||||
sentence=MQTT library that supports the FONA, ESP8266, ESP32, Yun, and generic Arduino Client hardware.
 | 
					sentence=MQTT library that supports the FONA, ESP8266, ESP32, Yun, and generic Arduino Client hardware.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user