[Positioning] Add Stock::ap_matrix_get_ss()

Add double Stock::ap_matrix_get_ss(transmitter, receiver).
This is the first step to handle self-calibration in owlps-positioning.

The idea is to simulates a square matrix of the listeners, with the
transmitters in one dimension and the receivers in the other dimension.
matrix[transmitter][receiver] is the signal strength received by
'receiver' from 'transmitter'.
The purpose of Stock::ap_matrix_get_ss() is precisely to access the
entry matrix[transmitter][receiver].

Note that the access is read-only, as the pseudo-matrix is (or will be)
filled by the standard mechanism of (auto)calibration requests and
measurements stored in Stock.
This commit is contained in:
Matteo Cypriani 2011-06-15 15:30:49 +02:00
parent f84276d8d7
commit 71784342e7
2 changed files with 13 additions and 0 deletions

View File

@ -239,6 +239,17 @@ void Stock::update_all_friis_indexes()
}
double Stock::ap_matrix_get_ss(const std::string &mac_transmitter,
const std::string &mac_receiver)
{
const AccessPoint &receiver = get_ap(mac_receiver) ;
const ReferencePoint &rp =
get_reference_point(receiver.get_coordinates()) ;
return rp.average_measurements(mac_transmitter) ;
}
/* *** ReferencePoint operations *** */

View File

@ -93,6 +93,8 @@ public:
static AccessPoint& getw_ap(const std::string &mac) ;
/// Updates the friis indexes of all the APs
static void update_all_friis_indexes(void) ;
static double ap_matrix_get_ss(const std::string &mac_transmitter,
const std::string &mac_receiver) ;
//@}
/** @name ReferencePoint operations */