diff options
author | eccopark@broadcom.com <eccopark@broadcom.com> | 2015-04-07 16:30:35 -0700 |
---|---|---|
committer | eccopark@broadcom.com <eccopark@broadcom.com> | 2015-04-08 11:29:39 -0700 |
commit | abe2d4864c8f15e4eb6d7dab64b159e47a605c21 (patch) | |
tree | ced3a5804c88b679151b6b3cab66cd52a3e1498d /bcmdhd | |
parent | c86b0f1aa52bb3e73a4ab2050a098f2ddc3d2a11 (diff) | |
download | hardware_broadcom_wlan-abe2d4864c8f15e4eb6d7dab64b159e47a605c21.zip hardware_broadcom_wlan-abe2d4864c8f15e4eb6d7dab64b159e47a605c21.tar.gz hardware_broadcom_wlan-abe2d4864c8f15e4eb6d7dab64b159e47a605c21.tar.bz2 |
rtt class change for HAL RTT API chage.
1) change the code for rtt_cancel to make it working.
=> we need to call the wifi_rtt_range_cancel
when we want to cancel the current RTT process
2) change the parameter for rtt.h change
Signed-off-by: eccopark@broadcom.com <eccopark@broadcom.com>
Change-Id: I87431c4ffca048b6b073941699ae8f1b4a4ea1ea
Diffstat (limited to 'bcmdhd')
-rw-r--r--[-rwxr-xr-x] | bcmdhd/wifi_hal/rtt.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/bcmdhd/wifi_hal/rtt.cpp b/bcmdhd/wifi_hal/rtt.cpp index 0d0b1e2..d6e7ca4 100755..100644 --- a/bcmdhd/wifi_hal/rtt.cpp +++ b/bcmdhd/wifi_hal/rtt.cpp @@ -44,14 +44,14 @@ typedef enum { RTT_ATTRIBUTE_TARGET_TYPE, RTT_ATTRIBUTE_TARGET_PEER, RTT_ATTRIBUTE_TARGET_CHAN, - RTT_ATTRIBUTE_TARGET_INTERVAL, + RTT_ATTRIBUTE_TARGET_PERIOD, RTT_ATTRIBUTE_TARGET_NUM_BURST, RTT_ATTRIBUTE_TARGET_NUM_FTM_BURST, RTT_ATTRIBUTE_TARGET_NUM_RETRY_FTM, RTT_ATTRIBUTE_TARGET_NUM_RETRY_FTMR, RTT_ATTRIBUTE_TARGET_LCI, RTT_ATTRIBUTE_TARGET_LCR, - RTT_ATTRIBUTE_TARGET_BURST_TIMEOUT, + RTT_ATTRIBUTE_TARGET_BURST_DURATION, RTT_ATTRIBUTE_TARGET_PREAMBLE, RTT_ATTRIBUTE_TARGET_BW, RTT_ATTRIBUTE_RESULTS_COMPLETE = 30, @@ -179,6 +179,14 @@ public: totalCnt = 0; } + RttCommand(wifi_interface_handle iface, int id) + : WifiCommand(iface, id) + { + currentIdx = 0; + mCompleted = 0; + totalCnt = 0; + numRttParams = 0; + } int createSetupRequest(WifiRequest& request) { int result = request.create(GOOGLE_OUI, RTT_SUBCMD_SET_CONFIG); @@ -242,7 +250,13 @@ public: return result; } - result = request.put_u32(RTT_ATTRIBUTE_TARGET_BURST_TIMEOUT, + result = request.put_u32(RTT_ATTRIBUTE_TARGET_PERIOD, + rttParams[i].burst_period); + if (result < 0) { + return result; + } + + result = request.put_u32(RTT_ATTRIBUTE_TARGET_BURST_DURATION, rttParams[i].burst_duration); if (result < 0) { return result; @@ -335,7 +349,7 @@ public: } int cancel_specific(unsigned num_devices, mac_addr addr[]) { - ALOGD("Stopping scan"); + ALOGE("Stopping RTT"); WifiRequest request(familyId(), ifaceId()); int result = createTeardownRequest(request, num_devices, addr); @@ -431,12 +445,13 @@ public: ALOGI("retrived rtt_result : \n\tburst_num :%d, measurement_number : %d, success_number : %d\n" "\tnumber_per_burst_peer : %d, status : %s, retry_after_duration : %d s\n" "\trssi : %d dbm, rx_rate : %d Kbps, rtt : %llu ns, rtt_sd : %llu\n" - "\tdistance : %d, burst_duration : %d ms\n", + "\tdistance : %d, burst_duration : %d ms, negotiated_burst_num : %d\n", rtt_result->burst_num, rtt_result->measurement_number, rtt_result->success_number, rtt_result->number_per_burst_peer, get_err_info(rtt_result->status), rtt_result->retry_after_duration, rtt_result->rssi, rtt_result->rx_rate.bitrate * 100, - rtt_result->rtt/10, rtt_result->rtt_sd, rtt_result->distance, rtt_result->burst_duration); + rtt_result->rtt/10, rtt_result->rtt_sd, rtt_result->distance, + rtt_result->burst_duration, rtt_result->negotiated_burst_num); currentIdx++; } } @@ -445,7 +460,6 @@ public: } if (mCompleted) { unregisterVendorHandler(GOOGLE_OUI, RTT_EVENT_COMPLETE); - wifi_unregister_cmd(wifiHandle(), id()); (*rttHandler.on_rtt_results)(id(), totalCnt, rttResults); for (int i = 0; i < currentIdx; i++) { free(rttResults[i]); @@ -474,13 +488,12 @@ wifi_error wifi_rtt_range_cancel(wifi_request_id id, wifi_interface_handle ifac unsigned num_devices, mac_addr addr[]) { wifi_handle handle = getWifiHandle(iface); - RttCommand *cmd = (RttCommand *)wifi_unregister_cmd(handle, id); + RttCommand *cmd = new RttCommand(iface, id); if (cmd) { cmd->cancel_specific(num_devices, addr); cmd->releaseRef(); return WIFI_SUCCESS; } - return WIFI_ERROR_INVALID_ARGS; } |