Diffstat (limited to 'noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp index 3df7f5c..cd7bb4a 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp @@ -7,44 +7,44 @@ using Opietooth2::OTGateway; using Opietooth2::OTDevice; using Opietooth2::OTDeviceAddress; BluetoothRFCOMMRun::~BluetoothRFCOMMRun( void ) { if( OT ) { OTGateway::releaseOTGateway(); } } State_t BluetoothRFCOMMRun::detectState( void ) { if( ! OT ) { OT = OTGateway::getOTGateway(); } - if( deviceNrOfConnection() >= 0 ) { + if( deviceNrOfNetworkSetup() >= 0 ) { return Available; } odebug << "Bluetooth " << OT->isEnabled() << oendl; return ( OT->isEnabled() ) ? Off : Unavailable; } -QString BluetoothRFCOMMRun::setMyState( NodeCollection *, +QString BluetoothRFCOMMRun::setMyState( NetworkSetup *, Action_t A, bool ) { if( OT ) { OTGateway::getOTGateway(); } if( A == Activate ) { // from OFF to Available RFCOMMChannel * Ch = getChannel( ); System & Sys = NSResources->system(); if( Ch ) { // connect to this peer DeviceNr = OT->getFreeRFCommDevice(); QStringList S; @@ -57,33 +57,33 @@ QString BluetoothRFCOMMRun::setMyState( NodeCollection *, if( Sys.runAsRoot( S ) ) { return QString( "Error starting %1").arg(S.join(" ")); } // here rfcomm should be running -> we will detect state later return QString(); } else { Log(( "No channel selected -> cancel\n" )); return QString( "No channel selected. Operation cancelled" ); } } if( A == Deactivate ) { if( DeviceNr >= 0 ) { if( OT->releaseRFCommDevice( DeviceNr ) ) { - return QString( "Cannot release RFCOMM connection" ); + return QString( "Cannot release RFCOMM NetworkSetup" ); } DeviceNr = -1; } } return QString(); } #include <qlistbox.h> #include <qframe.h> #include <qlabel.h> #include <qlayout.h> #include <qdialog.h> RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) { if( Data->Devices.count() == 1 ) { @@ -118,41 +118,41 @@ RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) { if( Dlg->exec() == QDialog::Accepted ) { unsigned int i = 0; for( i = 0; i < Data->Devices.count(); i ++ ) { if( LB->isSelected(i) ) { odebug << "Selected " << Data->Devices[i]->Name << oendl; Ch = Data->Devices[i]; break; } } } delete Dlg; return Ch; } QString BluetoothRFCOMMRun::deviceFile( void ) { - if( deviceNrOfConnection() >= 0 ) { + if( deviceNrOfNetworkSetup() >= 0 ) { OTDevice * OTD = OT->getOTDevice(); - // there is a connection + // there is a NetworkSetup return OTD->getRFCommDevicePattern().arg(DeviceNr); } return QString(); } -int BluetoothRFCOMMRun::deviceNrOfConnection( void ) { +int BluetoothRFCOMMRun::deviceNrOfNetworkSetup( void ) { if( ! OT ) { OT = OTGateway::getOTGateway(); } DeviceNr = -1; for( unsigned int i = 0; i < Data->Devices.count(); i ++ ) { odebug << "Check for rfcomm on " << Data->Devices[i]->BDAddress << " " << Data->Devices[i]->Channel << oendl; if( ( DeviceNr = OT->connectedToRFCommChannel( OTDeviceAddress( Data->Devices[i]->BDAddress ), Data->Devices[i]->Channel ) ) >= 0 ) { odebug << "Up " |