Get rid of from_tty variant, use gattty instead

This commit is contained in:
Denis Kenzior 2009-10-06 18:14:11 -05:00
parent bc8031e2d7
commit 273c8b06a0
2 changed files with 0 additions and 43 deletions

View File

@ -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)

View File

@ -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);