owlps/owlps-positioning/wifidevice.hh

46 lines
1.3 KiB
C++

#ifndef _OWLPS_POSITIONING_WIFIDEVICE_HH_
#define _OWLPS_POSITIONING_WIFIDEVICE_HH_
#include "posutil.hh"
#include <iostream>
#define WIFIDEVICE_DEFAULT_ANTENNA_GAIN 2
#define WIFIDEVICE_DEFAULT_TRX_POWER 20 // 20 dBm = 100 mW
class WifiDevice
{
protected:
std::string ip_addr ;
std::string mac_addr ;
float antenna_gain ; // Antenna gain in dBi
float trx_power ; // Transmit power in dBm
public:
WifiDevice(const std::string &_ip_addr,
const std::string &_mac_addr,
const float &_antenna_gain = WIFIDEVICE_DEFAULT_ANTENNA_GAIN,
const float &_trx_power = WIFIDEVICE_DEFAULT_TRX_POWER) ;
WifiDevice(const WifiDevice &wd) ;
~WifiDevice() {}
std::string get_ip_addr(void) const ;
std::string get_mac_addr(void) const ;
float get_antenna_gain(void) const ;
float get_trx_power(void) const ;
void set_ip_addr(const std::string &_ip_addr) ;
void set_mac_addr(const std::string &_mac_addr) ;
void set_antenna_gain(float &_antenna_gain) ;
void set_trx_power(float &_trx_power) ;
WifiDevice operator=(const WifiDevice &wd) ;
bool operator==(const WifiDevice &wd) const ;
bool operator!=(const WifiDevice &wl) const ;
friend std::ostream &operator<<(std::ostream &os, const WifiDevice &wd) ;
} ;
#endif // _OWLPS_POSITIONING_WIFIDEVICE_HH_