Chapter 2. API Reference
Note The value length will be automatically decided by strlen
Return
• ESP_OK success
• ESP_ERR_INVALID_ARG Parameter error
• ESP_ERR_NOT_FOUND Service not found
• ESP_ERR_NO_MEM memory error
Parameters
• service_type: service type (_http, _ftp, etc)
• proto: service protocol (_tcp, _udp)
• hostname: service hostname. If NULL, local hostname will be used.
• key: the key that you want to add/update
• value: the new value of the key
esp_err_t mdns_service_txt_item_set_for_host_with_explicit_value_len(const
char
*service_type,
const
char
*proto,
const
char
*hostname,
const
char
*key,
const
char
*value,
uint8_t
value_len)
Set/Add TXT item for service TXT record with hostname and txt value length.
Return
• ESP_OK success
• ESP_ERR_INVALID_ARG Parameter error
• ESP_ERR_NOT_FOUND Service not found
• ESP_ERR_NO_MEM memory error
Parameters
• service_type: service type (_http, _ftp, etc)
• proto: service protocol (_tcp, _udp)
• hostname: service hostname. If NULL, local hostname will be used.
• key: the key that you want to add/update
• value: the new value of the key
• value_len: the length of the value
esp_err_t mdns_service_txt_item_remove(const char *service_type, const char *proto,
const char *key)
Remove TXT item for service TXT record.
Return
• ESP_OK success
• ESP_ERR_INVALID_ARG Parameter error
• ESP_ERR_NOT_FOUND Service not found
• ESP_ERR_NO_MEM memory error
Parameters
• service_type: service type (_http, _ftp, etc)
• proto: service protocol (_tcp, _udp)
• key: the key that you want to remove
Espressif Systems 616
Submit Document Feedback
Release v4.4