-rw-r--r-- | noncore/net/opietooth/lib/device.cc | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/lib/manager.cc | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/noncore/net/opietooth/lib/device.cc b/noncore/net/opietooth/lib/device.cc index f81066e..eea1178 100644 --- a/noncore/net/opietooth/lib/device.cc +++ b/noncore/net/opietooth/lib/device.cc | |||
@@ -59,33 +59,33 @@ void Device::attach(){ | |||
59 | this, SLOT(slotStdOut(Opie::Core::OProcess*,char*,int ) ) ); | 59 | this, SLOT(slotStdOut(Opie::Core::OProcess*,char*,int ) ) ); |
60 | connect(m_process, SIGNAL(receivedStderr(Opie::Core::OProcess*, char*, int ) ), | 60 | connect(m_process, SIGNAL(receivedStderr(Opie::Core::OProcess*, char*, int ) ), |
61 | this, SLOT(slotStdErr(Opie::Core::OProcess*,char*,int) ) ); | 61 | this, SLOT(slotStdErr(Opie::Core::OProcess*,char*,int) ) ); |
62 | if(!m_process->start(OProcess::NotifyOnExit, OProcess::AllOutput ) ){ | 62 | if(!m_process->start(OProcess::NotifyOnExit, OProcess::AllOutput ) ){ |
63 | owarn << "Could not start" << oendl; | 63 | owarn << "Could not start" << oendl; |
64 | delete m_process; | 64 | delete m_process; |
65 | m_process = 0; | 65 | m_process = 0; |
66 | } | 66 | } |
67 | }; | 67 | }; |
68 | } | 68 | } |
69 | void Device::detach(){ | 69 | void Device::detach(){ |
70 | delete m_hci; | 70 | delete m_hci; |
71 | delete m_process; | 71 | delete m_process; |
72 | // kill the pid we got | 72 | // kill the pid we got |
73 | if(m_attached ){ | 73 | if(m_attached ){ |
74 | //kill the pid | 74 | //kill the pid |
75 | warn << "killing" << oendl; | 75 | owarn << "killing" << oendl; |
76 | kill(pid, 9); | 76 | kill(pid, 9); |
77 | } | 77 | } |
78 | owarn << "detached" << oendl; | 78 | owarn << "detached" << oendl; |
79 | } | 79 | } |
80 | bool Device::isLoaded()const{ | 80 | bool Device::isLoaded()const{ |
81 | return m_attached; | 81 | return m_attached; |
82 | } | 82 | } |
83 | QString Device::devName()const { | 83 | QString Device::devName()const { |
84 | return QString::fromLatin1("hci0"); | 84 | return QString::fromLatin1("hci0"); |
85 | }; | 85 | }; |
86 | void Device::slotExited( OProcess* proc) | 86 | void Device::slotExited( OProcess* proc) |
87 | { | 87 | { |
88 | owarn << "prcess exited" << oendl; | 88 | owarn << "prcess exited" << oendl; |
89 | if(proc== m_process ){ | 89 | if(proc== m_process ){ |
90 | owarn << "proc == m_process" << oendl; | 90 | owarn << "proc == m_process" << oendl; |
91 | if( m_process->normalExit() ){ // normal exit | 91 | if( m_process->normalExit() ){ // normal exit |
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc index 76d9127..53122c1 100644 --- a/noncore/net/opietooth/lib/manager.cc +++ b/noncore/net/opietooth/lib/manager.cc | |||
@@ -179,33 +179,33 @@ void Manager::slotHCIExited(OProcess* proc ) { | |||
179 | owarn << "process exited" << oendl; | 179 | owarn << "process exited" << oendl; |
180 | RemoteDevice::ValueList list; | 180 | RemoteDevice::ValueList list; |
181 | if (proc->normalExit() ) { | 181 | if (proc->normalExit() ) { |
182 | owarn << "normalExit " << proc->name() << oendl; | 182 | owarn << "normalExit " << proc->name() << oendl; |
183 | QMap<QString, QString>::Iterator it = m_devices.find(proc->name() ); | 183 | QMap<QString, QString>::Iterator it = m_devices.find(proc->name() ); |
184 | if (it != m_devices.end() ) { | 184 | if (it != m_devices.end() ) { |
185 | owarn << "!= end ;)" << oendl; | 185 | owarn << "!= end ;)" << oendl; |
186 | list = parseHCIOutput( it.data() ); | 186 | list = parseHCIOutput( it.data() ); |
187 | m_devices.remove( it ); | 187 | m_devices.remove( it ); |
188 | } | 188 | } |
189 | } | 189 | } |
190 | emit foundDevices( proc->name(), list ); | 190 | emit foundDevices( proc->name(), list ); |
191 | delete proc; | 191 | delete proc; |
192 | } | 192 | } |
193 | void Manager::slotHCIOut(OProcess* proc, char* ch, int len) { | 193 | void Manager::slotHCIOut(OProcess* proc, char* ch, int len) { |
194 | QCString str( ch, len+1 ); | 194 | QCString str( ch, len+1 ); |
195 | owarn << "hci: " << str.data() oendl; | 195 | owarn << "hci: " << str.data() << oendl; |
196 | QMap<QString, QString>::Iterator it; | 196 | QMap<QString, QString>::Iterator it; |
197 | it = m_devices.find( proc->name() ); | 197 | it = m_devices.find( proc->name() ); |
198 | owarn << "proc->name " << proc->name() << oendl; | 198 | owarn << "proc->name " << proc->name() << oendl; |
199 | QString string; | 199 | QString string; |
200 | if (it != m_devices.end() ) { | 200 | if (it != m_devices.end() ) { |
201 | owarn << "slotHCIOut " << oendl; | 201 | owarn << "slotHCIOut " << oendl; |
202 | string = it.data(); | 202 | string = it.data(); |
203 | } | 203 | } |
204 | string.append( str ); | 204 | string.append( str ); |
205 | 205 | ||
206 | m_devices.replace( proc->name(), string ); | 206 | m_devices.replace( proc->name(), string ); |
207 | } | 207 | } |
208 | RemoteDevice::ValueList Manager::parseHCIOutput(const QString& output ) { | 208 | RemoteDevice::ValueList Manager::parseHCIOutput(const QString& output ) { |
209 | owarn << "parseHCI " << output.latin1() << oendl; | 209 | owarn << "parseHCI " << output.latin1() << oendl; |
210 | RemoteDevice::ValueList list; | 210 | RemoteDevice::ValueList list; |
211 | QStringList strList = QStringList::split('\n', output ); | 211 | QStringList strList = QStringList::split('\n', output ); |
@@ -269,41 +269,41 @@ void Manager::slotConnectionExited( OProcess* proc ) { | |||
269 | } | 269 | } |
270 | void Manager::slotConnectionOutput(OProcess* /*proc*/, char* cha, int len) { | 270 | void Manager::slotConnectionOutput(OProcess* /*proc*/, char* cha, int len) { |
271 | QCString str(cha, len ); | 271 | QCString str(cha, len ); |
272 | m_hcitoolCon.append( str ); | 272 | m_hcitoolCon.append( str ); |
273 | //delete proc; | 273 | //delete proc; |
274 | } | 274 | } |
275 | ConnectionState::ValueList Manager::parseConnections( const QString& out ) { | 275 | ConnectionState::ValueList Manager::parseConnections( const QString& out ) { |
276 | ConnectionState::ValueList list2; | 276 | ConnectionState::ValueList list2; |
277 | QStringList list = QStringList::split('\n', out ); | 277 | QStringList list = QStringList::split('\n', out ); |
278 | QStringList::Iterator it; | 278 | QStringList::Iterator it; |
279 | // remove the first line ( "Connections:") | 279 | // remove the first line ( "Connections:") |
280 | it = list.begin(); | 280 | it = list.begin(); |
281 | it = list.remove( it ); | 281 | it = list.remove( it ); |
282 | for (; it != list.end(); ++it ) { | 282 | for (; it != list.end(); ++it ) { |
283 | QString row = (*it).stripWhiteSpace(); | 283 | QString row = (*it).stripWhiteSpace(); |
284 | QStringList value = QStringList::split(' ', row ); | 284 | QStringList value = QStringList::split(' ', row ); |
285 | owan << "0: %s" << value[0].latin1() << oendl; | 285 | owarn << "0: %s" << value[0].latin1() << oendl; |
286 | owan << "1: %s" << value[1].latin1() << oendl; | 286 | owarn << "1: %s" << value[1].latin1() << oendl; |
287 | owan << "2: %s" << value[2].latin1() << oendl; | 287 | owarn << "2: %s" << value[2].latin1() << oendl; |
288 | owan << "3: %s" << value[3].latin1() << oendl; | 288 | owarn << "3: %s" << value[3].latin1() << oendl; |
289 | owan << "4: %s" << value[4].latin1() << oendl; | 289 | owarn << "4: %s" << value[4].latin1() << oendl; |
290 | owan << "5: %s" << value[5].latin1() << oendl; | 290 | owarn << "5: %s" << value[5].latin1() << oendl; |
291 | owan << "6: %s" << value[6].latin1() << oendl; | 291 | owarn << "6: %s" << value[6].latin1() << oendl; |
292 | owan << "7: %s" << value[7].latin1() << oendl; | 292 | owarn << "7: %s" << value[7].latin1() << oendl; |
293 | owan << "8: %s" << value[8].latin1() << oendl; | 293 | owarn << "8: %s" << value[8].latin1() << oendl; |
294 | ConnectionState con; | 294 | ConnectionState con; |
295 | con.setDirection( value[0] == QString::fromLatin1("<") ? Outgoing : Incoming ); | 295 | con.setDirection( value[0] == QString::fromLatin1("<") ? Outgoing : Incoming ); |
296 | con.setConnectionMode( value[1] ); | 296 | con.setConnectionMode( value[1] ); |
297 | con.setMac( value[2] ); | 297 | con.setMac( value[2] ); |
298 | con.setHandle( value[4].toInt() ); | 298 | con.setHandle( value[4].toInt() ); |
299 | con.setState( value[6].toInt() ); | 299 | con.setState( value[6].toInt() ); |
300 | con.setLinkMode( value[8] == QString::fromLatin1("MASTER") ? Master : Client ); | 300 | con.setLinkMode( value[8] == QString::fromLatin1("MASTER") ? Master : Client ); |
301 | list2.append( con ); | 301 | list2.append( con ); |
302 | } | 302 | } |
303 | return list2; | 303 | return list2; |
304 | } | 304 | } |
305 | 305 | ||
306 | void Manager::signalStrength( const QString &mac ) { | 306 | void Manager::signalStrength( const QString &mac ) { |
307 | 307 | ||
308 | OProcess* sig_proc = new OProcess(); | 308 | OProcess* sig_proc = new OProcess(); |
309 | 309 | ||