summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp7
-rw-r--r--libopie2/opienet/onetwork.h9
2 files changed, 16 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
@@ -348,8 +348,9 @@ int OChannelHopper::channel() const
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();
}
@@ -592,8 +593,14 @@ int OWirelessNetworkInterface::channelHopping() const
return _hopper->interval();
}
+OChannelHopper* OWirelessNetworkInterface::channelHopper() const
+{
+ return _hopper;
+}
+
+
void OWirelessNetworkInterface::setMonitorMode( bool b )
{
if ( _mon )
_mon->setEnabled( b );
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h
index 10f52b8..d2cc25d 100644
--- a/libopie2/opienet/onetwork.h
+++ b/libopie2/opienet/onetwork.h
@@ -226,8 +226,10 @@ class ONetworkInterface : public QObject
* @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
*/
class OChannelHopper : public QObject
{
+ Q_OBJECT
+
public:
OChannelHopper( OWirelessNetworkInterface* );
virtual ~OChannelHopper();
bool isActive() const;
@@ -235,8 +237,11 @@ class OChannelHopper : public QObject
virtual void timerEvent( QTimerEvent* );
void setInterval( int );
int interval() const;
+ signals:
+ void hopped( int );
+
private:
OWirelessNetworkInterface* _iface;
int _interval;
int _tid;
@@ -324,8 +329,12 @@ class OWirelessNetworkInterface : public ONetworkInterface
* @returns the channel hopping interval or 0, if channel hopping is disabled.
*/
virtual int channelHopping() const;
/**
+ * @returns the @ref OChannelHopper of this interface or 0, if channel hopping has not been activated before
+ */
+ virtual OChannelHopper* channelHopper() const;
+ /**
* Set the station @a nickname.
*/
virtual void setNickName( const QString& nickname ) {}; //FIXME: Implement this
/**