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 #47 from adafruit/connack_custom_codes
Add Adafruit IO Custom MQTT CONNACK Return Codes
This commit is contained in:
		@@ -3,7 +3,7 @@ sudo: false
 | 
				
			|||||||
before_install:
 | 
					before_install:
 | 
				
			||||||
  - source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
 | 
					  - source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
 | 
				
			||||||
install:
 | 
					install:
 | 
				
			||||||
  - arduino --install-library "Adafruit SleepyDog Library,Adafruit FONA Library,Adafruit CC3000 Library"
 | 
					  - arduino --install-library "Adafruit SleepyDog Library,Adafruit FONA Library,Adafruit CC3000 Library,Adafruit_WINC1500"
 | 
				
			||||||
script:
 | 
					script:
 | 
				
			||||||
  - build_main_platforms
 | 
					  - build_main_platforms
 | 
				
			||||||
notifications:
 | 
					notifications:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -222,7 +222,7 @@ int8_t Adafruit_MQTT::connect() {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      success = true;
 | 
					      success = true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (! success) return 6; // failed to sub for some reason
 | 
					    if (! success) return -2; // failed to sub for some reason
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return 0;
 | 
					  return 0;
 | 
				
			||||||
@@ -285,13 +285,15 @@ uint16_t Adafruit_MQTT::readFullPacket(uint8_t *buffer, uint16_t timeout) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const __FlashStringHelper* Adafruit_MQTT::connectErrorString(int8_t code) {
 | 
					const __FlashStringHelper* Adafruit_MQTT::connectErrorString(int8_t code) {
 | 
				
			||||||
   switch (code) {
 | 
					   switch (code) {
 | 
				
			||||||
      case 1: return F("Wrong protocol");
 | 
					      case 1: return F("The Server does not support the level of the MQTT protocol requested");
 | 
				
			||||||
      case 2: return F("ID rejected");
 | 
					      case 2: return F("The Client identifier is correct UTF-8 but not allowed by the Server");
 | 
				
			||||||
      case 3: return F("Server unavail");
 | 
					      case 3: return F("The MQTT service is unavailable");
 | 
				
			||||||
      case 4: return F("Bad user/pass");
 | 
					      case 4: return F("The data in the user name or password is malformed");
 | 
				
			||||||
      case 5: return F("Not authed");
 | 
					      case 5: return F("Not authorized to connect");
 | 
				
			||||||
      case 6: return F("Failed to subscribe");
 | 
					      case 6: return F("Exceeded reconnect rate limit. Please try again later.");
 | 
				
			||||||
 | 
					      case 7: return F("You have been banned from connecting. Please contact the MQTT server administrator for more details.");
 | 
				
			||||||
      case -1: return F("Connection failed");
 | 
					      case -1: return F("Connection failed");
 | 
				
			||||||
 | 
					      case -2: return F("Failed to subscribe");
 | 
				
			||||||
      default: return F("Unknown error");
 | 
					      default: return F("Unknown error");
 | 
				
			||||||
   }
 | 
					   }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -68,7 +68,7 @@
 | 
				
			|||||||
#define MQTT_QOS_1 0x1
 | 
					#define MQTT_QOS_1 0x1
 | 
				
			||||||
#define MQTT_QOS_0 0x0
 | 
					#define MQTT_QOS_0 0x0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define CONNECT_TIMEOUT_MS 3000
 | 
					#define CONNECT_TIMEOUT_MS 6000
 | 
				
			||||||
#define PUBLISH_TIMEOUT_MS 500
 | 
					#define PUBLISH_TIMEOUT_MS 500
 | 
				
			||||||
#define PING_TIMEOUT_MS    500
 | 
					#define PING_TIMEOUT_MS    500
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										0
									
								
								examples/mqtt_2subs_esp8266/.due.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_2subs_esp8266/.due.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_2subs_esp8266/.leonardo.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_2subs_esp8266/.leonardo.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_2subs_esp8266/.uno.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_2subs_esp8266/.uno.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_2subs_esp8266/.zero.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_2subs_esp8266/.zero.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_arbitrary_data/.due.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_arbitrary_data/.due.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_arbitrary_data/.leonardo.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_arbitrary_data/.leonardo.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_arbitrary_data/.uno.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_arbitrary_data/.uno.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_arbitrary_data/.zero.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_arbitrary_data/.zero.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_cc3k/.leonardo.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_cc3k/.leonardo.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_cc3k/.uno.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_cc3k/.uno.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_cc3k/.zero.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_cc3k/.zero.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_esp8266/.zero.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_esp8266/.zero.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_yun/.leonardo.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_yun/.leonardo.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_yun/.uno.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_yun/.uno.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								examples/mqtt_yun/.zero.test.skip
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								examples/mqtt_yun/.zero.test.skip
									
									
									
									
									
										Normal file
									
								
							
		Reference in New Issue
	
	Block a user