summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetwork.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opienet/onetwork.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index e916c44..73b543b 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -328,48 +328,49 @@ OChannelHopper::OChannelHopper( OWirelessNetworkInterface* iface )
}
OChannelHopper::~OChannelHopper()
{
}
bool OChannelHopper::isActive() const
{
return _tid;
}
int OChannelHopper::channel() const
{
return *_channel;
}
void OChannelHopper::timerEvent( QTimerEvent* )
{
_iface->setChannel( *_channel );
+ emit( hopped( *_channel ) );
qDebug( "OChannelHopper::timerEvent(): set channel %d on interface '%s'",
*_channel, (const char*) _iface->name() );
if ( ++_channel == _channels.end() ) _channel = _channels.begin();
}
void OChannelHopper::setInterval( int interval )
{
if ( interval == _interval )
return;
if ( _interval )
killTimer( _tid );
_tid = 0;
_interval = interval;
if ( _interval )
{
_tid = startTimer( interval );
}
}
@@ -572,48 +573,54 @@ double OWirelessNetworkInterface::frequency() const
}
int OWirelessNetworkInterface::channels() const
{
return _channels.count();
}
void OWirelessNetworkInterface::setChannelHopping( int interval )
{
if ( !_hopper ) _hopper = new OChannelHopper( this );
_hopper->setInterval( interval );
//FIXME: When and by whom will the channel hopper be deleted?
//TODO: rely on QObject hierarchy
}
int OWirelessNetworkInterface::channelHopping() const
{
return _hopper->interval();
}
+OChannelHopper* OWirelessNetworkInterface::channelHopper() const
+{
+ return _hopper;
+}
+
+
void OWirelessNetworkInterface::setMonitorMode( bool b )
{
if ( _mon )
_mon->setEnabled( b );
else
qDebug( "ONetwork(): can't switch monitor mode without installed monitoring interface" );
}
bool OWirelessNetworkInterface::monitorMode() const
{
qDebug( "dataLinkType = %d", dataLinkType() );
return dataLinkType() == ARPHRD_IEEE80211;
}
QString OWirelessNetworkInterface::nickName() const
{
char str[IW_ESSID_MAX_SIZE];
_iwr.u.data.pointer = &str[0];
_iwr.u.data.length = IW_ESSID_MAX_SIZE;
if ( !wioctl( SIOCGIWNICKN ) )
{
return "<unknown>";