From acb880a6dd994506d65093f2443d7316848cdcdb Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 18 Jan 2023 08:23:45 +0100 Subject: [PATCH 1/2] Remove generic ESP include file --- src/Arduino_ESP_OTA.h | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/Arduino_ESP_OTA.h diff --git a/src/Arduino_ESP_OTA.h b/src/Arduino_ESP_OTA.h deleted file mode 100644 index 796b044..0000000 --- a/src/Arduino_ESP_OTA.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - This file is part of Arduino_ESP_OTA. - - Copyright 2020 ARDUINO SA (http://www.arduino.cc/) - - This software is released under the GNU General Public License version 3, - which covers the main part of arduino-cli. - The terms of this license can be found at: - https://www.gnu.org/licenses/gpl-3.0.en.html - - You can be released from the requirements of the above licenses by purchasing - a commercial license. Buying such a license is mandatory if you want to modify or - otherwise use the software for commercial activities involving the Arduino - software without disclosing the source code of your own applications. To purchase - a commercial license, send an email to license@arduino.cc. -*/ - -#ifndef ARDUINO_ESP_OTA_H_ -#define ARDUINO_ESP_OTA_H_ - -#include "Arduino_ESP32_OTA.h" - -#endif From 5241a2bf6ee5169ac38596dfd831b81586579030 Mon Sep 17 00:00:00 2001 From: pennam Date: Wed, 18 Jan 2023 08:33:08 +0100 Subject: [PATCH 2/2] Rename ESP to ESP32 --- README.md | 8 ++++---- keywords.txt | 4 ++-- library.properties | 4 ++-- src/Arduino_ESP32_OTA.cpp | 6 +++--- src/Arduino_ESP32_OTA.h | 10 +++++----- src/decompress/lzss.cpp | 6 +++--- src/decompress/lzss.h | 2 +- src/tls/amazon_root_ca.h | 6 +++--- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 062ad81..5e2c476 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -`Arduino_ESP_OTA` +`Arduino_ESP32_OTA` ==================== *Note: This library is currently in [beta](#board-support).* -[![Compile Examples](https://github.com/bcmi-labs/Arduino_ESP_OTA/workflows/Compile%20Examples/badge.svg)](https://github.com/bcmi-labs/Arduino_ESP_OTA/actions?workflow=Compile+Examples) -[![Arduino Lint](https://github.com/bcmi-labs/Arduino_ESP_OTA/workflows/Arduino%20Lint/badge.svg)](https://github.com/bcmi-labs/Arduino_ESP_OTA/actions?workflow=Arduino+Lint) -[![Spell Check](https://github.com/bcmi-labs/Arduino_ESP_OTA/workflows/Spell%20Check/badge.svg)](https://github.com/bcmi-labs/Arduino_ESP_OTA/actions?workflow=Spell+Check) +[![Compile Examples](https://github.com/bcmi-labs/Arduino_ESP32_OTA/workflows/Compile%20Examples/badge.svg)](https://github.com/bcmi-labs/Arduino_ESP32_OTA/actions?workflow=Compile+Examples) +[![Arduino Lint](https://github.com/bcmi-labs/Arduino_ESP32_OTA/workflows/Arduino%20Lint/badge.svg)](https://github.com/bcmi-labs/Arduino_ESP32_OTA/actions?workflow=Arduino+Lint) +[![Spell Check](https://github.com/bcmi-labs/Arduino_ESP32_OTA/workflows/Spell%20Check/badge.svg)](https://github.com/bcmi-labs/Arduino_ESP32_OTA/actions?workflow=Spell+Check) This library allows OTA (Over-The-Air) firmware updates for ESP32 boards. OTA binaries are downloaded via WiFi and stored in the OTA flash partition. After a reset the ESP32 bootloader update the reference to the new firmware. diff --git a/keywords.txt b/keywords.txt index 490adb8..87c0aeb 100644 --- a/keywords.txt +++ b/keywords.txt @@ -1,12 +1,12 @@ ####################################### -# Syntax Coloring Map For Arduino_ESP_OTA +# Syntax Coloring Map For Arduino_ESP32_OTA ####################################### ####################################### # Class (KEYWORD1) ####################################### -Arduino_ESP_OTA KEYWORD1 +Arduino_ESP32_OTA KEYWORD1 Error KEYWORD1 ####################################### diff --git a/library.properties b/library.properties index 325e830..07f1d66 100644 --- a/library.properties +++ b/library.properties @@ -1,4 +1,4 @@ -name=Arduino_ESP_OTA +name=Arduino_ESP32_OTA version=0.0.1 author=Arduino maintainer=Arduino @@ -7,4 +7,4 @@ paragraph=This library allows performing a firmware update on ESP32. category=Communication url= architectures=esp32 -includes=Arduino_ESP_OTA.h +includes=Arduino_ESP32_OTA.h diff --git a/src/Arduino_ESP32_OTA.cpp b/src/Arduino_ESP32_OTA.cpp index 669e06e..6c5ce05 100644 --- a/src/Arduino_ESP32_OTA.cpp +++ b/src/Arduino_ESP32_OTA.cpp @@ -1,5 +1,5 @@ /* - This file is part of Arduino_ESP_OTA. + This file is part of Arduino_ESP32_OTA. Copyright 2022 ARDUINO SA (http://www.arduino.cc/) @@ -90,7 +90,7 @@ uint8_t Arduino_ESP32_OTA::read_byte_from_network() bool is_http_data_timeout = false; for(unsigned long const start = millis();;) { - is_http_data_timeout = (millis() - start) > ARDUINO_ESP_OTA_BINARY_BYTE_RECEIVE_TIMEOUT_ms; + is_http_data_timeout = (millis() - start) > ARDUINO_ESP32_OTA_BINARY_BYTE_RECEIVE_TIMEOUT_ms; if (is_http_data_timeout) { DEBUG_ERROR("%s: timeout waiting data", __FUNCTION__); return -1; @@ -142,7 +142,7 @@ int Arduino_ESP32_OTA::download(const char * ota_url) is_http_header_timeout = false; for (unsigned long const start = millis(); !is_header_complete;) { - is_http_header_timeout = (millis() - start) > ARDUINO_ESP_OTA_HTTP_HEADER_RECEIVE_TIMEOUT_ms; + is_http_header_timeout = (millis() - start) > ARDUINO_ESP32_OTA_HTTP_HEADER_RECEIVE_TIMEOUT_ms; if (is_http_header_timeout) break; if (_client->available()) diff --git a/src/Arduino_ESP32_OTA.h b/src/Arduino_ESP32_OTA.h index 9b5c4aa..fe07108 100644 --- a/src/Arduino_ESP32_OTA.h +++ b/src/Arduino_ESP32_OTA.h @@ -1,5 +1,5 @@ /* - This file is part of Arduino_ESP_OTA. + This file is part of Arduino_ESP32_OTA. Copyright 2020 ARDUINO SA (http://www.arduino.cc/) @@ -30,15 +30,15 @@ CONSTANTS ******************************************************************************/ -static uint32_t const ARDUINO_ESP_OTA_HTTP_HEADER_RECEIVE_TIMEOUT_ms = 10000; -static uint32_t const ARDUINO_ESP_OTA_BINARY_BYTE_RECEIVE_TIMEOUT_ms = 2000; +static uint32_t const ARDUINO_ESP32_OTA_HTTP_HEADER_RECEIVE_TIMEOUT_ms = 10000; +static uint32_t const ARDUINO_ESP32_OTA_BINARY_BYTE_RECEIVE_TIMEOUT_ms = 2000; /****************************************************************************** * TYPEDEF ******************************************************************************/ -typedef uint8_t(*ArduinoEspOtaReadByteFuncPointer)(void); -typedef void(*ArduinoEspOtaWriteByteFuncPointer)(uint8_t); +typedef uint8_t(*ArduinoEsp32OtaReadByteFuncPointer)(void); +typedef void(*ArduinoEsp32OtaWriteByteFuncPointer)(uint8_t); /****************************************************************************** * CLASS DECLARATION diff --git a/src/decompress/lzss.cpp b/src/decompress/lzss.cpp index baa9885..72427ba 100644 --- a/src/decompress/lzss.cpp +++ b/src/decompress/lzss.cpp @@ -23,8 +23,8 @@ **************************************************************************************/ static size_t LZSS_FILE_SIZE = 0; -static ArduinoEspOtaReadByteFuncPointer read_byte_fptr = 0; -static ArduinoEspOtaWriteByteFuncPointer write_byte_fptr = 0; +static ArduinoEsp32OtaReadByteFuncPointer read_byte_fptr = 0; +static ArduinoEsp32OtaWriteByteFuncPointer write_byte_fptr = 0; int bit_buffer = 0, bit_mask = 128; unsigned char buffer[N * 2]; @@ -158,7 +158,7 @@ void lzss_decode(void) PUBLIC FUNCTIONS **************************************************************************************/ -int lzss_download(ArduinoEspOtaReadByteFuncPointer read_byte, ArduinoEspOtaWriteByteFuncPointer write_byte, size_t const lzss_file_size) +int lzss_download(ArduinoEsp32OtaReadByteFuncPointer read_byte, ArduinoEsp32OtaWriteByteFuncPointer write_byte, size_t const lzss_file_size) { read_byte_fptr = read_byte; write_byte_fptr = write_byte; diff --git a/src/decompress/lzss.h b/src/decompress/lzss.h index b4c45f7..3ddc3f2 100644 --- a/src/decompress/lzss.h +++ b/src/decompress/lzss.h @@ -11,6 +11,6 @@ FUNCTION DEFINITION **************************************************************************************/ -int lzss_download(ArduinoEspOtaReadByteFuncPointer read_byte, ArduinoEspOtaWriteByteFuncPointer write_byte, size_t const lzss_file_size); +int lzss_download(ArduinoEsp32OtaReadByteFuncPointer read_byte, ArduinoEsp32OtaWriteByteFuncPointer write_byte, size_t const lzss_file_size); #endif /* SSU_LZSS_H_ */ diff --git a/src/tls/amazon_root_ca.h b/src/tls/amazon_root_ca.h index 7ead876..89327bc 100644 --- a/src/tls/amazon_root_ca.h +++ b/src/tls/amazon_root_ca.h @@ -1,7 +1,7 @@ /* Certificates from https://www.amazontrust.com/repository/ */ -#ifndef ESP_OTA_AMAZON_ROOT_CA_H_ -#define ESP_OTA_AMAZON_ROOT_CA_H_ +#ifndef ESP32_OTA_AMAZON_ROOT_CA_H_ +#define ESP32_OTA_AMAZON_ROOT_CA_H_ const char* amazon_root_ca = \ /* Amazon Root CA 1 */ @@ -73,4 +73,4 @@ const char* amazon_root_ca = \ "AE47xDqUEpHJWEadIRNyp4iciuRMStuW1KyLa2tJElMzrdfkviT8tQp21KW8EA==\n" \ "-----END CERTIFICATE-----\n"; -#endif /* ESP_OTA_AMAZON_ROOT_CA_H_ */ +#endif /* ESP32_OTA_AMAZON_ROOT_CA_H_ */