Version of http://mbed.org/cookbook/NetServicesTribute with setting set the same for LPC2368

Dependents:   UDPSocketExample 24LCxx_I2CApp WeatherPlatform_pachube HvZServerLib ... more

Committer:
simon
Date:
Tue Nov 23 14:15:36 2010 +0000
Revision:
0:350011bf8be7
Experimental version for testing UDP

Who changed what in which revision?

UserRevisionLine numberNew contents of line
simon 0:350011bf8be7 1 /*
simon 0:350011bf8be7 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
simon 0:350011bf8be7 3 * All rights reserved.
simon 0:350011bf8be7 4 *
simon 0:350011bf8be7 5 * Redistribution and use in source and binary forms, with or without modification,
simon 0:350011bf8be7 6 * are permitted provided that the following conditions are met:
simon 0:350011bf8be7 7 *
simon 0:350011bf8be7 8 * 1. Redistributions of source code must retain the above copyright notice,
simon 0:350011bf8be7 9 * this list of conditions and the following disclaimer.
simon 0:350011bf8be7 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
simon 0:350011bf8be7 11 * this list of conditions and the following disclaimer in the documentation
simon 0:350011bf8be7 12 * and/or other materials provided with the distribution.
simon 0:350011bf8be7 13 * 3. The name of the author may not be used to endorse or promote products
simon 0:350011bf8be7 14 * derived from this software without specific prior written permission.
simon 0:350011bf8be7 15 *
simon 0:350011bf8be7 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
simon 0:350011bf8be7 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
simon 0:350011bf8be7 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
simon 0:350011bf8be7 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
simon 0:350011bf8be7 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
simon 0:350011bf8be7 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
simon 0:350011bf8be7 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
simon 0:350011bf8be7 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
simon 0:350011bf8be7 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
simon 0:350011bf8be7 25 * OF SUCH DAMAGE.
simon 0:350011bf8be7 26 *
simon 0:350011bf8be7 27 * This file is part of the lwIP TCP/IP stack.
simon 0:350011bf8be7 28 *
simon 0:350011bf8be7 29 * Author: Adam Dunkels <adam@sics.se>
simon 0:350011bf8be7 30 *
simon 0:350011bf8be7 31 */
simon 0:350011bf8be7 32 #ifndef __LWIP_DEBUG_H__
simon 0:350011bf8be7 33 #define __LWIP_DEBUG_H__
simon 0:350011bf8be7 34
simon 0:350011bf8be7 35 #include "lwip/arch.h"
simon 0:350011bf8be7 36
simon 0:350011bf8be7 37 /** lower two bits indicate debug level
simon 0:350011bf8be7 38 * - 0 all
simon 0:350011bf8be7 39 * - 1 warning
simon 0:350011bf8be7 40 * - 2 serious
simon 0:350011bf8be7 41 * - 3 severe
simon 0:350011bf8be7 42 */
simon 0:350011bf8be7 43 #define LWIP_DBG_LEVEL_ALL 0x00
simon 0:350011bf8be7 44 #define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL /* compatibility define only */
simon 0:350011bf8be7 45 #define LWIP_DBG_LEVEL_WARNING 0x01 /* bad checksums, dropped packets, ... */
simon 0:350011bf8be7 46 #define LWIP_DBG_LEVEL_SERIOUS 0x02 /* memory allocation failures, ... */
simon 0:350011bf8be7 47 #define LWIP_DBG_LEVEL_SEVERE 0x03
simon 0:350011bf8be7 48 #define LWIP_DBG_MASK_LEVEL 0x03
simon 0:350011bf8be7 49
simon 0:350011bf8be7 50 /** flag for LWIP_DEBUGF to enable that debug message */
simon 0:350011bf8be7 51 #define LWIP_DBG_ON 0x80U
simon 0:350011bf8be7 52 /** flag for LWIP_DEBUGF to disable that debug message */
simon 0:350011bf8be7 53 #define LWIP_DBG_OFF 0x00U
simon 0:350011bf8be7 54
simon 0:350011bf8be7 55 /** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */
simon 0:350011bf8be7 56 #define LWIP_DBG_TRACE 0x40U
simon 0:350011bf8be7 57 /** flag for LWIP_DEBUGF indicating a state debug message (to follow module states) */
simon 0:350011bf8be7 58 #define LWIP_DBG_STATE 0x20U
simon 0:350011bf8be7 59 /** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */
simon 0:350011bf8be7 60 #define LWIP_DBG_FRESH 0x10U
simon 0:350011bf8be7 61 /** flag for LWIP_DEBUGF to halt after printing this debug message */
simon 0:350011bf8be7 62 #define LWIP_DBG_HALT 0x08U
simon 0:350011bf8be7 63
simon 0:350011bf8be7 64 #ifndef LWIP_NOASSERT
simon 0:350011bf8be7 65 #define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \
simon 0:350011bf8be7 66 LWIP_PLATFORM_ASSERT(message); } while(0)
simon 0:350011bf8be7 67 #else /* LWIP_NOASSERT */
simon 0:350011bf8be7 68 #define LWIP_ASSERT(message, assertion)
simon 0:350011bf8be7 69 #endif /* LWIP_NOASSERT */
simon 0:350011bf8be7 70
simon 0:350011bf8be7 71 /** if "expression" isn't true, then print "message" and execute "handler" expression */
simon 0:350011bf8be7 72 #ifndef LWIP_ERROR
simon 0:350011bf8be7 73 #define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \
simon 0:350011bf8be7 74 LWIP_PLATFORM_ASSERT(message); handler;}} while(0)
simon 0:350011bf8be7 75 #endif /* LWIP_ERROR */
simon 0:350011bf8be7 76
simon 0:350011bf8be7 77 #ifdef LWIP_DEBUG
simon 0:350011bf8be7 78 /** print debug message only if debug message type is enabled...
simon 0:350011bf8be7 79 * AND is of correct type AND is at least LWIP_DBG_LEVEL
simon 0:350011bf8be7 80 */
simon 0:350011bf8be7 81 #define LWIP_DEBUGF(debug, message) do { \
simon 0:350011bf8be7 82 if ( \
simon 0:350011bf8be7 83 ((debug) & LWIP_DBG_ON) && \
simon 0:350011bf8be7 84 ((debug) & LWIP_DBG_TYPES_ON) && \
simon 0:350011bf8be7 85 ((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \
simon 0:350011bf8be7 86 LWIP_PLATFORM_DIAG(message); \
simon 0:350011bf8be7 87 if ((debug) & LWIP_DBG_HALT) { \
simon 0:350011bf8be7 88 while(1); \
simon 0:350011bf8be7 89 } \
simon 0:350011bf8be7 90 } \
simon 0:350011bf8be7 91 } while(0)
simon 0:350011bf8be7 92
simon 0:350011bf8be7 93 #else /* LWIP_DEBUG */
simon 0:350011bf8be7 94 #define LWIP_DEBUGF(debug, message)
simon 0:350011bf8be7 95 #endif /* LWIP_DEBUG */
simon 0:350011bf8be7 96
simon 0:350011bf8be7 97 #endif /* __LWIP_DEBUG_H__ */
simon 0:350011bf8be7 98