mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Add espressif__mdns component
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
idf_component_register(SRCS "rpc.cpp" "WifiManager.cpp"
|
||||
PRIV_REQUIRES driver esp_event nvs_flash esp_netif esp_wifi
|
||||
idf_component_register(SRCS "rpc.cpp" "WifiManager.cpp" "mDNSDiscoveryService.cpp"
|
||||
PRIV_REQUIRES driver esp_event nvs_flash esp_netif esp_wifi espressif__mdns
|
||||
INCLUDE_DIRS "include")
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
//
|
||||
// Created by Johnathon Slightham on 2025-05-25.
|
||||
//
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
class IWifiManager {
|
||||
public:
|
||||
virtual ~IWifiManager() {};
|
||||
virtual ~IWifiManager() = default;
|
||||
virtual int connect() = 0;
|
||||
virtual int disconnect() = 0;
|
||||
};
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
#ifndef DISCOVERYSERVICE_H
|
||||
#define DISCOVERYSERVICE_H
|
||||
|
||||
class mDNSDiscoveryService : IDiscoveryService {
|
||||
|
||||
}
|
||||
class mDNSDiscoveryService {
|
||||
public:
|
||||
mDNSDiscoveryService();
|
||||
};
|
||||
|
||||
#endif //DISCOVERYSERVICE_H
|
||||
|
||||
16
components/rpc/mDNSDiscoveryService.cpp
Normal file
16
components/rpc/mDNSDiscoveryService.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Created by Johnathon Slightham on 2025-05-25.
|
||||
//
|
||||
|
||||
#include "mdns.h"
|
||||
|
||||
#include "mDNSDiscoveryService.h"
|
||||
|
||||
mDNSDiscoveryService::mDNSDiscoveryService() {
|
||||
mdns_init();
|
||||
mdns_hostname_set("botchain-0000");
|
||||
mdns_instance_name_set("BotChain Robot Module 0000");
|
||||
|
||||
mdns_service_add(NULL, "_robotcontrol", "_udp", 3000, NULL, 0);
|
||||
mdns_service_instance_name_set("_robotcontrol", "_udp", "Robot Control UDP Server");
|
||||
}
|
||||
Reference in New Issue
Block a user