diff --git a/components/tcp_transport/include/esp_transport.h b/components/tcp_transport/include/esp_transport.h index f1f95ef6b8..c8c14e25a7 100644 --- a/components/tcp_transport/include/esp_transport.h +++ b/components/tcp_transport/include/esp_transport.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -73,7 +73,7 @@ esp_transport_list_handle_t esp_transport_list_init(void); esp_err_t esp_transport_list_destroy(esp_transport_list_handle_t list); /** - * @brief Add a transport to the list, and define a scheme to indentify this transport in the list + * @brief Add a transport to the list, and define a scheme to identify this transport in the list * * @param[in] list The list * @param[in] t The Transport @@ -329,7 +329,7 @@ esp_err_t esp_transport_set_parent_transport_func(esp_transport_handle_t t, payl * Warning: The returned pointer is valid only as long as esp_transport_handle_t exists. Once transport * handle gets destroyed, this value (esp_tls_error_handle_t) is freed automatically. * - * @param[in] A transport handle + * @param[in] t The transport handle * * @return * - valid pointer of esp_error_handle_t @@ -354,6 +354,15 @@ esp_tls_error_handle_t esp_transport_get_error_handle(esp_transport_handle_t t); */ int esp_transport_get_errno(esp_transport_handle_t t); +/** + * @brief Get the underlying socket from the transport + * + * @param[in] t The transport handle + * + * @return socket descriptor + */ +int esp_transport_get_socket(esp_transport_handle_t t); + /** * @brief Translates the TCP transport error codes to esp_err_t error codes * diff --git a/components/tcp_transport/private_include/esp_transport_internal.h b/components/tcp_transport/private_include/esp_transport_internal.h index 9e87d706b1..6556ad3e45 100644 --- a/components/tcp_transport/private_include/esp_transport_internal.h +++ b/components/tcp_transport/private_include/esp_transport_internal.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -116,16 +116,6 @@ void esp_transport_destroy_foundation_transport(esp_foundation_transport_t *foun */ void capture_tcp_transport_error(esp_transport_handle_t t, enum esp_tcp_transport_err_t error); -/** - * @brief Returns underlying socket for the supplied transport handle - * - * @param t Transport handle - * - * @return Socket file descriptor in case of success - * -1 in case of error - */ -int esp_transport_get_socket(esp_transport_handle_t t); - /** * @brief Captures the current errno * diff --git a/components/tcp_transport/test_apps/main/test_transport_fixtures.c b/components/tcp_transport/test_apps/main/test_transport_fixtures.c index 2e27e8c62c..225af7b809 100644 --- a/components/tcp_transport/test_apps/main/test_transport_fixtures.c +++ b/components/tcp_transport/test_apps/main/test_transport_fixtures.c @@ -19,9 +19,6 @@ #define CONNECT_TASK_PRIORITY (LISTENER_TASK_PRIORITY+1) #define CONNECT_TASK_PRIORITY_LOWER (LISTENER_TASK_PRIORITY-2) -// This is a private API of the tcp transport, but needed for socket operation tests -int esp_transport_get_socket(esp_transport_handle_t t); - /** * @brief Event flags for synchronization between the listener task, the connection task and the test task */