// Just dump everything we see on the line on screen // need to link with serials.c to get coms stuff and logfile // we usually talk to /dev/ttyS? // and log to a file called debug.log #include #include // need this to set the serial speed like B9600 #include #include main (int argc, char **argv) { int fd, n; unsigned char byte; FILE *store_file; if(argc != 2){ printf("arg: serialportpath (eg /dev/ttyS0)\n"); exit(1); } // open port initialise_coms(argv[1], B9600, "debug.log"); n = 100; while (n--){ byte = getbyte(); printf("%x\n ", byte); } }