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 13:52:21 +01:00
|
|
|
#include "point3d.hh"
|
|
|
|
#include "posutil.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
|
|
|
#include <iostream>
|
2008-04-11 10:11:29 +02:00
|
|
|
|
2009-12-11 13:52:21 +01:00
|
|
|
using namespace std ;
|
2008-04-11 10:11:29 +02:00
|
|
|
|
2009-12-11 13:52:21 +01:00
|
|
|
#define AP_DEFAULT_CHANNEL 6
|
|
|
|
#define AP_DEFAULT_ANTENNA_GAIN 2
|
|
|
|
#define AP_DEFAULT_TRX_POWER 20 // 20 dBm = 100 mW
|
2008-04-15 12:19:15 +02:00
|
|
|
|
2008-04-11 10:11:29 +02:00
|
|
|
class AccessPoint
|
2010-05-21 10:35:15 +02:00
|
|
|
{
|
|
|
|
protected:
|
2009-12-11 13:52:21 +01:00
|
|
|
Point3D coordinates ;
|
|
|
|
string ip_addr ;
|
|
|
|
string mac_addr ;
|
|
|
|
unsigned int frequency ; // Frequency (channel) in Hz
|
|
|
|
float antenna_gain ; // Antenna gain in dBi
|
|
|
|
float trx_power ; // Transmit power in dBm
|
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 13:52:21 +01:00
|
|
|
AccessPoint(const Point3D &_coordinates,
|
|
|
|
const string &_ip_addr,
|
|
|
|
const string &_mac_addr,
|
|
|
|
const unsigned int &_frequency = AP_DEFAULT_CHANNEL,
|
|
|
|
const float &_antenna_gain = AP_DEFAULT_ANTENNA_GAIN,
|
|
|
|
const float &_trx_power = AP_DEFAULT_TRX_POWER) ;
|
|
|
|
AccessPoint(const AccessPoint &ap) ;
|
|
|
|
|
|
|
|
~AccessPoint() {}
|
|
|
|
|
|
|
|
Point3D get_coordinates(void) const ;
|
|
|
|
string get_ip_addr(void) const ;
|
|
|
|
string get_mac_addr(void) const ;
|
|
|
|
unsigned int get_frequency(void) const ;
|
|
|
|
float get_antenna_gain(void) const ;
|
|
|
|
float get_trx_power(void) const ;
|
|
|
|
|
|
|
|
void set_coordinates(Point3D &_coordinates) ;
|
|
|
|
void set_ip_addr(const string &_ip_addr) ;
|
|
|
|
void set_mac_addr(const string &_mac_addr) ;
|
|
|
|
void set_frequency(unsigned int &_frequency) ;
|
|
|
|
void set_antenna_gain(float &_antenna_gain) ;
|
|
|
|
void set_trx_power(float &_trx_power) ;
|
|
|
|
|
|
|
|
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 // _OWLPS_POSITIONING_ACCESSPOINT_HH_
|