1 /* This program will act as a dumb terminal, sending characters typed to
2 the PDP-8 and printing characters received. Can be used to test the
5 The 8th bit is stripped for printing and set for sending to the PDP-8.
7 On the PC ctrl-break will terminate the program
25 #define ARRAYSIZE(a) (sizeof(a) / sizeof(a[0]))
33 #define STDOUT_FILENO 0
44 unsigned char buf
[256];
48 printf("Enter ^I (control-I) or ^break to terminate program\n");
49 setup_config(&baud
,&two_stop
,serial_dev
);
51 fd
= init_comm(serial_dev
,baud
,two_stop
);
54 if ((rc
= getchar_nonblock()) > 0) {
56 ser_write(fd
,(char *)buf
,1);
59 ser_write(fd
,(char *)buf
,1);
62 if ((rc
= ser_read(fd
,(char *) buf
,sizeof(buf
))) < 0) {
63 perror("\nstdin read failed\n");
67 for (cntr
= 0; cntr
< rc
; cntr
++)
69 write(STDOUT_FILENO
, buf
, rc
);