make it fit in allocated space

This commit is contained in:
philippe44
2023-03-27 17:09:27 -07:00
parent 7dfdd7b9e5
commit fc78b36c1f
24 changed files with 421 additions and 230 deletions

View File

@@ -5,11 +5,22 @@
using namespace bell;
class implMDNSService : public MDNSService {
private:
const std::string type;
const std::string proto;
void unregisterService() { mdns_service_remove(type.c_str(), proto.c_str()); }
public:
implMDNSService(std::string type, std::string proto) : type(type), proto(proto) { };
};
/**
* ESP32 implementation of MDNSService
* @see https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/protocols/mdns.html
**/
void* MDNSService::registerService(
std::unique_ptr<MDNSService> MDNSService::registerService(
const std::string& serviceName,
const std::string& serviceType,
const std::string& serviceProto,
@@ -35,5 +46,5 @@ void* MDNSService::registerService(
txtItems.size() /* num_items */
);
return NULL;
return std::make_unique<implMDNSService>(serviceType, serviceProto);
}