mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-07-31 06:32:01 +08:00
Add Netbios support
This commit is contained in:
parent
cd908616ed
commit
a7059bce51
@ -32,6 +32,9 @@
|
||||
//SSDD_FEATURE: this feature is a discovery protocol, supported on Windows out of the box
|
||||
#define SSDP_FEATURE
|
||||
|
||||
//NETBIOS_FEATURE: this feature is a discovery protocol, supported on Windows out of the box
|
||||
#define NETBIOS_FEATURE
|
||||
|
||||
//CAPTIVE_PORTAL_FEATURE: In SoftAP redirect all unknow call to main page
|
||||
#define CAPTIVE_PORTAL_FEATURE
|
||||
|
||||
|
@ -46,6 +46,9 @@ DNSServer dnsServer;
|
||||
#ifdef SSDP_FEATURE
|
||||
#include <ESP8266SSDP.h>
|
||||
#endif
|
||||
#ifdef NETBIOS_FEATURE
|
||||
#include <ESP8266NetBIOS.h>
|
||||
#endif
|
||||
#include <FS.h>
|
||||
#define MAX_SRV_CLIENTS 1
|
||||
WiFiServer * data_server;
|
||||
@ -141,15 +144,17 @@ void setup()
|
||||
// Check for any mDNS queries and send responses
|
||||
wifi_config.mdns.addService("http", "tcp", wifi_config.iweb_port);
|
||||
#endif
|
||||
|
||||
#if defined(SSDP_FEATURE) || defined(NETBIOS_FEATURE)
|
||||
String shost;
|
||||
if (!CONFIG::read_string(EP_HOSTNAME, shost , MAX_HOSTNAME_LENGTH)) {
|
||||
shost=wifi_config.get_default_hostname();
|
||||
}
|
||||
#endif
|
||||
#ifdef SSDP_FEATURE
|
||||
String stmp;
|
||||
SSDP.setSchemaURL("description.xml");
|
||||
SSDP.setHTTPPort( wifi_config.iweb_port);
|
||||
if (!CONFIG::read_string(EP_HOSTNAME, stmp , MAX_HOSTNAME_LENGTH)) {
|
||||
stmp=wifi_config.get_default_hostname();
|
||||
}
|
||||
SSDP.setName(stmp.c_str());
|
||||
SSDP.setName(shost.c_str());
|
||||
stmp=String(ESP.getChipId());
|
||||
SSDP.setSerialNumber(stmp.c_str());
|
||||
SSDP.setURL("/");
|
||||
@ -162,6 +167,9 @@ void setup()
|
||||
SSDP.begin();
|
||||
#endif
|
||||
SPIFFS.begin();
|
||||
#ifdef NETBIOS_FEATURE
|
||||
NBNS.begin(shost.c_str());
|
||||
#endif
|
||||
LOG("Setup Done\n");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user