mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-06 03:26:53 +03:00
added and activated espressif mDNS service (#3494)
* added and activated espressif mDNS service * moved esp-protocols to code/components
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -10,3 +10,6 @@
|
|||||||
[submodule "code/components/stb"]
|
[submodule "code/components/stb"]
|
||||||
path = code/components/stb
|
path = code/components/stb
|
||||||
url = https://github.com/nothings/stb.git
|
url = https://github.com/nothings/stb.git
|
||||||
|
[submodule "code/components/esp-protocols"]
|
||||||
|
path = code/components/esp-protocols
|
||||||
|
url = https://github.com/espressif/esp-protocols.git
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.16.0)
|
cmake_minimum_required(VERSION 3.16.0)
|
||||||
|
|
||||||
list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common components/esp-tflite-micro)
|
list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common components/esp-tflite-micro components/esp-protocols/components/mdns)
|
||||||
|
|
||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.cpp
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.cpp
|
||||||
|
|||||||
1
code/components/esp-protocols
Submodule
1
code/components/esp-protocols
Submodule
Submodule code/components/esp-protocols added at 9b74256b51
@@ -49,6 +49,9 @@
|
|||||||
#define ets_delay_us(a) esp_rom_delay_us(a)
|
#define ets_delay_us(a) esp_rom_delay_us(a)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "../esp-protocols/components/mdns/include/mdns.h"
|
||||||
|
|
||||||
|
|
||||||
static const char *TAG = "WIFI";
|
static const char *TAG = "WIFI";
|
||||||
|
|
||||||
static bool APWithBetterRSSI = false;
|
static bool APWithBetterRSSI = false;
|
||||||
@@ -657,6 +660,14 @@ esp_err_t wifi_init_sta(void)
|
|||||||
else {
|
else {
|
||||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Set hostname to: " + wlan_config.hostname);
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Set hostname to: " + wlan_config.hostname);
|
||||||
}
|
}
|
||||||
|
//initialize mDNS service
|
||||||
|
retval = mdns_init();
|
||||||
|
if (retval != ESP_OK) {
|
||||||
|
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "mdns_init failed! Error: " + std::to_string(retval));
|
||||||
|
} else {
|
||||||
|
//set mdns hostname
|
||||||
|
mdns_hostname_set(wlan_config.hostname.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Init successful");
|
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Init successful");
|
||||||
|
|||||||
Reference in New Issue
Block a user