2009-12-11 13:52:21 +01:00
|
|
|
#ifndef _OWLPS_POSITIONING_ACCESSPOINT_HH_
|
|
|
|
#define _OWLPS_POSITIONING_ACCESSPOINT_HH_
|
2008-04-11 10:11:29 +02:00
|
|
|
|
2009-12-11 17:56:31 +01:00
|
|
|
#include "wifidevice.hh"
|
2009-12-11 13:52:21 +01:00
|
|
|
#include "point3d.hh"
|
Incorporation de la dernière version de Julien
Extrait de son courriel :
« Par rapport à la précédente j'ai surtout corrigé des bugs. »
Note : la version du listener portable sur Fonera, envoyée en même temps
par Julien, viendra plus tard (le temps que je l'incorpore).
Détail des changements après analyse du code :
aggregator : correction de bogues.
positioning :
* Ajout d'un fichier de config format boost (cfg/config.cfg).
* Makefile : implantation des cibles "install" et "uninstall" ; la cible
"astyle" devient "style".
* accesspoint.{hh,cc}, area.cc, measurement.hh, point.{hh,cc},
referencepoint.{hh,cc} : cosmétique.
* owlps-positioning.c : correction de la lecture du fichier de config
(ajout d'une option permettant de spécifier un fichier alternatif).
* server.cc : essentiellement correction des requêtes.
* libowlps-positioning.{hh,cc} : passage de "unsigned long long" à
"uint64_t" comme type de retour de timeval_to_ms().
writeInDb :
* Ajout de la gestion d'un fichier de config.
* Ajout de deux scripts pour la BDD.
git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@96 785a6c6c-259e-4ff1-8b91-dc31627914f0
2009-07-01 15:39:58 +02:00
|
|
|
|
2009-12-11 13:52:21 +01:00
|
|
|
#define AP_DEFAULT_CHANNEL 6
|
2009-12-11 17:56:31 +01:00
|
|
|
#define AP_DEFAULT_ANTENNA_GAIN 5
|
2008-04-15 12:19:15 +02:00
|
|
|
|
2009-12-11 17:56:31 +01:00
|
|
|
class AccessPoint: public WifiDevice
|
2010-05-21 10:35:15 +02:00
|
|
|
{
|
|
|
|
protected:
|
2009-12-11 13:52:21 +01:00
|
|
|
Point3D coordinates ;
|
|
|
|
unsigned int frequency ; // Frequency (channel) in Hz
|
Incorporation de la dernière version de Julien
Extrait de son courriel :
« Par rapport à la précédente j'ai surtout corrigé des bugs. »
Note : la version du listener portable sur Fonera, envoyée en même temps
par Julien, viendra plus tard (le temps que je l'incorpore).
Détail des changements après analyse du code :
aggregator : correction de bogues.
positioning :
* Ajout d'un fichier de config format boost (cfg/config.cfg).
* Makefile : implantation des cibles "install" et "uninstall" ; la cible
"astyle" devient "style".
* accesspoint.{hh,cc}, area.cc, measurement.hh, point.{hh,cc},
referencepoint.{hh,cc} : cosmétique.
* owlps-positioning.c : correction de la lecture du fichier de config
(ajout d'une option permettant de spécifier un fichier alternatif).
* server.cc : essentiellement correction des requêtes.
* libowlps-positioning.{hh,cc} : passage de "unsigned long long" à
"uint64_t" comme type de retour de timeval_to_ms().
writeInDb :
* Ajout de la gestion d'un fichier de config.
* Ajout de deux scripts pour la BDD.
git-svn-id: https://pif.pu-pm.univ-fcomte.fr/svn/loc@96 785a6c6c-259e-4ff1-8b91-dc31627914f0
2009-07-01 15:39:58 +02:00
|
|
|
|
2010-05-21 10:35:15 +02:00
|
|
|
public:
|
2009-12-11 17:56:31 +01:00
|
|
|
AccessPoint(const WifiDevice &wd,
|
|
|
|
const Point3D &_coordinates,
|
|
|
|
const unsigned int &_frequency = AP_DEFAULT_CHANNEL):
|
|
|
|
WifiDevice(wd), coordinates(_coordinates), frequency(_frequency) {}
|
2010-01-12 00:31:22 +01:00
|
|
|
AccessPoint(const Point3D &_coordinates = Point3D(),
|
|
|
|
const std::string &_ip_addr = "",
|
|
|
|
const std::string &_mac_addr = "",
|
2009-12-11 13:52:21 +01:00
|
|
|
const float &_antenna_gain = AP_DEFAULT_ANTENNA_GAIN,
|
2009-12-11 17:56:31 +01:00
|
|
|
const float &_trx_power = WIFIDEVICE_DEFAULT_TRX_POWER,
|
|
|
|
const unsigned int &_frequency = AP_DEFAULT_CHANNEL):
|
|
|
|
WifiDevice(_ip_addr, _mac_addr, _antenna_gain, _trx_power),
|
|
|
|
coordinates(_coordinates), frequency(_frequency) {}
|
|
|
|
AccessPoint(const WifiDevice &wd):
|
|
|
|
WifiDevice(wd), coordinates(Point3D()), frequency(0) {}
|
|
|
|
AccessPoint(const AccessPoint &ap):
|
|
|
|
WifiDevice(ap), coordinates(ap.coordinates), frequency(ap.frequency) {}
|
2009-12-11 13:52:21 +01:00
|
|
|
|
|
|
|
~AccessPoint() {}
|
|
|
|
|
2010-01-13 15:29:44 +01:00
|
|
|
const Point3D& get_coordinates(void) const ;
|
2009-12-11 13:52:21 +01:00
|
|
|
unsigned int get_frequency(void) const ;
|
|
|
|
|
|
|
|
void set_coordinates(Point3D &_coordinates) ;
|
|
|
|
void set_frequency(unsigned int &_frequency) ;
|
|
|
|
|
2010-01-13 15:29:44 +01:00
|
|
|
const AccessPoint& operator=(const AccessPoint &ap) ;
|
2009-12-11 17:56:31 +01:00
|
|
|
bool operator==(const AccessPoint &ap) const ;
|
|
|
|
bool operator!=(const AccessPoint &ap) const ;
|
2009-12-11 13:52:21 +01:00
|
|
|
|
2010-01-04 17:10:42 +01:00
|
|
|
friend std::ostream &operator<<(std::ostream &os, const AccessPoint &ap) ;
|
2009-12-11 13:52:21 +01:00
|
|
|
} ;
|
|
|
|
|
2010-01-05 11:50:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*** Accesseurs lecture ***/
|
|
|
|
|
|
|
|
|
2010-01-13 15:29:44 +01:00
|
|
|
inline const Point3D& AccessPoint::get_coordinates() const
|
2010-01-05 11:50:24 +01:00
|
|
|
{
|
|
|
|
return coordinates ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline unsigned int AccessPoint::get_frequency() const
|
|
|
|
{
|
|
|
|
return frequency ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** Accesseurs écriture ***/
|
|
|
|
|
|
|
|
|
|
|
|
inline void AccessPoint::set_coordinates(Point3D &_coordinates)
|
|
|
|
{
|
|
|
|
coordinates = _coordinates ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inline void AccessPoint::set_frequency(unsigned int &_frequency)
|
|
|
|
{
|
|
|
|
frequency = _frequency ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*** Opérateurs ***/
|
|
|
|
|
|
|
|
|
|
|
|
inline bool AccessPoint::operator!=(const AccessPoint &ap) const
|
|
|
|
{
|
|
|
|
return !(*this == ap) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-11 13:52:21 +01:00
|
|
|
#endif // _OWLPS_POSITIONING_ACCESSPOINT_HH_
|