Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
### Release v1.3.0

1. Initial modifications for ESP8266 boards, using WiFi or LwIP Ethernet, with [ESP8266 core v3.0.2+](https://github.com/esp8266/Arduino/releases/tag/3.0.2) or WiFi with [ESP8266 core v2.7.4-](https://github.com/esp8266/Arduino/releases/tag/2.7.4) to avoid compile errors
  • Loading branch information
khoih-prog authored Sep 13, 2022
1 parent c2bbf7c commit 5720419
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 17 deletions.
62 changes: 50 additions & 12 deletions src/SyncClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,21 @@
#define SYNCCLIENT_H_

#include "Client.h"

// Needed for Arduino core releases prior to 2.5.0, because of changes
// made to accommodate Arduino core 2.5.0
// CONST was 1st defined in Core 2.5.0 in IPAddress.h
#ifndef CONST
#define CONST
#define CONST
#endif

#include <async_config.h>

class cbuf;
class AsyncClient;

class SyncClient: public Client {
class SyncClient: public Client
{
private:
AsyncClient *_client;
cbuf *_tx_buffer;
Expand All @@ -57,46 +61,80 @@ class SyncClient: public Client {

int ref();
int unref();
operator bool(){ return connected(); }

operator bool()
{
return connected();
}

SyncClient & operator=(const SyncClient &other);

#if ASYNC_TCP_SSL_ENABLED

int _connect(const IPAddress& ip, uint16_t port, bool secure);
int connect(CONST IPAddress& ip, uint16_t port, bool secure){

int connect(CONST IPAddress& ip, uint16_t port, bool secure)
{
return _connect(ip, port, secure);
}
int connect(IPAddress ip, uint16_t port, bool secure){

int connect(IPAddress ip, uint16_t port, bool secure)
{
return _connect(reinterpret_cast<const IPAddress&>(ip), port, secure);
}

int connect(const char *host, uint16_t port, bool secure);
int connect(CONST IPAddress& ip, uint16_t port){

int connect(CONST IPAddress& ip, uint16_t port)
{
return _connect(ip, port, false);
}
int connect(IPAddress ip, uint16_t port){

int connect(IPAddress ip, uint16_t port)
{
return _connect(reinterpret_cast<const IPAddress&>(ip), port, false);
}
int connect(const char *host, uint16_t port){

int connect(const char *host, uint16_t port)
{
return connect(host, port, false);
}

#else

int _connect(const IPAddress& ip, uint16_t port);
int connect(CONST IPAddress& ip, uint16_t port){

int connect(CONST IPAddress& ip, uint16_t port)
{
return _connect(ip, port);
}
int connect(IPAddress ip, uint16_t port){

int connect(IPAddress ip, uint16_t port)
{
return _connect(reinterpret_cast<const IPAddress&>(ip), port);
}

int connect(const char *host, uint16_t port);
#endif

void setTimeout(uint32_t seconds);

uint8_t status();
uint8_t connected();

bool stop(unsigned int maxWaitMs);
bool flush(unsigned int maxWaitMs);
void stop() { (void)stop(0);}
void flush() { (void)flush(0);}

void stop()
{
(void)stop(0);
}

void flush()
{
(void)flush(0);
}

size_t write(uint8_t data);
size_t write(const uint8_t *data, size_t len);

Expand Down
10 changes: 5 additions & 5 deletions src/tcp_axtls.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* Compatibility for AxTLS with LWIP raw tcp mode (http://lwip.wikia.com/wiki/Raw/TCP)
* Original Code and Inspiration: Slavey Karadzhov
*/
Compatibility for AxTLS with LWIP raw tcp mode (http://lwip.wikia.com/wiki/Raw/TCP)
Original Code and Inspiration: Slavey Karadzhov
*/

#ifndef LWIPR_COMPAT_H
#define LWIPR_COMPAT_H
Expand All @@ -32,8 +32,8 @@

#include "lwipopts.h"
/*
* All those functions will run only if LWIP tcp raw mode is used
*/
All those functions will run only if LWIP tcp raw mode is used
*/
#if LWIP_RAW==1

#ifdef __cplusplus
Expand Down

0 comments on commit 5720419

Please sign in to comment.