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