00001 #include "io_irda.h" 00002 00003 IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { 00004 m_attach = 0; 00005 } 00006 00007 00008 IOIrda::~IOIrda() { 00009 if ( m_attach ) { 00010 delete m_attach; 00011 } 00012 } 00013 00014 00015 void IOIrda::close() { 00016 00017 IOSerial::close(); 00018 // still need error handling 00019 delete m_attach; 00020 } 00021 00022 bool IOIrda::open() { 00023 bool ret; 00024 00025 // irdaattach here 00026 m_attach = new Opie::Core::OProcess(); 00027 *m_attach << "irattach /dev/ttyS2 -s"; 00028 00029 connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), 00030 this, SLOT( slotExited(Opie::Core::OProcess*) ) ); 00031 00032 if ( m_attach->start() ) { 00033 ret= IOSerial::open(); 00034 } else { 00035 // emit error!!! 00036 delete m_attach; 00037 m_attach = 0l; 00038 } 00039 return ret; 00040 } 00041 00042 void IOIrda::reload( const Profile &config ) { 00043 m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); 00044 m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); 00045 m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); 00046 m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); 00047 m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); 00048 m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); 00049 } 00050 00051 00052 QString IOIrda::identifier() const { 00053 return "irda"; 00054 } 00055 00056 QString IOIrda::name() const { 00057 return "Irda IO Layer"; 00058 } 00059 00060 void IOIrda::slotExited(Opie::Core::OProcess* proc ){ 00061 close(); 00062 delete proc; 00063 } 00064
1.4.2