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

Dependencies:   mbed

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?

UserRevisionLine numberNew 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 * Simon Goldschmidt
mbedalvaro 0:f76708a93fb3 31 *
mbedalvaro 0:f76708a93fb3 32 */
mbedalvaro 0:f76708a93fb3 33 #ifndef __LWIP_TIMERS_H__
mbedalvaro 0:f76708a93fb3 34 #define __LWIP_TIMERS_H__
mbedalvaro 0:f76708a93fb3 35
mbedalvaro 0:f76708a93fb3 36 #include "lwip/opt.h"
mbedalvaro 0:f76708a93fb3 37
mbedalvaro 0:f76708a93fb3 38 /* Timers are not supported when NO_SYS==1 and NO_SYS_NO_TIMERS==1 */
mbedalvaro 0:f76708a93fb3 39 #define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS))
mbedalvaro 0:f76708a93fb3 40
mbedalvaro 0:f76708a93fb3 41 #if LWIP_TIMERS
mbedalvaro 0:f76708a93fb3 42
mbedalvaro 0:f76708a93fb3 43 #include "lwip/err.h"
mbedalvaro 0:f76708a93fb3 44 #include "lwip/sys.h"
mbedalvaro 0:f76708a93fb3 45
mbedalvaro 0:f76708a93fb3 46 #ifdef __cplusplus
mbedalvaro 0:f76708a93fb3 47 extern "C" {
mbedalvaro 0:f76708a93fb3 48 #endif
mbedalvaro 0:f76708a93fb3 49
mbedalvaro 0:f76708a93fb3 50 #ifndef LWIP_DEBUG_TIMERNAMES
mbedalvaro 0:f76708a93fb3 51 #ifdef LWIP_DEBUG
mbedalvaro 0:f76708a93fb3 52 #define LWIP_DEBUG_TIMERNAMES SYS_DEBUG
mbedalvaro 0:f76708a93fb3 53 #else /* LWIP_DEBUG */
mbedalvaro 0:f76708a93fb3 54 #define LWIP_DEBUG_TIMERNAMES 0
mbedalvaro 0:f76708a93fb3 55 #endif /* LWIP_DEBUG*/
mbedalvaro 0:f76708a93fb3 56 #endif
mbedalvaro 0:f76708a93fb3 57
mbedalvaro 0:f76708a93fb3 58 /** Function prototype for a timeout callback function. Register such a function
mbedalvaro 0:f76708a93fb3 59 * using sys_timeout().
mbedalvaro 0:f76708a93fb3 60 *
mbedalvaro 0:f76708a93fb3 61 * @param arg Additional argument to pass to the function - set up by sys_timeout()
mbedalvaro 0:f76708a93fb3 62 */
mbedalvaro 0:f76708a93fb3 63 typedef void (* sys_timeout_handler)(void *arg);
mbedalvaro 0:f76708a93fb3 64
mbedalvaro 0:f76708a93fb3 65 struct sys_timeo {
mbedalvaro 0:f76708a93fb3 66 struct sys_timeo *next;
mbedalvaro 0:f76708a93fb3 67 u32_t time;
mbedalvaro 0:f76708a93fb3 68 sys_timeout_handler h;
mbedalvaro 0:f76708a93fb3 69 void *arg;
mbedalvaro 0:f76708a93fb3 70 #if LWIP_DEBUG_TIMERNAMES
mbedalvaro 0:f76708a93fb3 71 const char* handler_name;
mbedalvaro 0:f76708a93fb3 72 #endif /* LWIP_DEBUG_TIMERNAMES */
mbedalvaro 0:f76708a93fb3 73 };
mbedalvaro 0:f76708a93fb3 74
mbedalvaro 0:f76708a93fb3 75 void sys_timeouts_init(void);
mbedalvaro 0:f76708a93fb3 76
mbedalvaro 0:f76708a93fb3 77 #if LWIP_DEBUG_TIMERNAMES
mbedalvaro 0:f76708a93fb3 78 void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name);
mbedalvaro 0:f76708a93fb3 79 #define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler)
mbedalvaro 0:f76708a93fb3 80 #else /* LWIP_DEBUG_TIMERNAMES */
mbedalvaro 0:f76708a93fb3 81 void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg);
mbedalvaro 0:f76708a93fb3 82 #endif /* LWIP_DEBUG_TIMERNAMES */
mbedalvaro 0:f76708a93fb3 83
mbedalvaro 0:f76708a93fb3 84 void sys_untimeout(sys_timeout_handler handler, void *arg);
mbedalvaro 0:f76708a93fb3 85 #if NO_SYS
mbedalvaro 0:f76708a93fb3 86 void sys_check_timeouts(void);
mbedalvaro 0:f76708a93fb3 87 void sys_restart_timeouts(void);
mbedalvaro 0:f76708a93fb3 88 #else /* NO_SYS */
mbedalvaro 0:f76708a93fb3 89 void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg);
mbedalvaro 0:f76708a93fb3 90 #endif /* NO_SYS */
mbedalvaro 0:f76708a93fb3 91
mbedalvaro 0:f76708a93fb3 92
mbedalvaro 0:f76708a93fb3 93 #ifdef __cplusplus
mbedalvaro 0:f76708a93fb3 94 }
mbedalvaro 0:f76708a93fb3 95 #endif
mbedalvaro 0:f76708a93fb3 96
mbedalvaro 0:f76708a93fb3 97 #endif /* LWIP_TIMERS */
mbedalvaro 0:f76708a93fb3 98 #endif /* __LWIP_TIMERS_H__ */