Match changes to NSAPI in ESP8266Interface

mirrored from:
https://developer.mbed.org/teams/components/code/ESP8266Interface/
Christopher Haster 2016-05-10 14:32:24 -05:00 committed by Russ Butler
parent 7d9b5e6f76
commit 4684173778
2 changed files with 13 additions and 21 deletions

View File

@ -152,11 +152,6 @@ int ESP8266Interface::socket_connect(void *handle, const SocketAddress &addr)
return 0; return 0;
} }
bool ESP8266Interface::socket_is_connected(void *handle)
{
return true;
}
int ESP8266Interface::socket_accept(void **handle, void *server) int ESP8266Interface::socket_accept(void **handle, void *server)
{ {
return NSAPI_ERROR_UNSUPPORTED; return NSAPI_ERROR_UNSUPPORTED;

View File

@ -29,17 +29,21 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface
{ {
public: public:
/** ESP8266Interface lifetime /** ESP8266Interface lifetime
* @param tx TX pin * @param tx TX pin
* @param rx RX pin * @param rx RX pin
* @param debug Enable debugging * @param debug Enable debugging
*/ */
ESP8266Interface(PinName tx, PinName rx, bool debug = false); ESP8266Interface(PinName tx, PinName rx, bool debug = false);
/** Start the interface /** Start the interface
* @param ssid Name of the network to connect to *
* @param pass Security passphrase to connect to the network * Attempts to connect to a WiFi network. If passphrase is invalid,
* @param security Type of encryption for connection * NSAPI_ERROR_AUTH_ERROR is returned.
* @return 0 on success, negative on failure *
* @param ssid Name of the network to connect to
* @param pass Security passphrase to connect to the network
* @param security Type of encryption for connection
* @return 0 on success, negative error code on failure
*/ */
virtual int connect( virtual int connect(
const char *ssid, const char *ssid,
@ -98,12 +102,6 @@ protected:
* @return 0 on success, negative on failure * @return 0 on success, negative on failure
*/ */
virtual int socket_connect(void *handle, const SocketAddress &address); virtual int socket_connect(void *handle, const SocketAddress &address);
/** Check if the socket is connected
* @param handle Socket handle
* @return true if connected, false otherwise
*/
virtual bool socket_is_connected(void *handle);
/** Accept a new connection. /** Accept a new connection.
* @param handle Handle in which to store new socket * @param handle Handle in which to store new socket
@ -139,7 +137,7 @@ protected:
* @param address The remote SocketAddress * @param address The remote SocketAddress
* @param data The packet to be sent * @param data The packet to be sent
* @param size The length of the packet to be sent * @param size The length of the packet to be sent
* @return the number of written bytes on success, negative on failure * @return The number of written bytes on success, negative on failure
* @note This call is not-blocking, if this call would block, must * @note This call is not-blocking, if this call would block, must
* immediately return NSAPI_ERROR_WOULD_WAIT * immediately return NSAPI_ERROR_WOULD_WAIT
*/ */
@ -152,7 +150,7 @@ protected:
* If a packet is too long to fit in the supplied buffer, * If a packet is too long to fit in the supplied buffer,
* excess bytes are discarded * excess bytes are discarded
* @param size The length of the buffer * @param size The length of the buffer
* @return the number of received bytes on success, negative on failure * @return The number of received bytes on success, negative on failure
* @note This call is not-blocking, if this call would block, must * @note This call is not-blocking, if this call would block, must
* immediately return NSAPI_ERROR_WOULD_WAIT * immediately return NSAPI_ERROR_WOULD_WAIT
*/ */
@ -172,4 +170,3 @@ private:
}; };
#endif #endif