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 authored and suren-gabrielyan-espressif committed Mar 18, 2024
1 parent a363bee commit a7957fd
Show file tree
Hide file tree
Showing 4 changed files with 786 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/modem__target-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ jobs:
- name: Run Example Test on target
working-directory: ${{ env.TEST_DIR }}
run: |
pip install pytest
python -m pytest --log-cli-level DEBUG --target=${{ matrix.idf_target }}
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 a7957fd

Please sign in to comment.