Skip to content

Commit

Permalink
feat(mdns): add a new mdns query mode browse
Browse files Browse the repository at this point in the history
  • Loading branch information
zwx1995esp committed Mar 12, 2024
1 parent a363bee commit 53a9833
Show file tree
Hide file tree
Showing 3 changed files with 806 additions and 8 deletions.
10 changes: 10 additions & 0 deletions components/mdns/include/mdns.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ extern "C" {
*/
typedef struct mdns_search_once_s mdns_search_once_t;

/**
* @brief Daemon query handle
*/
typedef struct mdns_browse_s mdns_browse_t;

typedef enum {
MDNS_EVENT_ENABLE_IP4 = 1 << 1,
MDNS_EVENT_ENABLE_IP6 = 1 << 2,
Expand Down Expand Up @@ -97,6 +102,7 @@ typedef struct mdns_result_s {
} mdns_result_t;

typedef void (*mdns_query_notify_t)(mdns_search_once_t *search);
typedef void (*mdns_browse_notify_t)(mdns_result_t *result);

/**
* @brief Initialize mDNS on given interface
Expand Down Expand Up @@ -830,6 +836,10 @@ esp_err_t mdns_unregister_netif(esp_netif_t *esp_netif);
*/
esp_err_t mdns_netif_action(esp_netif_t *esp_netif, mdns_event_actions_t event_action);


mdns_browse_t *mdns_browse_new(const char *service, const char *proto, mdns_browse_notify_t notifier);
esp_err_t mdns_browse_delete(const char *service, const char *proto);

#ifdef __cplusplus
}
#endif
Expand Down
Loading

0 comments on commit 53a9833

Please sign in to comment.