Diffstat (limited to 'noncore/net/opietooth/lib/manager.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/lib/manager.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc index fcd21f6..177c94e 100644 --- a/noncore/net/opietooth/lib/manager.cc +++ b/noncore/net/opietooth/lib/manager.cc | |||
@@ -1,8 +1,11 @@ | |||
1 | |||
2 | |||
1 | #include <opie/oprocess.h> | 3 | #include <opie/oprocess.h> |
2 | 4 | ||
5 | #include "parser.h" | ||
3 | #include "manager.h" | 6 | #include "manager.h" |
4 | 7 | ||
5 | 8 | ||
6 | using namespace OpieTooth; | 9 | using namespace OpieTooth; |
7 | 10 | ||
8 | Manager::Manager( const QString& dev ) | 11 | Manager::Manager( const QString& dev ) |
@@ -10,13 +13,13 @@ Manager::Manager( const QString& dev ) | |||
10 | { | 13 | { |
11 | qWarning("created"); | 14 | qWarning("created"); |
12 | m_device = dev; | 15 | m_device = dev; |
13 | m_hcitool = 0; | 16 | m_hcitool = 0; |
14 | m_sdp = 0; | 17 | m_sdp = 0; |
15 | } | 18 | } |
16 | Manager::Manager( Device* dev ) | 19 | Manager::Manager( Device* /*dev*/ ) |
17 | : QObject() | 20 | : QObject() |
18 | { | 21 | { |
19 | m_hcitool = 0; | 22 | m_hcitool = 0; |
20 | m_sdp = 0; | 23 | m_sdp = 0; |
21 | } | 24 | } |
22 | Manager::Manager() | 25 | Manager::Manager() |
@@ -29,13 +32,13 @@ Manager::~Manager(){ | |||
29 | delete m_hcitool; | 32 | delete m_hcitool; |
30 | delete m_sdp; | 33 | delete m_sdp; |
31 | } | 34 | } |
32 | void Manager::setDevice( const QString& dev ){ | 35 | void Manager::setDevice( const QString& dev ){ |
33 | m_device = dev; | 36 | m_device = dev; |
34 | } | 37 | } |
35 | void Manager::setDevice( Device* dev ){ | 38 | void Manager::setDevice( Device* /*dev*/ ){ |
36 | 39 | ||
37 | } | 40 | } |
38 | void Manager::isAvailable( const QString& device ){ | 41 | void Manager::isAvailable( const QString& device ){ |
39 | OProcess* l2ping = new OProcess(); | 42 | OProcess* l2ping = new OProcess(); |
40 | l2ping->setName( device.latin1() ); | 43 | l2ping->setName( device.latin1() ); |
41 | *l2ping << "l2ping" << "-c1" << device; | 44 | *l2ping << "l2ping" << "-c1" << device; |
@@ -44,13 +47,14 @@ void Manager::isAvailable( const QString& device ){ | |||
44 | if (!l2ping->start() ) { | 47 | if (!l2ping->start() ) { |
45 | emit available( device, false ); | 48 | emit available( device, false ); |
46 | delete l2ping; | 49 | delete l2ping; |
47 | } | 50 | } |
48 | 51 | ||
49 | } | 52 | } |
50 | void Manager::isAvailable( Device* dev ){ | 53 | |
54 | void Manager::isAvailable( Device* /*dev*/ ){ | ||
51 | 55 | ||
52 | 56 | ||
53 | } | 57 | } |
54 | void Manager::searchDevices( const QString& device ){ | 58 | void Manager::searchDevices( const QString& device ){ |
55 | qWarning("search devices"); | 59 | qWarning("search devices"); |
56 | OProcess* hcitool = new OProcess(); | 60 | OProcess* hcitool = new OProcess(); |
@@ -65,13 +69,13 @@ void Manager::searchDevices( const QString& device ){ | |||
65 | RemoteDevice::ValueList list; | 69 | RemoteDevice::ValueList list; |
66 | emit foundDevices( device, list ); | 70 | emit foundDevices( device, list ); |
67 | delete hcitool; | 71 | delete hcitool; |
68 | } | 72 | } |
69 | } | 73 | } |
70 | 74 | ||
71 | void Manager::searchDevices(Device* d ){ | 75 | void Manager::searchDevices(Device* /*d*/ ){ |
72 | 76 | ||
73 | 77 | ||
74 | } | 78 | } |
75 | void Manager::addService(const QString& name ){ | 79 | void Manager::addService(const QString& name ){ |
76 | OProcess proc; | 80 | OProcess proc; |
77 | proc << "sdptool" << "add" << name; | 81 | proc << "sdptool" << "add" << name; |
@@ -112,17 +116,17 @@ void Manager::searchServices( const QString& remDevice ){ | |||
112 | emit foundServices( remDevice, list ); | 116 | emit foundServices( remDevice, list ); |
113 | } | 117 | } |
114 | } | 118 | } |
115 | void Manager::searchServices( const RemoteDevice& dev){ | 119 | void Manager::searchServices( const RemoteDevice& dev){ |
116 | searchServices( dev.mac() ); | 120 | searchServices( dev.mac() ); |
117 | } | 121 | } |
118 | QString Manager::toDevice( const QString& mac ){ | 122 | QString Manager::toDevice( const QString& /*mac*/ ){ |
119 | 123 | return QString::null; | |
120 | } | 124 | } |
121 | QString Manager::toMac( const QString &device ){ | 125 | QString Manager::toMac( const QString &/*device*/ ){ |
122 | 126 | return QString::null; | |
123 | } | 127 | } |
124 | void Manager::slotProcessExited(OProcess* proc ) { | 128 | void Manager::slotProcessExited(OProcess* proc ) { |
125 | bool conn= false; | 129 | bool conn= false; |
126 | if (proc->normalExit() && proc->exitStatus() == 0 ) | 130 | if (proc->normalExit() && proc->exitStatus() == 0 ) |
127 | conn = true; | 131 | conn = true; |
128 | 132 | ||
@@ -154,12 +158,14 @@ void Manager::slotSDPExited( OProcess* proc) | |||
154 | } | 158 | } |
155 | emit foundServices( proc->name(), list ); | 159 | emit foundServices( proc->name(), list ); |
156 | delete proc; | 160 | delete proc; |
157 | } | 161 | } |
158 | Services::ValueList Manager::parseSDPOutput( const QString& out ) { | 162 | Services::ValueList Manager::parseSDPOutput( const QString& out ) { |
159 | Services::ValueList list; | 163 | Services::ValueList list; |
164 | Parser parser( out ); | ||
165 | list = parser.services(); | ||
160 | return list; | 166 | return list; |
161 | } | 167 | } |
162 | 168 | ||
163 | void Manager::slotHCIExited(OProcess* proc ) { | 169 | void Manager::slotHCIExited(OProcess* proc ) { |
164 | qWarning("process exited"); | 170 | qWarning("process exited"); |
165 | RemoteDevice::ValueList list; | 171 | RemoteDevice::ValueList list; |