7faae257d294efdf0ad58bda170bcf573dae0d5f
7 int main (int argc
, char ** args
){
10 fd
=open("/dev/ttyUSB0", O_RDWR
);
12 perror("While opening port");
17 for (i
=0; i
<0x1000;i
++){
20 int ret
=write(fd
,&t1
,1);
22 perror("While writing to port");
25 if (i
%77==0) usleep(5000);
26 if (i
%355==0) usleep(50000);
29 perror("While reading from port");
34 perror("While reading from port");
39 if ((t1
!=t2
)||(t3
!=t1
)){
40 fprintf(stderr
,"Data mismatch!!!\n");
41 fprintf(stderr
,"T1: %03o T2: %03o T3: %03o\n",t1
,t2
,t3
);