mirror of
				https://github.com/esp8266/Arduino.git
				synced 2025-10-30 04:26:50 +03:00 
			
		
		
		
	* works * fixup! works * back to callbacks * names * daisy chain * seconds * less inline * fix dns setter * might as well keep using initlist /to d-a-v it has automatic storage, here it's the same stack based one (just one less line for us) * shift blame * naming * fix impl * revert to ip4 dns * merge fix * restyle * masking done wrong
		
			
				
	
	
		
			21 lines
		
	
	
		
			553 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			553 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include <Arduino.h>
 | |
| #include <ESP8266WiFi.h>
 | |
| 
 | |
| void setup() {
 | |
|   auto& server = WiFi.softAPDhcpServer();
 | |
|   server.onSendOptions([](const DhcpServer& server, auto& options) {
 | |
|     // VENDOR is... vendor specific
 | |
|     options.add(43, { 0xca, 0xfe, 0xca, 0xfe, 0xfe });
 | |
| 
 | |
|     // Captive Portal URI
 | |
|     const IPAddress gateway = netif_ip4_addr(server.getNetif());
 | |
|     const String captive = F("http://") + gateway.toString();
 | |
|     options.add(114, captive.c_str(), captive.length());
 | |
|   });
 | |
|   WiFi.softAP("TEST", "testtesttest");
 | |
| }
 | |
| 
 | |
| void loop() {
 | |
|   delay(100);
 | |
| }
 |