/* Desktop stand-in for ESP-IDF's mdns component: the query API the controller uses (wifi_drv.c). * The browser is in port/src/mdns_host.c. */ #pragma once #include #include #include "esp_err.h" #include "esp_netif_ip_addr.h" typedef struct { char *key; char *value; } mdns_txt_item_t; typedef struct mdns_ip_addr_s { esp_ip_addr_t addr; struct mdns_ip_addr_s *next; } mdns_ip_addr_t; typedef struct mdns_result_s { struct mdns_result_s *next; char *instance_name; char *hostname; /* without the .local suffix */ mdns_txt_item_t *txt; size_t txt_count; mdns_ip_addr_t *addr; } mdns_result_t; /* Browse for service._proto.local (for example "_http", "_tcp") for timeout_ms. Results are IN_ADDR answers * with their TXT items; free them with mdns_query_results_free. ESP_ERR_NOT_FOUND when nothing answered. */ esp_err_t mdns_query_ptr(const char *service, const char *proto, uint32_t timeout_ms, size_t max_results, mdns_result_t **results); void mdns_query_results_free(mdns_result_t *results);