mirror of
				https://github.com/esp8266/Arduino.git
				synced 2025-11-03 14:33:37 +03:00 
			
		
		
		
	use STA as default interface in mDNS (#7042)
This commit is contained in:
		@@ -114,33 +114,20 @@ bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& p_IPAddress
 | 
				
			|||||||
                IPAddress sta = WiFi.localIP();
 | 
					                IPAddress sta = WiFi.localIP();
 | 
				
			||||||
                IPAddress ap = WiFi.softAPIP();
 | 
					                IPAddress ap = WiFi.softAPIP();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (!sta.isSet() && !ap.isSet())
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] internal interfaces (STA, AP) are not set (none was specified)\n")));
 | 
					 | 
				
			||||||
                    return false;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                if (ap.isSet())
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                if (sta.isSet())
 | 
					                if (sta.isSet())
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] default interface AP selected over STA (none was specified)\n")));
 | 
					                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] STA interface selected\n")));
 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    else
 | 
					 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] default interface AP selected\n")));
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                    ipAddress = ap;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] default interface STA selected (none was specified)\n")));
 | 
					 | 
				
			||||||
                    ipAddress = sta;
 | 
					                    ipAddress = sta;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else if (ap.isSet())
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] AP interface selected\n")));
 | 
				
			||||||
 | 
					                    ipAddress = ap;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] standard interfaces are not up, please specify one in ::begin()\n")));
 | 
				
			||||||
 | 
					                    return false;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                // continue to ensure interface is UP
 | 
					                // continue to ensure interface is UP
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user