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