3 #include <lunaix/lunaix.h>
9 test_serial(char* dev, int wr)
11 int fd = open(dev, FO_WRONLY);
13 printf("tty %s not accessable (%d)\n", dev, errno);
21 printf("tty input: ");
23 if ((sz = read(fd, buf, 31)) < 0) {
24 printf("read to tty failed (%d)\n", errno);
32 int size = snprintf(buf, 256, "serial test: %s", dev);
40 main(int argc, char* argv[])
43 printf("usage: testp path_to_dev\n");
47 char* target = argv[1];
49 test_serial(target, 1);