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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp index e360fb4..b281b7d 100644 --- a/noncore/apps/opie-console/io_irda.cpp +++ b/noncore/apps/opie-console/io_irda.cpp | |||
@@ -1,77 +1,77 @@ | |||
1 | 1 | ||
2 | #include "io_irda.h" | 2 | #include "io_irda.h" |
3 | 3 | ||
4 | IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { | 4 | IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { |
5 | m_attach = 0; | 5 | m_attach = 0; |
6 | } | 6 | } |
7 | 7 | ||
8 | 8 | ||
9 | IOIrda::~IOIrda() { | 9 | IOIrda::~IOIrda() { |
10 | if ( m_attach ) { | 10 | if ( m_attach ) { |
11 | delete m_attach; | 11 | delete m_attach; |
12 | } | 12 | } |
13 | } | 13 | } |
14 | 14 | ||
15 | 15 | ||
16 | void IOIrda::close() { | 16 | void IOIrda::close() { |
17 | 17 | ||
18 | IOSerial::close(); | 18 | IOSerial::close(); |
19 | // still need error handling | 19 | // still need error handling |
20 | delete m_attach; | 20 | delete m_attach; |
21 | } | 21 | } |
22 | 22 | ||
23 | bool IOIrda::open() { | 23 | bool IOIrda::open() { |
24 | bool ret; | 24 | bool ret; |
25 | 25 | ||
26 | // irdaattach here | 26 | // irdaattach here |
27 | m_attach = new OProcess(); | 27 | m_attach = new OProcess(); |
28 | *m_attach << "irattach /dev/ttyS2 -s"; | 28 | *m_attach << "irattach /dev/ttyS2 -s"; |
29 | 29 | ||
30 | connect( m_attach, SIGNAL( processExited( OProcess* ) ), | 30 | connect( m_attach, SIGNAL( processExited(OProcess*) ), |
31 | this, SLOT( slotExited( OProcess* ) ) ); | 31 | this, SLOT( slotExited(OProcess*) ) ); |
32 | 32 | ||
33 | if ( m_attach->start() ) { | 33 | if ( m_attach->start() ) { |
34 | ret= IOSerial::open(); | 34 | ret= IOSerial::open(); |
35 | } else { | 35 | } else { |
36 | // emit error!!! | 36 | // emit error!!! |
37 | qWarning("could not attach to device"); | 37 | qWarning("could not attach to device"); |
38 | delete m_attach; | 38 | delete m_attach; |
39 | m_attach = 0l; | 39 | m_attach = 0l; |
40 | } | 40 | } |
41 | return ret; | 41 | return ret; |
42 | } | 42 | } |
43 | 43 | ||
44 | void IOIrda::reload( const Profile &config ) { | 44 | void IOIrda::reload( const Profile &config ) { |
45 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); | 45 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); |
46 | m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); | 46 | m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); |
47 | m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); | 47 | m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); |
48 | m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); | 48 | m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); |
49 | m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); | 49 | m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); |
50 | m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); | 50 | m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); |
51 | } | 51 | } |
52 | 52 | ||
53 | 53 | ||
54 | QString IOIrda::identifier() const { | 54 | QString IOIrda::identifier() const { |
55 | return "irda"; | 55 | return "irda"; |
56 | } | 56 | } |
57 | 57 | ||
58 | QString IOIrda::name() const { | 58 | QString IOIrda::name() const { |
59 | return "Irda IO Layer"; | 59 | return "Irda IO Layer"; |
60 | } | 60 | } |
61 | 61 | ||
62 | void IOIrda::slotExited(OProcess* proc ){ | 62 | void IOIrda::slotExited(OProcess* proc ){ |
63 | close(); | 63 | close(); |
64 | delete proc; | 64 | delete proc; |
65 | } | 65 | } |
66 | 66 | ||
67 | QBitArray IOIrda::supports()const { | 67 | QBitArray IOIrda::supports()const { |
68 | return QBitArray( 3 ); | 68 | return QBitArray( 3 ); |
69 | } | 69 | } |
70 | 70 | ||
71 | bool IOIrda::isConnected() { | 71 | bool IOIrda::isConnected() { |
72 | return false; | 72 | return false; |
73 | } | 73 | } |
74 | 74 | ||
75 | void IOIrda::send(const QByteArray &data) { | 75 | void IOIrda::send(const QByteArray &data) { |
76 | qDebug( "Please overload me..." ); | 76 | qDebug( "Please overload me..." ); |
77 | } | 77 | } |