mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-08-01 03:34:40 +02:00
ci/mdsn: Fix example test on ethernet runners
* Ethernet kit uses GPIO0 for ref-clock, so the test button hits constantly * Add a freeRTOS delay when checking result on assync queries * Original commit: espressif/esp-idf@afe7ab3b2c
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
94ae672041
commit
7f42c31252
@@ -1,5 +1,12 @@
|
||||
menu "Example Configuration"
|
||||
|
||||
config MDNS_GPIO_RANGE_MAX
|
||||
int
|
||||
default 33 if IDF_TARGET_ESP32
|
||||
default 46 if IDF_TARGET_ESP32S2
|
||||
default 19 if IDF_TARGET_ESP32C3
|
||||
default 48 if IDF_TARGET_ESP32S3
|
||||
|
||||
config MDNS_HOSTNAME
|
||||
string "mDNS Hostname"
|
||||
default "esp32-mdns"
|
||||
@@ -34,4 +41,11 @@ menu "Example Configuration"
|
||||
If enabled, a portion of MAC address is added to the hostname, this is used
|
||||
for evaluation of tests in CI
|
||||
|
||||
config MDNS_BUTTON_GPIO
|
||||
int "Button GPIO to trigger querries"
|
||||
range 0 MDNS_GPIO_RANGE_MAX
|
||||
default 0
|
||||
help
|
||||
Set the GPIO number used as mDNS test button
|
||||
|
||||
endmenu
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
|
||||
#define EXAMPLE_MDNS_INSTANCE CONFIG_MDNS_INSTANCE
|
||||
#define EXAMPLE_BUTTON_GPIO 0
|
||||
#define EXAMPLE_BUTTON_GPIO CONFIG_MDNS_BUTTON_GPIO
|
||||
|
||||
static const char * TAG = "mdns-test";
|
||||
static char * generate_hostname(void);
|
||||
@@ -174,7 +174,6 @@ static void query_mdns_hosts_async(const char * host_name)
|
||||
ESP_LOGI(TAG, "Query both A and AAA: %s.local", host_name);
|
||||
|
||||
mdns_search_once_t *s_a = mdns_query_async_new(host_name, NULL, NULL, MDNS_TYPE_A, 1000, 1, NULL);
|
||||
mdns_query_async_delete(s_a);
|
||||
mdns_search_once_t *s_aaaa = mdns_query_async_new(host_name, NULL, NULL, MDNS_TYPE_AAAA, 1000, 1, NULL);
|
||||
while (s_a || s_aaaa) {
|
||||
if (s_a && check_and_print_result(s_a)) {
|
||||
@@ -187,6 +186,7 @@ static void query_mdns_hosts_async(const char * host_name)
|
||||
mdns_query_async_delete(s_aaaa);
|
||||
s_aaaa = NULL;
|
||||
}
|
||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user