     break;
     
     case STATE_GAP:
-      //Serial.print("row:");
-      //Serial.print(row);
-      //Serial.print("=");
-      //Serial.println(sticky);
-      
-      //store row data in card buffer
+#if defined(CFGEN_SEND_ROW_REPORTS)
+      {
+         byte report[2];
+         report[0] = row;
+         report[1] = sticky;
+         sendCardReport(REPORT_OK_ROW, report, sizeof(report));
+      }
+#endif      
+      // store row data in card buffer
       card[row] = sticky;
       // advance row
       row += 1;

      // check for early card removal (all reading holes)
      if ((freg == 1) && (now == 0xFF))
      {
        state = STATE_REMOVED;
        //Serial.println(state);
      }
      else

  digitalWrite(LED_D0,  data&(1<<0));
}


void sendCardReport(byte type, byte* pData, byte len)
{
  Serial.write(":"); // Start char
  sendHexByte(type); // mandatory type
  
  // Show optional data of any length
  for (byte i=0; i<len; i++)
  {
    sendHexByte(pData[i]);
  }
  Serial.println(); // End char
}


void sendHexByte(byte val)
{
  Serial.write(tohexch(val>>4)); // high nybble
  Serial.write(tohexch(val));    // low nybble
}


char tohexch(byte val)
{
  val = val & 0x0F;
  if (val > 9)
  {
    return 'A' + (val-10);
  }
  else
  {
    return '0' + val;
  }
}

/* END OF FILE */


