mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-23 23:37:31 +02:00
mDNS: Updated APIs description and shows the warning when hostname contains domain name during the query
Closes https://github.com/espressif/esp-idf/issues/6590 * Original commit: espressif/esp-idf@9f8d2b944d
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
eda5d72acf
commit
22c7c0a195
@ -343,6 +343,8 @@ esp_err_t mdns_query_a(const char * host_name, uint32_t timeout, esp_ip4_addr_t
|
|||||||
/**
|
/**
|
||||||
* @brief Query mDNS for A record
|
* @brief Query mDNS for A record
|
||||||
*
|
*
|
||||||
|
* Please note that hostname must not contain domain name, as mDNS uses '.local' domain.
|
||||||
|
*
|
||||||
* @param host_name host name to look for
|
* @param host_name host name to look for
|
||||||
* @param timeout time in milliseconds to wait for answer. If 0, max_results needs to be defined
|
* @param timeout time in milliseconds to wait for answer. If 0, max_results needs to be defined
|
||||||
* @param addr pointer to the resulting IP6 address
|
* @param addr pointer to the resulting IP6 address
|
||||||
@ -361,6 +363,8 @@ esp_err_t mdns_query_aaaa(const char * host_name, uint32_t timeout, esp_ip6_addr
|
|||||||
* This method controls the service state on all active interfaces and applications are required
|
* This method controls the service state on all active interfaces and applications are required
|
||||||
* to call it from the system event handler for normal operation of mDNS service.
|
* to call it from the system event handler for normal operation of mDNS service.
|
||||||
*
|
*
|
||||||
|
* Please note that hostname must not contain domain name, as mDNS uses '.local' domain.
|
||||||
|
*
|
||||||
* @param ctx The system event context
|
* @param ctx The system event context
|
||||||
* @param event The system event
|
* @param event The system event
|
||||||
*/
|
*/
|
||||||
|
@ -4819,6 +4819,10 @@ esp_err_t mdns_query_a(const char * name, uint32_t timeout, esp_ip4_addr_t * add
|
|||||||
return ESP_ERR_INVALID_ARG;
|
return ESP_ERR_INVALID_ARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strstr(name, ".local")) {
|
||||||
|
ESP_LOGW(TAG, "Please note that hostname must not contain domain name, as mDNS uses '.local' domain");
|
||||||
|
}
|
||||||
|
|
||||||
err = mdns_query(name, NULL, NULL, MDNS_TYPE_A, timeout, 1, &result);
|
err = mdns_query(name, NULL, NULL, MDNS_TYPE_A, timeout, 1, &result);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -4853,6 +4857,10 @@ esp_err_t mdns_query_aaaa(const char * name, uint32_t timeout, esp_ip6_addr_t *
|
|||||||
return ESP_ERR_INVALID_ARG;
|
return ESP_ERR_INVALID_ARG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strstr(name, ".local")) {
|
||||||
|
ESP_LOGW(TAG, "Please note that hostname must not contain domain name, as mDNS uses '.local' domain");
|
||||||
|
}
|
||||||
|
|
||||||
err = mdns_query(name, NULL, NULL, MDNS_TYPE_AAAA, timeout, 1, &result);
|
err = mdns_query(name, NULL, NULL, MDNS_TYPE_AAAA, timeout, 1, &result);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
Reference in New Issue
Block a user