mdns: add remove delegate host api

* Original commit: espressif/esp-idf@2174693096
This commit is contained in:
Jiacheng Guo
2021-04-02 18:06:10 +08:00
committed by suren-gabrielyan-espressif
parent 1eb5df9780
commit c8821199a2
4 changed files with 85 additions and 0 deletions

View File

@ -187,10 +187,16 @@ static void mdns_example_task(void *pvParameters)
query_mdns_host_with_gethostbyname("tinytester-lwip.local");
query_mdns_host_with_getaddrinfo("tinytester-lwip.local");
#endif
bool removed = false;
while (1) {
check_button();
vTaskDelay(50 / portTICK_PERIOD_MS);
if (pdTICKS_TO_MS(xTaskGetTickCount()) >= 15 * 1000 && ! removed) {
printf("Remove device\n");
ESP_ERROR_CHECK(mdns_delegate_hostname_remove("test-device"));
removed = true;
}
}
}