Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/OTGateway.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/opietooth2/OTGateway.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
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 | ||