2012-02-06 16:44:09 +01:00
|
|
|
/*
|
2013-05-29 18:43:35 +02:00
|
|
|
* This file is part of the Owl Positioning System (OwlPS) project.
|
|
|
|
* It is subject to the copyright notice and license terms in the
|
|
|
|
* COPYRIGHT.t2t file found in the top-level directory of this
|
|
|
|
* distribution and at
|
2016-11-03 05:10:34 +01:00
|
|
|
* https://code.lm7.fr/mcy/owlps/src/master/COPYRIGHT.t2t
|
2013-05-29 18:43:35 +02:00
|
|
|
* No part of the OwlPS Project, including this file, may be copied,
|
|
|
|
* modified, propagated, or distributed except according to the terms
|
|
|
|
* contained in the COPYRIGHT.t2t file; the COPYRIGHT.t2t file must be
|
|
|
|
* distributed along with this file, either separately or by replacing
|
2013-06-22 23:30:17 +02:00
|
|
|
* this notice by the COPYRIGHT.t2t file's contents.
|
2012-02-06 16:44:09 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2009-12-11 17:56:31 +01:00
|
|
|
#include "wifidevice.hh"
|
|
|
|
|
2010-01-04 17:10:42 +01:00
|
|
|
using namespace std ;
|
|
|
|
|
|
|
|
|
2009-12-11 17:56:31 +01:00
|
|
|
|
2010-01-16 12:23:07 +01:00
|
|
|
/* *** Operators *** */
|
2009-12-11 17:56:31 +01:00
|
|
|
|
|
|
|
|
2011-07-30 20:38:42 +02:00
|
|
|
WifiDevice& WifiDevice::operator=(const WifiDevice &wd)
|
2009-12-11 17:56:31 +01:00
|
|
|
{
|
|
|
|
if (this == &wd)
|
|
|
|
return *this ;
|
|
|
|
|
|
|
|
ip_addr = wd.ip_addr ;
|
|
|
|
mac_addr = wd.mac_addr ;
|
|
|
|
antenna_gain = wd.antenna_gain ;
|
|
|
|
trx_power = wd.trx_power ;
|
|
|
|
|
|
|
|
return *this ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool WifiDevice::operator==(const WifiDevice &wd) const
|
|
|
|
{
|
|
|
|
if (this == &wd)
|
|
|
|
return true ;
|
|
|
|
|
|
|
|
return
|
|
|
|
ip_addr == wd.ip_addr &&
|
|
|
|
mac_addr == wd.mac_addr &&
|
|
|
|
antenna_gain == wd.antenna_gain &&
|
|
|
|
trx_power == wd.trx_power ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ostream &operator<<(ostream &os, const WifiDevice &wd)
|
|
|
|
{
|
|
|
|
os
|
2010-01-13 15:29:44 +01:00
|
|
|
<< "IP address: " << wd.ip_addr << '\n'
|
|
|
|
<< "MAC address: " << wd.mac_addr << '\n'
|
|
|
|
<< "Antenna gain: " << wd.antenna_gain << "dBi" << '\n'
|
2009-12-11 17:56:31 +01:00
|
|
|
<< "Output power: " << wd.trx_power << "dBm" ;
|
|
|
|
|
|
|
|
return os ;
|
|
|
|
}
|