tcp_client_main.c 721 B

123456789101112131415161718192021222324252627
  1. /*
  2. * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Unlicense OR CC0-1.0
  5. */
  6. #include "nvs_flash.h"
  7. #include "esp_netif.h"
  8. #include "protocol_examples_common.h"
  9. #include "esp_event.h"
  10. extern void tcp_client(void);
  11. void app_main(void)
  12. {
  13. ESP_ERROR_CHECK(nvs_flash_init());
  14. ESP_ERROR_CHECK(esp_netif_init());
  15. ESP_ERROR_CHECK(esp_event_loop_create_default());
  16. /* This helper function configures Wi-Fi or Ethernet, as selected in menuconfig.
  17. * Read "Establishing Wi-Fi or Ethernet Connection" section in
  18. * examples/protocols/README.md for more information about this function.
  19. */
  20. ESP_ERROR_CHECK(example_connect());
  21. tcp_client();
  22. }