Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: NetworkInterface.h
- Revision:
- 15:94e2cf3a06be
- Parent:
- 9:1600369a29dd
- Child:
- 17:b1d417383c0d
--- a/NetworkInterface.h Tue Apr 05 23:39:54 2016 +0000
+++ b/NetworkInterface.h Tue Apr 05 23:47:04 2016 +0000
@@ -27,7 +27,7 @@
* @enum ns_error_t
* @brief enum of standardized error codes
*/
-enum ns_error_t {
+enum nsapi_error_t {
NSAPI_ERROR_WOULD_BLOCK = -3001, /*!< no data is not available but call is non-blocking */
NSAPI_ERROR_UNSUPPORTED = -3002, /*!< unsupported configuration */
NSAPI_ERROR_NO_CONNECTION = -3003, /*!< not connected to a network */
@@ -39,7 +39,7 @@
NSAPI_ERROR_AUTH_FAILURE = -3009, /*!< connection to access point faield */
NSAPI_ERROR_DEVICE_ERROR = -3010, /*!< failure interfacing with the network procesor */
};
-
+
/**
* @enum ns_opt_t
* @brief enum of available options
@@ -47,6 +47,14 @@
enum ns_opt_t {
};
+/** Enum of socket protocols
+/enum protocol_t
+*/
+enum nsapi_protocol_t {
+ NSAPI_TCP, /*!< Socket is of TCP type */
+ NSAPI_UDP, /*!< Socket is of UDP type */
+};
+
/** NetworkInterface class
* Common interface that is shared between all hardware that
* can connect to a network over IP.
@@ -86,19 +94,11 @@
friend class TCPSocket;
friend class TCPServer;
- /** Enum of socket protocols
- /enum protocol_t
- */
- enum protocol_t {
- TCP, /*!< Socket is of TCP type */
- UDP, /*!< Socket is of UDP type */
- };
-
/** Create a socket
/param proto The type of socket to open, TCP or UDP
/return The alocated socket or null on failure
*/
- virtual void *socket_create(protocol_t proto) = 0;
+ virtual void *socket_create(nsapi_protocol_t proto) = 0;
/** Destroy a socket
/param socket Previously allocated socket