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

Dependents:   SPK-DVIMXR

Files at this revision

API Documentation at this revision

Comitter:
tobyspark
Date:
Fri Jul 26 22:10:20 2013 +0000
Parent:
0:fdea65150534
Commit message:
Fixed double receive bug! Or rather, a platform quirk. Gah!

Changed in this revision

mbedOSC.cpp Show annotated file Show diff for this revision Revisions of this file
mbedOSC.h Show annotated file Show diff for this revision Revisions of this file
diff -r fdea65150534 -r 63b72e393989 mbedOSC.cpp
--- a/mbedOSC.cpp	Sun Apr 15 15:50:42 2012 +0000
+++ b/mbedOSC.cpp	Fri Jul 26 22:10:20 2013 +0000
@@ -91,9 +91,9 @@
 
 
 double OSCMessage::getArgFloat(uint8_t _index){
-    double *value;
+    float *value;
     if(_index > argNum) _index=argNum;
-    value = (double *)arg[_index];
+    value = (float *)arg[_index]; // cast to float not double for correct parsing on mbed!
     return *value;
 }
 
@@ -146,10 +146,8 @@
             case 'f':
                 arg[i]=va_arg(argList, double *);
                 break;
-        }
-        
+        }   
     }
-    
 }
 
 // ================================================================================================================================================
@@ -162,6 +160,11 @@
     newMessage=false;
 }
 
+OSCClass::~OSCClass(){
+    udpSend.resetOnEvent();
+    udpRec.close();
+}
+
 OSCClass::OSCClass(OSCMessage *_mes){
     udpRec.setOnEvent(this, &OSCClass::onUDPSocketEvent);
     receiverMessage = _mes; // note: receiverMessage MUST be a pointer to the message, because we will modify things in it
diff -r fdea65150534 -r 63b72e393989 mbedOSC.h
--- a/mbedOSC.h	Sun Apr 15 15:50:42 2012 +0000
+++ b/mbedOSC.h	Fri Jul 26 22:10:20 2013 +0000
@@ -253,7 +253,7 @@
     
     /** Create an object to send and receive OSC messages */
     OSCClass();
-    
+    ~OSCClass();
 /**
  This sets "binds" the received message to the receiver container of the communication object
  @param[in] _mes A pointer to the "receiveing" OSC message (OSCMessage *)