[Positioning] Add option update-ap-coordinates-online
In InputUDPSocket, update the AP's coordinates when receiving a calibration or autocalibration request that contains the coordinates. This is done if the option positioning.update-ap-coordinates-online is activated.
This commit is contained in:
parent
0dd57b8ea7
commit
de9513e4b4
|
@ -59,6 +59,12 @@ csv-file = /tmp/owlps-positioning.log
|
|||
# request is compared directly to each calibration request.
|
||||
#radar-average-reference-points = false
|
||||
|
||||
# When receiving a calibration or autocalibration request from an AP,
|
||||
# containing the transmiter's coordinates, memorise the new AP's
|
||||
# coordinates.
|
||||
# This is unactivated by default for the sake of security.
|
||||
#update-ap-coordinates-online = false
|
||||
|
||||
[output]
|
||||
|
||||
# This is the default output if none is specified.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "inputudpsocket.hh"
|
||||
#include "posexcept.hh"
|
||||
#include "stock.hh"
|
||||
#include "configuration.hh"
|
||||
|
||||
#include <owlps.h>
|
||||
|
||||
|
@ -158,6 +159,14 @@ const Request& InputUDPSocket::get_next_request()
|
|||
if (request.type == OWL_REQUEST_AUTOCALIBRATION && ! position)
|
||||
position = transmitter.get_coordinates() ;
|
||||
|
||||
// Update the AP's coordinates if allowed. A 'false' position
|
||||
// (i.e. 0;0;0) is only set for calibration requests, to avoid
|
||||
// setting the coordinates to 0;0;0 if an autocalibration
|
||||
// request that does not contain the coordinates is received.
|
||||
else if (Configuration::
|
||||
bool_value("positioning.update-ap-coordinates-online"))
|
||||
transmitter.set_coordinates(position) ;
|
||||
|
||||
const ReferencePoint &reference_point =
|
||||
Stock::find_create_reference_point(position) ;
|
||||
current_request_to_calibration_request(&reference_point,
|
||||
|
|
|
@ -186,6 +186,11 @@ 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.update-ap-coordinates-online",
|
||||
po::value<bool>()->default_value(false),
|
||||
"Allow AP's coordinates to be updated when a calibration request"
|
||||
" with new coordinates is received from the AP (default is false,"
|
||||
" for security purposes).")
|
||||
;
|
||||
|
||||
file_options->add(options) ;
|
||||
|
|
Loading…
Reference in New Issue