创建mbed

Dependencies:   EthernetInterface SDFileSystem mbed-rtos mbed

Committer:
sunyiming
Date:
Tue Mar 06 08:53:46 2018 +0000
Revision:
1:6465a3f5c58a
??OK

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sunyiming 1:6465a3f5c58a 1 /**
sunyiming 1:6465a3f5c58a 2 * @file
sunyiming 1:6465a3f5c58a 3 * Error Management module
sunyiming 1:6465a3f5c58a 4 *
sunyiming 1:6465a3f5c58a 5 */
sunyiming 1:6465a3f5c58a 6
sunyiming 1:6465a3f5c58a 7 /*
sunyiming 1:6465a3f5c58a 8 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
sunyiming 1:6465a3f5c58a 9 * All rights reserved.
sunyiming 1:6465a3f5c58a 10 *
sunyiming 1:6465a3f5c58a 11 * Redistribution and use in source and binary forms, with or without modification,
sunyiming 1:6465a3f5c58a 12 * are permitted provided that the following conditions are met:
sunyiming 1:6465a3f5c58a 13 *
sunyiming 1:6465a3f5c58a 14 * 1. Redistributions of source code must retain the above copyright notice,
sunyiming 1:6465a3f5c58a 15 * this list of conditions and the following disclaimer.
sunyiming 1:6465a3f5c58a 16 * 2. Redistributions in binary form must reproduce the above copyright notice,
sunyiming 1:6465a3f5c58a 17 * this list of conditions and the following disclaimer in the documentation
sunyiming 1:6465a3f5c58a 18 * and/or other materials provided with the distribution.
sunyiming 1:6465a3f5c58a 19 * 3. The name of the author may not be used to endorse or promote products
sunyiming 1:6465a3f5c58a 20 * derived from this software without specific prior written permission.
sunyiming 1:6465a3f5c58a 21 *
sunyiming 1:6465a3f5c58a 22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
sunyiming 1:6465a3f5c58a 23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
sunyiming 1:6465a3f5c58a 24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
sunyiming 1:6465a3f5c58a 25 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
sunyiming 1:6465a3f5c58a 26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
sunyiming 1:6465a3f5c58a 27 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
sunyiming 1:6465a3f5c58a 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
sunyiming 1:6465a3f5c58a 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
sunyiming 1:6465a3f5c58a 30 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
sunyiming 1:6465a3f5c58a 31 * OF SUCH DAMAGE.
sunyiming 1:6465a3f5c58a 32 *
sunyiming 1:6465a3f5c58a 33 * This file is part of the lwIP TCP/IP stack.
sunyiming 1:6465a3f5c58a 34 *
sunyiming 1:6465a3f5c58a 35 * Author: Adam Dunkels <adam@sics.se>
sunyiming 1:6465a3f5c58a 36 *
sunyiming 1:6465a3f5c58a 37 */
sunyiming 1:6465a3f5c58a 38
sunyiming 1:6465a3f5c58a 39 #include "lwip/err.h"
sunyiming 1:6465a3f5c58a 40
sunyiming 1:6465a3f5c58a 41 #ifdef LWIP_DEBUG
sunyiming 1:6465a3f5c58a 42
sunyiming 1:6465a3f5c58a 43 static const char *err_strerr[] = {
sunyiming 1:6465a3f5c58a 44 "Ok.", /* ERR_OK 0 */
sunyiming 1:6465a3f5c58a 45 "Out of memory error.", /* ERR_MEM -1 */
sunyiming 1:6465a3f5c58a 46 "Buffer error.", /* ERR_BUF -2 */
sunyiming 1:6465a3f5c58a 47 "Timeout.", /* ERR_TIMEOUT -3 */
sunyiming 1:6465a3f5c58a 48 "Routing problem.", /* ERR_RTE -4 */
sunyiming 1:6465a3f5c58a 49 "Operation in progress.", /* ERR_INPROGRESS -5 */
sunyiming 1:6465a3f5c58a 50 "Illegal value.", /* ERR_VAL -6 */
sunyiming 1:6465a3f5c58a 51 "Operation would block.", /* ERR_WOULDBLOCK -7 */
sunyiming 1:6465a3f5c58a 52 "Address in use.", /* ERR_USE -8 */
sunyiming 1:6465a3f5c58a 53 "Already connected.", /* ERR_ISCONN -9 */
sunyiming 1:6465a3f5c58a 54 "Connection aborted.", /* ERR_ABRT -10 */
sunyiming 1:6465a3f5c58a 55 "Connection reset.", /* ERR_RST -11 */
sunyiming 1:6465a3f5c58a 56 "Connection closed.", /* ERR_CLSD -12 */
sunyiming 1:6465a3f5c58a 57 "Not connected.", /* ERR_CONN -13 */
sunyiming 1:6465a3f5c58a 58 "Illegal argument.", /* ERR_ARG -14 */
sunyiming 1:6465a3f5c58a 59 "Low-level netif error.", /* ERR_IF -15 */
sunyiming 1:6465a3f5c58a 60 };
sunyiming 1:6465a3f5c58a 61
sunyiming 1:6465a3f5c58a 62 /**
sunyiming 1:6465a3f5c58a 63 * Convert an lwip internal error to a string representation.
sunyiming 1:6465a3f5c58a 64 *
sunyiming 1:6465a3f5c58a 65 * @param err an lwip internal err_t
sunyiming 1:6465a3f5c58a 66 * @return a string representation for err
sunyiming 1:6465a3f5c58a 67 */
sunyiming 1:6465a3f5c58a 68 const char *
sunyiming 1:6465a3f5c58a 69 lwip_strerr(err_t err)
sunyiming 1:6465a3f5c58a 70 {
sunyiming 1:6465a3f5c58a 71 return err_strerr[-err];
sunyiming 1:6465a3f5c58a 72
sunyiming 1:6465a3f5c58a 73 }
sunyiming 1:6465a3f5c58a 74
sunyiming 1:6465a3f5c58a 75 #endif /* LWIP_DEBUG */