CC3000  1.14
 All Classes Functions Groups
error_codes.h
1 /*****************************************************************************
2 *
3 * error_codes.h - CC3000 Host Driver Implementation.
4 * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 *****************************************************************************/
35 #ifndef __ERROR_CODES__
36 #define __ERROR_CODES__
37 
38 //*****************************************************************************
39 //
40 // If building with a C++ compiler, make all of the definitions in this header
41 // have a C binding.
42 //
43 //*****************************************************************************
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 //
49 // Error numbers
50 //
51 #define ERROR_WIFI_ALREADY_DISCONNECTED -129
52 #define NOT_ENOUGH_SOCKETS -128
53 #define SOCKET_ALREADY_EXISTS -127
54 #define NOT_SUPPORTED -126
55 #define TCP_OPEN_FAILED -124
56 #define BAD_SOCKET_DATA -123
57 #define SOCKET_NOT_FOUND -122
58 #define SOCKET_TIMED_OUT -121
59 #define BAD_IP_HEADER -120
60 #define NEED_TO_LISTEN -119
61 #define RECV_TIMED_OUT -118
62 #define NEED_TO_SEND -114
63 #define UNABLE_TO_SEND -113
64 #define DHCP_ERROR -100
65 #define DHCP_LEASE_EXPIRED -99
66 #define ARP_REQUEST_FAILED -95
67 #define DHCP_LEASE_RENEWING -92
68 #define IGMP_ERROR -91
69 #define INVALID_VALUE -85
70 #define DNS_ID_ERROR -75
71 #define DNS_OPCODE_ERROR -74
72 #define DNS_RCODE_ERROR -73
73 #define DNS_COUNT_ERROR -72
74 #define DNS_TYPE_ERROR -71
75 #define DNS_CLASS_ERROR -70
76 #define DNS_NOT_FOUND -69
77 #define SOCKET_BUFFER_TOO_SMALL -68
78 #define REASSEMBLY_ERROR -64
79 #define REASSEMBLY_TIMED_OUT -63
80 #define BAD_REASSEMBLY_DATA -62
81 #define UNABLE_TO_TCP_SEND -60
82 #define ERROR_WIFI_NOT_CONNECTED -59
83 #define SEND_FAILED_ARP_IN_PROCESS -58
84 #define RECV_FAILED_SOCKET_INACTIVE -57
85 
86 //
87 // Return the same error code to all socket
88 // calls which fail due to socket's inactivity
89 //
90 #define ERROR_SOCKET_INACTIVE RECV_FAILED_SOCKET_INACTIVE
91 
92 //
93 // TCP function error codes
94 //
95 #define TCP_ERROR -1
96 #define TCP_TOO_LONG -2
97 #define TCP_BAD_HEADER -3
98 #define TCP_BAD_CSUM -4
99 #define TCP_BAD_FCS -5
100 #define TCP_NO_CONNECT -6
101 
102 //
103 // UDP function error codes
104 //
105 #define UDP_ERROR -1
106 #define UDP_TOO_LONG -2
107 #define UDP_BAD_CSUM -4
108 #define UDP_BAD_FCS -5
109 
110 //
111 // Raw error codes
112 //
113 #define RAW_ERROR -1
114 #define RAW_TOO_LONG -2
115 
116 //
117 // SimpleLink error codes
118 //
119 #define SL_INVALID_INTERFACE -1
120 #define SL_NO_MORE_DATA_TO_READ -2
121 #define SL_OUT_OF_RESOURCES (-150)
122 #define SL_NOT_ENOUGH_SPACE (-151)
123 #define SL_INCORRECT_IF (-152)
124 #define SL_NOTHING_TO_SEND (-153)
125 #define SL_WILL_SEND_LATER (100) // This is not an error - just an indication that we can't send data now
126 #define SL_TX_ALLOC_FAILED (-161)
127 
128 #define SL_INVALID_COMMAND_ARGUMENTS (-170)
129 
130 #ifdef __cplusplus
131 }
132 #endif /* __cplusplus */
133 
134 #endif /* __ERROR_CODES__ */