WlanLinux.h

Go to the documentation of this file.
00001 
00024 #ifndef _WLANLINUX_H
00025 #define _WLANLINUX_H
00026 
00027 #include "Wlan.h"
00028 #include "../../util/Thread.h"
00029 
00030 
00034 class WlanLinuxFeatureProvider : public WlanFeatureProvider, public Thread
00035 {
00036         private:
00038 
00039                 string ifname;
00040                 int wlsocket;
00041                 int delay;
00042                 mutable Lock lockApList;
00044 
00045         public:
00046                 // Linux interface name (e.g. wlan0, eth1) and delay between scans in
00047                 // milliseconds
00049                 WlanLinuxFeatureProvider(featureparams& params);
00051                 virtual ~WlanLinuxFeatureProvider() throw() ;
00052 
00053                 // the scanning thread, which continously scans for peers (only for the
00054                 // Peers feature, the other feature values can be read from the kernel with
00055                 // no delay and are thus handled in nextSample)
00056                 virtual void run() throw();
00057 
00058                 // we have to overwrite this because of the needed multi-thread locking
00059                 virtual Feature* getSample(string name) const;
00060                 virtual void nextSample(clock_t checkpoint);
00061         
00062         private:
00064 
00065                 bool initSocket(string interfaceName);
00066                 void closeSocket();
00067                 bool getEssid(string& essid);
00068                 bool getApAddress(string& apAddress);
00069                 bool getApList(vector<WlanPeerInfo>& apList, bool changeEssid);
00070                 bool getMode(WlanActiveModeFeature::FeatureKind& mode);
00071                 bool getApSignalLevel(double& level);
00073 };
00074 
00075 #endif // _WLANLINUX_H

Generated on Mon Jun 5 10:20:42 2006 for Intelligence.kdevelop by  doxygen 1.4.6