From 0dd57b8ea7d08e846bb6b83655053d62f8f4046d Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Thu, 16 Jun 2011 19:03:42 +0200 Subject: [PATCH] [Positioning] InputUDPSocket: use AP's coordinates Use the transmitting AP's coordinates when receiving an autocalibration request that does not contain the coordinates. --- owlps-positioning/src/inputudpsocket.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/owlps-positioning/src/inputudpsocket.cc b/owlps-positioning/src/inputudpsocket.cc index 174804d..69bfa2f 100644 --- a/owlps-positioning/src/inputudpsocket.cc +++ b/owlps-positioning/src/inputudpsocket.cc @@ -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(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,