J
jeffpierce12
Hello,
I am trying to send some characters to a scanner that I have hooked up
to the COM 1 port on my PC. I am running Linux operating system, and I
have the following sample program:
#include <stdio.h>
int main (void)
{
FILE *fd;
fd = fopen("/dev/ttyS0", "w");
fprintf (fd, "2");
fprintf (fd, "B");
<here>
fprintf (fd, "0");
fprintf (fd, "A");
fclose(fd);
return 0;
}
At the <here> line, I would like to send to the device an ASCII "ETX"
character, which is a hex 03. What is the syntax of the fprintf
statement to do this?
Thank you.
I am trying to send some characters to a scanner that I have hooked up
to the COM 1 port on my PC. I am running Linux operating system, and I
have the following sample program:
#include <stdio.h>
int main (void)
{
FILE *fd;
fd = fopen("/dev/ttyS0", "w");
fprintf (fd, "2");
fprintf (fd, "B");
<here>
fprintf (fd, "0");
fprintf (fd, "A");
fclose(fd);
return 0;
}
At the <here> line, I would like to send to the device an ASCII "ETX"
character, which is a hex 03. What is the syntax of the fprintf
statement to do this?
Thank you.