diff --git a/unit/test-caif.c b/unit/test-caif.c index a460fdae..8159c4e6 100644 --- a/unit/test-caif.c +++ b/unit/test-caif.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -41,14 +42,22 @@ static GMainLoop *mainloop; static int do_open(void) { + struct termios ti; int fd; - fd = open("/dev/chnlat10", O_RDWR); + fd = open("/dev/chnlat11", O_RDWR | O_NOCTTY | O_NONBLOCK); if (fd < 0) { - g_printerr("Open of chnlat10 failed (%d)\n", errno); + g_printerr("Open of chnlat11 failed (%d)\n", errno); return -EIO; } + /* Switch TTY to raw mode */ + memset(&ti, 0, sizeof(ti)); + cfmakeraw(&ti); + + tcflush(fd, TCIOFLUSH); + tcsetattr(fd, TCSANOW, &ti); + return fd; }