[AWARE] Update HIDL to match spec and add comments

Update some HIDL names to match more closely the spec
naming convention. Add comments - whenever possible
provide reference to NAN spec.

Bug: 34985658
Bug: 35040192
Test: unit tests and integration (sl4a) tests
Change-Id: I957fb8a9814b3acaf8b710d397fe18b39f6a8c77
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index 691f913..9e23d55 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -780,12 +780,13 @@
   legacy_request->discovery_indication_cfg |=
         hidl_request.configParams.disableJoinedClusterIndication ? 0x4 : 0x0;
   legacy_request->config_sid_beacon = 1;
-  if (hidl_request.configParams.numberOfServiceIdsInBeacon > 127) {
-    LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: numberOfServiceIdsInBeacon > 127";
+  if (hidl_request.configParams.numberOfPublishServiceIdsInBeacon > 127) {
+    LOG(ERROR) << "convertHidlNanEnableRequestToLegacy: numberOfPublishServiceIdsInBeacon > 127";
     return false;
   }
-  legacy_request->sid_beacon_val = (hidl_request.configParams.includeServiceIdsInBeacon ? 0x1 : 0x0)
-        | (hidl_request.configParams.numberOfServiceIdsInBeacon << 1);
+  legacy_request->sid_beacon_val =
+        (hidl_request.configParams.includePublishServiceIdsInBeacon ? 0x1 : 0x0)
+            | (hidl_request.configParams.numberOfPublishServiceIdsInBeacon << 1);
   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;
@@ -809,7 +810,7 @@
   legacy_request->config_2dot4g_rssi_proximity = 1;
   legacy_request->rssi_proximity_2dot4g_val =
         hidl_request.configParams.bandSpecificConfig[
-            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiCloseProximity;
   legacy_request->config_scan_params = 1;
   legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
         hidl_request.configParams.bandSpecificConfig[
@@ -832,7 +833,7 @@
   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;
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiCloseProximity;
   legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
         hidl_request.configParams.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
@@ -850,8 +851,8 @@
   legacy_request->config_dw.dw_5g_interval_val = hidl_request.configParams
         .bandSpecificConfig[(size_t) NanBandIndex::NAN_BAND_5GHZ].discoveryWindowIntervalVal;
   if (hidl_request.debugConfigs.validClusterIdVals) {
-    legacy_request->cluster_low = hidl_request.debugConfigs.clusterIdLowVal;
-    legacy_request->cluster_high = hidl_request.debugConfigs.clusterIdHighVal;
+    legacy_request->cluster_low = hidl_request.debugConfigs.clusterIdBottomRangeVal;
+    legacy_request->cluster_high = hidl_request.debugConfigs.clusterIdTopRangeVal;
   } else { // need 'else' since not configurable in legacy HAL
     legacy_request->cluster_low = 0x0000;
     legacy_request->cluster_high = 0xFFFF;
@@ -1072,13 +1073,13 @@
         legacy_hal::NAN_TX_PRIORITY_HIGH : legacy_hal::NAN_TX_PRIORITY_NORMAL;
   legacy_request->dw_or_faw = hidl_request.shouldUseDiscoveryWindow ?
         legacy_hal::NAN_TRANSMIT_IN_DW : legacy_hal::NAN_TRANSMIT_IN_FAW;
-  legacy_request->service_specific_info_len = hidl_request.message.size();
+  legacy_request->service_specific_info_len = hidl_request.serviceSpecificInfo.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,
-        hidl_request.message.data(),
+        hidl_request.serviceSpecificInfo.data(),
         legacy_request->service_specific_info_len);
   legacy_request->recv_indication_cfg = hidl_request.disableFollowupResultIndication ? 0x1 : 0x0;
 
@@ -1104,12 +1105,12 @@
   legacy_request->discovery_indication_cfg |=
         hidl_request.disableJoinedClusterIndication ? 0x4 : 0x0;
   legacy_request->config_sid_beacon = 1;
-  if (hidl_request.numberOfServiceIdsInBeacon > 127) {
-    LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: numberOfServiceIdsInBeacon > 127";
+  if (hidl_request.numberOfPublishServiceIdsInBeacon > 127) {
+    LOG(ERROR) << "convertHidlNanConfigRequestToLegacy: numberOfPublishServiceIdsInBeacon > 127";
     return false;
   }
-  legacy_request->sid_beacon = (hidl_request.includeServiceIdsInBeacon ? 0x1 : 0x0)
-        | (hidl_request.numberOfServiceIdsInBeacon << 1);
+  legacy_request->sid_beacon = (hidl_request.includePublishServiceIdsInBeacon ? 0x1 : 0x0)
+        | (hidl_request.numberOfPublishServiceIdsInBeacon << 1);
   legacy_request->config_rssi_window_size = 1;
   legacy_request->rssi_window_size_val = hidl_request.rssiWindowSize;
   legacy_request->config_disc_mac_addr_randomization = 1;
@@ -1130,7 +1131,7 @@
   legacy_request->config_2dot4g_rssi_proximity = 1;
   legacy_request->rssi_proximity_2dot4g_val =
         hidl_request.bandSpecificConfig[
-            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiProximity;
+            (size_t) NanBandIndex::NAN_BAND_24GHZ].rssiCloseProximity;
   */
   legacy_request->config_scan_params = 1;
   legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_24G_BAND] =
@@ -1156,7 +1157,7 @@
   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;
+            (size_t) NanBandIndex::NAN_BAND_5GHZ].rssiCloseProximity;
   legacy_request->scan_params_val.dwell_time[legacy_hal::NAN_CHANNEL_5G_BAND_LOW] =
         hidl_request.bandSpecificConfig[
             (size_t) NanBandIndex::NAN_BAND_5GHZ].dwellTimeMs;
@@ -1322,7 +1323,7 @@
   hidl_ind->peerId = legacy_ind.requestor_instance_id;
   hidl_ind->addr = hidl_array<uint8_t, 6>(legacy_ind.addr);
   hidl_ind->receivedInFaw = legacy_ind.dw_or_faw == 1;
-  hidl_ind->message = std::vector<uint8_t>(legacy_ind.service_specific_info,
+  hidl_ind->serviceSpecificInfo = std::vector<uint8_t>(legacy_ind.service_specific_info,
         legacy_ind.service_specific_info + legacy_ind.service_specific_info_len);
 
   return true;