PL::MdnsServer class
-
class MdnsServer : public PL::NetworkServer, public PL::EventHandler<Server>
mDNS server class
Public Functions
-
MdnsServer(const std::string &hostname)
Creates an mDNS server.
- Parameters:
hostname – hostname
-
virtual esp_err_t Lock(TickType_t timeout = portMAX_DELAY) override
Locks the object.
- Parameters:
timeout – timeout in FreeRTOS ticks
- Returns:
error code
-
virtual esp_err_t Unlock() override
Unlocks the object.
- Returns:
error code
-
virtual esp_err_t Enable() override
Enables the server.
- Returns:
error code
-
virtual esp_err_t Disable() override
Disables the server.
- Returns:
error code
Adds a network server to the mDNS server as a service.
- Parameters:
server – server
name – service name
type – service type (_http, _ftp, etc)
protocol – service protocol (_tcp, _udp)
additionalInfo – additional information
- Returns:
-
virtual bool IsEnabled() override
Checks if the server is enabled.
- Returns:
true if the server is enabled
-
virtual uint16_t GetPort() override
Gets listening port.
- Returns:
port
-
virtual esp_err_t SetPort(uint16_t port) override
Sets listening port.
- Parameters:
port – port
- Returns:
error code
-
virtual size_t GetMaxNumberOfClients() override
Gets the maximum number of server clients.
- Returns:
number of clients
-
virtual esp_err_t SetMaxNumberOfClients(size_t maxNumberOfClients) override
Sets the maximum number of server clients.
- Parameters:
maxNumberOfClients – number of clients
- Returns:
error code
-
std::string GetHostname()
Gets the hostname.
- Returns:
hostname
-
esp_err_t SetHostname(const std::string &hostname)
Sets the hostname.
- Parameters:
hostname –
- Returns:
error code
-
std::string GetName()
Gets the server name.
- Returns:
name
-
void SetName(const std::string &name)
Sets the server name.
- Parameters:
name – name
Public Members
-
MdnsServer(const std::string &hostname)