xref: /btstack/port/samv71-xplained-atwilc3000/ASF/sam/utils/status_codes.h (revision 1b2596b5303dd8caeea8565532c93cca8dab8cc4)
1*1b2596b5SMatthias Ringwald /**
2*1b2596b5SMatthias Ringwald  * \file
3*1b2596b5SMatthias Ringwald  *
4*1b2596b5SMatthias Ringwald  * \brief Status code definitions.
5*1b2596b5SMatthias Ringwald  *
6*1b2596b5SMatthias Ringwald  * This file defines various status codes returned by functions,
7*1b2596b5SMatthias Ringwald  * indicating success or failure as well as what kind of failure.
8*1b2596b5SMatthias Ringwald  *
9*1b2596b5SMatthias Ringwald  * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved.
10*1b2596b5SMatthias Ringwald  *
11*1b2596b5SMatthias Ringwald  * \asf_license_start
12*1b2596b5SMatthias Ringwald  *
13*1b2596b5SMatthias Ringwald  * \page License
14*1b2596b5SMatthias Ringwald  *
15*1b2596b5SMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
16*1b2596b5SMatthias Ringwald  * modification, are permitted provided that the following conditions are met:
17*1b2596b5SMatthias Ringwald  *
18*1b2596b5SMatthias Ringwald  * 1. Redistributions of source code must retain the above copyright notice,
19*1b2596b5SMatthias Ringwald  *    this list of conditions and the following disclaimer.
20*1b2596b5SMatthias Ringwald  *
21*1b2596b5SMatthias Ringwald  * 2. Redistributions in binary form must reproduce the above copyright notice,
22*1b2596b5SMatthias Ringwald  *    this list of conditions and the following disclaimer in the documentation
23*1b2596b5SMatthias Ringwald  *    and/or other materials provided with the distribution.
24*1b2596b5SMatthias Ringwald  *
25*1b2596b5SMatthias Ringwald  * 3. The name of Atmel may not be used to endorse or promote products derived
26*1b2596b5SMatthias Ringwald  *    from this software without specific prior written permission.
27*1b2596b5SMatthias Ringwald  *
28*1b2596b5SMatthias Ringwald  * 4. This software may only be redistributed and used in connection with an
29*1b2596b5SMatthias Ringwald  *    Atmel microcontroller product.
30*1b2596b5SMatthias Ringwald  *
31*1b2596b5SMatthias Ringwald  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
32*1b2596b5SMatthias Ringwald  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
33*1b2596b5SMatthias Ringwald  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
34*1b2596b5SMatthias Ringwald  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
35*1b2596b5SMatthias Ringwald  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36*1b2596b5SMatthias Ringwald  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37*1b2596b5SMatthias Ringwald  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38*1b2596b5SMatthias Ringwald  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39*1b2596b5SMatthias Ringwald  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
40*1b2596b5SMatthias Ringwald  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41*1b2596b5SMatthias Ringwald  * POSSIBILITY OF SUCH DAMAGE.
42*1b2596b5SMatthias Ringwald  *
43*1b2596b5SMatthias Ringwald  * \asf_license_stop
44*1b2596b5SMatthias Ringwald  *
45*1b2596b5SMatthias Ringwald  */
46*1b2596b5SMatthias Ringwald /*
47*1b2596b5SMatthias Ringwald  * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
48*1b2596b5SMatthias Ringwald  */
49*1b2596b5SMatthias Ringwald 
50*1b2596b5SMatthias Ringwald #ifndef STATUS_CODES_H_INCLUDED
51*1b2596b5SMatthias Ringwald #define STATUS_CODES_H_INCLUDED
52*1b2596b5SMatthias Ringwald 
53*1b2596b5SMatthias Ringwald /* Note: this is a local workaround to avoid a pre-processor clash due to the
54*1b2596b5SMatthias Ringwald  * lwIP macro ERR_TIMEOUT. */
55*1b2596b5SMatthias Ringwald #if defined(__LWIP_ERR_H__) && defined(ERR_TIMEOUT)
56*1b2596b5SMatthias Ringwald #if (ERR_TIMEOUT != -3)
57*1b2596b5SMatthias Ringwald 
58*1b2596b5SMatthias Ringwald /* Internal check to make sure that the later restore of lwIP's ERR_TIMEOUT
59*1b2596b5SMatthias Ringwald  * macro is set to the correct value. Note that it is highly improbable that
60*1b2596b5SMatthias Ringwald  * this value ever changes in lwIP. */
61*1b2596b5SMatthias Ringwald #error ASF developers: check lwip err.h new value for ERR_TIMEOUT
62*1b2596b5SMatthias Ringwald #endif
63*1b2596b5SMatthias Ringwald #undef ERR_TIMEOUT
64*1b2596b5SMatthias Ringwald #endif
65*1b2596b5SMatthias Ringwald 
66*1b2596b5SMatthias Ringwald /**
67*1b2596b5SMatthias Ringwald  * Status code that may be returned by shell commands and protocol
68*1b2596b5SMatthias Ringwald  * implementations.
69*1b2596b5SMatthias Ringwald  *
70*1b2596b5SMatthias Ringwald  * \note Any change to these status codes and the corresponding
71*1b2596b5SMatthias Ringwald  * message strings is strictly forbidden. New codes can be added,
72*1b2596b5SMatthias Ringwald  * however, but make sure that any message string tables are updated
73*1b2596b5SMatthias Ringwald  * at the same time.
74*1b2596b5SMatthias Ringwald  */
75*1b2596b5SMatthias Ringwald enum status_code {
76*1b2596b5SMatthias Ringwald 	STATUS_OK               =  0, //!< Success
77*1b2596b5SMatthias Ringwald 	STATUS_ERR_BUSY         =  0x19,
78*1b2596b5SMatthias Ringwald 	STATUS_ERR_DENIED       =  0x1C,
79*1b2596b5SMatthias Ringwald 	STATUS_ERR_TIMEOUT      =  0x12,
80*1b2596b5SMatthias Ringwald 	ERR_IO_ERROR            =  -1, //!< I/O error
81*1b2596b5SMatthias Ringwald 	ERR_FLUSHED             =  -2, //!< Request flushed from queue
82*1b2596b5SMatthias Ringwald 	ERR_TIMEOUT             =  -3, //!< Operation timed out
83*1b2596b5SMatthias Ringwald 	ERR_BAD_DATA            =  -4, //!< Data integrity check failed
84*1b2596b5SMatthias Ringwald 	ERR_PROTOCOL            =  -5, //!< Protocol error
85*1b2596b5SMatthias Ringwald 	ERR_UNSUPPORTED_DEV     =  -6, //!< Unsupported device
86*1b2596b5SMatthias Ringwald 	ERR_NO_MEMORY           =  -7, //!< Insufficient memory
87*1b2596b5SMatthias Ringwald 	ERR_INVALID_ARG         =  -8, //!< Invalid argument
88*1b2596b5SMatthias Ringwald 	ERR_BAD_ADDRESS         =  -9, //!< Bad address
89*1b2596b5SMatthias Ringwald 	ERR_BUSY                =  -10, //!< Resource is busy
90*1b2596b5SMatthias Ringwald 	ERR_BAD_FORMAT          =  -11, //!< Data format not recognized
91*1b2596b5SMatthias Ringwald 	ERR_NO_TIMER            =  -12, //!< No timer available
92*1b2596b5SMatthias Ringwald 	ERR_TIMER_ALREADY_RUNNING   =  -13, //!< Timer already running
93*1b2596b5SMatthias Ringwald 	ERR_TIMER_NOT_RUNNING   =  -14, //!< Timer not running
94*1b2596b5SMatthias Ringwald 	ERR_ABORTED             =  -15, //!< Operation aborted by user
95*1b2596b5SMatthias Ringwald 	/**
96*1b2596b5SMatthias Ringwald 	 * \brief Operation in progress
97*1b2596b5SMatthias Ringwald 	 *
98*1b2596b5SMatthias Ringwald 	 * This status code is for driver-internal use when an operation
99*1b2596b5SMatthias Ringwald 	 * is currently being performed.
100*1b2596b5SMatthias Ringwald 	 *
101*1b2596b5SMatthias Ringwald 	 * \note Drivers should never return this status code to any
102*1b2596b5SMatthias Ringwald 	 * callers. It is strictly for internal use.
103*1b2596b5SMatthias Ringwald 	 */
104*1b2596b5SMatthias Ringwald 	OPERATION_IN_PROGRESS	= -128,
105*1b2596b5SMatthias Ringwald };
106*1b2596b5SMatthias Ringwald 
107*1b2596b5SMatthias Ringwald typedef enum status_code status_code_t;
108*1b2596b5SMatthias Ringwald 
109*1b2596b5SMatthias Ringwald #if defined(__LWIP_ERR_H__)
110*1b2596b5SMatthias Ringwald #define ERR_TIMEOUT -3
111*1b2596b5SMatthias Ringwald #endif
112*1b2596b5SMatthias Ringwald 
113*1b2596b5SMatthias Ringwald #endif /* STATUS_CODES_H_INCLUDED */
114