Loading [MathJax]/extensions/tex2jax.js
SensESP
3.1.0
Universal Signal K sensor toolkit ESP32
Toggle main menu visibility
Main Page
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
m
n
o
s
u
v
w
Functions
a
b
c
e
f
g
h
m
o
s
u
Variables
Typedefs
a
b
d
f
i
n
s
v
w
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Typedefs
Related Symbols
Files
File List
File Members
All
b
d
g
h
k
l
m
p
r
s
w
Functions
Variables
Macros
▼
SensESP
►
Namespaces
►
Classes
▼
Files
▼
File List
▼
src
▼
sensesp
►
controllers
▼
net
►
web
discovery.cpp
►
discovery.h
►
http_authenticator.cpp
►
http_authenticator.h
►
http_server.cpp
►
http_server.h
►
networking.cpp
►
networking.h
ota.cpp
►
ota.h
►
wifi_state.h
►
sensors
►
signalk
►
system
►
transforms
►
types
►
ui
►
sensesp_version.h
►
main.cpp
►
sensesp.cpp
►
sensesp.h
►
sensesp_app.cpp
►
sensesp_app.h
►
sensesp_app_builder.h
sensesp_base_app.cpp
►
sensesp_base_app.h
►
sensesp_base_app_builder.h
►
sensesp_minimal_app.h
►
sensesp_minimal_app_builder.h
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Loading...
Searching...
No Matches
discovery.cpp
Go to the documentation of this file.
1
#include "
discovery.h
"
2
3
#include "
sensesp_base_app.h
"
4
5
namespace
sensesp
{
6
7
MDNSDiscovery::MDNSDiscovery
() {
8
event_loop
()->onDelay(0, [
this
]() {
9
String hostname =
SensESPBaseApp::get_hostname
();
10
11
// MDNS.begin(hostname) will crash if hostname is blank
12
if
((hostname ==
""
)) {
13
ESP_LOGE(__FILENAME__,
"hostname has not been set - mDNS can't start"
);
14
return
;
15
}
16
if
(!MDNS.begin(
17
hostname.c_str())) {
// Start the mDNS responder for hostname.local
18
ESP_LOGW(__FILENAME__,
"Error setting up mDNS responder"
);
19
}
else
{
20
ESP_LOGI(__FILENAME__,
"mDNS responder started for hostname '%s'"
,
21
hostname.c_str());
22
}
23
mdns_instance_name_set(hostname.c_str());
// mDNS hostname for ESP32
24
});
25
}
7
MDNSDiscovery::MDNSDiscovery
() {
…
}
26
27
}
// namespace sensesp
sensesp::MDNSDiscovery::MDNSDiscovery
MDNSDiscovery()
Definition
discovery.cpp:7
sensesp::SensESPBaseApp::get_hostname
static String get_hostname()
Get the current hostname.
Definition
sensesp_base_app.h:105
discovery.h
sensesp
Definition
sensesp.cpp:7
sensesp::event_loop
std::shared_ptr< reactesp::EventLoop > event_loop()
Definition
sensesp.cpp:9
sensesp_base_app.h
src
sensesp
net
discovery.cpp
Generated by
1.12.0