#include <midas.h>
#include "rs232.c"
Go to the source code of this file.
◆ main()
Definition at line 16 of file rs232test.cxx.
17{
20
21 printf("Enter port [/dev/ttyS0]: ");
22 fgets(
str,
sizeof(
str), stdin);
23 if (strchr(
str,
'\n'))
24 *strchr(
str,
'\n') = 0;
25
27 strcpy(
str,
"/dev/ttyS0");
28
29 info.fd = rs232_open(
str, 9600,
'N', 8, 1, 0);
30
32 printf("Cannot open ttyS0\n");
33 return 0;
34 }
35
36
38
39 printf("Connected to ttyS0, exit with <ESC>\n");
40
41 do {
42 memset(
str, 0,
sizeof(
str));
45 break;
46
49
52 fflush(stdout);
53
54 } while (1);
55
58
59 return 1;
60}
INT ss_getchar(BOOL reset)