Diffstat (limited to 'noncore/apps/opie-console/io_serial.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/io_serial.cpp | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp index 03f1b1a..a4a6f0b 100644 --- a/noncore/apps/opie-console/io_serial.cpp +++ b/noncore/apps/opie-console/io_serial.cpp @@ -18,52 +18,47 @@ IOSerial::~IOSerial() { } } void IOSerial::send(const QByteArray &data) { if (m_fd) { write(m_fd, data.data(), data.size()); } else { emit error(Refuse, tr("Not connected")); } } void IOSerial::close() { - qWarning("closing!"); if (m_fd) { delete m_read; delete m_error; ::close(m_fd); m_fd = 0; } else { emit error(Refuse, tr("Not connected")); } } bool IOSerial::open() { - qWarning("open"); if (!m_fd) { - qWarning("going to open %s", m_device.latin1()); struct termios tty; m_fd = ::open(m_device, O_RDWR | O_NOCTTY | O_NONBLOCK); if (m_fd < 0) { - qWarning(" fd < 0 "); emit error(CouldNotOpen, strerror(errno)); return FALSE; } tcgetattr(m_fd, &tty); /* Baud rate */ int speed = baud(m_baud); if (speed == -1) { - qWarning("speed -1"); emit error(Refuse, tr("Invalid baud rate")); } cfsetospeed(&tty, speed); cfsetispeed(&tty, speed); /* Take care of Space / Mark parity */ if (m_dbits == 7 && (m_parity == ParitySpace || m_parity == ParityMark)) { m_dbits = 8; } /* Data bits */ switch (m_dbits) { @@ -109,35 +104,32 @@ bool IOSerial::open() { tty.c_cflag |= (PARENB | PARODD); /* Set the changes */ tcsetattr(m_fd, TCSANOW, &tty); /* Notifications on read & errors */ m_read = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); m_error = new QSocketNotifier(m_fd, QSocketNotifier::Exception, this); connect(m_read, SIGNAL(activated(int)), this, SLOT(dataArrived())); connect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured())); return TRUE; } else { - qWarning(" already opened"); emit error(Refuse, tr("Device is already connected")); m_fd = 0; return FALSE; } } void IOSerial::reload(const Profile &config) { m_device = config.readEntry("Device", SERIAL_DEFAULT_DEVICE); - qWarning( "Dev" +m_device ); - qWarning( "Conf:" +config.readEntry("Device") ); m_baud = config.readNumEntry("Speed", SERIAL_DEFAULT_BAUD); m_parity = config.readNumEntry("Parity", SERIAL_DEFAULT_PARITY); m_dbits = config.readNumEntry("DataBits", SERIAL_DEFAULT_DBITS); m_sbits = config.readNumEntry("StopBits", SERIAL_DEFAULT_SBITS); m_flow = config.readNumEntry("Flow", SERIAL_DEFAULT_FLOW); } int IOSerial::baud(int baud) const { switch (baud) { case 300: return B300; break; case 600: return B600; break; |