X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/bef1210245bb3180a57f26405369654eaa477f63..1eeed1150149b63d6e49e033697454bc12b533b9:/lunaix-os/usr/testp/main.c diff --git a/lunaix-os/usr/testp/main.c b/lunaix-os/usr/testp/main.c deleted file mode 100644 index 8011c30..0000000 --- a/lunaix-os/usr/testp/main.c +++ /dev/null @@ -1,50 +0,0 @@ -#include -#include -#include -#include -#include -#include - -void -test_serial() -{ - int fd = open("/dev/ttyS0", FO_WRONLY); - if (fd < 0) { - printf("ttyS0 not accessable (%d)\n", errno); - return; - } - - char buf[32]; - int sz = 0; - - printf("ttyS0 input: "); - - if ((sz = read(fd, buf, 31)) < 0) { - printf("write to ttyS0 failed (%d)\n", errno); - } - - buf[sz] = 0; - - printf("%s", buf); - - close(fd); -} - -int -main(int argc, char* argv[]) -{ - if (argc <= 1) { - return 1; - } - - char* target = argv[1]; - - if (!strcmp(target, "serial")) { - test_serial(); - } else { - printf("unknown test: %s\n", target); - return 1; - } - - return 0; -} \ No newline at end of file