@@ -137,29 +137,39 @@ class NetworkInterface: public DNS {
137
137
*/
138
138
virtual nsapi_error_t set_dhcp (bool dhcp);
139
139
140
- /* * Start the interface .
140
+ /* * Connect to a network .
141
141
*
142
- * This blocks until connection is established, but asynchronous operation can be enabled
143
- * by calling NetworkInterface::set_blocking(false).
142
+ * This blocks until connection is established, but asynchronous operation can be enabled
143
+ * by calling NetworkInterface::set_blocking(false).
144
144
*
145
- * In asynchronous mode this starts the connection sequence and returns immediately.
146
- * Status of the connection can then checked from NetworkInterface::get_connection_status()
147
- * or from status callbacks.
145
+ * In asynchronous mode this starts the connection sequence and returns immediately.
146
+ * Status of the connection can then checked from NetworkInterface::get_connection_status()
147
+ * or from status callbacks.
148
148
*
149
- * @return NSAPI_ERROR_OK on success, or if asynchronous operation started.
150
- * @return NSAPI_ERROR_ALREADY if asynchronous connect operation already ongoing.
151
- * @return NSAPI_ERROR_IS_CONNECTED if interface is already connected.
152
- * @return negative error code on failure.
149
+ * NetworkInterface internally handles reconnections until disconnect() is called.
150
+ *
151
+ * @return NSAPI_ERROR_OK if connection established in blocking mode.
152
+ * @return NSAPI_ERROR_OK if asynchronous operation started.
153
+ * @return NSAPI_ERROR_BUSY if asynchronous operation cannot be started.
154
+ Implementation guarantees event generation, which can be used as an
155
+ trigger to reissue the rejected request.
156
+ * @return NSAPI_ERROR_IS_CONNECTED if already connected.
157
+ * @return negative error code on failure.
153
158
*/
154
159
virtual nsapi_error_t connect () = 0;
155
160
156
- /* * Stop the interface.
161
+ /* * Disconnect from the network
157
162
*
158
163
* This blocks until interface is disconnected, unless interface is set to
159
164
* asynchronous (non-blocking) mode by calling NetworkInterface::set_blocking(false).
160
165
*
161
- * @return NSAPI_ERROR_OK on success, or if asynchronous operation started.
162
- @ @return negative error code on failure.
166
+ * @return NSAPI_ERROR_OK on successfully disconnected in blocking mode.
167
+ * @return NSAPI_ERROR_OK if asynchronous operation started.
168
+ * @return NSAPI_ERROR_BUSY if asynchronous operation cannot be started.
169
+ Implementation guarantees event generation, which can be used as an
170
+ trigger to reissue the rejected request.
171
+ * @return NSAPI_ERROR_NO_CONNECTION if already disconnected.
172
+ * @return negative error code on failure.
163
173
*/
164
174
virtual nsapi_error_t disconnect () = 0;
165
175
@@ -253,10 +263,15 @@ class NetworkInterface: public DNS {
253
263
*/
254
264
virtual nsapi_connection_status_t get_connection_status () const ;
255
265
256
- /* * Set blocking status of connect() which by default should be blocking .
266
+ /* * Set asynchronous operation of connect() and disconnect() calls .
257
267
*
258
- * @param blocking Use true to make connect() blocking.
259
- * @return NSAPI_ERROR_OK on success, negative error code on failure.
268
+ * By default, interfaces are in synchronous mode which means that
269
+ * connect() or disconnect() blocks until it reach the target state or requested operation fails.
270
+ *
271
+ * @param blocking Use true to set NetworkInterface in asynchronous mode.
272
+ * @return NSAPI_ERROR_OK on success
273
+ * @return NSAPI_ERROR_UNSUPPORTED if driver does not support asynchronous mode.
274
+ * @return negative error code on failure.
260
275
*/
261
276
virtual nsapi_error_t set_blocking (bool blocking);
262
277
0 commit comments