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