Ram Gandikota / Mbed OS ABCD
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pal_errors.h Source File

pal_errors.h

00001 /*
00002 * Copyright (c) 2016 ARM Limited. All rights reserved.
00003 * SPDX-License-Identifier: Apache-2.0
00004 * Licensed under the Apache License, Version 2.0 (the License); you may
00005 * not use this file except in compliance with the License.
00006 * You may obtain a copy of the License at
00007 *
00008 * http://www.apache.org/licenses/LICENSE-2.0
00009 *
00010 * Unless required by applicable law or agreed to in writing, software
00011 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
00012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013 * See the License for the specific language governing permissions and
00014 * limitations under the License.
00015 */
00016 
00017 
00018 #ifndef _PAL_ERRORS_H
00019 #define _PAL_ERRORS_H
00020 
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024 
00025 #include "pal_types.h"
00026 
00027 
00028 typedef enum {
00029     PAL_ERR_MODULE_GENERAL      = 0x4,
00030     PAL_ERR_MODULE_PAL          = 0x6,
00031     PAL_ERR_MODULE_C            = 0x8,
00032     PAL_ERR_MODULE_RTOS         = 0xC,
00033     PAL_ERR_MODULE_NET          = 0x10,
00034     PAL_ERR_MODULE_TLS          = 0x14,
00035     PAL_ERR_MODULE_CRYPTO       = 0x18,
00036     PAL_ERR_MODULE_UPDATE       = 0x1C,
00037 } palErrorModules_t;
00038 
00039 
00040 typedef enum {
00041     // generic errors
00042     PAL_ERR_GENERAL_BASE =          (-1 << PAL_ERR_MODULE_GENERAL),
00043     PAL_ERR_GENERIC_FAILURE =       PAL_ERR_GENERAL_BASE,           /*! generic failure*/ // try to use a more specific error message whenever possible
00044     PAL_ERR_INVALID_ARGUMENT =      PAL_ERR_GENERAL_BASE + 1,   /*! one or more of the functions arguments is invalid */
00045     PAL_ERR_NO_MEMORY =             PAL_ERR_GENERAL_BASE + 2,   /*! failure due to a failed attempt to allocate memory */
00046     PAL_ERR_BUFFER_TOO_SMALL =      PAL_ERR_GENERAL_BASE + 3,   /*! buffer given is too small*/
00047     PAL_ERR_NOT_SUPPORTED =         PAL_ERR_GENERAL_BASE + 4,   /*! operation not supported by PAL for the current configuration*/
00048     PAL_ERR_TIMEOUT_EXPIRED =       PAL_ERR_GENERAL_BASE + 5,   /*! timeout for the operation has expired */
00049     PAL_ERR_NOT_INITIALIZED =       PAL_ERR_GENERAL_BASE + 6,   /*! timeout for the operation has expired */
00050     PAL_ERR_NULL_POINTER     =      PAL_ERR_GENERAL_BASE + 7,   /*! received a null pointer when it should be initialized */
00051     PAL_ERR_CREATION_FAILED =       PAL_ERR_GENERAL_BASE + 8,   /*! failure in creation of given type, like: mutex, thread , etc */
00052     // pal errors
00053     PAL_ERR_NOT_IMPLEMENTED =                               (-1 << PAL_ERR_MODULE_PAL), /*!Currently not implemented will be in the future*/
00054     // c errors
00055     // RTOS errors
00056     PAL_ERR_RTOS_ERROR_BASE =                               (-1 << PAL_ERR_MODULE_RTOS),    /*! generic failure in RTOS module*/ // try to use a more specific error message whenever possible
00057     PAL_ERR_RTOS_PARAMETER =                                PAL_ERR_RTOS_ERROR_BASE + 0x80,/*! PAL mapping of CMSIS error osErrorParameter : parameter error: a mandatory parameter was missing or specified an incorrect object.*/
00058     PAL_ERR_RTOS_RESOURCE =                                 PAL_ERR_RTOS_ERROR_BASE + 0x81,/*! PAL mapping of CMSIS error osErrorResource : resource not available: a specified resource was not available.*/
00059     PAL_ERR_RTOS_TIMEOUT =                                  PAL_ERR_RTOS_ERROR_BASE + 0xC1,/*! PAL mapping of CMSIS error osErrorTimeoutResource : resource not available within given time: a specified resource was not available within the timeout period*/
00060     PAL_ERR_RTOS_ISR =                                      PAL_ERR_RTOS_ERROR_BASE + 0x82,/*! PAL mapping of CMSIS error osErrorISR : not allowed in ISR context: the function cannot be called from interrupt service routines.*/
00061     PAL_ERR_RTOS_ISR_RECURSIVE =                            PAL_ERR_RTOS_ERROR_BASE + 0x83,/*! PAL mapping of CMSIS error osErrorISRRecursive : function called multiple times from ISR with same object.c*/
00062     PAL_ERR_RTOS_PRIORITY =                                 PAL_ERR_RTOS_ERROR_BASE + 0x84,/*! PAL mapping of CMSIS error osErrorPriority : system cannot determine priority or thread has illegal priority.*/
00063     PAL_ERR_RTOS_NO_MEMORY =                                PAL_ERR_RTOS_ERROR_BASE + 0x85,/*! PAL mapping of CMSIS error osErrorNoMemory : system is out of memory: it was impossible to allocate or reserve memory for the operation.*/
00064     PAL_ERR_RTOS_VALUE =                                    PAL_ERR_RTOS_ERROR_BASE + 0x86,/*! PAL mapping of CMSIS error osErrorValue :  value of a parameter is out of range.*/
00065     PAL_ERR_RTOS_OS =                                       PAL_ERR_RTOS_ERROR_BASE + 0xFF,/*! PAL mapping of CMSIS error osErrorOS : unspecified RTOS error: run-time error but no other error message fits.*/
00066     // network errors
00067     PAL_ERR_SOCKET_ERROR_BASE =                             (-1 << PAL_ERR_MODULE_NET),             /*! generic socket error */
00068     PAL_ERR_SOCKET_GENERIC =                                PAL_ERR_SOCKET_ERROR_BASE,              /*! generic socket error */
00069     PAL_ERR_SOCKET_NO_BUFFERS =                             PAL_ERR_SOCKET_ERROR_BASE + 1,          /*! no buffers -  PAL mapping of posix error ENOBUFS*/ 
00070     PAL_ERR_SOCKET_HOST_UNREACHABLE =                       PAL_ERR_SOCKET_ERROR_BASE + 2,          /*! host unreachable (routing error)-  PAL mapping of posix error EHOSTUNREACH*/
00071     PAL_ERR_SOCKET_IN_PROGRES =                             PAL_ERR_SOCKET_ERROR_BASE + 3,          /*! in progress-   PAL mapping of posix error EINPROGRESS*/
00072     PAL_ERR_SOCKET_INVALID_VALUE =                          PAL_ERR_SOCKET_ERROR_BASE + 4,          /*!invalid value -  PAL mapping of posix error EINVAL*/
00073     PAL_ERR_SOCKET_WOULD_BLOCK =                            PAL_ERR_SOCKET_ERROR_BASE + 5,          /*! would block -   PAL mapping of posix error EWOULDBLOCK*/
00074     PAL_ERR_SOCKET_ADDRESS_IN_USE =                         PAL_ERR_SOCKET_ERROR_BASE + 6,          /*! Address in use - PAL mapping of posix error EADDRINUSE*/
00075     PAL_ERR_SOCKET_ALREADY_CONNECTED =                      PAL_ERR_SOCKET_ERROR_BASE + 7,          /*! Already connected - PAL mapping of posix error EALREADY*/
00076     PAL_ERR_SOCKET_CONNECTION_ABORTED =                     PAL_ERR_SOCKET_ERROR_BASE + 8,          /*! Connection aborted - PAL mapping of posix error ECONNABORTED*/
00077     PAL_ERR_SOCKET_CONNECTION_RESET =                       PAL_ERR_SOCKET_ERROR_BASE + 9,          /*! Connection reset - PAL mapping of posix error ECONNRESET*/
00078     PAL_ERR_SOCKET_NOT_CONNECTED =                          PAL_ERR_SOCKET_ERROR_BASE + 10,         /*! Not connected -  PAL mapping of posix error ENOTCONN*/
00079     PAL_ERR_SOCKET_INPUT_OUTPUT_ERROR =                     PAL_ERR_SOCKET_ERROR_BASE + 11,         /*! I/O error  PAL mapping of posix error EIO*/
00080     PAL_ERR_SOCKET_CONNECTION_CLOSED =                      PAL_ERR_SOCKET_ERROR_BASE + 12,         /*! connection closed */
00081     PAL_ERR_SOCKET_FAILED_TO_SET_SOCKET_TO_NON_BLOCKING =   PAL_ERR_SOCKET_ERROR_BASE + 13,         /*! failed to set socket to non-blocking */
00082     PAL_ERR_SOCKET_INVALID_ADDRESS_FAMILY =                 PAL_ERR_SOCKET_ERROR_BASE + 14,         /*! failed to set socket to non-blocking */
00083     PAL_ERR_SOCKET_INVALID_ADDRESS =                        PAL_ERR_SOCKET_ERROR_BASE + 15,         /*! address given was not valid/found*/
00084     PAL_ERR_SOCKET_DNS_ERROR =                              PAL_ERR_SOCKET_ERROR_BASE + 16,         /*! DNS lookup error*/
00085     PAL_ERR_SOCKET_HDCP_ERROR =                             PAL_ERR_SOCKET_ERROR_BASE + 17,         /*! HDCP error*/
00086     PAL_ERR_SOCKET_AUTH_ERROR =                             PAL_ERR_SOCKET_ERROR_BASE + 18,         /*! authentication error*/
00087     PAL_ERR_SOCKET_OPTION_NOT_SUPPORTED =                   PAL_ERR_SOCKET_ERROR_BASE + 19,         /*! socket option not supported*/
00088     //update Error
00089     PAL_ERR_UPDATE_ERROR_BASE           =                   (-1 << PAL_ERR_MODULE_UPDATE),          /*! generic error */
00090     PAL_ERR_UPDATE_ERROR                =                   PAL_ERR_UPDATE_ERROR_BASE,              /*! unknown error */
00091     PAL_ERR_UPDATE_BUSY                 =                   PAL_ERR_UPDATE_ERROR_BASE + 1,          /*! unknown error */
00092     PAL_ERR_UPDATE_TIMEOUT              =                   PAL_ERR_UPDATE_ERROR_BASE + 2,          /*! unknown error */
00093     PAL_ERR_UPDATE_OUT_OF_BOUNDS        =                   PAL_ERR_UPDATE_ERROR_BASE + 3,          /*! unknown error */
00094     PAL_ERR_UPDATE_PALFROM_API          =                   PAL_ERR_UPDATE_ERROR_BASE + 4,          /*! unknown error */
00095     PAL_ERR_UPDATE_PALFROM_IO           =                   PAL_ERR_UPDATE_ERROR_BASE + 5,          /*! unknown error */
00096     PAL_ERR_UPDATE_END_OF_IMAGE         =                   PAL_ERR_UPDATE_ERROR_BASE + 6,          /*! unknown error */
00097     PAL_ERR_UPDATE_CHUNK_TO_SMALL       =                   PAL_ERR_UPDATE_ERROR_BASE + 7,          /*! unknown error */
00098 
00099 } palError_t; /*! errors returned by the pal service API */
00100 
00101 
00102 #ifdef __cplusplus
00103 }
00104 #endif
00105 #endif //_PAL_ERRORS