With --raw fflush() at every output to avoid delays.

This commit is contained in:
antirez 2013-01-10 19:01:25 +01:00
parent 9c8ad1c6b7
commit af4964d72f

View file

@ -919,7 +919,10 @@ void displayModesMessage(struct modesMessage *mm) {
for (j = 0; j < mm->msgbits/8; j++) printf("%02x", mm->msg[j]); for (j = 0; j < mm->msgbits/8; j++) printf("%02x", mm->msg[j]);
printf(";\n"); printf(";\n");
if (Modes.raw) return; /* Enough for --raw mode */ if (Modes.raw) {
fflush(stdout); /* Provide data to the reader ASAP. */
return; /* Enough for --raw mode */
}
printf("CRC: %06x (%s)\n", (int)mm->crc, mm->crcok ? "ok" : "wrong"); printf("CRC: %06x (%s)\n", (int)mm->crc, mm->crcok ? "ok" : "wrong");
if (mm->errorbit != -1) if (mm->errorbit != -1)