|
17 | 17 | #ifndef NETWORK_STACK_H |
18 | 18 | #define NETWORK_STACK_H |
19 | 19 |
|
20 | | -#include "mbed.h" |
21 | | -#include "SocketAddress.h" |
22 | | - |
23 | | - |
24 | | -/** Enum of standardized error codes |
25 | | - * |
26 | | - * Valid error codes have negative values and may |
27 | | - * be returned by any network operation. |
28 | | - * |
29 | | - * @enum nsapi_error_t |
30 | | - */ |
31 | | -enum nsapi_error_t { |
32 | | - NSAPI_ERROR_WOULD_BLOCK = -3001, /*!< no data is not available but call is non-blocking */ |
33 | | - NSAPI_ERROR_UNSUPPORTED = -3002, /*!< unsupported functionality */ |
34 | | - NSAPI_ERROR_PARAMETER = -3003, /*!< invalid configuration */ |
35 | | - NSAPI_ERROR_NO_CONNECTION = -3004, /*!< not connected to a network */ |
36 | | - NSAPI_ERROR_NO_SOCKET = -3005, /*!< socket not available for use */ |
37 | | - NSAPI_ERROR_NO_ADDRESS = -3006, /*!< IP address is not known */ |
38 | | - NSAPI_ERROR_NO_MEMORY = -3007, /*!< memory resource not available */ |
39 | | - NSAPI_ERROR_DNS_FAILURE = -3008, /*!< DNS failed to complete successfully */ |
40 | | - NSAPI_ERROR_DHCP_FAILURE = -3009, /*!< DHCP failed to complete successfully */ |
41 | | - NSAPI_ERROR_AUTH_FAILURE = -3010, /*!< connection to access point faield */ |
42 | | - NSAPI_ERROR_DEVICE_ERROR = -3011, /*!< failure interfacing with the network procesor */ |
43 | | -}; |
44 | | - |
45 | | -/** Enum of socket protocols |
46 | | - * |
47 | | - * The socket protocol specifies a particular protocol to |
48 | | - * be used with a newly created socket. |
49 | | - * |
50 | | - * @enum nsapi_protocol_t |
51 | | - */ |
52 | | -enum nsapi_protocol_t { |
53 | | - NSAPI_TCP, /*!< Socket is of TCP type */ |
54 | | - NSAPI_UDP, /*!< Socket is of UDP type */ |
55 | | -}; |
56 | | - |
57 | | -/* Enum of standardized stack option levels |
58 | | - * |
59 | | - * @enum nsapi_level_t |
60 | | - */ |
61 | | -enum nsapi_level_t { |
62 | | - NSAPI_STACK, /*!< Stack option level */ |
63 | | - NSAPI_SOCKET, /*!< Socket option level */ |
64 | | -}; |
65 | | - |
66 | | -/* Enum of standardized stack options |
67 | | - * |
68 | | - * These options may not be supported on all stacks, in which |
69 | | - * case NSAPI_ERROR_UNSUPPORTED may be returned from setsockopt. |
70 | | - * |
71 | | - * @enum nsapi_option_t |
72 | | - */ |
73 | | -enum nsapi_option_t { |
74 | | - NSAPI_REUSEADDR, /*!< Allow bind to reuse local addresses */ |
75 | | - NSAPI_KEEPALIVE, /*!< Enables sending of keepalive messages */ |
76 | | - NSAPI_KEEPIDLE, /*!< Sets timeout value to initiate keepalive */ |
77 | | - NSAPI_KEEPINTVL, /*!< Sets timeout value for keepalive */ |
78 | | - NSAPI_LINGER, /*!< Keeps close from returning until queues empty */ |
79 | | - NSAPI_SNDBUF, /*!< Sets send buffer size */ |
80 | | - NSAPI_RCVBUF, /*!< Sets recv buffer size */ |
81 | | -}; |
| 20 | +#include "nsapi_types.h" |
| 21 | +#include "NetworkSocketAPI/SocketAddress.h" |
82 | 22 |
|
83 | 23 |
|
84 | 24 | /** NetworkStack class |
@@ -337,4 +277,5 @@ class NetworkStack |
337 | 277 | virtual int getsockopt(void *handle, int level, int optname, void *optval, unsigned *optlen); |
338 | 278 | }; |
339 | 279 |
|
| 280 | + |
340 | 281 | #endif |
0 commit comments