File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -369,7 +369,13 @@ uint16_t
369
369
UIPClient::remotePort (void )
370
370
{
371
371
return data ? ntohs (uip_conns[data->conn_index ].rport ) : 0 ;
372
- }
372
+ }
373
+
374
+ uint8_t
375
+ UIPClient::status ()
376
+ {
377
+ return !data ? UIP_CLOSED : uip_conns[data->conn_index ].tcpstateflags & UIP_TS_MASK;
378
+ }
373
379
374
380
void
375
381
uipclient_appcall (void )
Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ class EthernetClient : public Client {
77
77
78
78
IPAddress remoteIP ();
79
79
uint16_t remotePort ();
80
+
81
+ uint8_t status ();
80
82
81
83
private:
82
84
EthernetClient (struct uip_conn *_conn);
Original file line number Diff line number Diff line change
1
+
2
+ #ifndef UIP_TCP_STATES_H
3
+ #define UIP_TCP_STATES_H
4
+
5
+ #include <utility/uip.h>
6
+
7
+ // common constants for client.state() return values
8
+ enum uip_tcp_state {
9
+ CLOSED = UIP_CLOSED ,
10
+ SYN_SENT = UIP_SYN_SENT ,
11
+ SYN_RCVD = UIP_SYN_RCVD ,
12
+ ESTABLISHED = UIP_ESTABLISHED ,
13
+ FIN_WAIT_1 = UIP_FIN_WAIT_1 ,
14
+ FIN_WAIT_2 = UIP_FIN_WAIT_2 ,
15
+ CLOSE_WAIT = 10 , // not used
16
+ CLOSING = UIP_CLOSING ,
17
+ LAST_ACK = UIP_LAST_ACK ,
18
+ TIME_WAIT = UIP_TIME_WAIT
19
+ };
20
+
21
+ #endif
You can’t perform that action at this time.
0 commit comments