summaryrefslogtreecommitdiff
authorbenmeyer <benmeyer>2002-10-18 18:25:08 (UTC)
committer benmeyer <benmeyer>2002-10-18 18:25:08 (UTC)
commitee1d0ae1ee86bb0373a3526928a4ae17468361c3 (patch) (side-by-side diff)
tree39c04aa1438f1e323c26bf5116f6bc4939dd6d00
parenta63b3b36cf4d665b67733e069bfaad8f96388276 (diff)
downloadopie-ee1d0ae1ee86bb0373a3526928a4ae17468361c3.zip
opie-ee1d0ae1ee86bb0373a3526928a4ae17468361c3.tar.gz
opie-ee1d0ae1ee86bb0373a3526928a4ae17468361c3.tar.bz2
cleanup
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/networksetup/wlan/wlanmodule.cpp2
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/noncore/net/networksetup/wlan/wlanmodule.cpp b/noncore/net/networksetup/wlan/wlanmodule.cpp
index 8d25d99..f12e608 100644
--- a/noncore/net/networksetup/wlan/wlanmodule.cpp
+++ b/noncore/net/networksetup/wlan/wlanmodule.cpp
@@ -96,97 +96,97 @@ QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){
QString n = (i->getInterfaceName());
const char* iname = n.latin1();
strcpy( iwr.ifr_ifrn.ifrn_name, (const char *)iname );
int result = ioctl( fd, SIOCGIWESSID, &iwr );
if ( result == 0 ){
//hasWirelessExtensions = true;
iwr.u.essid.pointer[(unsigned int) iwr.u.essid.length-1] = '\0';
info->essidLabel->setText(QString(iwr.u.essid.pointer));
}
else
return info;
//info->essidLabel->setText("*** Unknown ***");
// Address of associated access-point
result = ioctl( fd, SIOCGIWAP, &iwr );
if ( result == 0 ){
QString foo = foo.sprintf( "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X",
iwr.u.ap_addr.sa_data[0]&0xff,
iwr.u.ap_addr.sa_data[1]&0xff,
iwr.u.ap_addr.sa_data[2]&0xff,
iwr.u.ap_addr.sa_data[3]&0xff,
iwr.u.ap_addr.sa_data[4]&0xff,
iwr.u.ap_addr.sa_data[5]&0xff );
info->apLabel->setText(foo);
}
else info->apLabel->setText("*** Unknown ***");
iwr.u.data.pointer = (caddr_t) buffer;
iwr.u.data.length = IW_ESSID_MAX_SIZE;
iwr.u.data.flags = 0;
result = ioctl( fd, SIOCGIWNICKN, &iwr );
if ( result == 0 ){
iwr.u.data.pointer[(unsigned int) iwr.u.data.length-1] = '\0';
info->stationLabel->setText(iwr.u.data.pointer);
}
else info->stationLabel->setText("*** Unknown ***");
result = ioctl( fd, SIOCGIWMODE, &iwr );
if ( result == 0 )
info->modeLabel->setText( QString("%1").arg(iwr.u.mode == IW_MODE_ADHOC ? "Ad-Hoc" : "Managed"));
else
info->modeLabel->setText("*** Unknown ***");
result = ioctl( fd, SIOCGIWFREQ, &iwr );
if ( result == 0 )
info->freqLabel->setText(QString("%1").arg((double( iwr.u.freq.m ) * pow( 10, iwr.u.freq.e ) / 1000000000)));
else
- info->freqLabel->setText("0");
+ info->freqLabel->setText("*** Unknown ***");
/*
// gather link quality from /proc/net/wireless
char c;
QString status;
QString name;
QFile wfile( PROCNETWIRELESS );
bool hasFile = wfile.open( IO_ReadOnly );
QTextStream wstream( &wfile );
if ( hasFile )
{
wstream.readLine(); // skip the first two lines
wstream.readLine(); // because they only contain headers
}
if ( ( !hasFile ) || ( wstream.atEnd() ) )
{
#ifdef MDEBUG
qDebug( "WIFIAPPLET: D'oh! Someone removed the card..." );
#endif
quality = -1;
signal = IW_LOWER;
noise = IW_LOWER;
return false;
}
wstream >> name >> status >> quality >> c >> signal >> c >> noise;
if ( quality > 92 )
#ifdef MDEBUG
qDebug( "WIFIAPPLET: D'oh! Quality %d > estimated max!\n", quality );
#endif
if ( ( signal > IW_UPPER ) || ( signal < IW_LOWER ) )
#ifdef MDEBUG
qDebug( "WIFIAPPLET: Doh! Strength %d > estimated max!\n", signal );
#endif
if ( ( noise > IW_UPPER ) || ( noise < IW_LOWER ) )
#ifdef MDEBUG
qDebug( "WIFIAPPLET: Doh! Noise %d > estimated max!\n", noise );
#endif
return true;
}
*/
return info;
}
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index 8d25d99..f12e608 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -96,97 +96,97 @@ QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){
QString n = (i->getInterfaceName());
const char* iname = n.latin1();
strcpy( iwr.ifr_ifrn.ifrn_name, (const char *)iname );
int result = ioctl( fd, SIOCGIWESSID, &iwr );
if ( result == 0 ){
//hasWirelessExtensions = true;
iwr.u.essid.pointer[(unsigned int) iwr.u.essid.length-1] = '\0';
info->essidLabel->setText(QString(iwr.u.essid.pointer));
}
else
return info;
//info->essidLabel->setText("*** Unknown ***");
// Address of associated access-point
result = ioctl( fd, SIOCGIWAP, &iwr );
if ( result == 0 ){
QString foo = foo.sprintf( "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X",
iwr.u.ap_addr.sa_data[0]&0xff,
iwr.u.ap_addr.sa_data[1]&0xff,
iwr.u.ap_addr.sa_data[2]&0xff,
iwr.u.ap_addr.sa_data[3]&0xff,
iwr.u.ap_addr.sa_data[4]&0xff,
iwr.u.ap_addr.sa_data[5]&0xff );
info->apLabel->setText(foo);
}
else info->apLabel->setText("*** Unknown ***");
iwr.u.data.pointer = (caddr_t) buffer;
iwr.u.data.length = IW_ESSID_MAX_SIZE;
iwr.u.data.flags = 0;
result = ioctl( fd, SIOCGIWNICKN, &iwr );
if ( result == 0 ){
iwr.u.data.pointer[(unsigned int) iwr.u.data.length-1] = '\0';
info->stationLabel->setText(iwr.u.data.pointer);
}
else info->stationLabel->setText("*** Unknown ***");
result = ioctl( fd, SIOCGIWMODE, &iwr );
if ( result == 0 )
info->modeLabel->setText( QString("%1").arg(iwr.u.mode == IW_MODE_ADHOC ? "Ad-Hoc" : "Managed"));
else
info->modeLabel->setText("*** Unknown ***");
result = ioctl( fd, SIOCGIWFREQ, &iwr );
if ( result == 0 )
info->freqLabel->setText(QString("%1").arg((double( iwr.u.freq.m ) * pow( 10, iwr.u.freq.e ) / 1000000000)));
else
- info->freqLabel->setText("0");
+ info->freqLabel->setText("*** Unknown ***");
/*
// gather link quality from /proc/net/wireless
char c;
QString status;
QString name;
QFile wfile( PROCNETWIRELESS );
bool hasFile = wfile.open( IO_ReadOnly );
QTextStream wstream( &wfile );
if ( hasFile )
{
wstream.readLine(); // skip the first two lines
wstream.readLine(); // because they only contain headers
}
if ( ( !hasFile ) || ( wstream.atEnd() ) )
{
#ifdef MDEBUG
qDebug( "WIFIAPPLET: D'oh! Someone removed the card..." );
#endif
quality = -1;
signal = IW_LOWER;
noise = IW_LOWER;
return false;
}
wstream >> name >> status >> quality >> c >> signal >> c >> noise;
if ( quality > 92 )
#ifdef MDEBUG
qDebug( "WIFIAPPLET: D'oh! Quality %d > estimated max!\n", quality );
#endif
if ( ( signal > IW_UPPER ) || ( signal < IW_LOWER ) )
#ifdef MDEBUG
qDebug( "WIFIAPPLET: Doh! Strength %d > estimated max!\n", signal );
#endif
if ( ( noise > IW_UPPER ) || ( noise < IW_LOWER ) )
#ifdef MDEBUG
qDebug( "WIFIAPPLET: Doh! Noise %d > estimated max!\n", noise );
#endif
return true;
}
*/
return info;
}