   while((index<len-1)
   &&((lc(sbuf[index])!='a')||(lc(sbuf[index+1])!='t')))
       index++;
+
+  if(logFileOpen)
+  {
+      char cmdbuf[len+1];
+      memcpy(cmdbuf,sbuf,len);
+      cmdbuf[len]=0;
+      logFile.print("Command: ");
+      logFile.println(cmdbuf);
+  }
 
   if((index<len-1)
   &&(lc(sbuf[index])=='a')

byte ZCommand::CRC8(const byte *data, byte len) 
{
  byte crc = 0x00;
  while (len--) 
  {
    byte extract = *data++;
    for (byte tempI = 8; tempI; tempI--) 
    {
      byte sum = (crc ^ extract) & 0x01;

      extract >>= 1;
    }
  }
  if(logFileOpen)
    logFile.printf("\r\nFinal CRC8: %s\r\n",TOHEX(crc));
  return crc;
}    

