An Open Sound Control library for the mbed, created to be compatible with Recotana's OSCClass library (http://recotana.com) for the Arduino with Ethernet shield. It also uses parts of the OSC Transceiver(Sender/Receiver) code by xshige written by: Alvaro Cassinelli, October 2011 tweaked by: Toby Harris / *spark audio-visual, March 2012
Dependencies: NetServices mbed
Diff: mbedOSC.h
- Revision:
- 9:b37b68fdd9a4
- Parent:
- 8:06a5e78d6821
- Child:
- 10:b4cc0df203b7
--- a/mbedOSC.h Sun Apr 15 13:13:39 2012 +0000 +++ b/mbedOSC.h Sun Apr 15 13:21:01 2012 +0000 @@ -9,26 +9,7 @@ License version 2.1 as published by the Free Software Foundation. Open Sound Control http://opensoundcontrol.org/ - mbedOSC version 0.1 Specification (similar to Recotana's OSCClass library) - - ******** - Address : max 2 - "/ard" - "/ard/output" --address[0]="/ard" :max 15character - --address[1]="/output" :max 15character - - ******* - TypeTag : max 2 - "i" - long or unsigned long - "f" - double - - ******* - arg : max 2 - - ******* - Example of an OSC message: "/mbed/test1, if 50 32.4" (Note: this is not the byte string - sent as UDP packet - there are no spaces, and arguments are in binary, BIG ENDIAN) */ #ifndef mbedOSC_h @@ -54,7 +35,28 @@ #define TYPE_FLOAT 2 -/** Container class for OSC messages (receiving or sending) */ +/** Container class for OSC messages (receiving or sending) + mbedOSC version 0.1 Specification (similar to Recotana's OSCClass library) + + ******** + Address : max 2 + "/ard" + "/ard/output" --address[0]="/ard" :max 15character + --address[1]="/output" :max 15character + + ******* + TypeTag : max 2 + + "i" - long or unsigned long + "f" - double + + ******* + arg : max 2 + + ******* + Example of an OSC message: "/mbed/test1, if 50 32.4" + (Note: this is not the byte string sent as UDP packet - there are no spaces, and arguments are in binary, BIG ENDIAN) +*/ class OSCMessage{ private: @@ -284,7 +286,9 @@ */ void stop(); - //new OSC data in the receiver message container: +/** + Returns whether there is new OSC data in the receiver message container + */ bool newMessage; /** @@ -299,9 +303,6 @@ (Alternatively, one could have a function pointer to pass to the OSC object, that will be called each time a new packet is received: TO DO) */ OSCMessage *getMessage(); //return received OSCmessage - - //buffer clear - //void flush(); /** Send an OSC Message (message contain the host ip and port where the message data has to be sent) @@ -309,7 +310,12 @@ */ void sendOsc( OSCMessage *_mes ); //set&send OSCmessage (note: it will be sent to the host defined in the message container) - //to be set by host program, will be called on receipt of an OSC message +/** + A function pointer to be set by host program that will be called on receipt of an OSC message + @code + osc.messageReceivedCallback.attach(&processOSC); + @endcode + */ FunctionPointer messageReceivedCallback; };