   Serial.write((time>>16) & 0xFF);
   Serial.write((time>>24) & 0xFF);  
   // Send device data
-  //int j=0;
   for (int dev=0;dev<streamCmdArray[0];dev++)
   {
     int start = 5 + (dev * STREAM_LENGTH);
     char* recBuf = pfReadBytes(streamCmdArray[start],streamCmdArray[start+1],streamCmdArray[start+2]);
-    //for (int=0;i<streamCmdArray[start+2];i++)
-      //buff[5+i+j] = recBuf[i];
-    //j=j+streamCmdArray[start+2];
-    Serial.write(recBuf);
+    for (int i=0;i<streamCmdArray[start+2];i++)
+      Serial.write(recBuf[i]);
   }
   
   char CRC = 0x00;
-  //buff[5+j]=CRC;
-  //buff[5+j+1]=CMD_STREAM_END;
-  //Serial.write(buff);
   Serial.write(CRC);
   Serial.write(CMD_STREAM_END);
   //blinkLed();

  Serial.write(CMD_ESC);
}

void disableInterrupt()
{
  /*Timer1.detachInterrupt();
  Timer1.stop();*/
}

void enableInterrupt(long period)
{
  /*Timer1.initialize(period);
  
  // attach timer interrupt
  Timer1.attachInterrupt(heartBeat);*/

}

boolean receiveBytes(int length,char* buffer)
{
  Serial.readBytes(buffer,length);


void streamAddCmd(char *buffer)
{
  int start = ((int)streamCmdArray[0]*STREAM_LENGTH)+5;
  for (int i=0;i<5;i++)
    streamCmdArray[start+i]=buffer[i];
  streamCmdArray[0]++;
