San Mehat | 1441e76 | 2009-05-07 11:37:10 -0700 | [diff] [blame] | 1 | #ifndef _WIFISCANNER_H |
| 2 | #define _WIFISCANNER_H |
| 3 | |
| 4 | #include <pthread.h> |
| 5 | |
| 6 | class Supplicant; |
| 7 | |
| 8 | class WifiScanner { |
| 9 | pthread_t mWorker; |
| 10 | pthread_mutex_t mWorkerLock; |
| 11 | bool mWorkerRunning; |
| 12 | bool mAbortRequest; |
| 13 | pthread_mutex_t mAbortRequestLock; |
| 14 | |
| 15 | Supplicant *mSuppl; |
| 16 | int mPeriod; |
| 17 | bool mActive; |
| 18 | |
| 19 | |
| 20 | public: |
| 21 | WifiScanner(Supplicant *suppl, int period); |
| 22 | virtual ~WifiScanner() {} |
| 23 | |
| 24 | int getPeriod() { return mPeriod; } |
| 25 | |
| 26 | int startPeriodicScan(bool active); |
| 27 | int stopPeriodicScan(); |
| 28 | |
| 29 | private: |
| 30 | static void *threadStart(void *obj); |
| 31 | static void threadCleanup(void *obj); |
| 32 | |
| 33 | void run(); |
| 34 | }; |
| 35 | |
| 36 | #endif |