AMD PCM-5896 User Manual Page 38

  • Download
  • Add to my manuals
  • Print
  • Page
    / 39
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 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);
}
Page view 37
1 2 ... 33 34 35 36 37 38 39

Comments to this Manuals

No comments