nlattr *vendor_data = event.get_attribute(NL80211_ATTR_VENDOR_DATA);\r
int len = event.get_vendor_data_len();\r
int event_id = event.get_vendor_subcmd();\r
- ALOGD("handleEvent, event_id = %d", event_id);\r
+ ALOGD("handleEvent, event_id = %d", event_id);\r
\r
if(event_id == GSCAN_EVENT_COMPLETE_SCAN) {\r
if (vendor_data == NULL || len != 4) {\r
if (result < 0) {\r
return result;\r
}\r
- result = request.put_u8(GSCAN_ATTRIBUTE_CHANNEL_NUMBER, mParams.ap[i].channel);\r
+ result = request.put_u16(GSCAN_ATTRIBUTE_CHANNEL_NUMBER, mParams.ap[i].channel);\r
if (result < 0) {\r
return result;\r
}\r
\r
ALOGD("Successfully set %d APs in the hotlist", mParams.num_ap);\r
\r
- result = createFeatureRequest(request, SLSI_NL80211_VENDOR_SUBCMD_ADD_GSCAN);\r
- if (result < 0) {\r
- return result;\r
- }\r
-\r
registerVendorHandler(GOOGLE_OUI, GSCAN_EVENT_HOTLIST_RESULTS_FOUND);\r
registerVendorHandler(GOOGLE_OUI, GSCAN_EVENT_HOTLIST_RESULTS_LOST);\r
\r
- result = requestResponse(request);\r
- if (result != WIFI_SUCCESS) {\r
- ALOGE("failed to start scan; result = %d", result);\r
- unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_HOTLIST_RESULTS_FOUND);\r
- unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_HOTLIST_RESULTS_LOST);\r
- return result;\r
- }\r
-\r
- ALOGD("successfully restarted the scan");\r
-\r
return result;\r
}\r
\r
if (result < 0) {\r
return result;\r
}\r
+ result = request.put_u16(GSCAN_ATTRIBUTE_CHANNEL, mParams.ap[i].channel);\r
+ if (result < 0) {\r
+ return result;\r
+ }\r
request.attr_end(attr2);\r
}\r
\r
ALOGD("failed to set significant wifi change %d", result);\r
return result;\r
}\r
-\r
- result = createFeatureRequest(request, SLSI_NL80211_VENDOR_SUBCMD_ADD_GSCAN);\r
- if (result < 0) {\r
- return result;\r
- }\r
-\r
registerVendorHandler(GOOGLE_OUI, GSCAN_EVENT_SIGNIFICANT_CHANGE_RESULTS);\r
\r
- result = requestResponse(request);\r
- if (result < 0) {\r
- unregisterVendorHandler(GOOGLE_OUI, GSCAN_EVENT_SIGNIFICANT_CHANGE_RESULTS);\r
- return result;\r
- }\r
-\r
- ALOGD("successfully restarted the scan");\r
return result;\r
}\r
\r
for (int i = 0; i < num; i++) {\r
memcpy(mResultsBuffer[i].bssid, ci[i].bssid, sizeof(mac_addr));\r
mResultsBuffer[i].channel = ci[i].channel;\r
- mResultsBuffer[i].num_rssi = 8;\r
- for (int j = 0; j < mResultsBuffer[i].num_rssi; j++)\r
+ /* Driver sends N samples and the rest 8-N are filled 0x7FFF\r
+ * N = no of rssi samples to average sent in significant change request. */\r
+ int num_rssi = 0;\r
+ for (int j = 0; j < 8; j++) {\r
+ if (ci[i].rssi_history[j] == 0x7FFF) {\r
+ num_rssi = j;\r
+ break;\r
+ }\r
mResultsBuffer[i].rssi[j] = (int) ci[i].rssi_history[j];\r
+ }\r
+ mResultsBuffer[i].num_rssi = num_rssi;\r
mResults[i] = reinterpret_cast<wifi_significant_change_result *>(&(mResultsBuffer[i]));\r
}\r
\r