diff --git a/gatchat/gatmux.c b/gatchat/gatmux.c index b46675b7..4390b336 100644 --- a/gatchat/gatmux.c +++ b/gatchat/gatmux.c @@ -188,48 +188,6 @@ GAtMux *g_at_mux_new(GIOChannel *channel) return mux; } -static int open_device(const char *device) -{ - struct termios ti; - int fd; - - fd = open(device, O_RDWR | O_NOCTTY); - if (fd < 0) - return -1; - - tcflush(fd, TCIOFLUSH); - - /* Switch TTY to raw mode */ - memset(&ti, 0, sizeof(ti)); - cfmakeraw(&ti); - - tcsetattr(fd, TCSANOW, &ti); - - return fd; -} - -GAtMux *g_at_mux_new_from_tty(const char *device) -{ - GAtMux *mux; - GIOChannel *channel; - int fd; - - fd = open_device(device); - if (fd < 0) - return NULL; - - channel = g_io_channel_unix_new(fd); - mux = g_at_mux_new(channel); - g_io_channel_unref(channel); - - if (!mux) { - close(fd); - return NULL; - } - - return mux; -} - GAtMux *g_at_mux_ref(GAtMux *mux) { if (mux == NULL) diff --git a/gatchat/gatmux.h b/gatchat/gatmux.h index facc6fc6..5f9f5e7d 100644 --- a/gatchat/gatmux.h +++ b/gatchat/gatmux.h @@ -33,7 +33,6 @@ struct _GAtMux; typedef struct _GAtMux GAtMux; GAtMux *g_at_mux_new(GIOChannel *channel); -GAtMux *g_at_mux_new_from_tty(const char *device); GAtMux *g_at_mux_ref(GAtMux *mux); void g_at_mux_unref(GAtMux *mux);