1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Implement Async NBNS (NetBIOS) name resolution for Windows (#2275)

* Implement Async NBNS (NetBIOS) Name resolution for windows

Source: http://www.xpablo.cz/?p=751#more-751
This commit is contained in:
Me No Dev
2016-07-15 10:40:31 +03:00
committed by GitHub
parent e35ebf137d
commit 1f7989b31d
5 changed files with 385 additions and 0 deletions

View File

@ -0,0 +1,49 @@
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266NetBIOS.h>
const char* ssid = "............";
const char* password = "..............";
ESP8266WebServer wwwserver(80);
String content;
static void handleRoot(void)
{
content = F("<!DOCTYPE HTML>\n<html>Hello world from ESP8266");
content += F("<p>");
content += F("</html>");
wwwserver.send(200, F("text/html"), content);
}
void setup()
{
Serial.begin(115200);
// Connect to WiFi network
WiFi.begin(ssid, password);
Serial.println("");
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
wwwserver.on("/", handleRoot);
wwwserver.begin();
NBNS.begin("ESP");
}
void loop()
{
wwwserver.handleClient();
}