summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.cpp12
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
@@ -11,36 +11,36 @@ using Opietooth2::OTDeviceAddress;
11BluetoothRFCOMMRun::~BluetoothRFCOMMRun( void ) { 11BluetoothRFCOMMRun::~BluetoothRFCOMMRun( void ) {
12 if( OT ) { 12 if( OT ) {
13 OTGateway::releaseOTGateway(); 13 OTGateway::releaseOTGateway();
14 } 14 }
15} 15}
16 16
17State_t BluetoothRFCOMMRun::detectState( void ) { 17State_t BluetoothRFCOMMRun::detectState( void ) {
18 18
19 if( ! OT ) { 19 if( ! OT ) {
20 OT = OTGateway::getOTGateway(); 20 OT = OTGateway::getOTGateway();
21 } 21 }
22 22
23 if( deviceNrOfConnection() >= 0 ) { 23 if( deviceNrOfNetworkSetup() >= 0 ) {
24 return Available; 24 return Available;
25 } 25 }
26 26
27 odebug << "Bluetooth " 27 odebug << "Bluetooth "
28 << OT->isEnabled() 28 << OT->isEnabled()
29 << oendl; 29 << oendl;
30 30
31 return ( OT->isEnabled() ) ? Off : Unavailable; 31 return ( OT->isEnabled() ) ? Off : Unavailable;
32} 32}
33 33
34QString BluetoothRFCOMMRun::setMyState( NodeCollection *, 34QString BluetoothRFCOMMRun::setMyState( NetworkSetup *,
35 Action_t A, 35 Action_t A,
36 bool ) { 36 bool ) {
37 37
38 if( OT ) { 38 if( OT ) {
39 OTGateway::getOTGateway(); 39 OTGateway::getOTGateway();
40 } 40 }
41 41
42 if( A == Activate ) { 42 if( A == Activate ) {
43 // from OFF to Available 43 // from OFF to Available
44 RFCOMMChannel * Ch = getChannel( ); 44 RFCOMMChannel * Ch = getChannel( );
45 System & Sys = NSResources->system(); 45 System & Sys = NSResources->system();
46 46
@@ -61,25 +61,25 @@ QString BluetoothRFCOMMRun::setMyState( NodeCollection *,
61 61
62 // here rfcomm should be running -> we will detect state later 62 // here rfcomm should be running -> we will detect state later
63 return QString(); 63 return QString();
64 } else { 64 } else {
65 Log(( "No channel selected -> cancel\n" )); 65 Log(( "No channel selected -> cancel\n" ));
66 return QString( "No channel selected. Operation cancelled" ); 66 return QString( "No channel selected. Operation cancelled" );
67 } 67 }
68 } 68 }
69 69
70 if( A == Deactivate ) { 70 if( A == Deactivate ) {
71 if( DeviceNr >= 0 ) { 71 if( DeviceNr >= 0 ) {
72 if( OT->releaseRFCommDevice( DeviceNr ) ) { 72 if( OT->releaseRFCommDevice( DeviceNr ) ) {
73 return QString( "Cannot release RFCOMM connection" ); 73 return QString( "Cannot release RFCOMM NetworkSetup" );
74 } 74 }
75 DeviceNr = -1; 75 DeviceNr = -1;
76 } 76 }
77 } 77 }
78 return QString(); 78 return QString();
79} 79}
80 80
81#include <qlistbox.h> 81#include <qlistbox.h>
82#include <qframe.h> 82#include <qframe.h>
83#include <qlabel.h> 83#include <qlabel.h>
84#include <qlayout.h> 84#include <qlayout.h>
85#include <qdialog.h> 85#include <qdialog.h>
@@ -122,33 +122,33 @@ RFCOMMChannel * BluetoothRFCOMMRun::getChannel( void ) {
122 odebug << "Selected " << Data->Devices[i]->Name << oendl; 122 odebug << "Selected " << Data->Devices[i]->Name << oendl;
123 Ch = Data->Devices[i]; 123 Ch = Data->Devices[i];
124 break; 124 break;
125 } 125 }
126 } 126 }
127 } 127 }
128 128
129 delete Dlg; 129 delete Dlg;
130 return Ch; 130 return Ch;
131} 131}
132 132
133QString BluetoothRFCOMMRun::deviceFile( void ) { 133QString BluetoothRFCOMMRun::deviceFile( void ) {
134 if( deviceNrOfConnection() >= 0 ) { 134 if( deviceNrOfNetworkSetup() >= 0 ) {
135 OTDevice * OTD = OT->getOTDevice(); 135 OTDevice * OTD = OT->getOTDevice();
136 // there is a connection 136 // there is a NetworkSetup
137 return OTD->getRFCommDevicePattern().arg(DeviceNr); 137 return OTD->getRFCommDevicePattern().arg(DeviceNr);
138 } 138 }
139 return QString(); 139 return QString();
140} 140}
141 141
142int BluetoothRFCOMMRun::deviceNrOfConnection( void ) { 142int BluetoothRFCOMMRun::deviceNrOfNetworkSetup( void ) {
143 143
144 if( ! OT ) { 144 if( ! OT ) {
145 OT = OTGateway::getOTGateway(); 145 OT = OTGateway::getOTGateway();
146 } 146 }
147 147
148 DeviceNr = -1; 148 DeviceNr = -1;
149 for( unsigned int i = 0; i < Data->Devices.count(); i ++ ) { 149 for( unsigned int i = 0; i < Data->Devices.count(); i ++ ) {
150 odebug << "Check for rfcomm on " 150 odebug << "Check for rfcomm on "
151 << Data->Devices[i]->BDAddress 151 << Data->Devices[i]->BDAddress
152 << " " 152 << " "
153 << Data->Devices[i]->Channel 153 << Data->Devices[i]->Channel
154 << oendl; 154 << oendl;