59 lines
1.4 KiB
C++
59 lines
1.4 KiB
C++
#include "accesspoint.hh"
|
|
|
|
|
|
AccessPoint::AccessPoint(string addr, float fidx, Point coords, unsigned int f, float antg, float outp)
|
|
{
|
|
coordinates = coords;
|
|
ap_addr = addr;
|
|
friis_index = fidx;
|
|
freq = f;
|
|
antenna_gain = antg;
|
|
output_power = outp;
|
|
|
|
//cout << "coords = " << coords << " ; addr = " << addr << " ; fidx = " << fidx << " ; antg = " << antg << " ; outp = " << outp << endl ;
|
|
}
|
|
|
|
AccessPoint::AccessPoint(const AccessPoint &ap)
|
|
{
|
|
coordinates = ap.coordinates;
|
|
ap_addr = ap.ap_addr;
|
|
friis_index = ap.friis_index;
|
|
freq = ap.freq;
|
|
antenna_gain = ap.antenna_gain;
|
|
output_power = ap.output_power;
|
|
}
|
|
|
|
bool AccessPoint::operator==(const AccessPoint &ap)const
|
|
{
|
|
if(ap_addr == ap.ap_addr)
|
|
return true;
|
|
return false;
|
|
}
|
|
|
|
bool AccessPoint::operator!=(const AccessPoint &ap)const
|
|
{
|
|
if(ap_addr != ap.ap_addr)
|
|
return true;
|
|
return false;
|
|
}
|
|
|
|
AccessPoint AccessPoint::operator=(const AccessPoint &ap)
|
|
{
|
|
if(this == &ap)
|
|
return *this;
|
|
ap_addr = ap.ap_addr;
|
|
friis_index = ap.friis_index;
|
|
return *this;
|
|
}
|
|
|
|
ostream &operator<<(ostream & os, AccessPoint & ap)
|
|
{
|
|
os << "MAC Address: " << ap.ap_addr << endl;
|
|
os << "Coordinates: " << ap.coordinates << endl;
|
|
os << "Frequency: " << ap.freq << " Hz" << endl;
|
|
os << "Antenna gain: " << ap.antenna_gain << "dBi" << endl;
|
|
os << "Output power: " << ap.output_power << "dBm" << endl;
|
|
|
|
return os;
|
|
}
|