Skip to content

Commit

Permalink
Add support Arduino UNO R4 WiFi.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Aug 8, 2023
1 parent e8b7b3e commit 6f614c0
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/compile_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- "bluepill_f103c8_128k"
- "mkr1000USB"
- "teensy41"
- "renesas-ra"
steps:
- uses: actions/checkout@v2
- name: Cache pip
Expand Down
4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ESP_SSLClient",
"version": "2.0.7",
"version": "2.0.8",
"keywords": "communication, REST, esp32, esp8266, arduino",
"description": "This library provided the Secure Layer Networking (SSL/TLS) TCP Client for ESP8266, ESP32 and Raspberry Pi RP2040, Teensy, SAMD, AVR and other Arduino devices that support external networking interfaces e.g., WiFiClient, EthernetClient and GSMClient.",
"repository": {
Expand All @@ -12,5 +12,5 @@
"email": "[email protected]"
}],
"frameworks": "arduino",
"platforms": "espressif32, espressif8266, atmelsam, rp2040, atmelavr, atmelmegaavr, ststm32, teensy"
"platforms": "espressif32, espressif8266, atmelsam, atmelavr, atmelmegaavr, ststm32, teensy, rp2040, renesas-ra"
}
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name=ESP_SSLClient

version=2.0.7
version=2.0.8

author=Mobizt

Expand All @@ -14,4 +14,4 @@ category=Communication

url=https://github.com/mobizt/ESP_SSLClient.git

architectures=esp8266,esp32,sam,samd,stm32,STM32F1,STM32F4,teensy,avr,megaavr,mbed_nano,mbed_rp2040,rp2040
architectures=esp8266, esp32, sam,samd, stm32, STM32F1, STM32F4, teensy, avr, megaavr, mbed_nano, mbed_rp2040, rp2040, mbed_nano, mbed_portenta, mbed_nicla, mbed_opta, mbed_giga, renesas_portenta, renesas_uno
4 changes: 2 additions & 2 deletions src/ESP_SSLClient.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
*
* The ESP SSL Client Class, ESP_SSLClient.h v2.0.7
* The ESP SSL Client Class, ESP_SSLClient.h v2.0.8
*
* Created August 6, 2023
* Created August 8, 2023
*
* The MIT License (MIT)
* Copyright (c) 2023 K. Suwatchai (Mobizt)
Expand Down
15 changes: 13 additions & 2 deletions src/client/BSSL_Helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <stdlib.h>
#include <string.h>
#if defined __has_include
#if __has_include(<pgmspace.h>)
#if __has_include(<pgmspace.h>)
#include <pgmspace.h>
#endif
#endif
Expand Down Expand Up @@ -112,6 +112,7 @@ namespace key_bssl
bool looks_like_DER(const unsigned char *buf, size_t len);
pem_object *decode_pem(const void *src, size_t len, size_t *num);
void free_pem_object_contents(pem_object *po);
char *strdupImpl(const char *s);

// Used as callback multiple places to append a string to a vector
static void byte_vector_append(void *ctx, const void *buff, size_t len)
Expand Down Expand Up @@ -283,6 +284,16 @@ namespace key_bssl
}
}

char *strdupImpl(const char *s)
{
size_t slen = strlen(s);
char *result = (char *)malloc(slen + 1);
if (!result)
return NULL;
memcpy(result, s, slen + 1);
return result;
}

// Converts a PEM (~=base64) source into a set of DER-encoded binary blobs.
// Each blob is named by the ---- BEGIN xxx ---- field, and multiple
// blobs may be returned.
Expand Down Expand Up @@ -317,7 +328,7 @@ namespace key_bssl
switch (br_pem_decoder_event(pc.get()))
{
case BR_PEM_BEGIN_OBJ:
po.name = strdup(br_pem_decoder_name(pc.get()));
po.name = strdupImpl(br_pem_decoder_name(pc.get()));
br_pem_decoder_setdest(pc.get(), byte_vector_append, &bv);
inobj = true;
break;
Expand Down
6 changes: 4 additions & 2 deletions src/client/BSSL_TCP_Client.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* BSSL_TCP_Client v2.0.5 for Arduino devices.
* BSSL_TCP_Client v2.0.6 for Arduino devices.
*
* Created August 6, 2023
* Created August 8, 2023
*
* The MIT License (MIT)
* Copyright (c) 2023 K. Suwatchai (Mobizt)
Expand Down Expand Up @@ -277,6 +277,8 @@ int BSSL_TCP_Client::setTimeout(uint32_t seconds)
return 1;
}

int BSSL_TCP_Client::getTimeout() { return _ssl_client.getTimeout() / 1000; }

void BSSL_TCP_Client::setHandshakeTimeout(unsigned long handshake_timeout)
{
_handshake_timeout = handshake_timeout * 1000;
Expand Down
10 changes: 8 additions & 2 deletions src/client/BSSL_TCP_Client.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* BSSL_TCP_Client v2.0.5 for Arduino devices.
* BSSL_TCP_Client v2.0.6 for Arduino devices.
*
* Created August 6, 2023
* Created August 8, 2023
*
* The MIT License (MIT)
* Copyright (c) 2023 K. Suwatchai (Mobizt)
Expand Down Expand Up @@ -285,6 +285,12 @@ class BSSL_TCP_Client : public Client
*/
int setTimeout(uint32_t seconds);

/**
* Get the TCP timeout in seconds.
* @return The TCP timeout in seconds.
*/
int getTimeout();

/**
* Set the SSL handshake timeout in seconds.
* @param handshake_timeout The SSL handshake timeout in seconds.
Expand Down

0 comments on commit 6f614c0

Please sign in to comment.