aboutsummaryrefslogtreecommitdiff
path: root/firmwares/wifishield/wifiHD/src/ard_tcp.h
diff options
context:
space:
mode:
authorMimmo La Fauci <mlafauci@metodo2.it>2013-03-17 19:23:16 +0100
committerMimmo La Fauci <mlafauci@metodo2.it>2013-03-17 19:23:16 +0100
commitf0ba738a71ec8dafe4705ddd02c07a2eb880655c (patch)
tree3f96a7b5885a043655823fdf6de0cf8832a9fc1f /firmwares/wifishield/wifiHD/src/ard_tcp.h
parent9f77c8351090723410e126f63f7fbcb9b0875ce6 (diff)
Fix issue related to multiple client opened on web server sketch
Diffstat (limited to 'firmwares/wifishield/wifiHD/src/ard_tcp.h')
-rw-r--r--firmwares/wifishield/wifiHD/src/ard_tcp.h8
1 files changed, 7 insertions, 1 deletions
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)&&(ID<MAX_CLIENT_ACCEPTED))?TTCP->tpcb[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