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