Add some more debug
This commit is contained in:
@@ -289,10 +289,11 @@ static void *_read_net(void *arg)
|
|||||||
tty->fds[FD_MASTER].events = tty->master_suspended ? POLLPRI : POLLIN;
|
tty->fds[FD_MASTER].events = tty->master_suspended ? POLLPRI : POLLIN;
|
||||||
|
|
||||||
res = poll(tty->fds, 3, -1);
|
res = poll(tty->fds, 3, -1);
|
||||||
DBG2("%s: res=%d events-N/M/S=%#x/%#x/%#x\n", __func__,
|
DBG2("%s: res=%d events-N/M/S=%x:%x/%x:%x/%x:%x SS=%d MS=%d\n",
|
||||||
res,
|
__func__, res, tty->fds[FD_NET].events, tty->fds[FD_NET].revents,
|
||||||
tty->fds[FD_NET].revents, tty->fds[FD_MASTER].revents,
|
tty->fds[FD_MASTER].events, tty->fds[FD_MASTER].revents,
|
||||||
tty->fds[FD_SLAVE].revents);
|
tty->fds[FD_SLAVE].events, tty->fds[FD_SLAVE].revents,
|
||||||
|
tty->slave_suspended, tty->master_suspended);
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
{
|
{
|
||||||
if (errno == EINTR)
|
if (errno == EINTR)
|
||||||
@@ -339,6 +340,7 @@ static void *_read_net(void *arg)
|
|||||||
if ((tty->fds[FD_MASTER].revents & POLLIN) && !tty->master_suspended)
|
if ((tty->fds[FD_MASTER].revents & POLLIN) && !tty->master_suspended)
|
||||||
{
|
{
|
||||||
res = read(tty->fds[FD_MASTER].fd, buf, TMP_BUF_SIZE);
|
res = read(tty->fds[FD_MASTER].fd, buf, TMP_BUF_SIZE);
|
||||||
|
DBG("%s: read res=%d pollout=%d\n", __func__, res, tty->pollout);
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
{
|
{
|
||||||
_log(LOG_ERR, "master read error: %m\n");
|
_log(LOG_ERR, "master read error: %m\n");
|
||||||
@@ -477,6 +479,8 @@ static void _modem_status_cb(void *cctx, int status)
|
|||||||
mcr |= TIOCM_CTS;
|
mcr |= TIOCM_CTS;
|
||||||
|
|
||||||
tty->master_suspended = (mcr & TIOCM_CTS) ? 0 : 1;
|
tty->master_suspended = (mcr & TIOCM_CTS) ? 0 : 1;
|
||||||
|
DBG("%s: tty=%p mcr=%x MS=%d\n", __func__, tty, mcr,
|
||||||
|
tty->master_suspended);
|
||||||
|
|
||||||
pthread_mutex_lock(&tty->tty_lock);
|
pthread_mutex_lock(&tty->tty_lock);
|
||||||
tty->smcr_last = tty->smcr;
|
tty->smcr_last = tty->smcr;
|
||||||
|
|||||||
Reference in New Issue
Block a user