Diffstat (limited to 'noncore/settings/networksettings2/opietooth2') (more/less context) (ignore whitespace changes)
5 files changed, 21 insertions, 21 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/OTDriver.cpp b/noncore/settings/networksettings2/opietooth2/OTDriver.cpp index a7ee662..cfd0491 100644 --- a/noncore/settings/networksettings2/opietooth2/OTDriver.cpp +++ b/noncore/settings/networksettings2/opietooth2/OTDriver.cpp | |||
@@ -710,13 +710,13 @@ long OTDriver::getLinkQuality( const OTDeviceAddress & Addr ) { | |||
710 | return 0; | 710 | return 0; |
711 | 711 | ||
712 | bacpy( &(cr->bdaddr), &(Addr.getBDAddr()) ); | 712 | bacpy( &(cr->bdaddr), &(Addr.getBDAddr()) ); |
713 | cr->type = ACL_LINK; | 713 | cr->type = ACL_LINK; |
714 | 714 | ||
715 | if (ioctl( fd(), HCIGETCONNINFO, (unsigned long) cr) < 0) { | 715 | if (ioctl( fd(), HCIGETCONNINFO, (unsigned long) cr) < 0) { |
716 | odebug << "Get connection info failed" << oendl; | 716 | odebug << "Get NetworkSetup info failed" << oendl; |
717 | free(cr); | 717 | free(cr); |
718 | return 0; | 718 | return 0; |
719 | } | 719 | } |
720 | 720 | ||
721 | handle = htobs(cr->conn_info->handle); | 721 | handle = htobs(cr->conn_info->handle); |
722 | 722 | ||
@@ -728,13 +728,13 @@ long OTDriver::getLinkQuality( const OTDeviceAddress & Addr ) { | |||
728 | rq.cparam = &handle; | 728 | rq.cparam = &handle; |
729 | rq.clen = 2; | 729 | rq.clen = 2; |
730 | rq.rparam = &rp; | 730 | rq.rparam = &rp; |
731 | rq.rlen = GET_LINK_QUALITY_RP_SIZE; | 731 | rq.rlen = GET_LINK_QUALITY_RP_SIZE; |
732 | 732 | ||
733 | if (hci_send_req( fd(), &rq, 100) < 0) { | 733 | if (hci_send_req( fd(), &rq, 100) < 0) { |
734 | odebug << "Get connection info failed" << oendl; | 734 | odebug << "Get NetworkSetup info failed" << oendl; |
735 | return 0; | 735 | return 0; |
736 | } | 736 | } |
737 | 737 | ||
738 | if( rp.status ) { | 738 | if( rp.status ) { |
739 | odebug << QString().sprintf("HCI get_link_quality cmd failed (0x%2.2X)", rp.status) << oendl; | 739 | odebug << QString().sprintf("HCI get_link_quality cmd failed (0x%2.2X)", rp.status) << oendl; |
740 | return 0; | 740 | return 0; |
diff --git a/noncore/settings/networksettings2/opietooth2/OTDriver.h b/noncore/settings/networksettings2/opietooth2/OTDriver.h index b54ffdf..899fab4 100644 --- a/noncore/settings/networksettings2/opietooth2/OTDriver.h +++ b/noncore/settings/networksettings2/opietooth2/OTDriver.h | |||
@@ -9,13 +9,13 @@ | |||
9 | ***************************************************************************/ | 9 | ***************************************************************************/ |
10 | 10 | ||
11 | #ifndef OTDRIVER_H | 11 | #ifndef OTDRIVER_H |
12 | #define OTDRIVER_H | 12 | #define OTDRIVER_H |
13 | 13 | ||
14 | /* | 14 | /* |
15 | * This class handles the connection with the BlueZ libraries, implements | 15 | * This class handles the networkSetup with the BlueZ libraries, implements |
16 | * most of the bluetooth-related functions and owns the KBTDevice class | 16 | * most of the bluetooth-related functions and owns the KBTDevice class |
17 | * that is a single local bluetooth device representation. | 17 | * that is a single local bluetooth device representation. |
18 | * It is used as a Singleton pattern thru the getDefaultConnector() method. | 18 | * It is used as a Singleton pattern thru the getDefaultConnector() method. |
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | #include <qobject.h> | 21 | #include <qobject.h> |
@@ -115,13 +115,13 @@ public: | |||
115 | */ | 115 | */ |
116 | QString devname() | 116 | QString devname() |
117 | { return Dev; }; | 117 | { return Dev; }; |
118 | 118 | ||
119 | /* | 119 | /* |
120 | * Returns the file descriptor for the local | 120 | * Returns the file descriptor for the local |
121 | * connection to this device | 121 | * networkSetup to this device |
122 | */ | 122 | */ |
123 | int fd() const | 123 | int fd() const |
124 | { return Fd; }; | 124 | { return Fd; }; |
125 | void setfd(int _fd) | 125 | void setfd(int _fd) |
126 | { Fd = _fd; }; | 126 | { Fd = _fd; }; |
127 | 127 | ||
diff --git a/noncore/settings/networksettings2/opietooth2/OTGateway.cpp b/noncore/settings/networksettings2/opietooth2/OTGateway.cpp index 1b61a2e..7fc8719 100644 --- a/noncore/settings/networksettings2/opietooth2/OTGateway.cpp +++ b/noncore/settings/networksettings2/opietooth2/OTGateway.cpp | |||
@@ -59,15 +59,15 @@ OTGateway::OTGateway( void ) : QObject( 0, "OTGateway" ), | |||
59 | // load all known devices | 59 | // load all known devices |
60 | updateDrivers(); | 60 | updateDrivers(); |
61 | 61 | ||
62 | // load all peers we have ever seen | 62 | // load all peers we have ever seen |
63 | loadKnownPeers(); | 63 | loadKnownPeers(); |
64 | 64 | ||
65 | // iterate over drivers and find active connections | 65 | // iterate over drivers and find active NetworkSetups |
66 | // adding/updating peers | 66 | // adding/updating peers |
67 | loadActiveConnections(); | 67 | loadActiveNetworkSetups(); |
68 | 68 | ||
69 | // check every 4 seconds the state of BT | 69 | // check every 4 seconds the state of BT |
70 | timerEvent(0); | 70 | timerEvent(0); |
71 | RefreshTimer = -1; | 71 | RefreshTimer = -1; |
72 | setRefreshTimer( 4000 ); | 72 | setRefreshTimer( 4000 ); |
73 | 73 | ||
@@ -372,14 +372,14 @@ const char * OTGateway::deviceTypeToName( int cls ) { | |||
372 | default : | 372 | default : |
373 | break; | 373 | break; |
374 | } | 374 | } |
375 | return "unknown"; | 375 | return "unknown"; |
376 | } | 376 | } |
377 | 377 | ||
378 | PANConnectionVector OTGateway::getPANConnections( void ) { | 378 | PANNetworkSetupVector OTGateway::getPANNetworkSetups( void ) { |
379 | PANConnectionVector V; | 379 | PANNetworkSetupVector V; |
380 | 380 | ||
381 | struct bnep_connlist_req req; | 381 | struct bnep_connlist_req req; |
382 | struct bnep_conninfo ci[48]; | 382 | struct bnep_conninfo ci[48]; |
383 | 383 | ||
384 | V.setAutoDelete(TRUE); | 384 | V.setAutoDelete(TRUE); |
385 | 385 | ||
@@ -389,22 +389,22 @@ PANConnectionVector OTGateway::getPANConnections( void ) { | |||
389 | return V; | 389 | return V; |
390 | } | 390 | } |
391 | 391 | ||
392 | req.cnum = 48; | 392 | req.cnum = 48; |
393 | req.ci = ci; | 393 | req.ci = ci; |
394 | if (ioctl(ctl, BNEPGETCONNLIST, &req)) { | 394 | if (ioctl(ctl, BNEPGETCONNLIST, &req)) { |
395 | odebug << "Failed to get connection list" << oendl; | 395 | odebug << "Failed to get NetworkSetup list" << oendl; |
396 | ::close( ctl ); | 396 | ::close( ctl ); |
397 | return V; | 397 | return V; |
398 | } | 398 | } |
399 | 399 | ||
400 | for ( unsigned i=0; i < req.cnum; i++) { | 400 | for ( unsigned i=0; i < req.cnum; i++) { |
401 | V.resize( V.size() + 1 ); | 401 | V.resize( V.size() + 1 ); |
402 | if( ci[i].role == BNEP_SVC_PANU ) { | 402 | if( ci[i].role == BNEP_SVC_PANU ) { |
403 | // we are the client | 403 | // we are the client |
404 | V.insert( V.size()-1, new OTPANConnection( | 404 | V.insert( V.size()-1, new OTPANNetworkSetup( |
405 | ci[i].device, | 405 | ci[i].device, |
406 | batostr((bdaddr_t *) ci[i].dst) | 406 | batostr((bdaddr_t *) ci[i].dst) |
407 | ) ); | 407 | ) ); |
408 | } | 408 | } |
409 | } | 409 | } |
410 | 410 | ||
@@ -507,13 +507,13 @@ bool OTGateway::removeLinkKey( unsigned int Index ) { | |||
507 | AllKeys.resize( AllKeys.size()-1 ); | 507 | AllKeys.resize( AllKeys.size()-1 ); |
508 | 508 | ||
509 | return 1; | 509 | return 1; |
510 | } | 510 | } |
511 | 511 | ||
512 | #define MAXCONNECTIONS 10 | 512 | #define MAXCONNECTIONS 10 |
513 | void OTGateway::loadActiveConnections( void ) { | 513 | void OTGateway::loadActiveNetworkSetups( void ) { |
514 | 514 | ||
515 | struct hci_conn_list_req *cl; | 515 | struct hci_conn_list_req *cl; |
516 | struct hci_conn_info *ci; | 516 | struct hci_conn_info *ci; |
517 | OTDeviceAddress Addr; | 517 | OTDeviceAddress Addr; |
518 | OTPeer * P; | 518 | OTPeer * P; |
519 | 519 | ||
@@ -529,19 +529,19 @@ void OTGateway::loadActiveConnections( void ) { | |||
529 | i ++ ) { | 529 | i ++ ) { |
530 | 530 | ||
531 | if( ! AllDrivers[i]->isUp() ) { | 531 | if( ! AllDrivers[i]->isUp() ) { |
532 | continue; | 532 | continue; |
533 | } | 533 | } |
534 | 534 | ||
535 | // driver is up -> check connections | 535 | // driver is up -> check NetworkSetups |
536 | cl->dev_id = AllDrivers[i]->devId(); | 536 | cl->dev_id = AllDrivers[i]->devId(); |
537 | cl->conn_num = MAXCONNECTIONS; | 537 | cl->conn_num = MAXCONNECTIONS; |
538 | ci = cl->conn_info; | 538 | ci = cl->conn_info; |
539 | 539 | ||
540 | if (ioctl( getSocket(), HCIGETCONNLIST, (void *) cl)) { | 540 | if (ioctl( getSocket(), HCIGETCONNLIST, (void *) cl)) { |
541 | emit error( tr("Can't get connection list") ); | 541 | emit error( tr("Can't get NetworkSetup list") ); |
542 | break; | 542 | break; |
543 | } | 543 | } |
544 | 544 | ||
545 | for ( int k = 0; k < cl->conn_num; k++, ci++) { | 545 | for ( int k = 0; k < cl->conn_num; k++, ci++) { |
546 | 546 | ||
547 | if( ci->state != BT_CONNECTED ) { | 547 | if( ci->state != BT_CONNECTED ) { |
@@ -750,13 +750,13 @@ int OTGateway::releaseRFCommDevice( int devnr ) { | |||
750 | return 0; | 750 | return 0; |
751 | } | 751 | } |
752 | 752 | ||
753 | dr = di; | 753 | dr = di; |
754 | for (i = 0; i < dl->dev_num; i++, dr++) { | 754 | for (i = 0; i < dl->dev_num; i++, dr++) { |
755 | if( dr->id == devnr ) { | 755 | if( dr->id == devnr ) { |
756 | // still in connection list | 756 | // still in NetworkSetup list |
757 | struct rfcomm_dev_req req; | 757 | struct rfcomm_dev_req req; |
758 | int err; | 758 | int err; |
759 | 759 | ||
760 | memset(&req, 0, sizeof(req)); | 760 | memset(&req, 0, sizeof(req)); |
761 | req.dev_id = devnr; | 761 | req.dev_id = devnr; |
762 | 762 | ||
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 | |||
@@ -14,17 +14,17 @@ namespace Opietooth2 { | |||
14 | 14 | ||
15 | class OTDriverList; | 15 | class OTDriverList; |
16 | class OTDriver; | 16 | class OTDriver; |
17 | class OTDevice; | 17 | class OTDevice; |
18 | class OTPeer; | 18 | class OTPeer; |
19 | class OTInquiry; | 19 | class OTInquiry; |
20 | class OTPANConnection; | 20 | class OTPANNetworkSetup; |
21 | class OTLinkKey; | 21 | class OTLinkKey; |
22 | 22 | ||
23 | typedef QVector<OTPeer> PeerVector; | 23 | typedef QVector<OTPeer> PeerVector; |
24 | typedef QVector<OTPANConnection> PANConnectionVector; | 24 | typedef QVector<OTPANNetworkSetup> PANNetworkSetupVector; |
25 | typedef QArray<OTLinkKey> LinkKeyArray; | 25 | typedef QArray<OTLinkKey> LinkKeyArray; |
26 | 26 | ||
27 | class OTLinkKey { | 27 | class OTLinkKey { |
28 | 28 | ||
29 | public : | 29 | public : |
30 | 30 | ||
@@ -40,17 +40,17 @@ public : | |||
40 | { return From; } | 40 | { return From; } |
41 | 41 | ||
42 | OTDeviceAddress From; | 42 | OTDeviceAddress From; |
43 | OTDeviceAddress To; | 43 | OTDeviceAddress To; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | class OTPANConnection { | 46 | class OTPANNetworkSetup { |
47 | 47 | ||
48 | public : | 48 | public : |
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; |
@@ -89,13 +89,13 @@ public : | |||
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 : |
@@ -170,13 +170,13 @@ protected : | |||
170 | void disconnectNotify( const char * Signal ); | 170 | void disconnectNotify( const char * Signal ); |
171 | 171 | ||
172 | void timerEvent( QTimerEvent * ); | 172 | void timerEvent( QTimerEvent * ); |
173 | 173 | ||
174 | private : | 174 | private : |
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(); |
diff --git a/noncore/settings/networksettings2/opietooth2/OTInquiry.h b/noncore/settings/networksettings2/opietooth2/OTInquiry.h index f7bdeec..559af7a 100644 --- a/noncore/settings/networksettings2/opietooth2/OTInquiry.h +++ b/noncore/settings/networksettings2/opietooth2/OTInquiry.h | |||
@@ -35,13 +35,13 @@ class OTHCISocket; | |||
35 | * This class provides an asynchronous interface to the | 35 | * This class provides an asynchronous interface to the |
36 | * inquriy HCI command. To scan for other devices, connect | 36 | * inquriy HCI command. To scan for other devices, connect |
37 | * to the signals neighbourFound() and finished() and call | 37 | * to the signals neighbourFound() and finished() and call |
38 | * inquiry(). Inquiry results are signalled as soon as they arrive, | 38 | * inquiry(). Inquiry results are signalled as soon as they arrive, |
39 | * so the information can be displayed before the whole inquiry | 39 | * so the information can be displayed before the whole inquiry |
40 | * process is finished. | 40 | * process is finished. |
41 | * Still no connections should be set up before | 41 | * Still no networkSetups should be set up before |
42 | * the finished() signal was sent (hmm, is this always true..?) | 42 | * the finished() signal was sent (hmm, is this always true..?) |
43 | */ | 43 | */ |
44 | 44 | ||
45 | class OTInquiry : public QObject { | 45 | class OTInquiry : public QObject { |
46 | 46 | ||
47 | Q_OBJECT | 47 | Q_OBJECT |