Skip to content

Commit 4684173

Browse files
gekyc1728p9
authored andcommitted
Match changes to NSAPI in ESP8266Interface
mirrored from: https://developer.mbed.org/teams/components/code/ESP8266Interface/
1 parent 7d9b5e6 commit 4684173

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

net/ESP8266Interface/ESP8266Interface.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ int ESP8266Interface::socket_connect(void *handle, const SocketAddress &addr)
152152
return 0;
153153
}
154154

155-
bool ESP8266Interface::socket_is_connected(void *handle)
156-
{
157-
return true;
158-
}
159-
160155
int ESP8266Interface::socket_accept(void **handle, void *server)
161156
{
162157
return NSAPI_ERROR_UNSUPPORTED;

net/ESP8266Interface/ESP8266Interface.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,21 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface
2929
{
3030
public:
3131
/** ESP8266Interface lifetime
32-
* @param tx TX pin
33-
* @param rx RX pin
34-
* @param debug Enable debugging
32+
* @param tx TX pin
33+
* @param rx RX pin
34+
* @param debug Enable debugging
3535
*/
3636
ESP8266Interface(PinName tx, PinName rx, bool debug = false);
3737

3838
/** Start the interface
39-
* @param ssid Name of the network to connect to
40-
* @param pass Security passphrase to connect to the network
41-
* @param security Type of encryption for connection
42-
* @return 0 on success, negative on failure
39+
*
40+
* Attempts to connect to a WiFi network. If passphrase is invalid,
41+
* NSAPI_ERROR_AUTH_ERROR is returned.
42+
*
43+
* @param ssid Name of the network to connect to
44+
* @param pass Security passphrase to connect to the network
45+
* @param security Type of encryption for connection
46+
* @return 0 on success, negative error code on failure
4347
*/
4448
virtual int connect(
4549
const char *ssid,
@@ -98,12 +102,6 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface
98102
* @return 0 on success, negative on failure
99103
*/
100104
virtual int socket_connect(void *handle, const SocketAddress &address);
101-
102-
/** Check if the socket is connected
103-
* @param handle Socket handle
104-
* @return true if connected, false otherwise
105-
*/
106-
virtual bool socket_is_connected(void *handle);
107105

108106
/** Accept a new connection.
109107
* @param handle Handle in which to store new socket
@@ -139,7 +137,7 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface
139137
* @param address The remote SocketAddress
140138
* @param data The packet to be sent
141139
* @param size The length of the packet to be sent
142-
* @return the number of written bytes on success, negative on failure
140+
* @return The number of written bytes on success, negative on failure
143141
* @note This call is not-blocking, if this call would block, must
144142
* immediately return NSAPI_ERROR_WOULD_WAIT
145143
*/
@@ -152,7 +150,7 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface
152150
* If a packet is too long to fit in the supplied buffer,
153151
* excess bytes are discarded
154152
* @param size The length of the buffer
155-
* @return the number of received bytes on success, negative on failure
153+
* @return The number of received bytes on success, negative on failure
156154
* @note This call is not-blocking, if this call would block, must
157155
* immediately return NSAPI_ERROR_WOULD_WAIT
158156
*/
@@ -172,4 +170,3 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface
172170
};
173171

174172
#endif
175-

0 commit comments

Comments
 (0)