From 46bd32d9529a09a32a87ebb9bbc948d0156f9b05 Mon Sep 17 00:00:00 2001 From: Suren Gabrielyan Date: Thu, 2 Dec 2021 16:46:26 +0400 Subject: [PATCH] websocket: removed deprecated API "esp_websocket_client_send" Closes IDF-1470 * Original commit: espressif/esp-idf@7f6ab93f7e52bddaf4c030d7337ea5574f33381d --- .../esp_websocket_client.c | 23 +++---------- .../include/esp_websocket_client.h | 32 +++---------------- 2 files changed, 10 insertions(+), 45 deletions(-) diff --git a/components/esp_websocket_client/esp_websocket_client.c b/components/esp_websocket_client/esp_websocket_client.c index 2f6405d47..0b0dbfe21 100644 --- a/components/esp_websocket_client/esp_websocket_client.c +++ b/components/esp_websocket_client/esp_websocket_client.c @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include @@ -829,11 +821,6 @@ int esp_websocket_client_send_text(esp_websocket_client_handle_t client, const c return esp_websocket_client_send_with_opcode(client, WS_TRANSPORT_OPCODES_TEXT, (const uint8_t *)data, len, timeout); } -int esp_websocket_client_send(esp_websocket_client_handle_t client, const char *data, int len, TickType_t timeout) -{ - return esp_websocket_client_send_with_opcode(client, WS_TRANSPORT_OPCODES_BINARY, (const uint8_t *)data, len, timeout); -} - int esp_websocket_client_send_bin(esp_websocket_client_handle_t client, const char *data, int len, TickType_t timeout) { return esp_websocket_client_send_with_opcode(client, WS_TRANSPORT_OPCODES_BINARY, (const uint8_t *)data, len, timeout); diff --git a/components/esp_websocket_client/include/esp_websocket_client.h b/components/esp_websocket_client/include/esp_websocket_client.h index 0ed635346..1431263b1 100644 --- a/components/esp_websocket_client/include/esp_websocket_client.h +++ b/components/esp_websocket_client/include/esp_websocket_client.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_WEBSOCKET_CLIENT_H_ #define _ESP_WEBSOCKET_CLIENT_H_ @@ -169,20 +161,6 @@ esp_err_t esp_websocket_client_stop(esp_websocket_client_handle_t client); */ esp_err_t esp_websocket_client_destroy(esp_websocket_client_handle_t client); -/** - * @brief Generic write data to the WebSocket connection; defaults to binary send - * - * @param[in] client The client - * @param[in] data The data - * @param[in] len The length - * @param[in] timeout Write data timeout in RTOS ticks - * - * @return - * - Number of data was sent - * - (-1) if any errors - */ -int esp_websocket_client_send(esp_websocket_client_handle_t client, const char *data, int len, TickType_t timeout); - /** * @brief Write binary data to the WebSocket connection (data send with WS OPCODE=02, i.e. binary) *