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
OSCClass Class Reference
Wraps the UDP functions to send and receive OSC messages. More...
#include <mbedOSC.h>
Public Member Functions | |
OSCClass () | |
Create an object to send and receive OSC messages. | |
OSCClass (OSCMessage *_mes) | |
This sets "binds" the received message to the receiver container of the communication object. | |
void | begin () |
This initializes the OSC communication object with default receiving port (DEFAULT_REC_PORT) | |
void | begin (uint16_t _recievePort) |
Initialize an OSC object with arbitrary listening port. | |
void | stop () |
Stop OSC communication (in fact, only the receiver - the server side) | |
void | setReceiveMessage (OSCMessage *_mes) |
Set a OSC receive message container. | |
OSCMessage * | getMessage () |
Get the received OSC message (note: this is another way to access the message directly from the OSCClass object). | |
void | sendOsc (OSCMessage *_mes) |
Send an OSC Message (message contain the host ip and port where the message data has to be sent) | |
Data Fields | |
bool | newMessage |
Returns whether there is new OSC data in the receiver message container. | |
FunctionPointer | messageReceivedCallback |
A function pointer to be set by host program that will be called on receipt of an OSC message. |
Detailed Description
Wraps the UDP functions to send and receive OSC messages.
Definition at line 232 of file mbedOSC.h.
Constructor & Destructor Documentation
OSCClass | ( | ) |
Create an object to send and receive OSC messages.
Definition at line 158 of file mbedOSC.cpp.
OSCClass | ( | OSCMessage * | _mes ) |
This sets "binds" the received message to the receiver container of the communication object.
- Parameters:
-
[in] _mes A pointer to the "receiveing" OSC message (OSCMessage *)
Definition at line 168 of file mbedOSC.cpp.
Member Function Documentation
void begin | ( | ) |
This initializes the OSC communication object with default receiving port (DEFAULT_REC_PORT)
Definition at line 174 of file mbedOSC.cpp.
void begin | ( | uint16_t | _recievePort ) |
Initialize an OSC object with arbitrary listening port.
- Parameters:
-
[in] _recievePort The listening ("receiving") Port No (unsigned int)
Definition at line 181 of file mbedOSC.cpp.
OSCMessage * getMessage | ( | ) |
Get the received OSC message (note: this is another way to access the message directly from the OSCClass object).
The advantage is that we will signal that we read the message, and will be able to query if a NEW message arrived (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)
Definition at line 328 of file mbedOSC.cpp.
void sendOsc | ( | OSCMessage * | _mes ) |
Send an OSC Message (message contain the host ip and port where the message data has to be sent)
- Parameters:
-
[in] _mes Pointer to the OSC message container (OSCMessage *)
Definition at line 334 of file mbedOSC.cpp.
void setReceiveMessage | ( | OSCMessage * | _mes ) |
Set a OSC receive message container.
- Parameters:
-
[in] _mes Pointer to the OSC receive message container (OSCMessage *)
Definition at line 189 of file mbedOSC.cpp.
void stop | ( | ) |
Stop OSC communication (in fact, only the receiver - the server side)
Definition at line 401 of file mbedOSC.cpp.
Field Documentation
FunctionPointer messageReceivedCallback |
A function pointer to be set by host program that will be called on receipt of an OSC message.
osc.messageReceivedCallback.attach(&processOSC);
bool newMessage |
Generated on Wed Jul 13 2022 04:37:12 by 1.7.2