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