[Positioning] Add option accept-new-calibration-requests

The option positioning.accept-new-calibration-requests allows the
calibration requests sent during the positioning phase to be added to
the Stock. They are added to the calibration requests read by
InputDataReader during the start-up phase.
This commit is contained in:
Matteo Cypriani 2011-06-17 16:02:19 +02:00
parent 586cfdb77e
commit b8bd2acf44
3 changed files with 31 additions and 1 deletions

View File

@ -59,6 +59,15 @@ csv-file = /tmp/owlps-positioning.log
# request is compared directly to each calibration request.
#radar-average-reference-points = false
# This option allows the calibration requests sent during the
# positioning phase to be added to the calibration request's list. They
# are added to the calibration requests read by InputDataReader during
# the start-up phase. If this option is not activated, the calibration
# requests are handled as positioning requests.
# This option must be activated for the self-calibration to work, but
# it is not activated by default for security purposes.
#accept-new-calibration-requests = false
# When receiving a calibration or autocalibration request from an AP,
# containing the transmiter's coordinates, memorise the new AP's
# coordinates.

View File

@ -113,8 +113,22 @@ const Request& Input::get_next_request() const
{
if (! eof())
{
medium->get_next_request() ;
const Request& request = medium->get_next_request() ;
log_current_request() ;
// If the request is a calibration request, add it to the Stock
// (if allowed)
if (Configuration::
bool_value("positioning.accept-new-calibration-requests"))
{
if (! request) // Skip the request if empty
return request ;
CalibrationRequest *calibration_request =
dynamic_cast<CalibrationRequest*>(
const_cast<Request*>(&request)) ;
if (calibration_request != NULL)
Stock::store_calibration_request(*calibration_request) ;
}
}
return medium->get_current_request() ;

View File

@ -186,6 +186,13 @@ void UserInterface::fill_positioning_options()
" before to compute the SS distance."
" The default is false, i.e the positioning request is compared"
" directly to each calibration request.")
("positioning.accept-new-calibration-requests",
po::value<bool>()->default_value(false),
"Add the calibration requests received during the run-time to"
" the calibration requests' list; this is required for the"
" self-calibration. If unactivated, the calibration requests"
" are handled as positioning requests (default is unactivated,"
" for security purposes).")
("positioning.update-ap-coordinates-online",
po::value<bool>()->default_value(false),
"Allow AP's coordinates to be updated when a calibration request"