summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/wlan/info.ui6
-rw-r--r--noncore/net/networksetup/wlan/infoimp.cpp2
-rw-r--r--noncore/net/networksetup/wlan/wextensions.cpp23
-rw-r--r--noncore/net/networksetup/wlan/wextensions.h1
-rw-r--r--noncore/settings/networksettings/wlan/info.ui6
-rw-r--r--noncore/settings/networksettings/wlan/infoimp.cpp2
-rw-r--r--noncore/settings/networksettings/wlan/wextensions.cpp23
-rw-r--r--noncore/settings/networksettings/wlan/wextensions.h1
8 files changed, 56 insertions, 8 deletions
diff --git a/noncore/net/networksetup/wlan/info.ui b/noncore/net/networksetup/wlan/info.ui
index 1e3e8b5..7a5bf0b 100644
--- a/noncore/net/networksetup/wlan/info.ui
+++ b/noncore/net/networksetup/wlan/info.ui
@@ -11,7 +11,7 @@
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>242</width> 14 <width>238</width>
15 <height>316</height> 15 <height>316</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
@@ -61,7 +61,7 @@
61 </property> 61 </property>
62 <property stdset="1"> 62 <property stdset="1">
63 <name>text</name> 63 <name>text</name>
64 <string>Frequency</string> 64 <string>Channel</string>
65 </property> 65 </property>
66 </widget> 66 </widget>
67 <widget row="2" column="0" > 67 <widget row="2" column="0" >
@@ -172,7 +172,7 @@
172 <class>QLabel</class> 172 <class>QLabel</class>
173 <property stdset="1"> 173 <property stdset="1">
174 <name>name</name> 174 <name>name</name>
175 <cstring>freqLabel</cstring> 175 <cstring>channelLabel</cstring>
176 </property> 176 </property>
177 <property stdset="1"> 177 <property stdset="1">
178 <name>frameShape</name> 178 <name>frameShape</name>
diff --git a/noncore/net/networksetup/wlan/infoimp.cpp b/noncore/net/networksetup/wlan/infoimp.cpp
index 6d3e167..bd56678 100644
--- a/noncore/net/networksetup/wlan/infoimp.cpp
+++ b/noncore/net/networksetup/wlan/infoimp.cpp
@@ -37,7 +37,7 @@ void WlanInfoImp::update(){
37 apLabel->setText(wExtensions->ap()); 37 apLabel->setText(wExtensions->ap());
38 stationLabel->setText(wExtensions->station()); 38 stationLabel->setText(wExtensions->station());
39 modeLabel->setText(wExtensions->mode()); 39 modeLabel->setText(wExtensions->mode());
40 freqLabel->setText(QString("%1 GHz").arg(wExtensions->frequency())); 40 channelLabel->setText(QString("%1").arg(wExtensions->channel()));
41 int signal = 0; 41 int signal = 0;
42 int noise = 0; 42 int noise = 0;
43 int quality = 0; 43 int quality = 0;
diff --git a/noncore/net/networksetup/wlan/wextensions.cpp b/noncore/net/networksetup/wlan/wextensions.cpp
index 6335ebc..16654bb 100644
--- a/noncore/net/networksetup/wlan/wextensions.cpp
+++ b/noncore/net/networksetup/wlan/wextensions.cpp
@@ -91,8 +91,31 @@ double WExtensions::frequency(){
91 return 0; 91 return 0;
92} 92}
93 93
94/**
95 * Get the channel that the interface is running at.
96 * @return int the channel that the interfacae is running at.
97 */
98int WExtensions::channel(){
99 if(!hasWirelessExtensions)
100 return 0;
101 if ( 0 != ioctl( fd, SIOCGIWFREQ, &iwr ))
102 return 0;
103 double num = (double( iwr.u.freq.m ) * pow( 10, iwr.u.freq.e ) / 1000000000);
104 double left = 2.401;
105 double right = 2.416;
106 for(int channel = 1; channel<= 15; channel++){
107 if( num >= left && num <= right )
108 return channel;
109 left += 0.005;
110 right += 0.005;
111 }
112 qDebug(QString("Unknown frequency: %1, returning -1 for the channel.").arg(num).latin1());
113 return -1;
114}
115
94/*** 116/***
95 * Get the current rate that the card is transmiting at. 117 * Get the current rate that the card is transmiting at.
118 * @return double the rate, 0 if error.
96 */ 119 */
97double WExtensions::rate(){ 120double WExtensions::rate(){
98 if(!hasWirelessExtensions) 121 if(!hasWirelessExtensions)
diff --git a/noncore/net/networksetup/wlan/wextensions.h b/noncore/net/networksetup/wlan/wextensions.h
index 1565eb5..a89e33a 100644
--- a/noncore/net/networksetup/wlan/wextensions.h
+++ b/noncore/net/networksetup/wlan/wextensions.h
@@ -16,6 +16,7 @@ public:
16 QString essid(); 16 QString essid();
17 QString mode(); 17 QString mode();
18 double frequency(); 18 double frequency();
19 int channel();
19 double rate(); 20 double rate();
20 QString ap(); 21 QString ap();
21 bool stats( int &signal, int &noise, int &quality); 22 bool stats( int &signal, int &noise, int &quality);
diff --git a/noncore/settings/networksettings/wlan/info.ui b/noncore/settings/networksettings/wlan/info.ui
index 1e3e8b5..7a5bf0b 100644
--- a/noncore/settings/networksettings/wlan/info.ui
+++ b/noncore/settings/networksettings/wlan/info.ui
@@ -11,7 +11,7 @@
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>242</width> 14 <width>238</width>
15 <height>316</height> 15 <height>316</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
@@ -61,7 +61,7 @@
61 </property> 61 </property>
62 <property stdset="1"> 62 <property stdset="1">
63 <name>text</name> 63 <name>text</name>
64 <string>Frequency</string> 64 <string>Channel</string>
65 </property> 65 </property>
66 </widget> 66 </widget>
67 <widget row="2" column="0" > 67 <widget row="2" column="0" >
@@ -172,7 +172,7 @@
172 <class>QLabel</class> 172 <class>QLabel</class>
173 <property stdset="1"> 173 <property stdset="1">
174 <name>name</name> 174 <name>name</name>
175 <cstring>freqLabel</cstring> 175 <cstring>channelLabel</cstring>
176 </property> 176 </property>
177 <property stdset="1"> 177 <property stdset="1">
178 <name>frameShape</name> 178 <name>frameShape</name>
diff --git a/noncore/settings/networksettings/wlan/infoimp.cpp b/noncore/settings/networksettings/wlan/infoimp.cpp
index 6d3e167..bd56678 100644
--- a/noncore/settings/networksettings/wlan/infoimp.cpp
+++ b/noncore/settings/networksettings/wlan/infoimp.cpp
@@ -37,7 +37,7 @@ void WlanInfoImp::update(){
37 apLabel->setText(wExtensions->ap()); 37 apLabel->setText(wExtensions->ap());
38 stationLabel->setText(wExtensions->station()); 38 stationLabel->setText(wExtensions->station());
39 modeLabel->setText(wExtensions->mode()); 39 modeLabel->setText(wExtensions->mode());
40 freqLabel->setText(QString("%1 GHz").arg(wExtensions->frequency())); 40 channelLabel->setText(QString("%1").arg(wExtensions->channel()));
41 int signal = 0; 41 int signal = 0;
42 int noise = 0; 42 int noise = 0;
43 int quality = 0; 43 int quality = 0;
diff --git a/noncore/settings/networksettings/wlan/wextensions.cpp b/noncore/settings/networksettings/wlan/wextensions.cpp
index 6335ebc..16654bb 100644
--- a/noncore/settings/networksettings/wlan/wextensions.cpp
+++ b/noncore/settings/networksettings/wlan/wextensions.cpp
@@ -91,8 +91,31 @@ double WExtensions::frequency(){
91 return 0; 91 return 0;
92} 92}
93 93
94/**
95 * Get the channel that the interface is running at.
96 * @return int the channel that the interfacae is running at.
97 */
98int WExtensions::channel(){
99 if(!hasWirelessExtensions)
100 return 0;
101 if ( 0 != ioctl( fd, SIOCGIWFREQ, &iwr ))
102 return 0;
103 double num = (double( iwr.u.freq.m ) * pow( 10, iwr.u.freq.e ) / 1000000000);
104 double left = 2.401;
105 double right = 2.416;
106 for(int channel = 1; channel<= 15; channel++){
107 if( num >= left && num <= right )
108 return channel;
109 left += 0.005;
110 right += 0.005;
111 }
112 qDebug(QString("Unknown frequency: %1, returning -1 for the channel.").arg(num).latin1());
113 return -1;
114}
115
94/*** 116/***
95 * Get the current rate that the card is transmiting at. 117 * Get the current rate that the card is transmiting at.
118 * @return double the rate, 0 if error.
96 */ 119 */
97double WExtensions::rate(){ 120double WExtensions::rate(){
98 if(!hasWirelessExtensions) 121 if(!hasWirelessExtensions)
diff --git a/noncore/settings/networksettings/wlan/wextensions.h b/noncore/settings/networksettings/wlan/wextensions.h
index 1565eb5..a89e33a 100644
--- a/noncore/settings/networksettings/wlan/wextensions.h
+++ b/noncore/settings/networksettings/wlan/wextensions.h
@@ -16,6 +16,7 @@ public:
16 QString essid(); 16 QString essid();
17 QString mode(); 17 QString mode();
18 double frequency(); 18 double frequency();
19 int channel();
19 double rate(); 20 double rate();
20 QString ap(); 21 QString ap();
21 bool stats( int &signal, int &noise, int &quality); 22 bool stats( int &signal, int &noise, int &quality);