mdns_service_add() function
Add service to mDNS server
Arguments
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)
txt
string array of TXT data (eg. {{"var","val"},{"other","2"}})
num_items
number of items in TXT data
Return value
- ESP_OK success - ESP_ERR_INVALID_ARG Parameter error - ESP_ERR_NO_MEM memory error - ESP_FAIL failed to add service
Notes
The value length of txt items will be automatically decided by strlen
mdns_service_add() is called by 1 function and calls 1 function:
![]()
mdns_service_add()
mdns_service_add() reads 1 variable:
![]()
mdns_service_add()