From 46735566916e01fb6445bb9006c5039c05d5a902 Mon Sep 17 00:00:00 2001 From: Harshit Malpani Date: Tue, 27 Dec 2022 12:40:47 +0530 Subject: [PATCH] tcp_client: Remove components dir from tcp_client example and use esp_stubs from protocols/linux_stubs --- .../sockets/tcp_client/CMakeLists.txt | 3 +- .../components/esp_stubs/CMakeLists.txt | 6 --- .../esp_stubs/esp_stubs/esp_stubs.c | 37 ------------------- .../esp_stubs/include/stubs/esp_event.h | 8 ---- .../esp_stubs/include/stubs/esp_netif.h | 11 ------ .../esp_stubs/include/stubs/nvs_flash.h | 8 ---- .../include/stubs/protocol_examples_common.h | 8 ---- 7 files changed, 2 insertions(+), 79 deletions(-) delete mode 100644 examples/protocols/sockets/tcp_client/components/esp_stubs/CMakeLists.txt delete mode 100644 examples/protocols/sockets/tcp_client/components/esp_stubs/esp_stubs/esp_stubs.c delete mode 100644 examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/esp_event.h delete mode 100644 examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/esp_netif.h delete mode 100644 examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/nvs_flash.h delete mode 100644 examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/protocol_examples_common.h diff --git a/examples/protocols/sockets/tcp_client/CMakeLists.txt b/examples/protocols/sockets/tcp_client/CMakeLists.txt index 0d19ff5631..52a0c94544 100644 --- a/examples/protocols/sockets/tcp_client/CMakeLists.txt +++ b/examples/protocols/sockets/tcp_client/CMakeLists.txt @@ -3,7 +3,8 @@ cmake_minimum_required(VERSION 3.16) if(${IDF_TARGET} STREQUAL "linux") - list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/freertos/") + set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/freertos/" + "$ENV{IDF_PATH}/examples/protocols/linux_stubs/esp_stubs") set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) else() diff --git a/examples/protocols/sockets/tcp_client/components/esp_stubs/CMakeLists.txt b/examples/protocols/sockets/tcp_client/components/esp_stubs/CMakeLists.txt deleted file mode 100644 index 74f75ec2a8..0000000000 --- a/examples/protocols/sockets/tcp_client/components/esp_stubs/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -if(${IDF_TARGET} STREQUAL "linux") - idf_component_register(SRCS - esp_stubs/esp_stubs.c - INCLUDE_DIRS . include/stubs - REQUIRES main) -endif() diff --git a/examples/protocols/sockets/tcp_client/components/esp_stubs/esp_stubs/esp_stubs.c b/examples/protocols/sockets/tcp_client/components/esp_stubs/esp_stubs/esp_stubs.c deleted file mode 100644 index 51141e0bc5..0000000000 --- a/examples/protocols/sockets/tcp_client/components/esp_stubs/esp_stubs/esp_stubs.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 - */ -#include -#include "esp_err.h" -#include "esp_log.h" - -extern void app_main(void); - -esp_err_t esp_event_loop_create_default(void) -{ - return ESP_OK; -} - -esp_err_t esp_netif_init(void) -{ - return ESP_OK; -} - -esp_err_t example_connect(void) -{ - return ESP_OK; -} - -esp_err_t nvs_flash_init(void) -{ - return ESP_OK; -} - -int main() -{ - app_main(); - - return 0; -} diff --git a/examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/esp_event.h b/examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/esp_event.h deleted file mode 100644 index 79887049cf..0000000000 --- a/examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/esp_event.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 - */ -#include "esp_err.h" - -esp_err_t esp_event_loop_create_default(void); diff --git a/examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/esp_netif.h b/examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/esp_netif.h deleted file mode 100644 index 860d7a620b..0000000000 --- a/examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/esp_netif.h +++ /dev/null @@ -1,11 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 - */ -#include -#include -#include -#include "esp_err.h" - -esp_err_t esp_netif_init(void); diff --git a/examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/nvs_flash.h b/examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/nvs_flash.h deleted file mode 100644 index 9d138a838a..0000000000 --- a/examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/nvs_flash.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 - */ -#include "esp_err.h" - -esp_err_t nvs_flash_init(void); diff --git a/examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/protocol_examples_common.h b/examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/protocol_examples_common.h deleted file mode 100644 index 6f8bf0706f..0000000000 --- a/examples/protocols/sockets/tcp_client/components/esp_stubs/include/stubs/protocol_examples_common.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 - */ -#include "esp_err.h" - -esp_err_t example_connect(void);