author | harlekin <harlekin> | 2002-10-09 16:33:36 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-09 16:33:36 (UTC) |
commit | 205926ec86ffd582f795b649179291626e504830 (patch) (unidiff) | |
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 @@ | |||
1 | |||
2 | #include "io_irda.h" | ||
3 | |||
4 | IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { | ||
5 | m_attach = 0; | ||
6 | } | ||
7 | |||
8 | |||
9 | IOIrda::~IOIrda() { | ||
10 | if ( m_attach ) { | ||
11 | delete m_attach; | ||
12 | } | ||
13 | } | ||
14 | |||
15 | |||
16 | void IOIrda::close() { | ||
17 | |||
18 | IOSerial::close(); | ||
19 | // still need error handling | ||
20 | delete m_attach; | ||
21 | } | ||
22 | |||
23 | bool IOIrda::open() { | ||
24 | |||
25 | // irdaattach here | ||
26 | m_attach = new OProcess(); | ||
27 | *m_attach << "irattach /dev/ttyS2 -s"; | ||
28 | |||
29 | connect( m_attach, SIGNAL( processExited( OProcess* ) ), | ||
30 | this, SLOT( slotExited( OProcess* ) ) ); | ||
31 | |||
32 | if ( m_attach->start() ) { | ||
33 | IOSerial::open(); | ||
34 | } else { | ||
35 | qWarning("could not attach to device"); | ||
36 | delete m_attach; | ||
37 | } | ||
38 | } | ||
39 | |||
40 | void IOIrda::reload( const Profile &config ) { | ||
41 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); | ||
42 | m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); | ||
43 | m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); | ||
44 | m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); | ||
45 | m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); | ||
46 | m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); | ||
47 | } | ||
48 | |||
49 | |||
50 | QString IOIrda::identifier() const { | ||
51 | return "irda"; | ||
52 | } | ||
53 | |||
54 | QString IOIrda::name() const { | ||
55 | return "Irda IO Layer"; | ||
56 | } | ||
57 | |||
58 | void IOIrda::slotExited(OProcess* proc ){ | ||
59 | close(); | ||
60 | } | ||