From f0ba738a71ec8dafe4705ddd02c07a2eb880655c Mon Sep 17 00:00:00 2001 From: Mimmo La Fauci Date: Sun, 17 Mar 2013 19:23:16 +0100 Subject: Fix issue related to multiple client opened on web server sketch --- firmwares/wifishield/wifiHD/src/ard_tcp.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'firmwares/wifishield/wifiHD/src/ard_tcp.h') diff --git a/firmwares/wifishield/wifiHD/src/ard_tcp.h b/firmwares/wifishield/wifiHD/src/ard_tcp.h index 7d0bf7b..2bd3731 100644 --- a/firmwares/wifishield/wifiHD/src/ard_tcp.h +++ b/firmwares/wifishield/wifiHD/src/ard_tcp.h @@ -24,7 +24,9 @@ typedef void (ard_tcp_done_cb_t)(void *opaque, int result); // Maximum number of client connection accepted by server #define MAX_CLIENT_ACCEPTED 4 #define NO_VALID_ID -1 -#define GET_FIRST_CLIENT_TCP(TTCP) ((TTCP!=NULL)?TTCP->tpcb[0] : NULL) + +#define GET_FIRST_CLIENT_TCP(TTCP) getFirstClient(TTCP, 1) +#define GET_FIRST_CLIENT_TCP_NV(TTCP) getFirstClient(TTCP, 0) #define GET_CLIENT_TCP(TTCP,ID) (((TTCP!=NULL)&&(ID>=0)&&(IDtpcb[ID] : NULL) @@ -92,6 +94,10 @@ bool cleanNewClientConn(struct ttcp* _ttcp); int8_t getNewClientConnId(struct ttcp* _ttcp, struct tcp_pcb *newpcb); +int8_t getCurrClientConnId(); + +struct tcp_pcb * getFirstClient(struct ttcp* _ttcp, bool verbose); + void closeConnections(); #endif -- cgit v1.2.3-18-g5258