[Positioning] InputUDPSocket: use AP's coordinates

Use the transmitting AP's coordinates when receiving an autocalibration
request that does not contain the coordinates.
This commit is contained in:
Matteo Cypriani 2011-06-16 19:03:42 +02:00
parent 71784342e7
commit 0dd57b8ea7
1 changed files with 9 additions and 0 deletions

View File

@ -149,6 +149,15 @@ const Request& InputUDPSocket::get_next_request()
if (request.type == OWL_REQUEST_CALIBRATION ||
request.type == OWL_REQUEST_AUTOCALIBRATION)
{
AccessPoint &transmitter =
const_cast<AccessPoint&>(Stock::find_create_ap(mac_mobile)) ;
// If an autocalibration request does not contain the coordinates
// of the AP, we use the current coordinates of the AP as
// ReferencePoint.
if (request.type == OWL_REQUEST_AUTOCALIBRATION && ! position)
position = transmitter.get_coordinates() ;
const ReferencePoint &reference_point =
Stock::find_create_reference_point(position) ;
current_request_to_calibration_request(&reference_point,