From 00fd7bc33b6453a3cb0490ca1e89e0502b77b5b5 Mon Sep 17 00:00:00 2001 From: Jiafei Wen Date: Mon, 3 Nov 2014 14:27:23 -0800 Subject: [PATCH] Report 2D speed rather than 3D speed. According to Android API standard, it should be only the horizontal speed. Therefore, the speed should be reported in 2D rather than 3D. Change-Id: Ie42aa350637b56394869bac0af0207a5aceeede6 CRs-fixed: 745419 --- .../libloc_api-rpc-glue/src/LocApiRpc.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index 87d6b7c5..dbfc2fb7 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -715,12 +715,10 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re } // Speed - if ((location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) && - (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_VERTICAL)) + if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL) { location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED; - location.gpsLocation.speed = sqrt(location_report_ptr->speed_horizontal * location_report_ptr->speed_horizontal + - location_report_ptr->speed_vertical * location_report_ptr->speed_vertical); + location.gpsLocation.speed = location_report_ptr->speed_horizontal; } // Heading