summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/lib
Unidiff
Diffstat (limited to 'noncore/net/opietooth/lib') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/connection.cpp32
-rw-r--r--noncore/net/opietooth/lib/connection.h16
-rw-r--r--noncore/net/opietooth/lib/manager.cc10
-rw-r--r--noncore/net/opietooth/lib/manager.h4
4 files changed, 31 insertions, 31 deletions
diff --git a/noncore/net/opietooth/lib/connection.cpp b/noncore/net/opietooth/lib/connection.cpp
index 1f9baaf..ef7d925 100644
--- a/noncore/net/opietooth/lib/connection.cpp
+++ b/noncore/net/opietooth/lib/connection.cpp
@@ -3,19 +3,19 @@
3 3
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6Connection::Connection() { 6ConnectionState::ConnectionState() {
7 m_direction = Incoming; 7 m_direction = Incoming;
8 m_handle = -1; 8 m_handle = -1;
9 m_state = -1; 9 m_state = -1;
10 m_linkMode = -1; 10 m_linkMode = -1;
11}; 11};
12 12
13Connection::Connection( const Connection& con1 ) { 13ConnectionState::ConnectionState( const ConnectionState& con1 ) {
14 (*this) = con1; 14 (*this) = con1;
15} 15}
16 16
17 17
18Connection::Connection( bool in, 18ConnectionState::ConnectionState( bool in,
19 const QString& conType, 19 const QString& conType,
20 const QString& mac, 20 const QString& mac,
21 int handle, 21 int handle,
@@ -30,55 +30,55 @@ Connection::Connection( bool in,
30 30
31} 31}
32 32
33void Connection::setDirection( bool incoming ) { 33void ConnectionState::setDirection( bool incoming ) {
34 m_direction = incoming; 34 m_direction = incoming;
35} 35}
36 36
37bool Connection::direction() const { 37bool ConnectionState::direction() const {
38 return m_direction; 38 return m_direction;
39} 39}
40 40
41void Connection::setConnectionMode( const QString& conType ) { 41void ConnectionState::setConnectionMode( const QString& conType ) {
42 m_contype = conType; 42 m_contype = conType;
43} 43}
44 44
45QString Connection::connectionMode() const { 45QString ConnectionState::connectionMode() const {
46 return m_contype; 46 return m_contype;
47} 47}
48 48
49void Connection::setMac( const QString& mac ) { 49void ConnectionState::setMac( const QString& mac ) {
50 m_mac = mac; 50 m_mac = mac;
51} 51}
52 52
53QString Connection::mac() const{ 53QString ConnectionState::mac() const{
54 return m_mac; 54 return m_mac;
55} 55}
56 56
57void Connection::setHandle( int handle ) { 57void ConnectionState::setHandle( int handle ) {
58 m_handle = handle; 58 m_handle = handle;
59} 59}
60 60
61int Connection::handle() const{ 61int ConnectionState::handle() const{
62 return m_handle; 62 return m_handle;
63} 63}
64 64
65void Connection::setState( int state ) { 65void ConnectionState::setState( int state ) {
66 m_state = state; 66 m_state = state;
67} 67}
68 68
69int Connection::state()const { 69int ConnectionState::state()const {
70 return m_state; 70 return m_state;
71} 71}
72 72
73void Connection::setLinkMode( int linkMode ) { 73void ConnectionState::setLinkMode( int linkMode ) {
74 m_linkMode = linkMode; 74 m_linkMode = linkMode;
75} 75}
76 76
77int Connection::linkMode()const{ 77int ConnectionState::linkMode()const{
78 return m_linkMode; 78 return m_linkMode;
79} 79}
80 80
81Connection &Connection::operator=( const Connection& con1 ) { 81ConnectionState &ConnectionState::operator=( const ConnectionState& con1 ) {
82 m_direction = con1.m_direction; 82 m_direction = con1.m_direction;
83 m_contype = con1.m_contype; 83 m_contype = con1.m_contype;
84 m_mac = con1.m_mac; 84 m_mac = con1.m_mac;
diff --git a/noncore/net/opietooth/lib/connection.h b/noncore/net/opietooth/lib/connection.h
index 37090ce..76e5dad 100644
--- a/noncore/net/opietooth/lib/connection.h
+++ b/noncore/net/opietooth/lib/connection.h
@@ -17,18 +17,18 @@ namespace OpieTooth {
17 * in a OO way 17 * in a OO way
18 */ 18 */
19 19
20 class Connection { 20 class ConnectionState {
21 public: 21 public:
22 /** 22 /**
23 * typedef for a list of 23 * typedef for a list of
24 * Connections 24 * Connections
25 */ 25 */
26 typedef QValueList<Connection> ValueList; 26 typedef QValueList<ConnectionState> ValueList;
27 27
28 /** 28 /**
29 * Copy c'tor. 29 * Copy c'tor.
30 */ 30 */
31 Connection( const Connection& ); 31 ConnectionState( const ConnectionState& );
32 32
33 /** 33 /**
34 * Main c'tor 34 * Main c'tor
@@ -44,7 +44,7 @@ namespace OpieTooth {
44 * < ACL 00:02:C7:09:2B:53 handle 1 state 1 lm MASTER 44 * < ACL 00:02:C7:09:2B:53 handle 1 state 1 lm MASTER
45 * 45 *
46 */ 46 */
47 Connection( bool in, 47 ConnectionState( bool in,
48 const QString& conType, 48 const QString& conType,
49 const QString& mac, 49 const QString& mac,
50 int handle, 50 int handle,
@@ -55,7 +55,7 @@ namespace OpieTooth {
55 * C'tor for compability with QValueList 55 * C'tor for compability with QValueList
56 * QValueList needs this c'tor. 56 * QValueList needs this c'tor.
57 */ 57 */
58 Connection(); 58 ConnectionState();
59 59
60 /** 60 /**
61 * Set if the connection is incoming or 61 * Set if the connection is incoming or
@@ -131,11 +131,11 @@ namespace OpieTooth {
131 /** 131 /**
132 * copy c'tor 132 * copy c'tor
133 */ 133 */
134 Connection &operator=( const Connection& ); 134 ConnectionState &operator=( const ConnectionState& );
135 135
136 private: 136 private:
137 class ConnectionPrivate; 137 class ConnectionStatePrivate;
138 ConnectionPrivate *d; 138 ConnectionStatePrivate *d;
139 bool m_direction : 1; 139 bool m_direction : 1;
140 QString m_contype; 140 QString m_contype;
141 QString m_mac; 141 QString m_mac;
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc
index e07f9da..1281116 100644
--- a/noncore/net/opietooth/lib/manager.cc
+++ b/noncore/net/opietooth/lib/manager.cc
@@ -254,14 +254,14 @@ void Manager::searchConnections() {
254 *proc << "con"; 254 *proc << "con";
255 255
256 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 256 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
257 Connection::ValueList list; 257 ConnectionState::ValueList list;
258 emit connections( list ); 258 emit connections( list );
259 delete proc; 259 delete proc;
260 } 260 }
261} 261}
262void Manager::slotConnectionExited( OProcess* /*proc*/ ) { 262void Manager::slotConnectionExited( OProcess* /*proc*/ ) {
263 qWarning("exited"); 263 qWarning("exited");
264 Connection::ValueList list; 264 ConnectionState::ValueList list;
265 list = parseConnections( m_hcitoolCon ); 265 list = parseConnections( m_hcitoolCon );
266 emit connections(list ); 266 emit connections(list );
267} 267}
@@ -270,8 +270,8 @@ void Manager::slotConnectionOutput(OProcess* proc, char* cha, int len) {
270 m_hcitoolCon.append( str ); 270 m_hcitoolCon.append( str );
271 delete proc; 271 delete proc;
272} 272}
273Connection::ValueList Manager::parseConnections( const QString& out ) { 273ConnectionState::ValueList Manager::parseConnections( const QString& out ) {
274 Connection::ValueList list2; 274 ConnectionState::ValueList list2;
275 QStringList list = QStringList::split('\n', out ); 275 QStringList list = QStringList::split('\n', out );
276 QStringList::Iterator it; 276 QStringList::Iterator it;
277 for (it = list.begin(); it != list.end(); ++it ) { 277 for (it = list.begin(); it != list.end(); ++it ) {
@@ -286,7 +286,7 @@ Connection::ValueList Manager::parseConnections( const QString& out ) {
286 qWarning("6: %s", value[6].latin1() ); 286 qWarning("6: %s", value[6].latin1() );
287 qWarning("7: %s", value[7].latin1() ); 287 qWarning("7: %s", value[7].latin1() );
288 qWarning("8: %s", value[8].latin1() ); 288 qWarning("8: %s", value[8].latin1() );
289 Connection con; 289 ConnectionState con;
290 con.setDirection( value[0] == QString::fromLatin1("<") ? Outgoing : Incoming ); 290 con.setDirection( value[0] == QString::fromLatin1("<") ? Outgoing : Incoming );
291 con.setConnectionMode( value[1] ); 291 con.setConnectionMode( value[1] );
292 con.setMac( value[2] ); 292 con.setMac( value[2] );
diff --git a/noncore/net/opietooth/lib/manager.h b/noncore/net/opietooth/lib/manager.h
index b32327c..0ebe1b3 100644
--- a/noncore/net/opietooth/lib/manager.h
+++ b/noncore/net/opietooth/lib/manager.h
@@ -137,7 +137,7 @@ namespace OpieTooth {
137 void removedService( const QString& service, bool removed ); 137 void removedService( const QString& service, bool removed );
138 void foundServices( const QString& device, Services::ValueList ); 138 void foundServices( const QString& device, Services::ValueList );
139 void foundDevices( const QString& device, RemoteDevice::ValueList ); 139 void foundDevices( const QString& device, RemoteDevice::ValueList );
140 void connections( Connection::ValueList ); 140 void connections( ConnectionState::ValueList );
141 141
142private slots: 142private slots:
143 void slotProcessExited(OProcess* ); 143 void slotProcessExited(OProcess* );
@@ -153,7 +153,7 @@ private slots:
153 private: 153 private:
154 Services::ValueList parseSDPOutput( const QString& ); 154 Services::ValueList parseSDPOutput( const QString& );
155 RemoteDevice::ValueList parseHCIOutput( const QString& ); 155 RemoteDevice::ValueList parseHCIOutput( const QString& );
156 Connection::ValueList parseConnections( const QString& ); 156 ConnectionState::ValueList parseConnections( const QString& );
157 OProcess *m_hcitool; 157 OProcess *m_hcitool;
158 OProcess *m_sdp; // not only one 158 OProcess *m_sdp; // not only one
159 QString m_device; 159 QString m_device;