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.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc
index c89d325..56156a8 100644
--- a/noncore/net/opietooth/lib/manager.cc
+++ b/noncore/net/opietooth/lib/manager.cc
@@ -1,16 +1,18 @@
1 1
2 2
3#include <opie/oprocess.h> 3#include <opie2/oprocess.h>
4 4
5#include "parser.h" 5#include "parser.h"
6#include "manager.h" 6#include "manager.h"
7 7
8 8
9using namespace OpieTooth; 9using namespace OpieTooth;
10 10
11using namespace Opie::Core;
12using namespace Opie::Core;
11Manager::Manager( const QString& dev ) 13Manager::Manager( const QString& dev )
12 : QObject() 14 : QObject()
13{ 15{
14 qWarning("created"); 16 qWarning("created");
15 m_device = dev; 17 m_device = dev;
16 m_hcitool = 0; 18 m_hcitool = 0;
@@ -39,13 +41,13 @@ void Manager::setDevice( Device* /*dev*/ ){
39 41
40} 42}
41void Manager::isAvailable( const QString& device ){ 43void Manager::isAvailable( const QString& device ){
42 OProcess* l2ping = new OProcess(); 44 OProcess* l2ping = new OProcess();
43 l2ping->setName( device.latin1() ); 45 l2ping->setName( device.latin1() );
44 *l2ping << "l2ping" << "-c1" << device; 46 *l2ping << "l2ping" << "-c1" << device;
45 connect(l2ping, SIGNAL(processExited(OProcess* ) ), 47 connect(l2ping, SIGNAL(processExited(Opie::Core::OProcess* ) ),
46 this, SLOT(slotProcessExited(OProcess*) ) ); 48 this, SLOT(slotProcessExited(OProcess*) ) );
47 if (!l2ping->start() ) { 49 if (!l2ping->start() ) {
48 emit available( device, false ); 50 emit available( device, false );
49 delete l2ping; 51 delete l2ping;
50 } 52 }
51 53
@@ -57,15 +59,15 @@ void Manager::isAvailable( Device* /*dev*/ ){
57} 59}
58void Manager::searchDevices( const QString& device ){ 60void Manager::searchDevices( const QString& device ){
59 qWarning("search devices"); 61 qWarning("search devices");
60 OProcess* hcitool = new OProcess(); 62 OProcess* hcitool = new OProcess();
61 hcitool->setName( device.isEmpty() ? "hci0" : device.latin1() ); 63 hcitool->setName( device.isEmpty() ? "hci0" : device.latin1() );
62 *hcitool << "hcitool" << "scan"; 64 *hcitool << "hcitool" << "scan";
63 connect( hcitool, SIGNAL(processExited(OProcess*) ) , 65 connect( hcitool, SIGNAL(processExited(Opie::Core::OProcess*) ) ,
64 this, SLOT(slotHCIExited(OProcess* ) ) ); 66 this, SLOT(slotHCIExited(OProcess* ) ) );
65 connect( hcitool, SIGNAL(receivedStdout(OProcess*, char*, int ) ), 67 connect( hcitool, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ),
66 this, SLOT(slotHCIOut(OProcess*, char*, int ) ) ); 68 this, SLOT(slotHCIOut(OProcess*, char*, int ) ) );
67 if (!hcitool->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 69 if (!hcitool->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
68 qWarning("could not start"); 70 qWarning("could not start");
69 RemoteDevice::ValueList list; 71 RemoteDevice::ValueList list;
70 emit foundDevices( device, list ); 72 emit foundDevices( device, list );
71 delete hcitool; 73 delete hcitool;
@@ -104,15 +106,15 @@ void Manager::removeServices( const QStringList& list){
104} 106}
105void Manager::searchServices( const QString& remDevice ){ 107void Manager::searchServices( const QString& remDevice ){
106 OProcess *m_sdp =new OProcess(); 108 OProcess *m_sdp =new OProcess();
107 *m_sdp << "sdptool" << "browse" << remDevice; 109 *m_sdp << "sdptool" << "browse" << remDevice;
108 m_sdp->setName( remDevice.latin1() ); 110 m_sdp->setName( remDevice.latin1() );
109 qWarning("search Services for %s", remDevice.latin1() ); 111 qWarning("search Services for %s", remDevice.latin1() );
110 connect(m_sdp, SIGNAL(processExited(OProcess*) ), 112 connect(m_sdp, SIGNAL(processExited(Opie::Core::OProcess*) ),
111 this, SLOT(slotSDPExited(OProcess* ) ) ); 113 this, SLOT(slotSDPExited(OProcess* ) ) );
112 connect(m_sdp, SIGNAL(receivedStdout(OProcess*, char*, int ) ), 114 connect(m_sdp, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ),
113 this, SLOT(slotSDPOut(OProcess*, char*, int) ) ); 115 this, SLOT(slotSDPOut(OProcess*, char*, int) ) );
114 if (!m_sdp->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 116 if (!m_sdp->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
115 qWarning("could not start sdptool" ); 117 qWarning("could not start sdptool" );
116 delete m_sdp; 118 delete m_sdp;
117 Services::ValueList list; 119 Services::ValueList list;
118 emit foundServices( remDevice, list ); 120 emit foundServices( remDevice, list );
@@ -243,15 +245,15 @@ void Manager::connectTo( const QString& mac) {
243 245
244void Manager::searchConnections() { 246void Manager::searchConnections() {
245 qWarning("searching connections?"); 247 qWarning("searching connections?");
246 OProcess* proc = new OProcess(); 248 OProcess* proc = new OProcess();
247 m_hcitoolCon = QString::null; 249 m_hcitoolCon = QString::null;
248 250
249 connect(proc, SIGNAL(processExited(OProcess*) ), 251 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*) ),
250 this, SLOT(slotConnectionExited( OProcess*) ) ); 252 this, SLOT(slotConnectionExited( OProcess*) ) );
251 connect(proc, SIGNAL(receivedStdout(OProcess*, char*, int) ), 253 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int) ),
252 this, SLOT(slotConnectionOutput(OProcess*, char*, int) ) ); 254 this, SLOT(slotConnectionOutput(OProcess*, char*, int) ) );
253 *proc << "hcitool"; 255 *proc << "hcitool";
254 *proc << "con"; 256 *proc << "con";
255 257
256 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 258 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
257 ConnectionState::ValueList list; 259 ConnectionState::ValueList list;
@@ -302,15 +304,15 @@ ConnectionState::ValueList Manager::parseConnections( const QString& out ) {
302} 304}
303 305
304void Manager::signalStrength( const QString &mac ) { 306void Manager::signalStrength( const QString &mac ) {
305 307
306 OProcess* sig_proc = new OProcess(); 308 OProcess* sig_proc = new OProcess();
307 309
308 connect(sig_proc, SIGNAL(processExited(OProcess*) ), 310 connect(sig_proc, SIGNAL(processExited(Opie::Core::OProcess*) ),
309 this, SLOT(slotSignalStrengthExited( OProcess*) ) ); 311 this, SLOT(slotSignalStrengthExited( OProcess*) ) );
310 connect(sig_proc, SIGNAL(receivedStdout(OProcess*, char*, int) ), 312 connect(sig_proc, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int) ),
311 this, SLOT(slotSignalStrengthOutput(OProcess*, char*, int) ) ); 313 this, SLOT(slotSignalStrengthOutput(OProcess*, char*, int) ) );
312 *sig_proc << "hcitool"; 314 *sig_proc << "hcitool";
313 *sig_proc << "lq"; 315 *sig_proc << "lq";
314 *sig_proc << mac; 316 *sig_proc << mac;
315 317
316 sig_proc->setName( mac.latin1() ); 318 sig_proc->setName( mac.latin1() );