author | harlekin <harlekin> | 2002-10-09 16:33:36 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-09 16:33:36 (UTC) |
commit | 205926ec86ffd582f795b649179291626e504830 (patch) (side-by-side diff) | |
tree | 3a5759b98a1a263ade37dfb35cfd529a7bcafde9 /noncore/apps/opie-console/io_irda.cpp | |
parent | f696c6248824166f3ac025d23ac66b46c93b440c (diff) | |
download | opie-205926ec86ffd582f795b649179291626e504830.zip opie-205926ec86ffd582f795b649179291626e504830.tar.gz opie-205926ec86ffd582f795b649179291626e504830.tar.bz2 |
flow now has mode none too .-), irda config widget and beginning of layer, first sweep, rest later
Diffstat (limited to 'noncore/apps/opie-console/io_irda.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/io_irda.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp new file mode 100644 index 0000000..8e31e82 --- a/dev/null +++ b/noncore/apps/opie-console/io_irda.cpp @@ -0,0 +1,60 @@ + +#include "io_irda.h" + +IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { + m_attach = 0; +} + + +IOIrda::~IOIrda() { + if ( m_attach ) { + delete m_attach; + } +} + + +void IOIrda::close() { + + IOSerial::close(); + // still need error handling + delete m_attach; +} + +bool IOIrda::open() { + + // irdaattach here + m_attach = new OProcess(); + *m_attach << "irattach /dev/ttyS2 -s"; + + connect( m_attach, SIGNAL( processExited( OProcess* ) ), + this, SLOT( slotExited( OProcess* ) ) ); + + if ( m_attach->start() ) { + IOSerial::open(); + } else { + qWarning("could not attach to device"); + delete m_attach; + } +} + +void IOIrda::reload( const Profile &config ) { + m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); + m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); + m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); + m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); + m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); + m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); +} + + +QString IOIrda::identifier() const { + return "irda"; +} + +QString IOIrda::name() const { + return "Irda IO Layer"; +} + +void IOIrda::slotExited(OProcess* proc ){ + close(); +} |