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 | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp index c9155d1..b495f39 100644 --- a/noncore/apps/opie-console/io_serial.cpp +++ b/noncore/apps/opie-console/io_serial.cpp @@ -4,7 +4,7 @@ #include <unistd.h> #include "io_serial.h" -IOSerial::IOSerial(const Config &config) : IOLayer(config) { +IOSerial::IOSerial(const Profile &config) : IOLayer(config) { m_fd = 0; reload(config); } @@ -46,7 +46,7 @@ bool IOSerial::open() { tcgetattr(m_fd, &tty); /* Baud rate */ - int speed = getBaud(m_baud); + int speed = baud(m_baud); if (speed == -1) { emit error(Refuse, tr("Invalid baud rate")); } @@ -64,6 +64,7 @@ bool IOSerial::open() { case 6: tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS6; break; case 7: tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS7; break; case 8: tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8; break; + default: break; } /* Raw, no echo mode */ @@ -115,7 +116,7 @@ bool IOSerial::open() { } } -void IOSerial::reload(const Config &config) { +void IOSerial::reload(const Profile &config) { m_device = config.readEntry("Device", SERIAL_DEFAULT_DEVICE); m_baud = config.readNumEntry("Baud", SERIAL_DEFAULT_BAUD); m_parity = config.readNumEntry("Parity", SERIAL_DEFAULT_PARITY); @@ -124,7 +125,7 @@ void IOSerial::reload(const Config &config) { m_flow = config.readNumEntry("Flow", SERIAL_DEFAULT_FLOW); } -int IOSerial::getBaud(int baud) const { +int IOSerial::baud(int baud) const { switch (baud) { case 300: return B300; break; case 600: return B600; break; |