summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib/device.cc
Unidiff
Diffstat (limited to 'noncore/net/opietooth/lib/device.cc') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/device.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/noncore/net/opietooth/lib/device.cc b/noncore/net/opietooth/lib/device.cc
index 40acbd2..2f04d46 100644
--- a/noncore/net/opietooth/lib/device.cc
+++ b/noncore/net/opietooth/lib/device.cc
@@ -22,8 +22,7 @@ namespace {
22 QString string( par ); 22 QString string( par );
23 QStringList list = QStringList::split( '\n', string ); 23 QStringList list = QStringList::split( '\n', string );
24 24
25 for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) 25 for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
26 {
27 owarn << "parsePID: " << (*it).latin1() << oendl; 26 owarn << "parsePID: " << (*it).latin1() << oendl;
28 27
29 // FIXME mbhaynie: Surely there is a better way to skip 28 // FIXME mbhaynie: Surely there is a better way to skip
@@ -35,8 +34,7 @@ namespace {
35 if( (*it).startsWith("TI") ) continue; 34 if( (*it).startsWith("TI") ) continue;
36 if( (*it).startsWith("Loading") ) continue; 35 if( (*it).startsWith("Loading") ) continue;
37 if( (*it).startsWith("BTS") ) continue; 36 if( (*it).startsWith("BTS") ) continue;
38 if( !(*it).startsWith("CSR") ) 37 if( !(*it).startsWith("CSR") ) {
39 {
40 id = (*it).toInt(); 38 id = (*it).toInt();
41 break; 39 break;
42 } 40 }
@@ -75,13 +73,9 @@ void Device::attach(){
75 73
76 // FIXME -- this is a hack for an odd hciattach interface. 74 // FIXME -- this is a hack for an odd hciattach interface.
77 if ( ODevice::inst()->modelString() == "HX4700" ) 75 if ( ODevice::inst()->modelString() == "HX4700" )
78 {
79 *m_process << "-S" << "/etc/bluetooth/TIInit_3.2.26.bts" << "/dev/ttyS1" << "texas"; 76 *m_process << "-S" << "/etc/bluetooth/TIInit_3.2.26.bts" << "/dev/ttyS1" << "texas";
80 }
81 else 77 else
82 {
83 *m_process << m_device << m_mode << m_speed; 78 *m_process << m_device << m_mode << m_speed;
84 }
85 connect(m_process, SIGNAL( processExited(Opie::Core::OProcess*) ), 79 connect(m_process, SIGNAL( processExited(Opie::Core::OProcess*) ),
86 this, SLOT( slotExited(Opie::Core::OProcess* ) ) ); 80 this, SLOT( slotExited(Opie::Core::OProcess* ) ) );
87 connect(m_process, SIGNAL( receivedStdout(Opie::Core::OProcess*, char*, int) ), 81 connect(m_process, SIGNAL( receivedStdout(Opie::Core::OProcess*, char*, int) ),
@@ -93,16 +87,18 @@ void Device::attach(){
93 delete m_process; 87 delete m_process;
94 m_process = 0; 88 m_process = 0;
95 } 89 }
96 }; 90 }
97} 91}
98void Device::detach(){ 92void Device::detach(){
99 delete m_hci; 93 delete m_hci;
94 m_hci = 0;
100 delete m_process; 95 delete m_process;
96 m_process = 0;
101 // kill the pid we got 97 // kill the pid we got
102 if(m_attached ){ 98 if(m_attached ){
103 //kill the pid 99 //kill the pid
104 owarn << "killing" << oendl; 100 owarn << "killing" << oendl;
105 kill(pid, 9); 101 ::kill(pid, 9);
106 } 102 }
107 owarn << "detached" << oendl; 103 owarn << "detached" << oendl;
108} 104}