Пример #1
0
unsigned
TTYPort::GetBaudrate() const
{
  struct termios attr;
  if (tcgetattr(fd, &attr) < 0)
    return 0;

  return speed_t_to_baud_rate(cfgetispeed(&attr));
}
Пример #2
0
unsigned
TTYPort::GetBaudrate() const
{
  assert(tty.IsDefined());

  struct termios attr;
  if (!tty.GetAttr(attr))
    return 0;

  return speed_t_to_baud_rate(cfgetispeed(&attr));
}