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

Commit c2d4c16

Browse files
authored
Does not compile with git head esp8266com
Some callback function prototypes do not match the lip headers. Please correct this by either: - Casting the function addresses (as I did here) - Or correct the prototypes so they match. Thank you.
1 parent 9b0cc37 commit c2d4c16

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/ESPAsyncTCP.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ AsyncClient::AsyncClient(tcp_pcb* pcb):
7474
_rx_last_packet = millis();
7575
tcp_setprio(_pcb, TCP_PRIO_MIN);
7676
tcp_arg(_pcb, this);
77-
tcp_recv(_pcb, &_s_recv);
78-
tcp_sent(_pcb, &_s_sent);
79-
tcp_err(_pcb, &_s_error);
80-
tcp_poll(_pcb, &_s_poll, 1);
77+
tcp_recv(_pcb, (tcp_recv_fn)&_s_recv);
78+
tcp_sent(_pcb, (tcp_sent_fn)&_s_sent);
79+
tcp_err(_pcb, (tcp_err_fn)&_s_error);
80+
tcp_poll(_pcb, (tcp_poll_fn)&_s_poll, 1);
8181
#if ASYNC_TCP_SSL_ENABLED
8282
if(ssl_ctx){
8383
if(tcp_ssl_new_server(_pcb, ssl_ctx) < 0){
@@ -125,7 +125,7 @@ bool AsyncClient::connect(IPAddress ip, uint16_t port){
125125
_handshake_done = !secure;
126126
#endif
127127
tcp_arg(pcb, this);
128-
tcp_err(pcb, &_s_error);
128+
tcp_err(pcb, (tcp_err_fn)&_s_error);
129129
tcp_connect(pcb, &addr, port,(tcp_connected_fn)&_s_connected);
130130
return true;
131131
}
@@ -163,10 +163,10 @@ AsyncClient& AsyncClient::operator=(const AsyncClient& other){
163163
_rx_last_packet = millis();
164164
tcp_setprio(_pcb, TCP_PRIO_MIN);
165165
tcp_arg(_pcb, this);
166-
tcp_recv(_pcb, &_s_recv);
167-
tcp_sent(_pcb, &_s_sent);
168-
tcp_err(_pcb, &_s_error);
169-
tcp_poll(_pcb, &_s_poll, 1);
166+
tcp_recv(_pcb, (tcp_recv_fn)&_s_recv);
167+
tcp_sent(_pcb, (tcp_sent_fn)&_s_sent);
168+
tcp_err(_pcb, (tcp_err_fn)&_s_error);
169+
tcp_poll(_pcb, (tcp_poll_fn)&_s_poll, 1);
170170
#if ASYNC_TCP_SSL_ENABLED
171171
if(tcp_ssl_has(_pcb)){
172172
_pcb_secure = true;
@@ -287,9 +287,9 @@ int8_t AsyncClient::_connected(void* pcb, int8_t err){
287287
_pcb_busy = false;
288288
_rx_last_packet = millis();
289289
tcp_setprio(_pcb, TCP_PRIO_MIN);
290-
tcp_recv(_pcb, &_s_recv);
291-
tcp_sent(_pcb, &_s_sent);
292-
tcp_poll(_pcb, &_s_poll, 1);
290+
tcp_recv(_pcb, (tcp_recv_fn)&_s_recv);
291+
tcp_sent(_pcb, (tcp_sent_fn)&_s_sent);
292+
tcp_poll(_pcb, (tcp_poll_fn)&_s_poll, 1);
293293
#if ASYNC_TCP_SSL_ENABLED
294294
if(_pcb_secure){
295295
if(tcp_ssl_new_client(_pcb) < 0){
@@ -836,7 +836,7 @@ void AsyncServer::begin(){
836836
}
837837
_pcb = listen_pcb;
838838
tcp_arg(_pcb, (void*) this);
839-
tcp_accept(_pcb, &_s_accept);
839+
tcp_accept(_pcb, (tcp_accept_fn)&_s_accept);
840840
}
841841

842842
#if ASYNC_TCP_SSL_ENABLED

0 commit comments

Comments
 (0)