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

Commit 5720419

Browse files
authored
v1.3.0
### 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
1 parent c2bbf7c commit 5720419

File tree

2 files changed

+55
-17
lines changed

2 files changed

+55
-17
lines changed

src/SyncClient.h

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,21 @@
2323
#define SYNCCLIENT_H_
2424

2525
#include "Client.h"
26+
2627
// Needed for Arduino core releases prior to 2.5.0, because of changes
2728
// made to accommodate Arduino core 2.5.0
2829
// CONST was 1st defined in Core 2.5.0 in IPAddress.h
2930
#ifndef CONST
30-
#define CONST
31+
#define CONST
3132
#endif
33+
3234
#include <async_config.h>
35+
3336
class cbuf;
3437
class AsyncClient;
3538

36-
class SyncClient: public Client {
39+
class SyncClient: public Client
40+
{
3741
private:
3842
AsyncClient *_client;
3943
cbuf *_tx_buffer;
@@ -57,46 +61,80 @@ class SyncClient: public Client {
5761

5862
int ref();
5963
int unref();
60-
operator bool(){ return connected(); }
64+
65+
operator bool()
66+
{
67+
return connected();
68+
}
69+
6170
SyncClient & operator=(const SyncClient &other);
6271

6372
#if ASYNC_TCP_SSL_ENABLED
73+
6474
int _connect(const IPAddress& ip, uint16_t port, bool secure);
65-
int connect(CONST IPAddress& ip, uint16_t port, bool secure){
75+
76+
int connect(CONST IPAddress& ip, uint16_t port, bool secure)
77+
{
6678
return _connect(ip, port, secure);
6779
}
68-
int connect(IPAddress ip, uint16_t port, bool secure){
80+
81+
int connect(IPAddress ip, uint16_t port, bool secure)
82+
{
6983
return _connect(reinterpret_cast<const IPAddress&>(ip), port, secure);
7084
}
85+
7186
int connect(const char *host, uint16_t port, bool secure);
72-
int connect(CONST IPAddress& ip, uint16_t port){
87+
88+
int connect(CONST IPAddress& ip, uint16_t port)
89+
{
7390
return _connect(ip, port, false);
7491
}
75-
int connect(IPAddress ip, uint16_t port){
92+
93+
int connect(IPAddress ip, uint16_t port)
94+
{
7695
return _connect(reinterpret_cast<const IPAddress&>(ip), port, false);
7796
}
78-
int connect(const char *host, uint16_t port){
97+
98+
int connect(const char *host, uint16_t port)
99+
{
79100
return connect(host, port, false);
80101
}
102+
81103
#else
104+
82105
int _connect(const IPAddress& ip, uint16_t port);
83-
int connect(CONST IPAddress& ip, uint16_t port){
106+
107+
int connect(CONST IPAddress& ip, uint16_t port)
108+
{
84109
return _connect(ip, port);
85110
}
86-
int connect(IPAddress ip, uint16_t port){
111+
112+
int connect(IPAddress ip, uint16_t port)
113+
{
87114
return _connect(reinterpret_cast<const IPAddress&>(ip), port);
88115
}
116+
89117
int connect(const char *host, uint16_t port);
90118
#endif
119+
91120
void setTimeout(uint32_t seconds);
92121

93122
uint8_t status();
94123
uint8_t connected();
95124

96125
bool stop(unsigned int maxWaitMs);
97126
bool flush(unsigned int maxWaitMs);
98-
void stop() { (void)stop(0);}
99-
void flush() { (void)flush(0);}
127+
128+
void stop()
129+
{
130+
(void)stop(0);
131+
}
132+
133+
void flush()
134+
{
135+
(void)flush(0);
136+
}
137+
100138
size_t write(uint8_t data);
101139
size_t write(const uint8_t *data, size_t len);
102140

src/tcp_axtls.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2020
*/
2121
/*
22-
* Compatibility for AxTLS with LWIP raw tcp mode (http://lwip.wikia.com/wiki/Raw/TCP)
23-
* Original Code and Inspiration: Slavey Karadzhov
24-
*/
22+
Compatibility for AxTLS with LWIP raw tcp mode (http://lwip.wikia.com/wiki/Raw/TCP)
23+
Original Code and Inspiration: Slavey Karadzhov
24+
*/
2525

2626
#ifndef LWIPR_COMPAT_H
2727
#define LWIPR_COMPAT_H
@@ -32,8 +32,8 @@
3232

3333
#include "lwipopts.h"
3434
/*
35-
* All those functions will run only if LWIP tcp raw mode is used
36-
*/
35+
All those functions will run only if LWIP tcp raw mode is used
36+
*/
3737
#if LWIP_RAW==1
3838

3939
#ifdef __cplusplus

0 commit comments

Comments
 (0)