mirror of
https://github.com/EyeTrackVR/OpenIris.git
synced 2025-11-04 15:39:42 +08:00
fix: bug in MDNS handler
This commit is contained in:
parent
1313a96da8
commit
4af73d0377
@ -15,10 +15,10 @@ bool MDNSHandler::startMDNS()
|
|||||||
}
|
}
|
||||||
|
|
||||||
stateManager->setState(MDNSState_e::MDNSState_Starting);
|
stateManager->setState(MDNSState_e::MDNSState_Starting);
|
||||||
MDNS.addService(mdnsConfig->hostname.c_str(), "tcp", 80);
|
MDNS.addService(("_" + mdnsConfig->hostname).c_str(), "_tcp", 80);
|
||||||
char port[20];
|
char port[20];
|
||||||
//! Add service needs leading _ on ESP32 implementation for some reason (according to the docs)
|
//! Add service needs leading _ on ESP32 implementation for some reason (according to the docs)
|
||||||
MDNS.addServiceTxt(("_" + mdnsConfig->hostname).c_str(), "_tcp", "stream_port", (const char *)Helpers::itoa(80, port, 10)); //! convert int to const char* using a very efficient implemenation of itoa
|
MDNS.addServiceTxt(("_" + mdnsConfig->hostname).c_str(), "_tcp", "stream_port", "80"); //! convert int to const char* using a very efficient implemenation of itoa
|
||||||
log_i("MDNS initialized!");
|
log_i("MDNS initialized!");
|
||||||
stateManager->setState(MDNSState_e::MDNSState_Started);
|
stateManager->setState(MDNSState_e::MDNSState_Started);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -50,8 +50,9 @@ void setup()
|
|||||||
deviceConfig.load();
|
deviceConfig.load();
|
||||||
wifiHandler._enable_adhoc = ENABLE_ADHOC;
|
wifiHandler._enable_adhoc = ENABLE_ADHOC;
|
||||||
wifiHandler.setupWifi();
|
wifiHandler.setupWifi();
|
||||||
|
mdnsHandler.startMDNS();
|
||||||
|
|
||||||
mdnsStateManager.setState(MDNSState_e::MDNSState_Starting);
|
/* mdnsStateManager.setState(MDNSState_e::MDNSState_Starting);
|
||||||
switch (mdnsStateManager.getCurrentState())
|
switch (mdnsStateManager.getCurrentState())
|
||||||
{
|
{
|
||||||
case MDNSState_e::MDNSState_Starting:
|
case MDNSState_e::MDNSState_Starting:
|
||||||
@ -63,7 +64,7 @@ void setup()
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
} */
|
||||||
|
|
||||||
switch (wifiStateManager.getCurrentState())
|
switch (wifiStateManager.getCurrentState())
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user