66 lines
1.5 KiB
C++
66 lines
1.5 KiB
C++
#ifndef _LIBOWLPS_POSITINING_HH_
|
|
#define _LIBOWLPS_POSITINING_HH_
|
|
|
|
#include <cstdio>
|
|
#include <iostream>
|
|
#include <fstream>
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <cstring>
|
|
#include <cmath>
|
|
#include <cstdlib>
|
|
#include <stdint.h>
|
|
|
|
#include <map>
|
|
#include <set>
|
|
#include <vector>
|
|
|
|
#include <ctime>
|
|
#include <sys/time.h>
|
|
|
|
#include <postgresql/libpq-fe.h>
|
|
|
|
|
|
#define DEFAULT_AP_FILE "csv/minipc.cfg"
|
|
#define DEFAULT_PT_FILE "csv/toutes.csv"
|
|
#define DEFAULT_TOPO_FILE "csv/topo.csv"
|
|
#define DEFAULT_WAYPOINT_FILE "csv/waypoints.csv"
|
|
|
|
#define DEFAULT_CONFIG_FILE "owlps-positioning.cfg"
|
|
|
|
#define DEFAULT_BDD_HOST "127.0.0.1"
|
|
#define DEFAULT_BDD_NAME "owlps_db"
|
|
#define DEFAULT_BDD_USER "owlps"
|
|
#define DEFAULT_BDD_PASS "owlps"
|
|
|
|
#define LIGHT_SPEED 300000000
|
|
#define MINMAX_STEP 0.5
|
|
#define MINMAX_X_START 0.5
|
|
#define MINMAX_Y_START 0.5
|
|
#define MINMAX_Z_START 0
|
|
#define MINMAX_X_STOP 10
|
|
#define MINMAX_Y_STOP 31.5
|
|
#define MINMAX_Z_STOP 6
|
|
|
|
typedef struct _couple_info
|
|
{
|
|
unsigned char ap_mac_addr_bytes[6]; // Adresse MAC de l'AP
|
|
int antenna_signal_dbm; // Puissance du signal reçu par l'AP
|
|
} couple_info;
|
|
|
|
typedef struct _request
|
|
{
|
|
unsigned char mobile_mac_addr_bytes[6]; //Adresse MAC du mobile
|
|
struct timeval request_time; // Date sur le client
|
|
int nb_couples; // Nombre couples (MAC AP;Puissance)
|
|
} request;
|
|
|
|
using namespace std;
|
|
|
|
float round_float(float f, int n);
|
|
vector<string> explode(const string &input, const char &sep);
|
|
vector<string> extractReferencePointInfoFromBuffer(const string &buffer_in);
|
|
uint64_t timeval_to_ms(const struct timeval &d);
|
|
|
|
#endif
|