Use netbios
This commit is contained in:
@@ -106,6 +106,12 @@
|
||||
<input type='checkbox' id='ssdp' name='ssdp'><label for='ssdp'></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class='datafield'>
|
||||
<h2>NETBIOS (reboot required)</h2>
|
||||
<div class='checkboxThree'>
|
||||
<input type='checkbox' id='netbios' name='netbios'><label for='netbios'></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class='datafield'>
|
||||
<h2>Local DNS (devicename.local) (reboot required)</h2>
|
||||
<div class='checkboxContainer'>
|
||||
|
||||
@@ -32,6 +32,7 @@ typedef struct {
|
||||
bool isSerialSet;
|
||||
bool use_mdns;
|
||||
bool use_llmnr;
|
||||
bool use_netbios;
|
||||
} eepromStruct_t;
|
||||
|
||||
eepromStruct_t *getEeprom(void);
|
||||
|
||||
@@ -6,5 +6,6 @@ void startSSDP(void);
|
||||
void startLLMNR(void);
|
||||
void startMDNS(void);
|
||||
void updateMDNS(void);
|
||||
void startNETBIOS(void);
|
||||
|
||||
#endif
|
||||
@@ -350,6 +350,7 @@ void WifiGet(AsyncWebServerRequest *request)
|
||||
jsonObj["ssdp"] = getEeprom()->ssdp;
|
||||
jsonObj["mdns"] = getEeprom()->use_mdns;
|
||||
jsonObj["llmnr"] = getEeprom()->use_llmnr;
|
||||
jsonObj["netbios"] = getEeprom()->use_netbios;
|
||||
response->setLength();
|
||||
request->send(response);
|
||||
}
|
||||
@@ -373,6 +374,7 @@ void WifiPost(AsyncWebServerRequest *request)
|
||||
getEeprom()->ssdp = request->hasArg("ssdp");
|
||||
getEeprom()->use_mdns = request->hasArg("mdns");
|
||||
getEeprom()->use_llmnr = request->hasArg("llmnr");
|
||||
getEeprom()->use_netbios = request->hasArg("netbios");
|
||||
saveEeprom();
|
||||
}
|
||||
request->redirect(F("/wifi.html"));
|
||||
|
||||
@@ -139,6 +139,13 @@ void checkEeprom()
|
||||
writeCheck = true;
|
||||
}
|
||||
|
||||
boolvalue = (uint8_t)eepromStruct.use_netbios;
|
||||
if (boolvalue >= 3)
|
||||
{
|
||||
eepromStruct.use_netbios = true;
|
||||
writeCheck = true;
|
||||
}
|
||||
|
||||
yield();
|
||||
|
||||
if (writeCheck == true)
|
||||
|
||||
@@ -162,6 +162,7 @@ void setup()
|
||||
startLLMNR();
|
||||
startMDNS();
|
||||
startSSDP();
|
||||
startNETBIOS();
|
||||
|
||||
unsigned int ledCounter = 0;
|
||||
while (1)
|
||||
@@ -182,6 +183,7 @@ void setup()
|
||||
startLLMNR();
|
||||
startMDNS();
|
||||
startSSDP();
|
||||
startNETBIOS();
|
||||
|
||||
startSendTimer();
|
||||
//Vertsuur meteen de eerste status
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <ESP8266SSDP.h>
|
||||
#include <ESP8266LLMNR.h>
|
||||
#include <ESP8266mDNS.h>
|
||||
#include <ESP8266NetBIOS.h>
|
||||
#include "global.h"
|
||||
#include "h1602_eeprom.h"
|
||||
#include "asyncWebserver.h"
|
||||
@@ -76,4 +77,15 @@ void updateMDNS()
|
||||
{
|
||||
MDNS.update();
|
||||
}
|
||||
}
|
||||
|
||||
void startNETBIOS()
|
||||
{
|
||||
if (getEeprom()->use_netbios)
|
||||
{
|
||||
#ifdef DEBUG_MSG
|
||||
Serial.printf("Starting NETBIOS...\n");
|
||||
#endif
|
||||
NBNS.begin(getEeprom()->device);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user