mDNS Component

Installation

The component requires ESP-IDF 5.3 and higher and is installed using IDF Component Manager.

Add this to the idf_component.yml in the project main directory or in the component directory:

dependencies:
  plasmapper/pl_mdns: "^1.1.0"

Add this to the source code:

#include "pl_mdns.h"

Add extern "C" to the app_main function:

extern "C" void app_main(void) {...}

Add this to the sdkconfig.defaults in the project directory or configure the values using Project Configuration:

CONFIG_COMPILER_CXX_RTTI=y
CONFIG_LWIP_SO_RCVBUF=y

Features

  1. PL::MdnsClient - an mDNS client class. PL::MdnsClient::DnsSdQuery() discovers services using a DNS-SD query.

  2. PL::MdnsServer - an mDNS server class. PL::MdnsServer::AddService() adds a PL::NetworkServer to the mDNS server as a service.

Thread safety

Class method thread safety is implemented by having the PL::Lockable as a base class and creating the class object lock guard at the beginning of the methods.

Examples

API reference