mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Configuration
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
idf_component_register(SRCS "rpc.cpp" "WifiManager.cpp" "mDNSDiscoveryService.cpp" "TCPServer"
|
||||
PRIV_REQUIRES driver esp_event nvs_flash esp_netif esp_wifi espressif__mdns constants
|
||||
idf_component_register(SRCS "rpc.cpp" "WifiManager.cpp" "mDNSDiscoveryService.cpp" "TCPServer.cpp"
|
||||
PRIV_REQUIRES driver esp_event nvs_flash esp_netif esp_wifi espressif__mdns constants config
|
||||
INCLUDE_DIRS "include")
|
||||
|
||||
@@ -4,13 +4,21 @@
|
||||
|
||||
#include "mdns.h"
|
||||
|
||||
#include "ConfigManager.h"
|
||||
|
||||
#include "mDNSDiscoveryService.h"
|
||||
|
||||
#include "constants/tcp.h"
|
||||
|
||||
#include <string>
|
||||
#include <format>
|
||||
|
||||
// todo: clean this up (strange to be a constructor) also need to add more details
|
||||
mDNSDiscoveryService::mDNSDiscoveryService() {
|
||||
mdns_init();
|
||||
mdns_hostname_set("botchain-0000");
|
||||
mdns_instance_name_set("BotChain Robot Module 0000");
|
||||
mdns_hostname_set(std::format("botchain-{}", ConfigManager::get_module_id()).c_str());
|
||||
mdns_instance_name_set(std::format("BotChain Robot Module {}", ConfigManager::get_module_id()).c_str());
|
||||
|
||||
mdns_service_add(NULL, "_robotcontrol", "_udp", 3000, NULL, 0);
|
||||
mdns_service_instance_name_set("_robotcontrol", "_udp", "Robot Control UDP Server");
|
||||
mdns_service_add(nullptr, "_robotcontrol", "_tcp", TCP_PORT, nullptr, 0);
|
||||
mdns_service_instance_name_set("_robotcontrol", "_tcp", "Robot Control TCP Server");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user