summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetwork.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opienet/onetwork.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index b6c9876..e141097 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -114,17 +114,17 @@ void ONetwork::synchronize()
iface = new ONetworkInterface( this, (const char*) str );
}
_interfaces.insert( str, iface );
s.readLine();
}
}
-short ONetwork::wirelessExtensionVersion()
+short ONetwork::wirelessExtensionCompileVersion()
{
return WIRELESS_EXT;
}
int ONetwork::count() const
{
return _interfaces.count();
@@ -377,34 +377,33 @@ bool ONetworkInterface::isWireless() const
/*======================================================================================
* OChannelHopper
*======================================================================================*/
OChannelHopper::OChannelHopper( OWirelessNetworkInterface* iface )
:QObject( 0, "Mickey's funky hopper" ),
_iface( iface ), _interval( 0 ), _tid( 0 )
{
- int _maxChannel = iface->channels()+1;
+ int _maxChannel = iface->channels();
// generate fancy hopping sequence honoring the device capabilities
if ( _maxChannel >= 1 ) _channels.append( 1 );
if ( _maxChannel >= 7 ) _channels.append( 7 );
if ( _maxChannel >= 13 ) _channels.append( 13 );
if ( _maxChannel >= 2 ) _channels.append( 2 );
if ( _maxChannel >= 8 ) _channels.append( 8 );
if ( _maxChannel >= 3 ) _channels.append( 3 );
if ( _maxChannel >= 14 ) _channels.append( 14 );
if ( _maxChannel >= 9 ) _channels.append( 9 );
if ( _maxChannel >= 4 ) _channels.append( 4 );
if ( _maxChannel >= 10 ) _channels.append( 10 );
if ( _maxChannel >= 5 ) _channels.append( 5 );
if ( _maxChannel >= 11 ) _channels.append( 11 );
if ( _maxChannel >= 6 ) _channels.append( 6 );
if ( _maxChannel >= 12 ) _channels.append( 12 );
_channel = _channels.begin();
-
}
OChannelHopper::~OChannelHopper()
{
}
@@ -556,26 +555,33 @@ void OWirelessNetworkInterface::buildInformation()
struct iw_range range;
memcpy( &range, buffer, sizeof range );
odebug << "OWirelessNetworkInterface::buildInformation(): Interface reported to have " << (int) range.num_frequency << " channels." << oendl;
for ( int i = 0; i < range.num_frequency; ++i )
{
int freq = (int) ( double( range.freq[i].m ) * pow( 10.0, range.freq[i].e ) / 1000000.0 );
+ odebug << "OWirelessNetworkInterface::buildInformation: Adding frequency " << freq << " as channel " << i+1 << oendl;
_channels.insert( freq, i+1 );
}
}
memcpy( &_range, buffer, sizeof( struct iw_range ) );
odebug << "OWirelessNetworkInterface::buildInformation(): Information block constructed." << oendl;
free(buffer);
}
+short OWirelessNetworkInterface::wirelessExtensionDriverVersion() const
+{
+ return _range.we_version_compiled;
+}
+
+
void OWirelessNetworkInterface::buildPrivateList()
{
odebug << "OWirelessNetworkInterface::buildPrivateList()" << oendl;
struct iw_priv_args priv[IW_MAX_PRIV_DEF];
_iwr.u.data.pointer = (char*) &priv;
_iwr.u.data.length = IW_MAX_PRIV_DEF; // length in terms of number of (sizeof iw_priv_args), not (sizeof iw_priv_args) itself