Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 036ea44

Browse files
committed
Fix compilation errors
Fixes: #57 Fixes: #56 Closes: #56
1 parent 9b0cc37 commit 036ea44

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

src/ESPAsyncTCP.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ size_t AsyncClient::ack(size_t len){
281281

282282
// Private Callbacks
283283

284-
int8_t AsyncClient::_connected(void* pcb, int8_t err){
284+
long AsyncClient::_connected(void* pcb, long err){
285285
_pcb = reinterpret_cast<tcp_pcb*>(pcb);
286286
if(_pcb){
287287
_pcb_busy = false;
@@ -334,7 +334,7 @@ int8_t AsyncClient::_close(){
334334
return err;
335335
}
336336

337-
void AsyncClient::_error(int8_t err) {
337+
void AsyncClient::_error(long err) {
338338
if(_pcb){
339339
#if ASYNC_TCP_SSL_ENABLED
340340
if(_pcb_secure){
@@ -361,7 +361,7 @@ void AsyncClient::_ssl_error(int8_t err){
361361
}
362362
#endif
363363

364-
int8_t AsyncClient::_sent(tcp_pcb* pcb, uint16_t len) {
364+
long AsyncClient::_sent(tcp_pcb* pcb, uint16_t len) {
365365
_rx_last_packet = millis();
366366
ASYNC_TCP_DEBUG("_sent: %u\n", len);
367367
_tx_unacked_len -= len;
@@ -375,7 +375,7 @@ int8_t AsyncClient::_sent(tcp_pcb* pcb, uint16_t len) {
375375
return ERR_OK;
376376
}
377377

378-
int8_t AsyncClient::_recv(tcp_pcb* pcb, pbuf* pb, int8_t err) {
378+
long AsyncClient::_recv(tcp_pcb* pcb, pbuf* pb, long err) {
379379
if(pb == NULL){
380380
ASYNC_TCP_DEBUG("_recv: pb == NULL! Closing... %d\n", err);
381381
return _close();
@@ -414,7 +414,7 @@ int8_t AsyncClient::_recv(tcp_pcb* pcb, pbuf* pb, int8_t err) {
414414
return ERR_OK;
415415
}
416416

417-
int8_t AsyncClient::_poll(tcp_pcb* pcb){
417+
long AsyncClient::_poll(tcp_pcb* pcb){
418418
// Close requested
419419
if(_close_pcb){
420420
_close_pcb = false;
@@ -469,23 +469,23 @@ void AsyncClient::_s_dns_found(const char *name, ip_addr_t *ipaddr, void *arg){
469469
reinterpret_cast<AsyncClient*>(arg)->_dns_found(ipaddr);
470470
}
471471

472-
int8_t AsyncClient::_s_poll(void *arg, struct tcp_pcb *tpcb) {
472+
long AsyncClient::_s_poll(void *arg, struct tcp_pcb *tpcb) {
473473
return reinterpret_cast<AsyncClient*>(arg)->_poll(tpcb);
474474
}
475475

476-
int8_t AsyncClient::_s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, int8_t err) {
476+
long AsyncClient::_s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, long err) {
477477
return reinterpret_cast<AsyncClient*>(arg)->_recv(tpcb, pb, err);
478478
}
479479

480-
void AsyncClient::_s_error(void *arg, int8_t err) {
480+
void AsyncClient::_s_error(void *arg, long err) {
481481
reinterpret_cast<AsyncClient*>(arg)->_error(err);
482482
}
483483

484-
int8_t AsyncClient::_s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len) {
484+
long AsyncClient::_s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len) {
485485
return reinterpret_cast<AsyncClient*>(arg)->_sent(tpcb, len);
486486
}
487487

488-
int8_t AsyncClient::_s_connected(void* arg, void* tpcb, int8_t err){
488+
long AsyncClient::_s_connected(void* arg, void* tpcb, long err){
489489
return reinterpret_cast<AsyncClient*>(arg)->_connected(tpcb, err);
490490
}
491491

@@ -896,7 +896,7 @@ uint8_t AsyncServer::status(){
896896
return _pcb->state;
897897
}
898898

899-
int8_t AsyncServer::_accept(tcp_pcb* pcb, int8_t err){
899+
long AsyncServer::_accept(tcp_pcb* pcb, long err){
900900
if(_connect_cb){
901901
#if ASYNC_TCP_SSL_ENABLED
902902
if (_noDelay || _ssl_ctx)
@@ -964,7 +964,7 @@ int8_t AsyncServer::_accept(tcp_pcb* pcb, int8_t err){
964964
return ERR_OK;
965965
}
966966

967-
int8_t AsyncServer::_s_accept(void *arg, tcp_pcb* pcb, int8_t err){
967+
long AsyncServer::_s_accept(void *arg, tcp_pcb* pcb, long err){
968968
return reinterpret_cast<AsyncServer*>(arg)->_accept(pcb, err);
969969
}
970970

src/ESPAsyncTCP.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,19 @@ class AsyncClient {
8484
uint16_t _connect_port;
8585

8686
int8_t _close();
87-
int8_t _connected(void* pcb, int8_t err);
88-
void _error(int8_t err);
87+
long _connected(void* pcb, long err);
88+
void _error(long err);
8989
#if ASYNC_TCP_SSL_ENABLED
9090
void _ssl_error(int8_t err);
9191
#endif
92-
int8_t _poll(tcp_pcb* pcb);
93-
int8_t _sent(tcp_pcb* pcb, uint16_t len);
92+
long _poll(tcp_pcb* pcb);
93+
long _sent(tcp_pcb* pcb, uint16_t len);
9494
void _dns_found(struct ip_addr *ipaddr);
95-
static int8_t _s_poll(void *arg, struct tcp_pcb *tpcb);
96-
static int8_t _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, int8_t err);
97-
static void _s_error(void *arg, int8_t err);
98-
static int8_t _s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len);
99-
static int8_t _s_connected(void* arg, void* tpcb, int8_t err);
95+
static long _s_poll(void *arg, struct tcp_pcb *tpcb);
96+
static long _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, long err);
97+
static void _s_error(void *arg, long err);
98+
static long _s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len);
99+
static long _s_connected(void* arg, void* tpcb, long err);
100100
static void _s_dns_found(const char *name, struct ip_addr *ipaddr, void *arg);
101101
#if ASYNC_TCP_SSL_ENABLED
102102
static void _s_data(void *arg, struct tcp_pcb *tcp, uint8_t * data, size_t len);
@@ -184,7 +184,7 @@ class AsyncClient {
184184
const char * errorToString(int8_t error);
185185
const char * stateToString();
186186

187-
int8_t _recv(tcp_pcb* pcb, pbuf* pb, int8_t err);
187+
long _recv(tcp_pcb* pcb, pbuf* pb, long err);
188188
};
189189

190190
#if ASYNC_TCP_SSL_ENABLED
@@ -224,15 +224,15 @@ class AsyncServer {
224224
uint8_t status();
225225

226226
protected:
227-
int8_t _accept(tcp_pcb* newpcb, int8_t err);
228-
static int8_t _s_accept(void *arg, tcp_pcb* newpcb, int8_t err);
227+
long _accept(tcp_pcb* newpcb, long err);
228+
static long _s_accept(void *arg, tcp_pcb* newpcb, long err);
229229
#if ASYNC_TCP_SSL_ENABLED
230230
int _cert(const char *filename, uint8_t **buf);
231-
int8_t _poll(tcp_pcb* pcb);
232-
int8_t _recv(tcp_pcb *pcb, struct pbuf *pb, int8_t err);
231+
long _poll(tcp_pcb* pcb);
232+
long _recv(tcp_pcb *pcb, struct pbuf *pb, long err);
233233
static int _s_cert(void *arg, const char *filename, uint8_t **buf);
234-
static int8_t _s_poll(void *arg, struct tcp_pcb *tpcb);
235-
static int8_t _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, int8_t err);
234+
static long _s_poll(void *arg, struct tcp_pcb *tpcb);
235+
static long _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, long err);
236236
#endif
237237
};
238238

0 commit comments

Comments
 (0)