95 lines
2.1 KiB
C++
95 lines
2.1 KiB
C++
#ifndef _ACCESSPOINT_HH_
|
|
#define _ACCESSPOINT_HH_
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
#include "point.hh"
|
|
|
|
using namespace std;
|
|
using std::string;
|
|
|
|
#define AP_DEFAULT_ADDR ""
|
|
#define AP_DEFAULT_FRIIS_INDEX 0
|
|
#define AP_DEFAULT_FREQ 2412
|
|
#define AP_DEFAULT_ANTENNA_GAIN 2 // A good value
|
|
#define AP_DEFAULT_OUTPUT_POWER 20 // Another good value, eq. to 100mW
|
|
|
|
class AccessPoint
|
|
{
|
|
protected:
|
|
Point coordinates;
|
|
string ap_addr;
|
|
float friis_index;
|
|
unsigned int freq;
|
|
float antenna_gain;
|
|
float output_power;
|
|
|
|
public:
|
|
AccessPoint(const string &addr = AP_DEFAULT_ADDR, const float &fidx = AP_DEFAULT_FRIIS_INDEX, const Point &coords = Point(), const unsigned int &f = AP_DEFAULT_FREQ, const float &antg = AP_DEFAULT_ANTENNA_GAIN, const float &outp = AP_DEFAULT_OUTPUT_POWER);
|
|
AccessPoint(const AccessPoint &ap);
|
|
~AccessPoint() {};
|
|
|
|
string getApAddr()const
|
|
{
|
|
return ap_addr;
|
|
};
|
|
float getFriisIndex()const
|
|
{
|
|
return friis_index;
|
|
};
|
|
Point getCoordinates()const
|
|
{
|
|
return coordinates;
|
|
};
|
|
float getAntennaGain()const
|
|
{
|
|
return antenna_gain;
|
|
};
|
|
unsigned int getFrequency()const
|
|
{
|
|
return freq;
|
|
};
|
|
float getOutputPower()const
|
|
{
|
|
return output_power;
|
|
};
|
|
|
|
void setApAddr(const string &addr)
|
|
{
|
|
ap_addr = addr;
|
|
};
|
|
void setFriisIndex(const float &fidx)
|
|
{
|
|
friis_index = fidx;
|
|
};
|
|
void setCoordinates(const Point &apc)
|
|
{
|
|
coordinates = apc;
|
|
};
|
|
void setCoordinates(const float &x, const float &y, const float &z)
|
|
{
|
|
Point apc(x, y, z);
|
|
coordinates = apc;
|
|
};
|
|
void setFrequency(const unsigned int &f)
|
|
{
|
|
freq = f;
|
|
};
|
|
void setAntennaGain(const float &antg)
|
|
{
|
|
antenna_gain = antg;
|
|
};
|
|
void setOutputPower(const float &outp)
|
|
{
|
|
output_power = outp;
|
|
};
|
|
|
|
bool operator==(const AccessPoint &ap)const;
|
|
bool operator!=(const AccessPoint &ap)const;
|
|
AccessPoint operator=(const AccessPoint &ap);
|
|
friend ostream &operator<<(ostream &os, const AccessPoint &ap);
|
|
};
|
|
|
|
#endif // _ACCESSPOINT_HH_
|