Merge pull request #8836 from SeppoTakalo/clarify_connect_docs

Clarify asynchronous NetworkInterface::connect() documentation
pull/8790/head
Martin Kojtal 2018-11-25 11:27:16 +01:00 committed by GitHub
commit aae6bb125a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 2 deletions

View File

@ -135,13 +135,27 @@ public:
/** Start the interface.
*
* @return NSAPI_ERROR_OK on success, negative error code on failure.
* This blocks until connection is established, but asynchronous operation can be enabled
* by calling NetworkInterface::set_blocking(false).
*
* In asynchronous mode this starts the connection sequence and returns immediately.
* Status of the connection can then checked from NetworkInterface::get_connection_status()
* or from status callbacks.
*
* @return NSAPI_ERROR_OK on success, or if asynchronous operation started.
* @return NSAPI_ERROR_ALREADY if asynchronous connect operation already ongoing.
* @return NSAPI_ERROR_IS_CONNECTED if interface is already connected.
* @return negative error code on failure.
*/
virtual nsapi_error_t connect() = 0;
/** Stop the interface.
*
* @return NSAPI_ERROR_OK on success, negative error code on failure.
* This blocks until interface is disconnected, unless interface is set to
* asynchronous (non-blocking) mode by calling NetworkInterface::set_blocking(false).
*
* @return NSAPI_ERROR_OK on success, or if asynchronous operation started.
@ @return negative error code on failure.
*/
virtual nsapi_error_t disconnect() = 0;