Classes | Private Member Functions | Private Attributes
WifiScan Class Reference

The wifi_scan main class. More...

#include <wifiscan.h>

List of all members.

Classes

struct  DeviceAddressCompare
struct  iwmask_name
 Bit to name mapping. More...
struct  iwscan_state
 Scan state and meta-information, used to decode events. More...

Public Member Functions

01. Constructors and destructor
 WifiScan (std::vector< int > channels, std::string interface="wlan0")
 Default constructor.
virtual ~WifiScan ()
 Destructor.
02. Configuration
std::string interface () const
 Get the interface on which scans are performed.
void set_interface (std::string interface)
 Set the interface to perform scans on.
03. ROS operations
void createFingerprint (ros::Publisher *pub)
 Publishes a Fingerprint message to the Publisher pub.

Private Member Functions

struct wireless_scan * iw_process_scanning_token (struct iw_event *event, struct wireless_scan *wscan)
 Process/store one element from the scanning results in wireless_scan.
double MeanRSSI (const std::vector< double > &RSSIValues)
int scan_channels (wireless_scan_head *context)
 Scan the channels indicated in channels.

Private Attributes

std::vector< int > channels_
char * interface_
int kernel_version_
struct iw_range range_
int socket_

Detailed Description

The wifi_scan main class.

The WifiScan class allows for easy operations on the iwlib library, and easy publishing to the defined topics.

Definition at line 53 of file wifiscan.h.


Constructor & Destructor Documentation

WifiScan::WifiScan ( std::vector< int >  channels,
std::string  interface = "wlan0" 
)

Default constructor.

Todo:
Design better so that no channels must be passed when all channels must be scanned.
Parameters:
channelsThe channels to scan. Defaults to all channels.
interfaceThe Ethernet interface to scan. Defaults to "wlan0".

Definition at line 313 of file wifiscan.cpp.

WifiScan::~WifiScan ( ) [virtual]

Destructor.

Definition at line 326 of file wifiscan.cpp.


Member Function Documentation

Publishes a Fingerprint message to the Publisher pub.

A fingerprint is a list of all visible WiFi access points' device addresses linked with their corresponding received signal strength indication.

Parameters:
pubA ROS Publisher, publishing wifi_scan::Fingerprint messages. Example: ros::Publisher pub = node.advertise<wifi_scan::Fingerprint> ("wifi_fp", 10);
Returns:
void
Exceptions:
WIFISCAN_ERROR_OPENING_IOCTL_SOCKETError opening ioctl socket.
WIFISCAN_ERROR_IN_IW_SCANError in iw_scan().

Definition at line 331 of file wifiscan.cpp.

std::string WifiScan::interface ( ) const [inline]

Get the interface on which scans are performed.

Returns:
The interface as std::string.

Definition at line 156 of file wifiscan.h.

struct wireless_scan * WifiScan::iw_process_scanning_token ( struct iw_event *  event,
struct wireless_scan *  wscan 
) [read, private]

Process/store one element from the scanning results in wireless_scan.

Todo:
More documentation.
Parameters:
event
wscan
Returns:

Definition at line 21 of file wifiscan.cpp.

double WifiScan::MeanRSSI ( const std::vector< double > &  RSSIValues) [private]

Definition at line 302 of file wifiscan.cpp.

int WifiScan::scan_channels ( wireless_scan_head *  context) [private]

Scan the channels indicated in channels.

This code is based on the iwlist print_scanning_info function. See source code of the libiw project (iwlist.c).

I would like to update this function to a class method, so that this range info can be a private variable and must not be constantly checked. Also, the function should be void and use throws instead of returns to indicate errors.

Parameters:
contextScan results.
Returns:
0 for success; see defines for other options.

Definition at line 99 of file wifiscan.cpp.

void WifiScan::set_interface ( std::string  interface) [inline]

Set the interface to perform scans on.

Parameters:
interfaceAn std::string that corresponds to a live Ethernet interface.
Returns:
void

Definition at line 167 of file wifiscan.h.


Member Data Documentation

std::vector<int> WifiScan::channels_ [private]

Definition at line 56 of file wifiscan.h.

char* WifiScan::interface_ [private]

Definition at line 55 of file wifiscan.h.

Definition at line 60 of file wifiscan.h.

struct iw_range WifiScan::range_ [private]

Definition at line 58 of file wifiscan.h.

int WifiScan::socket_ [private]

Definition at line 59 of file wifiscan.h.


The documentation for this class was generated from the following files:


wifi_scan
Author(s): Rafael Berkvens
autogenerated on Fri Aug 28 2015 13:41:23