Skip to content

Commit

Permalink
Fixed compilation error in ESP32 Arduino Core SDK v1.0.6 and earlier.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Jul 25, 2022
1 parent 5ffd839 commit 278c586
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ The latest Core SDK is recommended. For ESP8266, the Core SDK version 3.x.x or l

The ESP8266 Core SDK version 2.5.x and earlier are not supported.

For ESP32, the Core SDK version 2.0.4 or later is recommended.

The ESP32 Core SDK version 1.0.4 and earlier are not supported.

### SAMD21 custom build firmware

For Atmel's SAMD21 based boards, [custom build WiFiNINA firmware](https://github.com/mobizt/nina-fw) should be installed instead of official Arduino WiFiNINA firmware.
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ESP Mail Client",
"version": "2.5.0",
"version": "2.5.1",
"keywords": "communication, email, imap, smtp, esp32, esp8266, samd, arduino",
"description": "Arduino E-Mail Client Library to send, read and get incoming email notification for ESP32, ESP8266 and SAMD21 devices. The library also supported other Arduino Devices using Clients interfaces e.g. WiFiClient, EthernetClient, and GSMClient.",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name=ESP Mail Client

version=2.5.0
version=2.5.1

author=Mobizt

Expand Down
2 changes: 1 addition & 1 deletion src/ESP_Mail_Client_Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

#ifndef ESP_MAIL_VERSION

#define ESP_MAIL_VERSION "2.5.0"
#define ESP_MAIL_VERSION "2.5.1"

#endif
4 changes: 2 additions & 2 deletions src/ESP_Mail_Const.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Created July 20, 2022
// Created July 26, 2022

#pragma once

Expand Down Expand Up @@ -1988,7 +1988,7 @@ static const char esp_mail_str_286[] PROGMEM = "\1auth=Bearer ";
static const char esp_mail_str_287[] PROGMEM = "\1\1";
static const char esp_mail_str_294[] PROGMEM = "{\"status\":";
static const char esp_mail_str_305[] PROGMEM = "connection failed";
static const char esp_mail_str_310[] PROGMEM = "> C: Perform the SSL handshake";
static const char esp_mail_str_310[] PROGMEM = "> C: Perform the SSL/TLS handshake";
static const char esp_mail_str_311[] PROGMEM = "STARTTLS\r\n";
static const char esp_mail_str_314[] PROGMEM = "> C: ESP Mail Client v";
static const char esp_mail_str_328[] PROGMEM = "0.0.0.0";
Expand Down
14 changes: 8 additions & 6 deletions src/wcs/base/TCP_Client_Base.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* TCP Client Base class, version 2.0.0
* TCP Client Base class, version 2.0.1
*
* Created July 20, 2022
* Created July 26, 2022
*
* The MIT License (MIT)
* Copyright (c) 2022 K. Suwatchai (Mobizt)
Expand Down Expand Up @@ -29,6 +29,7 @@
#define TCP_CLIENT_BASE_H

#include <Arduino.h>
#include <sys/time.h>
#include "ESP_Mail_Const.h"
#include <IPAddress.h>
#include <Client.h>
Expand Down Expand Up @@ -163,8 +164,10 @@ class TCP_Client_Base
int setTimestamp(time_t ts)
{
#if defined(ESP32) || defined(ESP8266)
struct timeval tm = {ts, 0}; // sec, us
return settimeofday((const timeval *)&tm, 0);
struct timeval tm; // sec, us
tm.tv_sec = ts;
tm.tv_usec = 0;
return settimeofday((const struct timeval *)&tm, 0);
#endif
return -1;
}
Expand All @@ -180,7 +183,7 @@ class TCP_Client_Base
for (int i = 0; i < session->ports_functions.size; i++)
{
if (session->ports_functions.list[i].port == port)
return (int)session->ports_functions.list[i].protocol;
return (int)session->ports_functions.list[i].protocol;
}
}
}
Expand All @@ -207,7 +210,6 @@ class TCP_Client_Base
}

protected:

MB_FS *mbfs = nullptr;
int chunkSize = 4096;
int tmo = 40000; // 40 sec
Expand Down
4 changes: 2 additions & 2 deletions src/wcs/esp32/ESP32_SSL_Client.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* ESP32 SSL Client v2.0.1
*
* Created July 24, 2022
* Created July 26, 2022
*
* The MIT License (MIT)
* Copyright (c) 2022 K. Suwatchai (Mobizt)
Expand Down Expand Up @@ -64,7 +64,7 @@ static const char esp_ssl_client_str_14[] PROGMEM = "> C: set mbedtls config";
static const char esp_ssl_client_str_15[] PROGMEM = "> C: loading CRT cert";
static const char esp_ssl_client_str_16[] PROGMEM = "> C: loading private key";
static const char esp_ssl_client_str_17[] PROGMEM = "> C: setting hostname for TLS session";
static const char esp_ssl_client_str_18[] PROGMEM = "> C: performing the SSL/TLS handshake";
static const char esp_ssl_client_str_18[] PROGMEM = "> C: perform the SSL/TLS handshake";
static const char esp_ssl_client_str_19[] PROGMEM = "> C: verifying peer X.509 certificate";
static const char esp_ssl_client_str_20[] PROGMEM = "! E: failed to verify peer certificate!";
static const char esp_ssl_client_str_21[] PROGMEM = "> C: certificate verified";
Expand Down

0 comments on commit 278c586

Please sign in to comment.