EasyManua.ls Logo

Espressif ESP32-S2 - Page 623

Espressif ESP32-S2
1695 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 2. API Reference
Return
ESP_OK success
ESP_ERR_INVALID_STATE mDNS is not running
ESP_ERR_INVALID_ARG Parameter error
ESP_ERR_NO_MEM memory error
Parameters
hostname: Hostname to remove
bool mdns_hostname_exists(const char *hostname)
Query whether a hostname has been added.
Return
true The hostname has been added.
false The hostname has not been added.
Parameters
hostname: Hostname to query
esp_err_t mdns_instance_name_set(const char *instance_name)
Set the default instance name for mDNS server.
Return
ESP_OK success
ESP_ERR_INVALID_ARG Parameter error
ESP_ERR_NO_MEM memory error
Parameters
instance_name: Instance name to set
esp_err_t mdns_service_add(const char *instance_name, const char *service_type, const char
*proto, uint16_t port, mdns_txt_item_t txt[], size_t num_items)
Add service to mDNS server.
Note The value length of txt items will be automatically decided by strlen
Return
ESP_OK success
ESP_ERR_INVALID_ARG Parameter error
ESP_ERR_NO_MEM memory error
ESP_FAIL failed to add service
Parameters
instance_name: instance name to set. If NULL, global instance name or hostname will be used.
Note that MDNS_MULTIPLE_INSTANCE config option needs to be enabled for adding multiple
instances with the same instance type.
service_type: service type (_http, _ftp, etc)
proto: service protocol (_tcp, _udp)
port: service port
txt: string array of TXT data (eg. {{var,val},{other,2}})
num_items: number of items in TXT data
esp_err_t mdns_service_add_for_host(const char *instance_name, const char *service_type,
const char *proto, const char *hostname, uint16_t port,
mdns_txt_item_t txt[], size_t num_items)
Add service to mDNS server with a delegated hostname.
Note The value length of txt items will be automatically decided by strlen
Return
ESP_OK success
ESP_ERR_INVALID_ARG Parameter error
ESP_ERR_NO_MEM memory error
ESP_FAIL failed to add service
Parameters
instance_name: instance name to set. If NULL, global instance name or hostname will be used
Note that MDNS_MULTIPLE_INSTANCE config option needs to be enabled for adding multiple
instances with the same instance type.
Espressif Systems 612
Submit Document Feedback
Release v4.4

Table of Contents