Index: trunk/MagicSoft/Cosy/tcpip/MCeCoCom.cc
===================================================================
--- trunk/MagicSoft/Cosy/tcpip/MCeCoCom.cc	(revision 2514)
+++ trunk/MagicSoft/Cosy/tcpip/MCeCoCom.cc	(revision 2517)
@@ -11,66 +11,75 @@
 }
 
+bool MCeCoCom::InterpreteReport(TString &str)
+{
+    int y, m, d, h, min, s, ms, len;
+
+    int n=sscanf(str.Data(),
+                 "%02d %04d %02d %02d %02d %02d %02d %03d %n",
+                 &fCCStatus, &y, &m, &d, &h, &min, &s, &ms, &len);
+    if (n!=8)
+    {
+        cout << "Communication Problem: Wrong number of arguments" << endl;
+        fComStat = kComProblem;
+        return false;
+    }
+    str.Remove(0, len);
+
+    fT.SetTimer(y, m, d, h, min, s, ms/1000.);
+
+    // Remove the 30 tokens of the subsystem status
+    //  table 12.1 p59
+    for (int i=0; i<30; i++)
+        str.Remove(0, str.First(' ')+1);
+
+    // skip solar_irr_Wm2, wind_speed, UPS
+    float zd, az, dec, ra, temp, solar, wind, hum;
+    n=sscanf(str.Data(),
+             "%f %f %f %f %f %f %f %f %*f %*f %n",
+             &zd, &az, &dec, &ra, &temp, &solar, &wind, &hum, &len);
+    if (n!=8)
+    {
+        cout << "Communication Problem: Wrong number of arguments" << endl;
+        fComStat = kComProblem;
+        return false;
+    }
+    str.Remove(0, len);
+
+    if (str!=(TString)"OVER")
+    {
+        cout << "Communication Problem: Termination (OVER) too far away." << endl;
+        fComStat = kComProblem;
+        return false;
+    }
+
+    cout << "Zd/Az: " << zd << "/" << az << "   ";
+    cout << "Ra/Dec: " << ra << "/" << dec << "   ";
+    cout << "Temp: " << temp << "'C   ";
+    cout << "Hum: " << hum << "%   ";
+    cout << "SolRad: " << solar << "W/m²   ";
+    cout << "Wind: " << wind << "km/h" << endl;
+
+    fHumidity = hum;
+    fTemperature = temp;
+    fSolarRadiation = solar;
+    fWindSpeed = wind;
+
+    fComStat = kCmdReceived;
+    return true;
+}
+
 bool MCeCoCom::InterpreteStr(TString str)
 {
     const Ssiz_t tok  = str.First(' ');
-    const TString cmd = str(0, tok);
-    str.Remove(0, tok+1);
+    const TString cmd = tok<0 ? str : str(0, tok);
+    if (tok<0)
+        str = "";
+    else
+        str.Remove(0, tok+1);
 
     if (cmd==(TString)"CC-REPORT" && str.EndsWith("OVER"))
-    {
-        cout << cmd << ": " << str << endl;
-        int y, m, d, h, min, s, ms, len;
+        return InterpreteReport(str);
 
-        int n=sscanf(str.Data(),
-                     "%02d %04d %02d %02d %02d %02d %02d %03d %n",
-                     &fCCStatus, &y, &m, &d, &h, &min, &s, &ms, &len);
-        if (n!=8)
-        {
-            cout << "Communication Problem: Wrong number of arguments" << endl;
-            fComStat = kComProblem;
-            return false;
-        }
-        str.Remove(0, len+1);
-
-        fT.SetTimer(y, m, d, h, min, s, ms/1000.);
-
-        // Remove the 29 tokens of the subsystem status
-        //  table 12.1 p59
-        for (int i=0; i<29; i++)
-            str.Remove(0, str.First(' ')+1);
-
-        // skip solar_irr_Wm2, wind_speed, UPS
-		float zd, az, dec, ra, temp, hum;
-        n=sscanf(str.Data(),
-                 "%f %f %f %f %f %*f %*f %f %*f %n",
-                 &zd, &az, &dec, &ra, &temp, &hum, &len);
-        if (n!=6)
-        {
-            cout << "Communication Problem: Wrong number of arguments" << endl;
-            fComStat = kComProblem;
-            return false;
-        }
-        str.Remove(0, len);
-
-        if (str!=(TString)"OVER")
-        {
-            cout << "Communication Problem: Termination (OVER) not found." << endl;
-            fComStat = kComProblem;
-            return false;
-        }
-
-        cout << "Zd/Az: " << zd << "/" << az << "   ";
-        cout << "Ra/Dec: " << ra << "/" << dec << "   ";
-        cout << "Temp:  " << temp << "'C   ";
-        cout << "Hum: " << hum << "%" << endl;
-
-        fHumidity = hum;
-        fTemperature = temp;
-
-        fComStat = kCmdReceived;
-        return true;
-    }
-
-    const bool rc = InterpreteCmd(cmd, str);
+    const bool rc = InterpreteCmd(cmd, str.Strip(TString::kBoth));
     fComStat = rc ? kCmdReceived : kComProblem;
     return rc;
