AMD PCM-5896 Bedienungsanleitung Seite 38

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 39
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 37
38
terminal settings done, now handle
input
In this example, inputting a 'z' at
the beginning of a line will
exit the program.
*/
while (STOP==FALSE) { /* loop until
we have a terminating condition */
/* read blocks program execution until
a line terminating character is
input, even if more than 255 chars
are input. If the number
of characters read is smaller than
the number of chars available,
subsequent reads will return the
remaining chars. res will be set
to the actual number of characters
actually read */
res = read(fd,buf,255);
buf[res]=0; /* set end
of string, so we can printf */
printf(":%s:%d\n", buf, res);
if (buf[0]=='z') STOP=TRUE;
}
/* restore the old port settings */
tcsetattr(fd,TCSANOW,&oldtio);
}
Seitenansicht 37
1 2 ... 33 34 35 36 37 38 39

Kommentare zu diesen Handbüchern

Keine Kommentare