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

Commit 1c4ab74

Browse files
committed
code cleanup
1 parent 83b4768 commit 1c4ab74

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/AsyncTCP.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ typedef struct {
4646
void *arg;
4747
union {
4848
struct {
49-
void * pcb;
49+
tcp_pcb * pcb;
5050
int8_t err;
5151
} connected;
5252
struct {
@@ -895,13 +895,10 @@ void AsyncClient::_free_closed_slot(){
895895
* Private Callbacks
896896
* */
897897

898-
int8_t AsyncClient::_connected(void* pcb, int8_t err){
898+
int8_t AsyncClient::_connected(tcp_pcb* pcb, int8_t err){
899899
_pcb = reinterpret_cast<tcp_pcb*>(pcb);
900900
if(_pcb){
901901
_rx_last_packet = millis();
902-
// tcp_recv(_pcb, &_tcp_recv);
903-
// tcp_sent(_pcb, &_tcp_sent);
904-
// tcp_poll(_pcb, &_tcp_poll, 1);
905902
}
906903
if(_connect_cb) {
907904
_connect_cb(_connect_cb_arg, this);
@@ -1353,7 +1350,7 @@ void AsyncClient::_s_error(void * arg, int8_t err) {
13531350
reinterpret_cast<AsyncClient*>(arg)->_error(err);
13541351
}
13551352

1356-
int8_t AsyncClient::_s_connected(void * arg, void * pcb, int8_t err){
1353+
int8_t AsyncClient::_s_connected(void * arg, struct tcp_pcb * pcb, int8_t err){
13571354
return reinterpret_cast<AsyncClient*>(arg)->_connected(pcb, err);
13581355
}
13591356

src/AsyncTCP.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class AsyncClient {
182182
static int8_t _s_lwip_fin(void *arg, struct tcp_pcb *tpcb, int8_t err);
183183
static void _s_error(void *arg, int8_t err);
184184
static int8_t _s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len);
185-
static int8_t _s_connected(void* arg, void* tpcb, int8_t err);
185+
static int8_t _s_connected(void* arg, struct tcp_pcb *tpcb, int8_t err);
186186
static void _s_dns_found(const char *name, struct ip_addr *ipaddr, void *arg);
187187

188188
int8_t _recv(tcp_pcb* pcb, pbuf* pb, int8_t err);
@@ -223,7 +223,7 @@ class AsyncClient {
223223
int8_t _close();
224224
void _free_closed_slot();
225225
void _allocate_closed_slot();
226-
int8_t _connected(void* pcb, int8_t err);
226+
int8_t _connected(tcp_pcb* pcb, int8_t err);
227227
void _error(int8_t err);
228228
int8_t _poll(tcp_pcb* pcb);
229229
int8_t _sent(tcp_pcb* pcb, uint16_t len);

0 commit comments

Comments
 (0)