osc test

Dependencies:   EthernetNetIf mbed mbed

Fork of OSC by Toby Harris

Revision:
1:63b72e393989
Parent:
0:fdea65150534
--- 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