Ibiltari Nora / OSC
Revision:
18:3c678e1d5a84
Parent:
17:9479c15a9d54
Child:
19:35408d190f4e
--- a/OSCMessage.cpp	Fri Dec 14 19:47:55 2018 +0100
+++ b/OSCMessage.cpp	Fri Dec 14 20:51:12 2018 +0100
@@ -457,12 +457,10 @@
     lengthEnd=lengthStart+(4-(lengthStart%4));
 
     for(int i=lengthStart ; i<lengthEnd; i++){
-    	buff[i]=0;
+    	buff[i]=nullChar;
     }
 
- /*   while(addrPad--){
-        p.write(nullChar);
-    } */  // TODO: try to reuse this
+
 
     lengthStart=lengthEnd;
 
@@ -513,16 +511,22 @@
             	buff[lengthEnd++]=ptr[i];
             }
 
-        } /*  else if (datum->type == 't'){ TODO: implement time sending
+        }   else if (datum->type == 't'){
             osctime_t time =  datum->data.time;
             uint32_t d = BigEndian(time.seconds);
             uint8_t * ptr = (uint8_t *)    &d;
-            p.write(ptr, 4);
+            for(int i = 0; i < 4; i++){
+            	buff[lengthEnd++]=ptr[i];
+            }
+         //   p.write(ptr, 4);
             d = BigEndian(time.fractionofseconds);
             ptr = (uint8_t *)    &d;
-            p.write(ptr, 4);
+            for(int i = 0; i < 4; i++){
+            	buff[lengthEnd++]=ptr[i];
+            }
+          //  p.write(ptr, 4);
 
-        } */ else  if (datum->type == 'T' || datum->type == 'F')
+        }  else  if (datum->type == 'T' || datum->type == 'F')
                     { }
         else { // float or int
             uint32_t i = BigEndian(datum->data.i);