Merge "Wi-Fi/NAN HAL/service fixups"

am: 7f1c9647b8

Change-Id: I9cf88ab989a4365c15cc3a48aa446e1452e3efe0
This commit is contained in:
Etan Cohen 2017-02-01 05:37:22 +00:00 committed by android-build-merger
commit cc195e0c67
4 changed files with 83 additions and 33 deletions

View file

@ -162,8 +162,10 @@ interface IWifiNanIfaceEventCallback {
* |NanStatusType.INTERNAL_FAILURE|
* |NanStatusType.PROTOCOL_FAILURE|
* |NanStatusType.INVALID_PEER_ID|
* @param ndpInstanceId ID of the new data path being negotiated (on successful status).
*/
oneway notifyInitiateDataPathResponse(CommandIdShort id, WifiNanStatus status);
oneway notifyInitiateDataPathResponse(CommandIdShort id, WifiNanStatus status,
uint32_t ndpInstanceId );
/**
* Callback invoked in response to a respond to data path indication request
@ -176,10 +178,8 @@ interface IWifiNanIfaceEventCallback {
* |NanStatusType.INTERNAL_FAILURE|
* |NanStatusType.PROTOCOL_FAILURE|
* |NanStatusType.INVALID_NDP_ID|
* @param ndpInstanceId ID of the new data path being negotiated (on successful status).
*/
oneway notifyRespondToDataPathIndicationResponse(CommandIdShort id, WifiNanStatus status,
uint32_t ndpInstanceId);
oneway notifyRespondToDataPathIndicationResponse(CommandIdShort id, WifiNanStatus status);
/**
* Callback invoked in response to a terminate data path request |terminateDataPathRequest|.

View file

@ -759,17 +759,17 @@ bool convertHidlNanEnableRequestToLegacy(
const NanEnableRequest& hidl_request,
legacy_hal::NanEnableRequest* legacy_request) {
if (!legacy_request) {
LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: null legacy_request";
return false;
}
memset(legacy_request, 0, sizeof(legacy_hal::NanEnableRequest));
// TODO: b/34059183 tracks missing configurations in legacy HAL or uknown defaults
legacy_request->config_2dot4g_support = 1;
legacy_request->support_2dot4g_val = hidl_request.operateInBand[
(size_t) NanBandIndex::NAN_BAND_24GHZ];
legacy_request->config_support_5g = 1;
legacy_request->support_5g_val = hidl_request.operateInBand[(size_t) NanBandIndex::NAN_BAND_5GHZ];
legacy_request->config_hop_count_limit = 0; // TODO: don't know default yet
legacy_request->config_hop_count_limit = 1;
legacy_request->hop_count_limit_val = hidl_request.hopCountMax;
legacy_request->master_pref = hidl_request.configParams.masterPref;
legacy_request->discovery_indication_cfg = 0;
@ -781,11 +781,12 @@ bool convertHidlNanEnableRequestToLegacy(
hidl_request.configParams.disableJoinedClusterIndication ? 0x4 : 0x0;
legacy_request->config_sid_beacon = 1;
if (hidl_request.configParams.numberOfServiceIdsInBeacon > 127) {
LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: numberOfServiceIdsInBeacon > 127";
return false;
}
legacy_request->sid_beacon_val = (hidl_request.configParams.includeServiceIdsInBeacon ? 0x1 : 0x0)
| (hidl_request.configParams.numberOfServiceIdsInBeacon << 1);
legacy_request->config_rssi_window_size = 0; // TODO: don't know default yet
legacy_request->config_rssi_window_size = 1;
legacy_request->rssi_window_size_val = hidl_request.configParams.rssiWindowSize;
legacy_request->config_disc_mac_addr_randomization = 1;
legacy_request->disc_mac_addr_rand_interval_sec =
@ -793,19 +794,23 @@ bool convertHidlNanEnableRequestToLegacy(
legacy_request->config_responder_auto_response = 1;
legacy_request->ranging_auto_response_cfg = hidl_request.configParams.acceptRangingRequests ?
legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
legacy_request->config_2dot4g_rssi_close = 0; // TODO: don't know default yet
legacy_request->config_2dot4g_rssi_close = 1;
if (hidl_request.configParams.bandSpecificConfig.size() != 2) {
LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: bandSpecificConfig.size() != 2";
return false;
}
legacy_request->rssi_close_2dot4g_val =
hidl_request.configParams.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_24GHZ].rssiClose;
legacy_request->config_2dot4g_rssi_middle = 0; // TODO: don't know default yet
legacy_request->config_2dot4g_rssi_middle = 1;
legacy_request->rssi_middle_2dot4g_val =
hidl_request.configParams.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_24GHZ].rssiMiddle;
legacy_request->config_2dot4g_rssi_proximity = 0; // TODO: don't know default yet
legacy_request->config_2dot4g_rssi_proximity = 1;
legacy_request->rssi_proximity_2dot4g_val =
hidl_request.configParams.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
legacy_request->config_scan_params = 0; // TODO: don't know default yet
legacy_request->config_scan_params = 1;
legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
hidl_request.configParams.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs;
@ -816,15 +821,15 @@ bool convertHidlNanEnableRequestToLegacy(
.bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].validDiscoveryWindowIntervalVal;
legacy_request->config_dw.dw_2dot4g_interval_val = hidl_request.configParams
.bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].discoveryWindowIntervalVal;
legacy_request->config_5g_rssi_close = 0; // TODO: don't know default yet
legacy_request->config_5g_rssi_close = 1;
legacy_request->rssi_close_5g_val =
hidl_request.configParams.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_5GHZ].rssiClose;
legacy_request->config_5g_rssi_middle = 0; // TODO: don't know default yet
legacy_request->config_5g_rssi_middle = 1;
legacy_request->rssi_middle_5g_val =
hidl_request.configParams.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_5GHZ].rssiMiddle;
legacy_request->config_5g_rssi_close_proximity = 0; // TODO: don't know default yet
legacy_request->config_5g_rssi_close_proximity = 1;
legacy_request->rssi_close_proximity_5g_val =
hidl_request.configParams.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_5GHZ].rssiProximity;
@ -885,6 +890,7 @@ bool convertHidlNanPublishRequestToLegacy(
const NanPublishRequest& hidl_request,
legacy_hal::NanPublishRequest* legacy_request) {
if (!legacy_request) {
LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: null legacy_request";
return false;
}
memset(legacy_request, 0, sizeof(legacy_hal::NanPublishRequest));
@ -895,14 +901,16 @@ bool convertHidlNanPublishRequestToLegacy(
legacy_request->publish_count = hidl_request.baseConfigs.discoveryCount;
legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size();
if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: service_name_len too large";
return false;
}
memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.c_str(),
memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.data(),
legacy_request->service_name_len);
legacy_request->publish_match_indicator =
(legacy_hal::NanMatchAlg) hidl_request.baseConfigs.discoveryMatchIndicator;
legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size();
if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: service_specific_info_len too large";
return false;
}
memcpy(legacy_request->service_specific_info,
@ -910,6 +918,7 @@ bool convertHidlNanPublishRequestToLegacy(
legacy_request->service_specific_info_len);
legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size();
if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: rx_match_filter_len too large";
return false;
}
memcpy(legacy_request->rx_match_filter,
@ -917,6 +926,7 @@ bool convertHidlNanPublishRequestToLegacy(
legacy_request->rx_match_filter_len);
legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size();
if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: tx_match_filter_len too large";
return false;
}
memcpy(legacy_request->tx_match_filter,
@ -933,6 +943,7 @@ bool convertHidlNanPublishRequestToLegacy(
legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes;
legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: pmk_len too large";
return false;
}
memcpy(legacy_request->pmk,
@ -957,6 +968,7 @@ bool convertHidlNanSubscribeRequestToLegacy(
const NanSubscribeRequest& hidl_request,
legacy_hal::NanSubscribeRequest* legacy_request) {
if (!legacy_request) {
LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: legacy_request is null";
return false;
}
memset(legacy_request, 0, sizeof(legacy_hal::NanSubscribeRequest));
@ -967,14 +979,16 @@ bool convertHidlNanSubscribeRequestToLegacy(
legacy_request->subscribe_count = hidl_request.baseConfigs.discoveryCount;
legacy_request->service_name_len = hidl_request.baseConfigs.serviceName.size();
if (legacy_request->service_name_len > NAN_MAX_SERVICE_NAME_LEN) {
LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: service_name_len too large";
return false;
}
memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.c_str(),
memcpy(legacy_request->service_name, hidl_request.baseConfigs.serviceName.data(),
legacy_request->service_name_len);
legacy_request->subscribe_match_indicator =
(legacy_hal::NanMatchAlg) hidl_request.baseConfigs.discoveryMatchIndicator;
legacy_request->service_specific_info_len = hidl_request.baseConfigs.serviceSpecificInfo.size();
if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: service_specific_info_len too large";
return false;
}
memcpy(legacy_request->service_specific_info,
@ -982,6 +996,7 @@ bool convertHidlNanSubscribeRequestToLegacy(
legacy_request->service_specific_info_len);
legacy_request->rx_match_filter_len = hidl_request.baseConfigs.rxMatchFilter.size();
if (legacy_request->rx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: rx_match_filter_len too large";
return false;
}
memcpy(legacy_request->rx_match_filter,
@ -989,6 +1004,7 @@ bool convertHidlNanSubscribeRequestToLegacy(
legacy_request->rx_match_filter_len);
legacy_request->tx_match_filter_len = hidl_request.baseConfigs.txMatchFilter.size();
if (legacy_request->tx_match_filter_len > NAN_MAX_MATCH_FILTER_LEN) {
LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: tx_match_filter_len too large";
return false;
}
memcpy(legacy_request->tx_match_filter,
@ -1005,6 +1021,7 @@ bool convertHidlNanSubscribeRequestToLegacy(
legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes;
legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size();
if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: pmk_len too large";
return false;
}
memcpy(legacy_request->pmk,
@ -1029,6 +1046,7 @@ bool convertHidlNanSubscribeRequestToLegacy(
legacy_hal::NAN_SSI_REQUIRED_IN_MATCH_IND : legacy_hal::NAN_SSI_NOT_REQUIRED_IN_MATCH_IND;
legacy_request->num_intf_addr_present = hidl_request.intfAddr.size();
if (legacy_request->num_intf_addr_present > NAN_MAX_SUBSCRIBE_MAX_ADDRESS) {
LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: num_intf_addr_present - too many";
return false;
}
for (int i = 0; i < legacy_request->num_intf_addr_present; i++) {
@ -1042,6 +1060,7 @@ bool convertHidlNanTransmitFollowupRequestToLegacy(
const NanTransmitFollowupRequest& hidl_request,
legacy_hal::NanTransmitFollowupRequest* legacy_request) {
if (!legacy_request) {
LOG(ERROR) << "convertHidlNanTransmitFollowupRequestToLegacy: legacy_request is null";
return false;
}
memset(legacy_request, 0, sizeof(legacy_hal::NanTransmitFollowupRequest));
@ -1055,6 +1074,7 @@ bool convertHidlNanTransmitFollowupRequestToLegacy(
legacy_hal::NAN_TRANSMIT_IN_DW : legacy_hal::NAN_TRANSMIT_IN_FAW;
legacy_request->service_specific_info_len = hidl_request.message.size();
if (legacy_request->service_specific_info_len > NAN_MAX_SERVICE_SPECIFIC_INFO_LEN) {
LOG(ERROR) << "convertHidlNanTransmitFollowupRequestToLegacy: service_specific_info_len too large";
return false;
}
memcpy(legacy_request->service_specific_info,
@ -1069,6 +1089,7 @@ bool convertHidlNanConfigRequestToLegacy(
const NanConfigRequest& hidl_request,
legacy_hal::NanConfigRequest* legacy_request) {
if (!legacy_request) {
LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: legacy_request is null";
return false;
}
memset(legacy_request, 0, sizeof(legacy_hal::NanConfigRequest));
@ -1084,11 +1105,12 @@ bool convertHidlNanConfigRequestToLegacy(
hidl_request.disableJoinedClusterIndication ? 0x4 : 0x0;
legacy_request->config_sid_beacon = 1;
if (hidl_request.numberOfServiceIdsInBeacon > 127) {
LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: numberOfServiceIdsInBeacon > 127";
return false;
}
legacy_request->sid_beacon = (hidl_request.includeServiceIdsInBeacon ? 0x1 : 0x0)
| (hidl_request.numberOfServiceIdsInBeacon << 1);
legacy_request->config_rssi_window_size = 0; // TODO: don't know default yet
legacy_request->config_rssi_window_size = 1;
legacy_request->rssi_window_size_val = hidl_request.rssiWindowSize;
legacy_request->config_disc_mac_addr_randomization = 1;
legacy_request->disc_mac_addr_rand_interval_sec =
@ -1097,20 +1119,20 @@ bool convertHidlNanConfigRequestToLegacy(
legacy_request->ranging_auto_response_cfg = hidl_request.acceptRangingRequests ?
legacy_hal::NAN_RANGING_AUTO_RESPONSE_ENABLE : legacy_hal::NAN_RANGING_AUTO_RESPONSE_DISABLE;
/* TODO : missing
legacy_request->config_2dot4g_rssi_close = 0; // TODO: don't know default yet
legacy_request->config_2dot4g_rssi_close = 1;
legacy_request->rssi_close_2dot4g_val =
hidl_request.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_24GHZ].rssiClose;
legacy_request->config_2dot4g_rssi_middle = 0; // TODO: don't know default yet
legacy_request->config_2dot4g_rssi_middle = 1;
legacy_request->rssi_middle_2dot4g_val =
hidl_request.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_24GHZ].rssiMiddle;
legacy_request->config_2dot4g_rssi_proximity = 0; // TODO: don't know default yet
legacy_request->config_2dot4g_rssi_proximity = 1;
legacy_request->rssi_proximity_2dot4g_val =
hidl_request.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
*/
legacy_request->config_scan_params = 0; // TODO: don't know default yet
legacy_request->config_scan_params = 1;
legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
hidl_request.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_24GHZ].dwellTimeMs;
@ -1122,16 +1144,16 @@ bool convertHidlNanConfigRequestToLegacy(
legacy_request->config_dw.dw_2dot4g_interval_val = hidl_request
.bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_24GHZ].discoveryWindowIntervalVal;
/* TODO: missing
legacy_request->config_5g_rssi_close = 0; // TODO: don't know default yet
legacy_request->config_5g_rssi_close = 1;
legacy_request->rssi_close_5g_val =
hidl_request.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_5GHZ].rssiClose;
legacy_request->config_5g_rssi_middle = 0; // TODO: don't know default yet
legacy_request->config_5g_rssi_middle = 1;
legacy_request->rssi_middle_5g_val =
hidl_request.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_5GHZ].rssiMiddle;
*/
legacy_request->config_5g_rssi_close_proximity = 0; // TODO: don't know default yet
legacy_request->config_5g_rssi_close_proximity = 1;
legacy_request->rssi_close_proximity_5g_val =
hidl_request.bandSpecificConfig[
(size_t) NanBandIndex::NAN_BAND_5GHZ].rssiProximity;
@ -1159,6 +1181,7 @@ bool convertHidlNanBeaconSdfPayloadRequestToLegacy(
const NanBeaconSdfPayloadRequest& hidl_request,
legacy_hal::NanBeaconSdfPayloadRequest* legacy_request) {
if (!legacy_request) {
LOG(ERROR) << "convertHidlNanBeaconSdfPayloadRequestToLegacy: legacy_request is null";
return false;
}
memset(legacy_request, 0, sizeof(legacy_hal::NanBeaconSdfPayloadRequest));
@ -1170,6 +1193,7 @@ bool convertHidlNanBeaconSdfPayloadRequestToLegacy(
legacy_request->vsa.vendor_oui = hidl_request.vendorOui;
legacy_request->vsa.vsa_len = hidl_request.vsa.size();
if (legacy_request->vsa.vsa_len > NAN_MAX_VSA_DATA_LEN) {
LOG(ERROR) << "convertHidlNanBeaconSdfPayloadRequestToLegacy: vsa_len too long";
return false;
}
memcpy(legacy_request->vsa.vsa, hidl_request.vsa.data(), legacy_request->vsa.vsa_len);
@ -1181,6 +1205,7 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy(
const NanInitiateDataPathRequest& hidl_request,
legacy_hal::NanDataPathInitiatorRequest* legacy_request) {
if (!legacy_request) {
LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: legacy_request is null";
return false;
}
memset(legacy_request, 0, sizeof(legacy_hal::NanDataPathInitiatorRequest));
@ -1195,6 +1220,7 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy(
legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: ndp_app_info_len to large";
return false;
}
memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
@ -1213,6 +1239,7 @@ bool convertHidlNanDataPathIndicationResponseToLegacy(
const NanRespondToDataPathIndicationRequest& hidl_request,
legacy_hal::NanDataPathIndicationResponse* legacy_request) {
if (!legacy_request) {
LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: legacy_request is null";
return false;
}
memset(legacy_request, 0, sizeof(legacy_hal::NanDataPathIndicationResponse));
@ -1225,6 +1252,7 @@ bool convertHidlNanDataPathIndicationResponseToLegacy(
legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY;
legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size();
if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) {
LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: ndp_app_info_len too large";
return false;
}
memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(),
@ -1232,6 +1260,7 @@ bool convertHidlNanDataPathIndicationResponseToLegacy(
legacy_request->cipher_type = hidl_request.supportedCipherTypes;
legacy_request->pmk_len = hidl_request.pmk.size();
if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) {
LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: pmk_len too large";
return false;
}
memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len);
@ -1243,6 +1272,7 @@ bool convertLegacyNanResponseHeaderToHidl(
const legacy_hal::NanResponseMsg& legacy_response,
WifiNanStatus* wifiNanStatus) {
if (!wifiNanStatus) {
LOG(ERROR) << "convertLegacyNanResponseHeaderToHidl: wifiNanStatus is null";
return false;
}
wifiNanStatus->status = convertLegacyNanStatusTypeToHidl(legacy_response.status);
@ -1255,6 +1285,7 @@ bool convertLegacyNanCapabilitiesResponseToHidl(
const legacy_hal::NanCapabilities& legacy_response,
NanCapabilities* hidl_response) {
if (!hidl_response) {
LOG(ERROR) << "convertLegacyNanCapabilitiesResponseToHidl: hidl_response is null";
return false;
}
hidl_response->maxConcurrentClusters = legacy_response.max_concurrent_nan_clusters;
@ -1280,6 +1311,7 @@ bool convertLegacyNanMatchIndToHidl(
const legacy_hal::NanMatchInd& legacy_ind,
NanMatchInd* hidl_ind) {
if (!hidl_ind) {
LOG(ERROR) << "convertLegacyNanMatchIndToHidl: hidl_ind is null";
return false;
}
hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id;
@ -1307,6 +1339,7 @@ bool convertLegacyNanFollowupIndToHidl(
const legacy_hal::NanFollowupInd& legacy_ind,
NanFollowupReceivedInd* hidl_ind) {
if (!hidl_ind) {
LOG(ERROR) << "convertLegacyNanFollowupIndToHidl: hidl_ind is null";
return false;
}
hidl_ind->discoverySessionId = legacy_ind.publish_subscribe_id;
@ -1323,6 +1356,7 @@ bool convertLegacyNanBeaconSdfPayloadIndToHidl(
const legacy_hal::NanBeaconSdfPayloadInd& legacy_ind,
NanBeaconSdfPayloadInd* hidl_ind) {
if (!hidl_ind) {
LOG(ERROR) << "convertLegacyNanBeaconSdfPayloadIndToHidl: hidl_ind is null";
return false;
}
hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
@ -1342,6 +1376,7 @@ bool convertLegacyNanDataPathRequestIndToHidl(
const legacy_hal::NanDataPathRequestInd& legacy_ind,
NanDataPathRequestInd* hidl_ind) {
if (!hidl_ind) {
LOG(ERROR) << "convertLegacyNanDataPathRequestIndToHidl: hidl_ind is null";
return false;
}
hidl_ind->discoverySessionId = legacy_ind.service_instance_id;
@ -1359,6 +1394,7 @@ bool convertLegacyNanDataPathConfirmIndToHidl(
const legacy_hal::NanDataPathConfirmInd& legacy_ind,
NanDataPathConfirmInd* hidl_ind) {
if (!hidl_ind) {
LOG(ERROR) << "convertLegacyNanDataPathConfirmIndToHidl: hidl_ind is null";
return false;
}
hidl_ind->ndpInstanceId = legacy_ind.ndp_instance_id;

View file

@ -60,6 +60,7 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_RESPONSE_DISABLED: {
for (const auto& callback : shared_ptr_this->event_callbacks_) {
@ -67,6 +68,7 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_RESPONSE_PUBLISH: {
for (const auto& callback : shared_ptr_this->event_callbacks_) {
@ -75,6 +77,7 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_RESPONSE_PUBLISH_CANCEL: {
for (const auto& callback : shared_ptr_this->event_callbacks_) {
@ -82,6 +85,7 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_RESPONSE_TRANSMIT_FOLLOWUP: {
for (const auto& callback : shared_ptr_this->event_callbacks_) {
@ -89,6 +93,7 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_RESPONSE_SUBSCRIBE: {
for (const auto& callback : shared_ptr_this->event_callbacks_) {
@ -97,6 +102,7 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_RESPONSE_SUBSCRIBE_CANCEL: {
for (const auto& callback : shared_ptr_this->event_callbacks_) {
@ -104,6 +110,7 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_RESPONSE_CONFIG: {
for (const auto& callback : shared_ptr_this->event_callbacks_) {
@ -111,6 +118,7 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_RESPONSE_BEACON_SDF_PAYLOAD: {
for (const auto& callback : shared_ptr_this->event_callbacks_) {
@ -118,6 +126,7 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_GET_CAPABILITIES: {
NanCapabilities hidl_struct;
@ -132,6 +141,7 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_DP_INTERFACE_CREATE: {
for (const auto& callback : shared_ptr_this->event_callbacks_) {
@ -139,6 +149,7 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_DP_INTERFACE_DELETE: {
for (const auto& callback : shared_ptr_this->event_callbacks_) {
@ -146,18 +157,20 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_DP_INITIATOR_RESPONSE: {
for (const auto& callback : shared_ptr_this->event_callbacks_) {
if (!callback->notifyInitiateDataPathResponse(id, wifiNanStatus).isOk()) {
if (!callback->notifyInitiateDataPathResponse(id, wifiNanStatus,
msg.body.data_request_response.ndp_instance_id).isOk()) {
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_DP_RESPONDER_RESPONSE: {
for (const auto& callback : shared_ptr_this->event_callbacks_) {
if (!callback->notifyRespondToDataPathIndicationResponse(id, wifiNanStatus,
msg.body.data_request_response.ndp_instance_id).isOk()) {
if (!callback->notifyRespondToDataPathIndicationResponse(id, wifiNanStatus).isOk()) {
LOG(ERROR) << "Failed to invoke the callback";
}
}
@ -168,6 +181,7 @@ WifiNanIface::WifiNanIface(
LOG(ERROR) << "Failed to invoke the callback";
}
}
break;
}
case legacy_hal::NAN_RESPONSE_TCA:
/* fall through */

View file

@ -750,19 +750,19 @@ struct NanDebugConfig {
* Frequency in MHz to of the discovery channel in the specified band. Indexed by |NanBandIndex|.
*/
bool validDiscoveryChannelVal;
vec<WifiChannelInMhz> discoveryChannelMhzVal;
WifiChannelInMhz[2] discoveryChannelMhzVal;
/**
* Specifies whether sync/discovery beacons are transmitted in the specified band. Indexed by
* |NanBandIndex|.
*/
bool validUseBeaconsInBandVal;
vec<bool> useBeaconsInBandVal;
bool[2] useBeaconsInBandVal;
/**
* Specified whether SDF (service discovery frames) are transmitted in the specified band. Indexed
* by |NanBandIndex|.
*/
bool validUseSdfInBandVal;
vec<bool> useSdfInBandVal;
bool[2] useSdfInBandVal;
};
/**
@ -816,7 +816,7 @@ struct NanConfigRequest {
/**
* Additional configuration provided per band: indexed by |NanBandIndex|.
*/
vec<NanBandSpecificConfig> bandSpecificConfig;
NanBandSpecificConfig[2] bandSpecificConfig;
};
/**
@ -826,7 +826,7 @@ struct NanEnableRequest {
/**
* Enable operation in a specific band: indexed by |NanBandIndex|.
*/
vec<bool> operateInBand;
bool[2] operateInBand;
/**
* Specify extent of cluster by specifying the max hop count.
*/
@ -888,7 +888,7 @@ struct NanDiscoveryCommonConfig {
* UTF-8 encoded string identifying the service.
* Max length: |NanCapabilities.maxServiceNameLen|.
*/
string serviceName;
vec<uint8_t> serviceName;
/**
* Specifies the matching indication to host: once, continuous, or never.
*/