Skip to content

Commit 9deef35

Browse files
committed
documentation: add description for connected() and status()
ref. the original PR and the discussion esp8266#4626 esp8266#6701
1 parent 9d024d1 commit 9deef35

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

doc/esp8266wifi/client-class.rst

+11-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@ Methods documented for `Client <https://www.arduino.cc/en/Reference/WiFiClientCo
1616
9. `flush() <https://www.arduino.cc/en/Reference/WiFiClientFlush>`__
1717
10. `stop() <https://www.arduino.cc/en/Reference/WiFIClientStop>`__
1818

19-
Methods and properties described further down are specific to ESP8266. They are not covered in `Arduino WiFi library <https://www.arduino.cc/en/Reference/WiFi>`__ documentation. Before they are fully documented please refer to information below.
19+
Methods and properties described further down below are specific to ESP8266. Some of them behave differently from the reference `Arduino WiFi library <https://www.arduino.cc/en/Reference/WiFi>`__ , or are only implemented for this Core.
20+
21+
connected
22+
~~~~~~~~~
23+
24+
Unlike the reference implementation, ``connected()`` means that the client is available for both reads and writes. Please use ``status()`` for only the connection information, and ``available()`` if you mean to check whether there's unread data.
25+
26+
status
27+
~~~~~~
28+
29+
Current implementation returns ``0`` (``CLOSED``) when the client is disconnected and ``4`` (``ESTABLISHED``) when connected. At the time of writing these refer to the ``enum tcp_state`` values that can be found at the `lwip/tcpbase.h <https://github.com/esp8266/Arduino/blob/master/tools/sdk/lwip2/include/lwip/tcpbase.h>`
2030

2131
flush and stop
2232
~~~~~~~~~~~~~~
@@ -92,7 +102,6 @@ Other Function Calls
92102

93103
.. code:: cpp
94104
95-
uint8_t status ()
96105
virtual size_t write (const uint8_t *buf, size_t size)
97106
size_t write_P (PGM_P buf, size_t size)
98107
size_t write (Stream &stream)

0 commit comments

Comments
 (0)