Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/OTGateway.cpp') (more/less context) (ignore 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 @@ -53,27 +53,27 @@ OTGateway::OTGateway( void ) : QObject( 0, "OTGateway" ), if ( ( HciCtl = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI)) < 0) { SLOT_ShowError( tr( "error opening hci socket" ) ); return; } // load all known devices updateDrivers(); // load all peers we have ever seen loadKnownPeers(); - // iterate over drivers and find active connections + // iterate over drivers and find active NetworkSetups // adding/updating peers - loadActiveConnections(); + loadActiveNetworkSetups(); // check every 4 seconds the state of BT timerEvent(0); RefreshTimer = -1; setRefreshTimer( 4000 ); // load known link keys readLinkKeys(); } // close bluetooth system OTGateway::~OTGateway( void ) { @@ -366,51 +366,51 @@ const char * OTGateway::deviceTypeToName( int cls ) { return "av"; case 0x05: return "peripheral"; case 0x06: return "imaging"; case 0x07: default : break; } return "unknown"; } -PANConnectionVector OTGateway::getPANConnections( void ) { - PANConnectionVector V; +PANNetworkSetupVector OTGateway::getPANNetworkSetups( void ) { + PANNetworkSetupVector V; struct bnep_connlist_req req; struct bnep_conninfo ci[48]; V.setAutoDelete(TRUE); int ctl = socket(PF_BLUETOOTH, SOCK_RAW, BTPROTO_BNEP); if (ctl < 0) { odebug << "Failed to open control socket" << oendl; return V; } req.cnum = 48; req.ci = ci; if (ioctl(ctl, BNEPGETCONNLIST, &req)) { - odebug << "Failed to get connection list" << oendl; + odebug << "Failed to get NetworkSetup list" << oendl; ::close( ctl ); return V; } for ( unsigned i=0; i < req.cnum; i++) { V.resize( V.size() + 1 ); if( ci[i].role == BNEP_SVC_PANU ) { // we are the client - V.insert( V.size()-1, new OTPANConnection( + V.insert( V.size()-1, new OTPANNetworkSetup( ci[i].device, batostr((bdaddr_t *) ci[i].dst) ) ); } } ::close( ctl ); return V; } struct link_key { bdaddr_t sba; @@ -501,53 +501,53 @@ bool OTGateway::removeLinkKey( unsigned int Index ) { if( Index < (AllKeys.size()-1) ) { // collapse array AllKeys[Index] = AllKeys[AllKeys.size()-1]; } // remove last element AllKeys.resize( AllKeys.size()-1 ); return 1; } #define MAXCONNECTIONS 10 -void OTGateway::loadActiveConnections( void ) { +void OTGateway::loadActiveNetworkSetups( void ) { struct hci_conn_list_req *cl; struct hci_conn_info *ci; OTDeviceAddress Addr; OTPeer * P; if (!(cl = (struct hci_conn_list_req *)malloc( MAXCONNECTIONS * sizeof(*ci) + sizeof(*cl)))) { emit error( tr("Can't allocate memory") ); return; } memset( cl, 0, MAXCONNECTIONS * sizeof(*ci) + sizeof(*cl) ); for( unsigned int i = 0; i < AllDrivers.count(); i ++ ) { if( ! AllDrivers[i]->isUp() ) { continue; } - // driver is up -> check connections + // driver is up -> check NetworkSetups cl->dev_id = AllDrivers[i]->devId(); cl->conn_num = MAXCONNECTIONS; ci = cl->conn_info; if (ioctl( getSocket(), HCIGETCONNLIST, (void *) cl)) { - emit error( tr("Can't get connection list") ); + emit error( tr("Can't get NetworkSetup list") ); break; } for ( int k = 0; k < cl->conn_num; k++, ci++) { if( ci->state != BT_CONNECTED ) { // not yet connected continue; } Addr.setBDAddr( ci->bdaddr ); P = findPeer( Addr ); @@ -744,25 +744,25 @@ int OTGateway::releaseRFCommDevice( int devnr ) { dl->dev_num = RFCOMM_MAX_DEV; di = dl->dev_info; if( ::ioctl(s, RFCOMMGETDEVLIST, (void *) dl) < 0) { emit error( tr("Can't get device list") ); ::close( s ); return 0; } dr = di; for (i = 0; i < dl->dev_num; i++, dr++) { if( dr->id == devnr ) { - // still in connection list + // still in NetworkSetup list struct rfcomm_dev_req req; int err; memset(&req, 0, sizeof(req)); req.dev_id = devnr; if ((err = ioctl(s, RFCOMMRELEASEDEV, &req)) < 0 ) { return err; } return 0; } } |