example: use example common componments in esp_local_ctrl

This commit is contained in:
Chen Yudong
2022-07-04 22:13:16 +08:00
parent 9575f03b8d
commit 4d9393fc53
6 changed files with 41 additions and 126 deletions

View File

@@ -82,17 +82,22 @@ void example_print_all_netif_ips(const char *prefix)
esp_err_t example_connect(void)
{
#if CONFIG_EXAMPLE_CONNECT_ETHERNET
example_ethernet_connect();
if (example_ethernet_connect() != ESP_OK) {
return ESP_FAIL;
}
ESP_ERROR_CHECK(esp_register_shutdown_handler(&example_ethernet_shutdown));
#endif
#if CONFIG_EXAMPLE_CONNECT_WIFI
example_wifi_connect();
if (example_wifi_connect() != ESP_OK) {
return ESP_FAIL;
}
ESP_ERROR_CHECK(esp_register_shutdown_handler(&example_wifi_shutdown));
#endif
#if CONFIG_EXAMPLE_CONNECT_ETHERNET
example_print_all_netif_ips(EXAMPLE_NETIF_DESC_ETH);
#endif
#if CONFIG_EXAMPLE_CONNECT_WIFI
example_print_all_netif_ips(EXAMPLE_NETIF_DESC_STA);
#endif
@@ -101,7 +106,6 @@ esp_err_t example_connect(void)
}
esp_err_t example_disconnect(void)
{
#if CONFIG_EXAMPLE_CONNECT_ETHERNET