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