--- /dev/null
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+int main (int argc, char ** args){
+ int fd;
+
+ fd=open("/dev/ttyUSB0", O_RDWR);
+ if (fd<0) {
+ perror("While opening port");
+ exit(2);
+ }
+
+ int i=0;
+ for (i=0; i<0x1000;i++){
+ char t1,t2,t3;
+ t1=i&0xff;
+ int ret=write(fd,&t1,1);
+ if (ret!=1) {
+ perror("While writing to port");
+ exit(2);
+ }
+ if (i%77==0) usleep(5000);
+ if (i%355==0) usleep(50000);
+ ret=read(fd,&t2,1);
+ if (ret!=1) {
+ perror("While reading from port");
+ exit(2);
+ }
+ ret=read(fd,&t3,1);
+ if (ret!=1) {
+ perror("While reading from port");
+ exit(2);
+ }
+
+ t3=~t3;
+ if ((t1!=t2)||(t3!=t1)){
+ fprintf(stderr,"Data mismatch!!!\n");
+ fprintf(stderr,"T1: %03o T2: %03o T3: %03o\n",t1,t2,t3);
+ exit(3);
+ }
+ }
+
+ printf("Success.\n");
+
+ return 0;
+}