summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib/manager.cc
Unidiff
Diffstat (limited to 'noncore/net/opietooth/lib/manager.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/manager.cc33
1 files changed, 32 insertions, 1 deletions
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc
index 8ddcfe8..c89d325 100644
--- a/noncore/net/opietooth/lib/manager.cc
+++ b/noncore/net/opietooth/lib/manager.cc
@@ -262,3 +262,2 @@ void Manager::searchConnections() {
262void Manager::slotConnectionExited( OProcess* proc ) { 262void Manager::slotConnectionExited( OProcess* proc ) {
263 qWarning("<<<<<<<<<<<<<<<<<exited");
264 ConnectionState::ValueList list; 263 ConnectionState::ValueList list;
@@ -303 +302,33 @@ ConnectionState::ValueList Manager::parseConnections( const QString& out ) {
303} 302}
303
304void Manager::signalStrength( const QString &mac ) {
305
306 OProcess* sig_proc = new OProcess();
307
308 connect(sig_proc, SIGNAL(processExited(OProcess*) ),
309 this, SLOT(slotSignalStrengthExited( OProcess*) ) );
310 connect(sig_proc, SIGNAL(receivedStdout(OProcess*, char*, int) ),
311 this, SLOT(slotSignalStrengthOutput(OProcess*, char*, int) ) );
312 *sig_proc << "hcitool";
313 *sig_proc << "lq";
314 *sig_proc << mac;
315
316 sig_proc->setName( mac.latin1() );
317
318 if (!sig_proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
319 emit signalStrength( mac, "-1" );
320 delete sig_proc;
321 }
322}
323
324void Manager::slotSignalStrengthOutput(OProcess* proc, char* cha, int len) {
325 QCString str(cha, len );
326 QString temp = QString(str).stripWhiteSpace();
327 QStringList value = QStringList::split(' ', temp );
328 emit signalStrength( proc->name(), value[2].latin1() );
329}
330
331
332void Manager::slotSignalStrengthExited( OProcess* proc ) {
333 delete proc;
334}