@@ -26,6 +26,11 @@ extern "C" {
26
26
*/
27
27
typedef struct mdns_search_once_s mdns_search_once_t ;
28
28
29
+ /**
30
+ * @brief Daemon query handle
31
+ */
32
+ typedef struct mdns_browse_s mdns_browse_t ;
33
+
29
34
typedef enum {
30
35
MDNS_EVENT_ENABLE_IP4 = 1 << 1 ,
31
36
MDNS_EVENT_ENABLE_IP6 = 1 << 2 ,
@@ -97,6 +102,7 @@ typedef struct mdns_result_s {
97
102
} mdns_result_t ;
98
103
99
104
typedef void (* mdns_query_notify_t )(mdns_search_once_t * search );
105
+ typedef void (* mdns_browse_notify_t )(mdns_result_t * result );
100
106
101
107
/**
102
108
* @brief Initialize mDNS on given interface
@@ -830,6 +836,28 @@ esp_err_t mdns_unregister_netif(esp_netif_t *esp_netif);
830
836
*/
831
837
esp_err_t mdns_netif_action (esp_netif_t * esp_netif , mdns_event_actions_t event_action );
832
838
839
+ /**
840
+ * @brief Browse mDNS for a service `_service._proto`.
841
+ *
842
+ * @param service Pointer to the `_service` which will be browsed.
843
+ * @param proto Pointer to the `_proto` which will be browsed.
844
+ * @param notifier The callback which will be called when the browsing service changed.
845
+ * @return mdns_browse_t pointer to new browse object if initiated successfully.
846
+ * NULL otherwise.
847
+ */
848
+ mdns_browse_t * mdns_browse_new (const char * service , const char * proto , mdns_browse_notify_t notifier );
849
+
850
+ /**
851
+ * @brief Stop the `_service._proto` browse.
852
+ * @param service Pointer to the `_service` which will be browsed.
853
+ * @param proto Pointer to the `_proto` which will be browsed.
854
+ * @return
855
+ * - ESP_OK success.
856
+ * - ESP_ERR_FAIL mDNS is not running or the browsing of `_service._proto` is never started.
857
+ * - ESP_ERR_NO_MEM memory error.
858
+ */
859
+ esp_err_t mdns_browse_delete (const char * service , const char * proto );
860
+
833
861
#ifdef __cplusplus
834
862
}
835
863
#endif
0 commit comments