summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/opietooth2/OTGateway.h
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/OTGateway.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTGateway.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/OTGateway.h b/noncore/settings/networksettings2/opietooth2/OTGateway.h
index 11c6b30..d0e42db 100644
--- a/noncore/settings/networksettings2/opietooth2/OTGateway.h
+++ b/noncore/settings/networksettings2/opietooth2/OTGateway.h
@@ -8,55 +8,55 @@
8#include <OTDriverList.h> 8#include <OTDriverList.h>
9#include <OTInquiry.h> 9#include <OTInquiry.h>
10 10
11class QPixmap; 11class QPixmap;
12 12
13namespace Opietooth2 { 13namespace Opietooth2 {
14 14
15class OTDriverList; 15class OTDriverList;
16class OTDriver; 16class OTDriver;
17class OTDevice; 17class OTDevice;
18class OTPeer; 18class OTPeer;
19class OTInquiry; 19class OTInquiry;
20class OTPANConnection; 20class OTPANNetworkSetup;
21class OTLinkKey; 21class OTLinkKey;
22 22
23typedef QVector<OTPeer> PeerVector; 23typedef QVector<OTPeer> PeerVector;
24typedef QVector<OTPANConnection> PANConnectionVector; 24typedef QVector<OTPANNetworkSetup> PANNetworkSetupVector;
25typedef QArray<OTLinkKey> LinkKeyArray; 25typedef QArray<OTLinkKey> LinkKeyArray;
26 26
27class OTLinkKey { 27class OTLinkKey {
28 28
29public : 29public :
30 30
31 OTLinkKey( const OTDeviceAddress & F, 31 OTLinkKey( const OTDeviceAddress & F,
32 const OTDeviceAddress & T ) { 32 const OTDeviceAddress & T ) {
33 From = F; 33 From = F;
34 To = T; 34 To = T;
35 } 35 }
36 36
37 const OTDeviceAddress & to() 37 const OTDeviceAddress & to()
38 { return To; } 38 { return To; }
39 const OTDeviceAddress & from() 39 const OTDeviceAddress & from()
40 { return From; } 40 { return From; }
41 41
42 OTDeviceAddress From; 42 OTDeviceAddress From;
43 OTDeviceAddress To; 43 OTDeviceAddress To;
44}; 44};
45 45
46class OTPANConnection { 46class OTPANNetworkSetup {
47 47
48public : 48public :
49 49
50 OTPANConnection( const QString & Dev, const QString & CT ) { 50 OTPANNetworkSetup( const QString & Dev, const QString & CT ) {
51 Device = Dev; 51 Device = Dev;
52 ConnectedTo = CT; 52 ConnectedTo = CT;
53 } 53 }
54 54
55 QString Device; 55 QString Device;
56 QString ConnectedTo; 56 QString ConnectedTo;
57}; 57};
58 58
59 59
60class OTGateway : public QObject { 60class OTGateway : public QObject {
61 61
62 Q_OBJECT 62 Q_OBJECT
@@ -83,25 +83,25 @@ public :
83 bool isEnabled(); 83 bool isEnabled();
84 void setRefreshTimer( int MilleSecs ); 84 void setRefreshTimer( int MilleSecs );
85 // return socket to HCI raw layer 85 // return socket to HCI raw layer
86 inline int getSocket() 86 inline int getSocket()
87 { return HciCtl; } 87 { return HciCtl; }
88 88
89 OTDriverList & getDriverList() 89 OTDriverList & getDriverList()
90 { return AllDrivers; } 90 { return AllDrivers; }
91 OTDriver * driver( int nr ) 91 OTDriver * driver( int nr )
92 { return AllDrivers.count() == 0 ? 0 : AllDrivers[nr]; } 92 { return AllDrivers.count() == 0 ? 0 : AllDrivers[nr]; }
93 void updateDrivers(); 93 void updateDrivers();
94 94
95 PANConnectionVector getPANConnections(); 95 PANNetworkSetupVector getPANNetworkSetups();
96 96
97 // scan neighbourhood using device 97 // scan neighbourhood using device
98 void scanNeighbourhood( OTDriver * D = 0 ); 98 void scanNeighbourhood( OTDriver * D = 0 );
99 void stopScanOfNeighbourhood(void ); 99 void stopScanOfNeighbourhood(void );
100 void setScanWith( OTDriver * D = 0 ) 100 void setScanWith( OTDriver * D = 0 )
101 { ScanWith = (D) ? D : 101 { ScanWith = (D) ? D :
102 (AllDrivers.count() ) ? AllDrivers[0] : 0; } 102 (AllDrivers.count() ) ? AllDrivers[0] : 0; }
103 OTDriver * scanWith( void ) 103 OTDriver * scanWith( void )
104 { return ScanWith; } 104 { return ScanWith; }
105 105
106 // get list of all detected peers 106 // get list of all detected peers
107 inline const PeerVector & peers( void ) 107 inline const PeerVector & peers( void )
@@ -164,25 +164,25 @@ signals :
164 // end of detection process 164 // end of detection process
165 void finishedDetecting(); 165 void finishedDetecting();
166 166
167protected : 167protected :
168 168
169 void connectNotify( const char * Signal ); 169 void connectNotify( const char * Signal );
170 void disconnectNotify( const char * Signal ); 170 void disconnectNotify( const char * Signal );
171 171
172 void timerEvent( QTimerEvent * ); 172 void timerEvent( QTimerEvent * );
173 173
174private : 174private :
175 175
176 void loadActiveConnections( void ); 176 void loadActiveNetworkSetups( void );
177 void loadKnownPeers( void ); 177 void loadKnownPeers( void );
178 void saveKnownPeers( void ); 178 void saveKnownPeers( void );
179 bool isConnectedTo( int devid, 179 bool isConnectedTo( int devid,
180 const OTDeviceAddress & Address ); 180 const OTDeviceAddress & Address );
181 181
182 void readLinkKeys(); 182 void readLinkKeys();
183 183
184 static OTGateway * SingleGateway; 184 static OTGateway * SingleGateway;
185 static int UseCount; 185 static int UseCount;
186 186
187 OTDriver * ScanWith; 187 OTDriver * ScanWith;
188 OTDriverList AllDrivers; 188 OTDriverList AllDrivers;